WEBVTT

00:01.390 --> 00:08.200
Code execution vulnerabilities, these type of vulnerabilities allow us to execute our operating system

00:08.200 --> 00:09.890
code on the target server.

00:10.210 --> 00:13.990
So if the target server uses windows, will be able to execute Windows commands.

00:14.140 --> 00:17.320
If it uses Linux, then we'll be able to use the next command.

00:18.520 --> 00:24.610
Clearly, this is a really critical problem that would allow us to do anything we want with the target,

00:24.610 --> 00:31.840
really, we can upload a shell using the will you get command or upload a payload, a virus, anything

00:31.840 --> 00:35.400
we want using the W w get Linux command.

00:35.710 --> 00:40.360
You just need to make sure that you're uploading it to a file or to a directory which you're allowed

00:40.360 --> 00:41.350
to write stuff to.

00:42.190 --> 00:49.360
Another way of exploiting this vulnerability is to just run all these commands and get a reverse based

00:49.360 --> 00:50.100
on these commands.

00:50.290 --> 00:55.420
So because we can run operating system commands, we can use the programming languages supported by

00:55.420 --> 01:01.060
the operating system to try and get a reverse connection on our computer.

01:02.500 --> 01:10.000
So first of all, let's just assume that we're browsing here and we managed we were going around and

01:10.000 --> 01:16.710
then we got to a tab and the website where it allows you to, for example, do a thing.

01:16.930 --> 01:22.260
Now, what you should do is you should always try to experiment with any input box.

01:22.270 --> 01:27.450
You see, try to see what that input box does and what can you inject into it.

01:27.460 --> 01:30.260
What can you do to get stuff running?

01:30.460 --> 01:33.490
So, for example, this input box is telling you it's going to do a ping.

01:33.970 --> 01:39.130
And if you put an IP, for example, I'm going to put 10, 20, 14, two or three, which is my own

01:39.130 --> 01:42.790
IP, just to see it, to use it as a normal person.

01:42.940 --> 01:48.260
And I'm going to do a submit and it's going to go ahead and ping it for me and give me the ping results.

01:48.820 --> 01:52.540
So what looks like here, it's actually executing the ping command.

01:53.940 --> 01:55.080
And Linux systems.

01:55.440 --> 02:00.150
Now, let's see if we can exploit that, if it's actually executed in the Pinkham on.

02:00.160 --> 02:02.220
So what it's doing is it's going.

02:02.460 --> 02:03.690
And it's doing.

02:04.780 --> 02:13.090
So we're sending 10 2014 to 03 as the dipping and then it's going to go to the Web server and the Web

02:13.090 --> 02:17.890
server is doing ping 10, 20, 14, two or three.

02:19.790 --> 02:25.550
So let's see if we can exploit this, how would we exploit it if it's taking what we're importing right

02:25.550 --> 02:38.120
here and then it's doing that now in Linux and Unix based commands, you can use the this sign to execute

02:38.120 --> 02:40.210
multiple commands on one line.

02:40.640 --> 02:44.510
So if you do this, for example, in your own terminal.

02:44.660 --> 02:49.190
So I'm just going to go to my terminal here and I'm just going to do less, which is the last command.

02:49.640 --> 02:53.910
And then WD is what lists what shows your working directory.

02:54.230 --> 03:01.240
So if I do, unless followed by this sign and then DPW deal, it'll execute both commands.

03:01.250 --> 03:05.060
So it will do this and then it will show where the working directory is.

03:05.950 --> 03:12.090
So we can do the same thing with this and see if it works for us, so we're going to put an IP Arite

03:12.100 --> 03:17.290
IP and then I'm just going to do it and see if it'll execute deployability for me.

03:18.070 --> 03:24.180
If it does, then this is a code execution vulnerability and I can execute anything I want on the server.

03:24.730 --> 03:26.110
So let's see what's going to happen.

03:26.110 --> 03:28.540
I pasted this and I'm going to hit submit.

03:30.750 --> 03:36.240
And as we can see, we got big results, but at the end we got our current working directory, so it's

03:36.240 --> 03:42.050
worth w D.V. w A is an exec.

03:42.360 --> 03:46.220
So it executed DPW that I inserted.

03:46.530 --> 03:50.880
And that means I can insert any commands I want in there and they'll be executed.

03:52.160 --> 04:00.440
So I've inserted a resources file that will that you can use to get reverse connection from the target

04:00.440 --> 04:00.990
computer.

04:01.590 --> 04:05.600
Now, there's a number of ways, a number of commands that would give you a reverse connection.

04:05.870 --> 04:08.390
All of these commands depend on the programming language.

04:08.420 --> 04:12.320
So, for example, we have commands and we we have commands a ruby.

04:12.560 --> 04:15.260
You have Perl commands and we have the one for Bash.

04:15.680 --> 04:17.570
Bash is the.

04:18.450 --> 04:25.000
The next shall command language so all Unix operating systems will be able to execute Basche commands,

04:25.190 --> 04:28.810
so that's a very, very good way of doing it.

04:29.690 --> 04:35.570
So most Unix system, this command should work on most Unix based systems.

04:35.720 --> 04:37.880
So this would be a really good way of doing it.

04:38.360 --> 04:41.920
Again, most of them would have Python, so Python would be a good way.

04:42.320 --> 04:44.790
Netcare, most of them do have nice cat as well.

04:44.810 --> 04:46.730
So in that case, it's a good way of doing that.

04:47.090 --> 04:49.610
And we're actually going to use that cat in this video.

04:50.210 --> 04:50.600
So.

04:50.690 --> 04:54.890
Well, I'm going to do is first I'm going to listen for connections, just like we used to do with me

04:54.890 --> 04:57.380
to exploit when we used to do multi handler.

04:57.530 --> 05:01.010
You can actually use a multi handler for this and listen for connections.

05:01.280 --> 05:05.360
Well, I'm just going to keep it simpler and show you a new way, and I'm going to use that.

05:05.810 --> 05:06.710
So in that cat.

05:11.530 --> 05:15.990
Not is just a tool that allows you to listen and connect computers together.

05:16.870 --> 05:23.200
So I'm going to listen 880 so that Kattis the program, which just to see verbals output so we can see

05:23.200 --> 05:24.080
a lot of output.

05:24.100 --> 05:30.320
Anything goes wrong, we can see it and we're telling it to listen using the EL option on Port 880.

05:31.160 --> 05:36.760
So I'm going to hit enter, and that's saying it's just listening to 88, that's all it's going to do.

05:37.610 --> 05:43.730
The next commander we're going to do is we're going to try to connect from the Web server back to my

05:43.730 --> 05:45.750
computer using that card as well.

05:45.950 --> 05:48.150
So we're assuming the Web server has notecard.

05:48.320 --> 05:50.080
We're going to try it and see if that works.

05:50.630 --> 05:52.010
So the command is very simple.

05:52.010 --> 05:55.460
It's not cut and we're telling it to use the bin bash.

05:56.770 --> 06:03.310
And we're giving it the IP of my device, my ataca device, which is 10, 20, 14.

06:06.220 --> 06:11.410
And then the port, which is 80, 80, which is worth listening on right here.

06:12.510 --> 06:13.980
So I'm going to copy that.

06:15.570 --> 06:21.150
And I'm just going to execute it the same way we used to execute the dependability command.

06:22.820 --> 06:25.940
So the last thing we did was 10, 20.

06:28.820 --> 06:30.530
Fourteen to three.

06:32.690 --> 06:33.620
And then we did.

06:34.400 --> 06:39.500
So what I'm going to do now, I'm going to remove the possibility and paste the code that we just created,

06:39.710 --> 06:45.550
which will try to connect from the Web server back to the candy machine to the attacker machine.

06:46.250 --> 06:47.330
And I'm going to come here.

06:48.550 --> 06:55.280
And as you can see, we got a connection back from two to us from 10, 20 to over.

06:55.480 --> 06:57.450
So that's the target computer.

06:58.000 --> 07:02.260
And if we do a deal, you'll see that we have a reversal.

07:02.260 --> 07:09.520
If we do, unless, uh, if we do an I.D., you'll see that whatever the data and if we do a you name

07:09.520 --> 07:10.930
a just to confirm.

07:12.020 --> 07:18.410
That in the exploitable and you can see that among the missile exploitable and I'm able to run any command

07:18.410 --> 07:20.210
that I want on the target computer.

07:20.240 --> 07:23.360
So basically I have full access to the target computer.
