5.7 Tunneling

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with

Already have an account? Sign In »

14 hours 43 minutes
Video Transcription
Hello, everybody. And welcome to the Oasis Speakers Episode number 24 Channel in My name is Alejandro Gonna and I'll be your instructor for today's session.
The learning objectives is to understand the concepts behind this attack and applied the next to implement this attack. So let's get down to business, shall we?
Well, previously we saw some such time alone techniques, but we will dive deeper into this technique. You know, basically there are three types of s h tiling.
Well, I will be describing why by one by one, but three main types are local for forward and
reverse pour forward in and dynamic board forward. And, uh,
let me give you scenarios so you can better understand that applicability of each ah type of tunnel and you know, you can understand it better let me start by saying that you can actually you have to actually create unnecessary channel.
It means that you have actually have to have a nest, each client
and an estate server in order for this to work. So for this scenario, we have our
or lead column Shin, which is the client, and let me just drag this out So you can understand it better. We have our window stained machine which has, you know, this I p and you know it will be our sssh server.
So let me get get this out of the way. I will be dry in this, that this screen and you know the system so you can actually see the results from each scenario. So let's say that let me give, you should marry outside the year award or, you know, a to university and want to connect to the server outside the Internet.
Unfortunately for this scenario, firewall, where you're located is blocking the connection are actually blocking that port. You can treat that the fire will into thinking that you're actually want to connect to another port. For this scenario, let's say a 1 81
eso fire will Doesn't blood that connection For example, the firewall this actually blocking the FTP connection port port, anyone? I'm starting to anyone
and you know, you actually want to connect that back to your Maybe your home server, your home FTP server,
eso. In this case, our home server will be the Windows machine and our, you know, work or the university computer will be your column Mission. So I just type sssh
dash l for local poor forward and then report that I want to connect to, you know, the Newport anyone? Anyone? The one that is not blocked by the firewall in this scenario, then the remote mission I p. Or the machine where I want to connect you to stand that,
uh and then, um,
the ap that it's actually blocked. I mean, this is what I'm saying is that every time I connect to my local host in the sport forward any connection to that port?
True, off course, the s S H tunnel. So it means I have to first create unnecessary connection. So
I put the user name
and the server
and requested credentials
before ice hit. Enter. Let me just show you this. Um, that's that
grip. It wanted one. Nothing is actually listening. The left port. So if I did this, I create hopes
if I created the connection. You know, as you can see in my Windows machine
if I create the connection, uh,
it means that I'm already created a tunnel on Mrs s Donald. And you know, if I go here, uh, port 81 81 is over. It'll listen. And so, uh,
remember that the command was actually redirecting. Whatever I hit, I entered to the port. Anyone? Anyone on my local machine in the column mission
to the port to anyone. So let me just ftp to that.
I'm sorry.
Port anyone? Anyone. So it's actually something that is actually sitting here, so I just type
and puzzle required.
And boom. There you go. User lucked in remote.
You know, I don't have
you can actually you know, this is throwing errors, but that doesn't matter. The point is that
I'm actually connected to the windows machine to port 81 81.
If I If I actually exit this
and kill that tunnel,
I can't. Of course, nothing is Listen anymore time. Wait,
it's not listening. So if I go to have to be here, you know, connection refused because there's nothing listening in there. So that's how local poor forwarding that works.
Kind of in a nutshell. If you want,
uh, we have reverse port forwarding, which is another type. You can do the same but back ports. I don't know if that makes sense. You guys But, you know, let me give you scenario. Maybe you want to continue working from home, But you don't really want to take the computer with you.
Eso you in this case, remember these Wes or or work? This Carolina's was reward machine,
and this Windows machine was our home machine. So
right now I want to leave work, and I want to continue working on some stuff from home. But I don't want to take the machine or, you know, I don't wanna go with machine, especially if it's not. I lapped up. Um,
but we can use the brewer reverse port for Britain s Oh, maybe in this scenario, let's say I want to continue using the Honorable Men Ability scanner or continue using mobile in it. At least Connor managing our building abilities. Kinder.
We first have to start up and dust. Remember, we sell up and buy sensible inability scanner. Upton Bus service start.
You know it will start, and it will tell us to to go to port. I believe it's 93 90.
so but these will be available only for local machine
that it's united to Okay,
Uh, so what happens if I actually go to, uh, you know, I look in and everything's working as expected, but what happens if I again want to live work and I want to go there? Continue working from home? I can just type. Um
let me just grab the command here. Oh, but maybe wait. You know this. Just so you know, if I type here in and type up, you know, nets up, nets that and find the poor, Let's say, uh, I don't know the same anyone Anyone?
Nothing will release in any. Here. I just want to show you this. You can see the results from running that other command.
So again, a sage dash art this case for the more remote or rivers pour forbidding anyone? Anyone to wonder what I just type in the Windows mission. In this case, I wanted to forward the traffic back to this machine, this Kali machine.
So I just type
You could just type local host
local holes, which will be, you know, they won t reverse traffic to and then poured 93 93 92
which will be the one that is actually listening here. 93 92 you know, again, my credentials,
which will be, you know, the, uh the creation from from the Windows machine, you know? And, you know, I tell the pas alert
and I'm connected. So let me just grab the machine, the windows machine here, and just typed exact same command. As you can see, there's actually a poor listening here. Ah, and I can actually connect to the force. Let's let's continues in this one's mission. Let me
put a little bit bigger here, and I can actually go to, you know,
use this machine connected this machine a port. Uh, anyone? Anyone, So
Nope. Sorry
for 81. A one.
00 it's http is remember is https this month. My fail because at the end of the new browsers nowadays have some kind of malicious connection detections.
And since I'm connecting to support my local hose on port 81 81 the certificate coming back
from from my local machine will not match at all. Um,
the certificate that the browser in this case
edge is expecting in my failed due to, you know, this restriction, but let's see what happens.
Ok, this side might will be secured. That's what I'm talking about. This you know, the browsers actually rejecting that I go to that page. Oh, so sorry.
Home page.
You know, we saw that in here in details, you know, certificate. It's invalid about it. See a involve the certificate authority. You know, that's expected that.
You know, I just say, Hey, I don't care about that and just go here. And,
you know, I can actually look in you remember?
I'm actually connecting to the local machine. Oh, my Windows machine, which will is representing the home computer. And I can actually look again to administrate my balloon abilities. Kinder. Back of home
again If I just let me just go take that here. If I kill this, if I kill this connection
Oops. Sorry.
And go back to my windows machine. You know? No, no connection will. I will not be displayed. All will be time. Wait.
Meaning that you? No, no, no, no. Not the port. Anyone. Anyone is not listening anymore. If I go here and I refreshed its page, you will fail. Of course. So that's the magic of remote for forwarded.
But what I What about dynamic pull forward in this, perhaps, is the most use. And, you know, you can actually turn out all the air traffic from different ports through these to another server.
This is kind of a proxy, actually. If you use dynamic, which will be dash D, let me just show the syntax I will not execute. That was a little checking out a proxy chain synth or in this video. But the syntax is fairly almost the same Dash D for dynamic. And they just put anyone, anyone, you know, port again.
Then log in again to your remote server,
37 that's it. That's the syntax. And then you just go to your browser and say I'll be using a proxy. Ah, socks five Proxy to be more precise and you know, every every all the traffic tunnel it, you have to tunnel it. Our passage through this tunnel is sshh style.
So this is basically what it is.
But let me just show you this same scenario. But using something called called for you know, the tor Network and the proxy change for does not come install, but the fall in college. You just have to type a pity dash get installed, Thor and I will be You know it well with style.
Um, this is basically Thor is basically
need work so you can pass all the traffic through it, and, you know, it's kind of a proxy. You just have to connect to the fourth proxy, the tor network. Indy will pinpoint your location through the tire world. Kind of a neat thing to do, actually. And, you know,
let me just, uh,
give you this command, so you know, you know, they empty. Get that? Sorry. I'm sure. Dash, get a pity that should get him. Sorry. Start for it. And that's it. And then just service
for a start. I don't want to stop but to explain much mouth, or you can actually go click. You know, it's kind of a proxy. Were its importance to your location. You know, you can google it for more information. Uh, then, you know, just to check a service Thor status.
You know, it's active listening,
and, you know, just so nothing is messing off my connections. Well,
nets that hope Sorry. By default, let me just give you the port.
by the fall, our tour will be listening to this
in this sport. 90 50. So what now? We need to tell us all over programs, you know, for example, or or or
browser or you know, or tools that we want to connect to that to that proxy. So for that, we use something called proxy chains. There's new, newer versions. Brooks. It changes. Just proxy changed three years. You know, at this point, budget proxy chain three. It was one, Um,
but you know, you can use whatever version of proxy change. The point is that you can use proxy change to actually passing traffic through the toward a proxy. So for that, we actually went to first con figure proxy chains.
And let me just give you some insight of this, although that is fully pretty cell self's planetary. But you can, you know, let me just give you some hands about this.
Ah, there's dynamic chain, which will be, you know, as the name's Jess or the The comments say that each connection would be done, be a changed boxes up. Brooks is changing the order as they appear on the list. At least one proximos being lined to play to play in chain This mean that? Let's say you have four proxies
and three of them are dead. It doesn't mean that the financial will not work. It will just go to one proxy. But that's it.
Strict chain means that it will go to all of the proxies in the order you put it. And if one fails, the connection failed. So
you maybe maybe you actually went to for some recent went to use the strict up proxy chain because you want to jump in exactly that order for that those specific boxes. But you know, dynamic, I guess the most use one and random chain, you know, maybe the same is dynamic just in random order.
Now, each each connection will be done. Be a random proxy or proxy chain and see chain land.
And you tell that the land of change. But you know, the most used one I believe at this point is dynamic proxy chain.
Then we have a proximity ns for Deanna's leak.
Ah, you know,
as you can see, the option property and SS enabled by default. This wasn't true in all version of proxy chains, though, but, you know, from from this process chain version from really previous practice change versions up to this one, and I believe the future will be the same. This option is enabled by default.
What CNN's leak means is that even though your I p change
your DNA is still the same and will point back to your original Deanna Surber, meaning that Yeah, Europea change. But, you know, if I going to actually track who's actually poor poor scanning me or maybe something malicious you did something Malaysians to me and the old you change was your people know your d n s.
Anybody would access to that. Vienna's locks can find your real location.
So this is what the N s lik means, so enable in this option means that proxy change will take care of that it will actually use a different proxy. I'm sorry. A different you will show you a different I p. But it will also show you or, you know, use a different d N s o. They cannot point you point by your location.
Uh, yeah, this is enable but the fall now but the fall process James Gone comes with broke up soaks four
proxy enable but you can, you know, you know, enable sucks. Five. I do this. And I guess everybody does this because satisfy house more authentication options and, you know, in the proxy and the initial handshake has a couple of additional security steps.
You know, you can live with the suck for if that's what you want, but I just enabled. Sucks five.
At this point in time sucks fight Is that enabled by default. So you have to do this.
And, you know,
let me just This is, you know, so we have food components here, Thor, which will be the proxy and proxy change will be the program to actually turn out all the traffic to that proxy again. Remember that you can do the same with dynamic pour forward in in the S H.
Tool with this stool, which will be will be creating kind of sucks five proxy.
But you came to also did the same with proxy chains and Thor. Very cool. Actually. Thought it's really neat,
uh, boxes. So you can pinpoint or hide your your location, your traffic and what you're actually looking for. So let me just say proxy change here and just fire folks, for example. And it will start my Firefox. If, for example, I'm It's just, by the way. Ah, this might not work all the time,
because but brooksie chains and thought have you know, they're not created by the same guy, so they have some compatibility issues sometimes. And
sometimes they actually worked. For example, it seems that it's no working right now. Um,
because at the end, I'm based in Guatemala, by the way, so you can actually see my location? Oh, no, it's actually working. Okay, I'm basing. What? Amalia, I already told you that, but you know, this is telling that I mean, the United States really nice to be more precise and definitely not there. So that's that.
Let me just
close this and you can actually get new I p and your information. But just, uh,
we're starting the service.
And if I
hit the sink a man again,
Meus, my location.
And this, of course, this whole I mean, Moldova, whatever that is. Romania work, Rania. Multiple. Okay. Yeah. I'm not a mold about the Philly again located in Guatemala, Central America,
but, um,
you know, But
this is what project Thames does. And actually, if I close all of this duking actually terminal every traffic, for example, you can actually hopes just little this proxy chains and, for example, a name Abbas Khan.
You can actually
This will not throw on some, you know, social. Actually, you can also sit this Mrs just deny it or time out again.
Proxy chains and thought that does not get alone all the time. So even though you see the message, it will work as you can, as you just saw. And also, sometimes you don't see the message and it will not work. So you have to Maybe the but the buck that true. Maybe
this'd be damp or something like that.
Well, you can you can actually let me just put one specific port that would now is open
and he still tells us disappear were up to. So it's not telling us that is up in or close its discipline. Grab. Okay, wonderful. But the point is that this i p
we'll see. Let me find okay. This happy will see a traffic coming for multiple in this case or whatever other location proceed chains uses. This is, you know, the basic tunneling you can actually perform or use for your attacks.
You know, ethical hacking attacks or had your traffic for some recent. Remember, you have to use all of this
for ethical purposes.
So what are the different between reverse and dynamic? Poor for burden will reverse its Actually telling your remote server to connect back to your machine your local mission to a different port or throughout service or whatever. And dynamic performer in is kind of a proxy
fashion server,
where you can actually pass all your traffic through that proxy, for example, of sucks five proxy,
Can we actually get a remote control to this attack? Yeah, we can.
You know, this is not necessarily something to gain remote control, but you can actually control anything you want remotely. And you know how your traffic, and even worse you know that that the victim will never know that it was you.
It is video. We learn the concepts behind this attack. You know, behind tunneling, we implemented something next to two kids this attack or this technique itself on. We saw how much of this that can be
supplemental materials, as always for the all this, this entire domain or module? The hacker playbook has really good techniques and commands and ideas you can actually practice on your local out. Love and every possible source in Google us always need to
in the next video cover lateral and vertical movement.
Well, that's it for today, folks, I hope in your deberia and talk to you soon.
Up Next
Offensive Penetration Testing

This is a deep course about penetration testing. In this course, you’ll learn from basic to the most advanced and modern techniques to find vulnerabilities through information gathering, create and/or use exploits and be able to escalate privileges in order to test your information systems defenses.

Instructed By