Linux Proxychains Using SSH & SOCKS Proxy For Easy Remote Management & Testing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Nice one, Tom.

Though familiar with SSH and socks proxies, I had not previously heard of proxychains, or ifconfig.co. I hope I can remember them next time I could use them.

👍︎︎ 5 👤︎︎ u/FlightyGuy 📅︎︎ Mar 17 2019 🗫︎ replies

Following

👍︎︎ 3 👤︎︎ u/ccrisham 📅︎︎ Mar 17 2019 🗫︎ replies

So you would you this if you had programs on the client but not the server? If you had the program on the server, this wouldn't be any different than X-Forwading would it?

👍︎︎ 1 👤︎︎ u/reavessm 📅︎︎ Mar 18 2019 🗫︎ replies
Captions
so the SSH protocol is well known for being able to remotely administer servers it also can encapsulate in tunnel other types of traffic such as port forwarding or you can also use it as a proxy and this becomes very handy because if you are wanting to administer a remote networking you don't want to go through the trouble of setting up a full VPN or it's just not really necessary because the services you need to access are just some browser-based services then tunneling through a proxy works really well but we're gonna go from my computer here one 92168 3.9 the computer we're recording on will be doing a stem one we're gonna first connect to this digital ocean server and I'm going to show you also how you connect to a PF sense firewalls through SSH and then so I can get to servers that are behind it and we use this for remote administration of some of our clients cuz it's just a really convenient way to be able to jump right in and fit into their network without having to setup a full VPN now proxies don't support the full protocol stack as AV and us proxies are much more simplistic VPNs allow you to connect to larger networks together or even your individual computer and essentially bridge all full protocols into that network and there's times when you need a VPN but for some of the basic just I want to get to remote web administration out of server proxies work absolutely great now someone may say what are is the data going across the proxies to here well in the case of SSH you're encapsulating a proxy data so the proxy data may or may not be secured but that becomes irrelevant if you're tunneling it in an SSH tunnels that way you're always wrapping in a security layer but when I go from here through this London digital ocean or to my house encapsulation layer is going from here and being on encapsulated within the network so that would prevent anyone from sniffing it across the internet and then it's just reliant on whatever protocols are being used so from here to here is using HTTPS you're perfectly fine in terms of security all right let's kind of show this in practice and show how it works it's actually really simple now first thing is there's nothing special they had to be done with either PF sense other than turning out an SSH server and this digitalocean server is out of the box pretty much default the only thing I did was apt-get update to make sure it had to latest updates on there you should always be doing that and I loaded my command line on there which there's a link to github below if you like the command line that you see here other than that is the default sshd server out-of-the-box let's go over here to the terminal so the first thing you want to do is make sure we can log into this server so this is the digital server digitalocean server IP address 104 two four eight one six eight 203 and we're in we can get into the server perfect now that's just a standard SSH command to log in for those of you wondering I've already installed my SSH keys on there and so I can log in without prompted for a password we're going to exit now we're going to add the proxy information we're gonna choose port 1955 the is up to you the port you choose to set up a dynamic proxy it only has to be known by you not in use so Everly because I'm not ringing this was to do something above 1024 or you could assign it to a lower port some people like to use 8080 I just chose 1955 it's really are up to you which port you want to use we're gonna do SSH - Dee oh here - root at they might be address and login from the come from the command prompt why nothing else seems to have changed but now we have added port 1955 as the proxy port we're gonna go over here and I have Firefox open now I have I have config does Co slash country I have config as a website that will display public IP address information or refresh rate here it shows me in the United States and we have the proxy settings pulled up here and by default we have no proxy we're gonna go ahead go to manual proxy configuration on to 700 won because we boundless Tim our local host of this computer and by the way this is all in Linux if you didn't notice already you can do this within Windows there are separate tutorials for that using rules like putty but here's the local host here is the 9055 don't get hit okay and over back over here refresh in eighty Kingdom matter of fact let's go I have config without the slash country and it zooms in here we go back two hundred percent there's that it IP address country look up all the information you find which I love this I have config dot Co it's a simple way to get some information about you know yeah and let's go ahead and surf the web here open up Google whether just to a weather forecaster goo sink it thinks I'm in the UK so I can surf the web I can use this it brings up all local search results pacing or IP Google does that stuff though I'm surfing the web perfectly fine and it works so this is simply proxied over there no firewall needed no special config no VPN needed on proxy Dan via SSH tunnel across there and yeah that's great the downside of this is having to set that proxy up all the time and having to make sure that this is done and also you may have noticed when you connect through a proxy because not all protocols are supported it may have tried to look up things that aren't so you're gonna get some administrator hitted failed you may have some problems with that like I said this is not the same as a VPN but it can instantly get you over there and we're talking more about how we use it to get inside of a client Network and I'm going to talk about ways to make this tool Livity use all from the Linux command line here so we're gonna go back over to know proxy refresh back in the United States all right so Firefox is back to being Firefox normal we want to login dynamic proxy again just like that so really nothing changed I just logged out to break any connections that may have been open we're gonna SSH again we're gonna change the port number to 90 50 another reason I changed 90 50 is that is a default port for proxy chains let's talk about what our proxy chains proxy chains is a UNIX Program Linux program in this case that hooks network related functions and dynamically allows us to wrap everything into a proxy chain so let's dig into a little bit more what that means we're going to go ahead and Oh through and likes I'll leave a link so you can read all this but we're gonna go ahead and get a connection started first so here's our sshd 1950 route there this is team ox I'm using quiche wondering how I split the screen move this up a little bit and I've already got proxy team install standard apt-get install for proxy chain we're gonna go ahead and pseudo m / SC back see chains you and port 9050 is the default set for practicing if you have tor installed proxy chains can do tor I'll do that in a separate video but by default 9050 so we'll go ahead and leave it at 90 50 here exit out of there but now how does proxy change work we're gonna run the curl command I have fig @co slash country I'm in the United States simple enough but if we add the command proxy chains in front of it I mean United Kingdom now now what this does we have this proxy set up here port 90 feet 90 50 so ssh st 90 50 we're logging into that digitalocean server then from there the proxy chain connects it makes a connection it wraps our DNS response as well as proxies can leak DNS information so proxy changed by default out of the box will also grab all that DNS config in run those DNS queries across the proxy and then it runs the command out of the proxy so any command that you want to run across here for the most part can be wrapped into a proxy chain to get that information it includes and we're going to go ahead and fire up Firefox so now we launched Firefox wrapped in proxy chains and there's lots of things that's looking up it's looking up all the things but different pages I was at and let's go - I have config dot country again United Kingdom and let's go over here to preferences Roxy nope see settings and a reason why in us the way proxy change works its wrapping whatever you told it to launch in that proxy this means we are now assumed the IP address of that digitalocean server so when we look at it from this we're still at that IP address if we go places like Google or wherever you we'll do a weather search again forecast it thinks I'm in London we close it we just type Firefox again from the command line without adding proxy chains in front of it opens up just like normal I have to make that CEO country back United States really simple and this is really handy if you have tools you need to run from the Linux command line you want to launch them but as the IP address of whatever your proxied into this becomes a very convenient way to do it so we're gonna do up here at the top exit out of this we're gonna go ahead and connect to my PSN server at home all right to connect my PA - II 9050 will use the same proxy port then it's LTS at home Tom and we're gonna go ash e-102 to my pfSense server is at home Tom which just as the host name to hide my public IP address it's on port 1022 and LCS is the username we're going to use now we're into my pfSense go over down here Vox nothing happened I'm not in just to show you that it's not working unless we go and close that I've been proxy Gaines Firefox proxy chains I'm right into my local network no big deal simple and get into my Zen orcish at home I didn't have the VPN but I we see you're probably thinking okay but then you have to remember to type this command out each time that doesn't sound convenient at all you'd be right but don't worry there's an even easier way to manage these via the SSH config so you can just jump into him anytime and create aliases let's go ahead and do that we're gonna go ahead and exit we're gonna go VIN SSH and fake now if you don't have a dot SSH config file configured you can create a blank one and this is a template for it I have a lot of things configured in here because this is one of the ways that I don't have to remember the IP address or configuration settings or weird port numbers I put everything on you save everything into a config file or go ahead and jump into SSH config and yes I blurred out all the different weird stuff that I have in there but we're gonna create this one here it's host you have sense at Toms house hostname home tom user LTS port 102 - dynamic forward 90/50 how does that work well let's show you go ahead and exit this as this.h you have sense home at Toms and we're in means we launch Firefox again for simplicity and I'm in at my home network just like that if I wanted to add another like let's say let's make one called let's go to London so we're gonna go ahead next tie this like some of this back to this SSH config and we're going to add another host information so we're gonna go ahead and add this here so tape in host a state sensitive so it matters oh let's call it let's go to London Oh London whoops now they spelled things right hostname dress in here of that digitalocean droplet that I have set up in London user root this was on port 22 and you do have complicity list the port and then we want the dynamic forward oops mi see 50 now if we type in SSH let's go to London I'm now in that Rock seed into that go ahead and proxy chain over to Firefox and we're in London so you can see you can save these from the command line and quickly launch or jump around between different proxies or you could you configure each proxy and configure different browsers to use different proxy settings kind of there's a lot of different dynamic options to do here a lot of it we save our client information through these SSH config especially when I'm working on a couple projects but when I gotta jump in and out maybe have to log into a web browser to look at a printer or any of these different applications for our clients it's really quick to suit proxy enthuse or firewall I'm in their network I can browser in without disrupting one of my clients or having to have remote access to one of the local computers there and I'm in and the last thing I'm gonna show you that this will work with is I can actually SSH into more than just the firewall so let's go ahead and exit out of this the skyfall proxy right and as it's aged to my house same aliases I have an SSA justice SSH home that'll connect me to my home server here all right let's xyx I do not have that set up with a proxy so let's add that D 90/50 sshd 9050 home logs in those Tom's house server which is different than the PF sense because this has an IP address of 192 168 1.5 but it still works so if I type in proxy chains rocks you have sense now I'm coming in as 1.5 and let's open up another window to kind of show you one last thing of how that works at how pfSense might see this so here's the PF sense law again we're going to split the screen down here again LTS at home Tom II we're not proxying this one we're just logging in to show you what happens so now we're sitting here logged in as pfSense su-100 local and then when I log in here we're gonna go LTS and type in the password successful user login from one 92168 one not five because that's the IP address of this video computer so this is when you're doing this you can also use it for testing purposes maybe you have restrictions that you have to proxy in because of the way you restricted web access to only a certain block of local IPS and this is one of those features that you can do though I pass through my PF sense to this particular box that I have behind the PF sense but then PF sense when I log into it sees me logging in not remotely from this computer 192 168 3.9 but locally LTS user from here it also does the same thing if you SSH into the PF sense and proxy the PF sense it sees it logging into itself so it sees a localhost login at that point so hopefully this gets you started with SSH proxying and proxy changes it's a lot of fun it's a lot of simple ways you can do just to jump into a client network without the need for a VPN or even in the case I spun up the digitalocean server in London but really any server you have on the Internet located wherever that you spin up with a sh and the proxy ports you can just assume and start using it as a proxy I do recommend using it like idea of demonstrated here with an SSH tunnel because if you're using with SH tunnel you're encapsulating all the security as opposed to relying on whatever transport layer the proxy may be using but hopefully this help will get you started there's a lot more fun you can have with this I'll leave all links of documentation so you can do some more reading and have some more fun thanks thanks for watching if you like this video give it a thumbs up if you want to subscribe to this channel to see more content hit that subscribe button in the Bailiwick on and maybe YouTube will sense you and notice when we post if you want to hire us for a project that you've seen or discussed in this video head over to Lauren systems comm where we offer both business IT services and consulting services and are excited to help you with whatever project you want to throw at us also if you want to carry on the discussion further ahead over to forums at Lauren systems comm where we can keep the conversation going and if you want to help the channel out in other ways we offer affiliate links below which offer discounts for you and a small cut for us that does help fund this channel and once again thanks again for watching this video and see you next time
Info
Channel: Lawrence Systems
Views: 21,508
Rating: 4.9871793 out of 5
Keywords: proxychains, proxychains vs vpn, proxychains hackersploit, proxychains ubuntu, proxy, ssh socks proxy, ssh, socks, linux, socks5
Id: _CPxlzznv0U
Channel Id: undefined
Length: 18min 19sec (1099 seconds)
Published: Sun Mar 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.