WEBVTT

00:00.970 --> 00:08.050
Just like we did before and the last video we put five times back and then we put ATC password to access

00:08.050 --> 00:09.400
the password file.

00:09.580 --> 00:15.200
What we're going to do today is we're going to try to access a file located on a different server.

00:15.340 --> 00:21.640
So if you're doing this Penn test on an actual web server then you need to store the file that you want

00:21.640 --> 00:27.720
to access needs to be stored on a place with a real IP address or with a domain name.

00:27.730 --> 00:33.280
I'm doing this on my local server so I'm going to store this on the on the web server on the Kali machine

00:33.280 --> 00:35.520
on the 10 2014 to 0 3.

00:35.530 --> 00:43.930
This is 10 20 40 into 4 and I'm going to store my file on 10 2014 two or three so that file as I said

00:43.930 --> 00:46.000
can be anything it could be a web shell.

00:46.000 --> 00:47.910
It could be a payload.

00:47.920 --> 00:52.540
Well what I'm going to do is I'm going to create a very simple BHP file.

00:52.720 --> 00:56.320
So this is just a page for you start and end of the file.

00:56.530 --> 01:00.520
And what I'm going to put in the file I'm going to use of a function called pass through.

01:01.420 --> 01:04.180
And in that function basically what this function does.

01:04.180 --> 01:12.190
It executes operating system commands so it executes Windows Linux or depending on the web server it's

01:12.190 --> 01:19.550
going to execute commands related to that so you put the command here between the two quotation marks

01:19.910 --> 01:24.830
and I'm going to use the same command we used with the code execution version of vulnerability which

01:24.830 --> 01:31.910
was the net cat command which allowed us to get a connection or reverse connection from our target.

01:32.270 --> 01:34.460
So going to start here.

01:34.550 --> 01:36.230
So let's just first have a look on this.

01:36.230 --> 01:44.120
So BHP in the end these are just the start and the end of the file of the BHP file pass through is a

01:44.120 --> 01:50.000
function that I'm going to use which executes any command that's inserted between the quotations and

01:50.000 --> 01:56.000
I'm using the same command that we used in the command execution vulnerability which will just do a

01:56.000 --> 01:59.310
reverse connection to my computer.

01:59.320 --> 02:00.220
So this is all good.

02:00.220 --> 02:02.690
Now the next step is the most important step.

02:02.860 --> 02:04.570
And it's stored in this file.

02:04.570 --> 02:12.410
So as I said if your target was a remote web server then you should be star in this file in a place

02:12.590 --> 02:16.910
with a real IP where you can access it from the remote web server.

02:16.910 --> 02:22.670
Now I'm going to be X trying to access this from my meters political machine which is able to access

02:22.670 --> 02:27.950
files stored on the county machine because they're both on the same network and I'm going to be calling

02:27.950 --> 02:31.930
this I'm gonna be storing it in my var w w w hasty AML.

02:32.000 --> 02:32.690
So it's starting.

02:32.780 --> 02:36.160
It's being stored on the county not on the myth exploitable.

02:36.170 --> 02:45.710
And I'm gonna call it reverse and I'm gonna save it as GST not BHP and I'm doing this if I started as

02:45.710 --> 02:50.280
a BHP it is going to be executed on the candy machine.

02:50.300 --> 02:54.730
So it's going to create a reverse connection from the candy machine and I don't want that.

02:54.740 --> 02:59.180
I don't want to have the killing machine I actually already have access to the candy machine the one

02:59.180 --> 03:04.770
that I want to hack is the myth exploitable machine and that one is stored remotely.

03:04.850 --> 03:12.590
So in order to be able to include the IP HP code and executed on the remote machine we're gonna use

03:12.590 --> 03:19.220
it as GST and get it executed are the methods political machine and instead of executed on my tally.

03:19.790 --> 03:26.820
So I'm I'm starting it as a GST and I'm going to say save it and now let's just see here so if I go

03:26.820 --> 03:36.900
to my local host and if I say reverse the THC we'll see our file right here.

03:36.910 --> 03:42.310
So again this is on my local host which is not the most exploitable machine.

03:42.310 --> 03:49.990
It's 10 20 40 into 0 3 and the meter deployable is on 2 0 4.

03:50.040 --> 03:55.530
So how are we going to run this first let me just listen for connections like we did before.

03:55.590 --> 03:58.830
So it's just going to be net cat.

03:58.990 --> 04:10.430
The the LDP 1880 and then right here instead of including a file on the same server I'm going to include

04:10.430 --> 04:14.480
a remote file and the command is going to be hazed TTP.

04:14.510 --> 04:21.950
So it's just going to be the link to this file so we can access the file here as GHC gonna copied and

04:21.950 --> 04:22.780
pasted here

04:27.420 --> 04:33.600
and also in some cases you might need to add a question mark to the end to get this file to be executed

04:33.650 --> 04:34.550
RSP HP.

04:35.280 --> 04:40.950
So I'm just gonna go over this again for one more time including a remote file which is on a remote

04:40.950 --> 04:41.600
server.

04:41.700 --> 04:48.840
Make sure the remote server is accessible by your target and also make sure you start as GST because

04:48.840 --> 04:54.840
if you keep it as BHP this file the reverse file will be executed on the remote server so it will be

04:54.840 --> 04:58.850
executed on the 2 0 3 instead of being executed on the 2 0 4.

04:59.610 --> 05:01.270
And I'm keeping it at 60.

05:01.350 --> 05:02.790
This way it'll be great.

05:02.850 --> 05:09.030
It's gonna be executed on the two or four and it's gonna give me a remote connection to this computer

05:09.650 --> 05:11.880
to the mute exploitable computer.

05:12.150 --> 05:15.840
So if I come back here as you can see we have a remote connection.

05:15.840 --> 05:23.100
If we do a you name a you'll see that this is the meter's potable machine not the tally machine.

05:23.100 --> 05:29.370
So we basically have full access to the most exploitable machine through and a remote file inclusion

05:29.370 --> 05:30.510
vulnerability.

05:30.510 --> 05:36.960
Now if we do an atlas we can do a p WD to see where we are and we can literally run and in the next

05:36.960 --> 05:37.740
command we want.

05:37.740 --> 05:40.260
Now on the machine and do anything we want.

05:40.260 --> 05:42.450
Basically we have full access to that machine.
