WEBVTT

00:00.990 --> 00:02.070
Welcome back everyone.

00:02.070 --> 00:08.160
This is Sadr from abductee degree in this lecture I will show you how to detect excesses and then even

00:08.160 --> 00:13.380
bypass some of the filters that some so-called smart developers use.

00:13.380 --> 00:16.860
First of all we will be exploiting the excesses on low level.

00:16.860 --> 00:19.070
Then we will go to medium and then on high.

00:19.860 --> 00:27.930
So right now I have said my DPW security to low level and we will be compromising the reflected excesses

00:28.820 --> 00:36.940
in reflected excesses the excesses payload needs to be injected in the United States so for example

00:37.030 --> 00:39.310
when we see the source code of the speech

00:43.840 --> 00:52.840
you will notice that there is no security mechanism and it is simply printing the name as it this so

00:53.200 --> 00:58.650
if I use a script tag which can be a javascript let's say script

01:05.320 --> 01:11.080
and I add anything in between this tag it should render.

01:11.260 --> 01:20.270
Let me just add a very simple alert.

01:20.290 --> 01:22.300
Well let me just add a alert as one

01:26.620 --> 01:33.550
so when we submit this thing you will see that a pop up comes which is an alert and it sees one.

01:33.550 --> 01:41.350
This means that the website is infected with the access as one visibility but which kind of vulnerability.

01:41.380 --> 01:46.590
Now when you see in the you auto it is giving the parameter as it is.

01:46.660 --> 01:50.610
There is this script alert and then this group and this hash.

01:51.190 --> 01:58.310
This is the reflected excesses where the excesses as in the euro or the GDP barometer.

01:58.600 --> 02:03.700
Now venue corporate this thing and you send it to anyone.

02:03.820 --> 02:04.470
Let's see.

02:04.480 --> 02:06.510
I will pasted that Ecklie.

02:06.730 --> 02:09.670
You will see that this excesses works.

02:09.760 --> 02:18.310
So this you are all is now infected with the excesses payload instead of using the script TAC with alert.

02:18.310 --> 02:24.830
I may use something like a cookie stealer or I may use some virus or a backdoor or anything.

02:25.000 --> 02:32.080
So that's the severity of excesses when you talk about some secure applications.

02:32.080 --> 02:35.230
Let's go ahead and change the security to medium

02:39.750 --> 02:42.440
so here the security is medium.

02:42.480 --> 02:49.380
When you go and access asset infected and you try to apply the same payload it may or may not work.

02:50.100 --> 02:57.460
So let me just use the same payload and I says submit you will see it says alert one.

02:57.510 --> 03:01.570
It simply means that this script tag is not working.

03:01.770 --> 03:07.820
But let's check the source code and analyze what's the problem.

03:07.950 --> 03:14.980
Now here you will see the name parameter that is using these strings replace.

03:15.010 --> 03:22.480
So it is replacing the string and it is replacing script tag with null value.

03:22.810 --> 03:25.960
So it is simply removing the script time.

03:25.960 --> 03:30.750
Now in such kind of cases there are many options available to you.

03:30.760 --> 03:33.360
You can use some variations and script tag.

03:33.430 --> 03:35.750
You will see SC are IPT.

03:35.890 --> 03:40.160
This is simply filtering this script tag which is in lowercase.

03:40.240 --> 03:49.620
What if I change this thing in uppercase let us see that instead of using script tag in lower case I

03:49.620 --> 03:51.780
change the script tag in uppercase

03:58.010 --> 04:04.080
and right here as row.

04:04.470 --> 04:09.150
So now you see I have changed the script tag in uppercase and it works.

04:09.150 --> 04:13.920
This happens because the application is not validating the input.

04:13.920 --> 04:18.640
Instead it is simply trying to remove the logic is script tag.

04:18.870 --> 04:24.870
If this doesn't works we could have even tried to capitalize one or two letters let's say s will be

04:24.870 --> 04:34.890
capitalized here and let's see are will be capitalized here and you will see that this combination will

04:35.160 --> 04:36.470
actually work as well.

04:37.810 --> 04:39.700
You can see it works.

04:39.700 --> 04:45.460
So these are some of the bypassing techniques when some so-called smart developer tries to defend against

04:45.520 --> 04:55.250
excesses renewable one to the high level of security you will notice that the developer has now done

04:55.310 --> 05:01.010
some great work let us try to use the excesses same payload.

05:01.140 --> 05:09.990
Let's say I will capitalize the eye here and I will capitalize the B here when you go ahead and submit

05:10.020 --> 05:10.730
this thing.

05:10.770 --> 05:11.730
It doesn't work.

05:11.790 --> 05:13.290
Now as well.

05:13.290 --> 05:18.780
So when you check the source code the developer has done it good work.

05:18.780 --> 05:22.690
He or she has replaced the each character.

05:22.860 --> 05:30.810
So it is checking for characters S C R I P T in this case it is simply checking each and every character

05:31.080 --> 05:33.600
and all of their combinations.

05:33.600 --> 05:40.180
Rather it is uppercase or lowercase any different combinations that is making this script.

05:40.260 --> 05:41.790
That is really fine.

05:41.790 --> 05:47.630
Script tag is not only one kind of injection in excesses you can use some other HDMI element.

05:47.640 --> 05:55.970
For example the body element let us try to form the same script with the body.

05:55.970 --> 06:02.740
Let's see body and let me close the body.

06:03.200 --> 06:07.740
Now in the body tag I will see on load.

06:07.790 --> 06:13.020
So we are using the on load parameter and here I can give it.

06:13.140 --> 06:18.090
Let's see on load equals and I can give it anything like alert again

06:21.640 --> 06:31.140
let's say one and let's try to find this up no you will see it works on this name now because this body

06:31.140 --> 06:38.940
tag is a different element in the exercise right here we are not using the script tag this body tag

06:38.940 --> 06:39.830
works.

06:40.080 --> 06:44.900
Let me show you how you can actually security web application from accesses.

06:45.180 --> 06:48.750
You can see the secure version in the impossible level.

06:48.750 --> 06:51.680
Let us move down and to submit.

06:51.910 --> 07:00.160
Now let's go ahead and exercise it reflected its go to view source this is the source

07:04.280 --> 07:06.320
in this specific thing.

07:06.560 --> 07:12.090
It is checking the estimates special Connectors right.

07:12.110 --> 07:13.410
That's the thing here.

07:13.430 --> 07:20.180
It does not filtering anything this time but it is simply checking that there is no SDM special Connector

07:20.180 --> 07:20.540
in that.

07:20.570 --> 07:21.170
Right.

07:21.170 --> 07:24.870
So it is basically removing anything which is from MDMA.

07:25.100 --> 07:27.550
And simply allowing plain.

07:27.650 --> 07:32.120
This is the perfect example of securing a web app against excesses.

07:32.150 --> 07:34.860
Always remember you can never trust the user.

07:34.910 --> 07:37.440
So you should always validate the input.

07:37.580 --> 07:40.010
And this is how access as reflected works.
