by twakefield on 10/8/21, 6:30 PM with 60 comments
by opsdisk on 10/10/21, 12:06 PM
I made it free to the HN community a few years back [1]. There is a paid interactive lab portion (details in the repo) if you are looking for hands-on experience.
Book Overview
This book is packed with practical and real world examples of SSH tunneling and port redirection in multiple realistic scenarios. It walks you through the basics of SSH tunneling (both local and remote port forwards), SOCKS proxies, port redirection, and how to utilize them with other tools like proxychains, nmap, Metasploit, and web browsers.
Advanced topics included SSHing through 4 jump boxes, throwing exploits through SSH tunnels, scanning assets using proxychains and Metasploit's Meterpreter, browsing the Internet through a SOCKS proxy, utilizing proxychains and nmap to scan targets, and leveraging Metasploit's Meterpreter portfwd command.
by adrianmonk on 10/10/21, 6:29 PM
This uses the escape mechanism. For help on that, hit return, type "~?" and hit return again.
From there you will see that "~#" will list them. And "~C" takes you to a line-oriented command prompt where you can add them.
For example, type return "~C", then at the prompt type "-L1234:localhost:22". Then in another window, type "telnet localhost 1234". Then back in the ssh window, type return "~#" and you will see the tunnel being used.
Another trick: if you don't need a shell and only want to forward ports, run "ssh -N" instead of "ssh".
by wadkar on 10/10/21, 6:15 PM
The fact is that ssh tunnels are bound to an interface on one side and the other can be any (reachable) host:port. So if example.com:1234 isn’t reachable from your host network, you can do a local port forward to example.com:1234 from an intermediary host that can reach example.com:1234
by gnufx on 10/10/21, 11:26 AM
by a-dub on 10/10/21, 8:58 AM
my personal preference has been to use ssh -D and tsocks for this. it doesn't require root on either side and tsocks is elegant for inbueing just the processes you want with the ability to use the tunnel.
by Y_Y on 10/10/21, 8:09 AM
(pwnat is pretty cool, but I don't think it does quite what I'm looking for)
by sloshnmosh on 10/10/21, 11:18 AM
What’s also very interesting is that the article links to page from TrendMicro about malicious Android apps using Java’s version of SSH to infiltrate internal corporate networks.
TrendMicro’s own Android app ALSO contained the same Java SSH sdk.
by grifball on 10/10/21, 11:10 AM
by reacharavindh on 10/10/21, 9:36 AM
I was wondering if there is a better way to setup a central bastion host with RBAC such that the attack vector is also not centralised. Does anyone here have ideas?
by catillac on 10/11/21, 2:52 AM
After reading this article I started a port forwarding session and can access the remote notebook without issue. All it took was the ssh port forwarding. Amazing.
by dls2016 on 10/10/21, 2:39 PM
I always laugh when I ssh into AWS, then into the RPI (over the internet and then a 900MHz bridge). Then sometimes I ssh or ftp into a data logger running in the field. Good times and has worked relatively flawlessly for a few months. (I don’t have any uptime metrics for the network connection but no noticeable problems.)
I’m planning a few more which would be much more remote. Any other suggestions for managing such a setup? Some sites may have cellular connections and so I’m not sure I want 24/7 ssh tunnel (though I don’t think it uses too much data).
Edit: I see others recommending WireGuard for similar situation. Never heard of it will check out.
by brightball on 10/10/21, 2:47 PM
by bloqs on 10/10/21, 2:24 PM
by gue-ni on 10/10/21, 9:41 AM
by denki on 10/10/21, 10:33 AM