WEBVTT - This file was automatically generated by VIMEO

0
00:00:09.200 --> 00:00:12.900
Hi and welcome back to Section 8 web application

1
00:00:12.900 --> 00:00:15.400
 attack in this video. You will

2
00:00:15.400 --> 00:00:18.500
 learn how to manually perform SQL injection on

3
00:00:18.500 --> 00:00:20.100
 a vulnerable web application.

4
00:00:21.800 --> 00:00:24.400
I hope you're excited. So let's dive on

5
00:00:24.400 --> 00:00:24.500
 in.

6
00:00:26.600 --> 00:00:29.100
This exercise you will learn how to

7
00:00:29.100 --> 00:00:30.500
 perform SQL injection.

8
00:00:31.300 --> 00:00:35.200
SQL injection is simply a type of injection visas

9
00:00:34.200 --> 00:00:37.400
 Arc that allows. Let's see the article

10
00:00:37.400 --> 00:00:40.900
 hacker or the penetration tester to inject customize

11
00:00:40.900 --> 00:00:43.600
 SQL statements into an input

12
00:00:43.600 --> 00:00:45.600
 form on a vulnerable web application.

13
00:00:46.600 --> 00:00:49.300
If the web application does not validate or

14
00:00:49.300 --> 00:00:52.200
 sanitize input the code will be sent to

15
00:00:52.200 --> 00:00:55.200
 the SQL server on the backend for processing.

16
00:00:55.900 --> 00:00:59.100
If the web application is vulnerable the

17
00:00:58.100 --> 00:01:01.600
 article hacker or the penetration tester will be

18
00:01:01.600 --> 00:01:04.700
 able to create modify retrieve or

19
00:01:04.700 --> 00:01:07.500
 even delete records are stored

20
00:01:07.500 --> 00:01:08.400
 on the database.

21
00:01:09.500 --> 00:01:13.400
In this exercise, you will learn how to perform SQL

22
00:01:12.400 --> 00:01:16.700
 injection to gain administrative access

23
00:01:16.700 --> 00:01:19.600
 on the OS Juice Shop web application.

24
00:01:20.900 --> 00:01:22.200
directly on the scoreboard

25
00:01:22.900 --> 00:01:25.700
simply click on show all

26
00:01:26.500 --> 00:01:28.200
And then let's click on hide all.

27
00:01:29.500 --> 00:01:30.100
like so

28
00:01:31.000 --> 00:01:31.400
great.

29
00:01:32.700 --> 00:01:35.900
Let's filter for all injection based

30
00:01:35.900 --> 00:01:36.100
 attacks.

31
00:01:36.800 --> 00:01:37.900
Let's click on injection.

32
00:01:40.600 --> 00:01:40.900
Great.

33
00:01:41.600 --> 00:01:45.200
Currently we can see there's a few injection based

34
00:01:44.200 --> 00:01:47.100
 attacks. The one that we are

35
00:01:47.100 --> 00:01:50.900
 looking to complete is a one that says login admin. This

36
00:01:50.900 --> 00:01:54.000
 one is where we need to find a

37
00:01:53.400 --> 00:01:56.800
 Wii to gain access to the administrators user

38
00:01:56.800 --> 00:02:00.300
 account in the situation where we do know the

39
00:01:59.300 --> 00:02:02.500
 actual administrative password to get

40
00:02:02.500 --> 00:02:02.600
 started.

41
00:02:03.600 --> 00:02:06.200
Let's scroll up just a little bit on the web application.

42
00:02:07.400 --> 00:02:08.700
And let's click on account.

43
00:02:09.600 --> 00:02:10.000
like so

44
00:02:11.900 --> 00:02:15.100
once you click on account, you will see a drop-down page

45
00:02:14.100 --> 00:02:17.500
 that says login simply click

46
00:02:17.500 --> 00:02:18.100
 on login.

47
00:02:19.400 --> 00:02:23.000
Now we have the login page. Let's check bootsuit.

48
00:02:24.200 --> 00:02:25.700
And we have a few web requests.

49
00:02:26.500 --> 00:02:28.100
Let's follow these web requests.

50
00:02:30.200 --> 00:02:33.100
Great. Let's take a look at a login page.

51
00:02:33.800 --> 00:02:35.400
Currently it is asking.

52
00:02:36.400 --> 00:02:36.600
for

53
00:02:37.700 --> 00:02:40.300
a valid email address and a

54
00:02:40.300 --> 00:02:40.400
 password

55
00:02:41.600 --> 00:02:44.200
So let's send some type of malformed eater

56
00:02:44.200 --> 00:02:45.800
 and intercept this data.

57
00:02:46.400 --> 00:02:49.200
So we can simply type any username. So

58
00:02:49.200 --> 00:02:50.900
 let's type user one add.

59
00:02:51.600 --> 00:02:54.600
email address Comm like

60
00:02:54.600 --> 00:02:54.800
 so

61
00:02:55.500 --> 00:02:58.600
let's create a random password. Let's call it as password.

62
00:02:59.700 --> 00:03:00.900
And simply click on login.

63
00:03:02.700 --> 00:03:05.100
Once you click on login, let's head over back to

64
00:03:05.100 --> 00:03:05.600
 boob Suite.

65
00:03:06.900 --> 00:03:09.300
And here we can see that there's a few more requests that

66
00:03:09.300 --> 00:03:10.600
 is waiting to be processed.

67
00:03:11.100 --> 00:03:14.900
Let's click on forward until we see the post requests that

68
00:03:14.900 --> 00:03:18.000
 is actually trying to send the user credential across

69
00:03:17.200 --> 00:03:18.700
 the web application.

70
00:03:21.100 --> 00:03:21.500
Great.

71
00:03:22.300 --> 00:03:25.600
We have found the requests. Actually. It's not a requests.

72
00:03:25.600 --> 00:03:26.800
 It's a post message.

73
00:03:27.600 --> 00:03:30.400
So you can see post and here we can see the

74
00:03:30.400 --> 00:03:33.900
 user email that we were sending across and

75
00:03:33.900 --> 00:03:34.300
 password.

76
00:03:35.300 --> 00:03:39.300
Currently both Suite has intercepted this information preventing it

77
00:03:39.300 --> 00:03:41.300
 from being sent to the actual web app.

78
00:03:43.200 --> 00:03:43.900
Let's right click.

79
00:03:45.300 --> 00:03:48.300
Now let's choose send to repeater.

80
00:03:49.500 --> 00:03:51.600
Next let's click on the repeater tab.

81
00:03:52.700 --> 00:03:55.200
Repeater simply allows us to modify

82
00:03:55.200 --> 00:03:58.700
 any sorta requests unresponds between our

83
00:03:58.700 --> 00:04:00.700
 web browser and web application.

84
00:04:02.200 --> 00:04:05.300
This tool is very good because we can simply modify

85
00:04:05.300 --> 00:04:08.100
 the data before sending it across to

86
00:04:08.100 --> 00:04:09.800
 the actual web application.

87
00:04:10.900 --> 00:04:14.400
As you can see within this web requests

88
00:04:13.400 --> 00:04:16.600
 it contains on each TDP

89
00:04:16.600 --> 00:04:19.600
 postmessage, but simply includes a

90
00:04:19.600 --> 00:04:22.900
 random email address and password that we have sent currently.

91
00:04:22.900 --> 00:04:25.800
 The message was not deliver just

92
00:04:25.800 --> 00:04:25.800
 yet.

93
00:04:26.500 --> 00:04:29.200
To deliver this web requests. Let's click on send.

94
00:04:30.100 --> 00:04:33.500
Create so now repeater has captured the

95
00:04:33.500 --> 00:04:36.300
 response from the web application that is

96
00:04:36.300 --> 00:04:38.100
 being returned to our web browser.

97
00:04:38.800 --> 00:04:42.200
Notice online 1 it says http.

98
00:04:42.900 --> 00:04:45.900
4 0 1 or authorize this

99
00:04:45.900 --> 00:04:48.400
 means to see that the user credentials that

100
00:04:48.400 --> 00:04:51.800
 we are provided within the requests. It is invalid. It

101
00:04:51.800 --> 00:04:54.700
 is not the correct thing. Let's make

102
00:04:54.700 --> 00:04:57.700
 a simple modification to the original request.

103
00:04:59.600 --> 00:05:00.900
At the end of the email address here.

104
00:05:01.500 --> 00:05:04.600
Simply please a single quotation mark like

105
00:05:04.600 --> 00:05:07.300
 so now let's hit send one more

106
00:05:07.300 --> 00:05:08.300
 time to see what happens.

107
00:05:09.200 --> 00:05:12.600
And noticed the entire response is completely different.

108
00:05:14.600 --> 00:05:17.900
We got a lot more information than the

109
00:05:17.900 --> 00:05:18.900
 previous response.

110
00:05:19.800 --> 00:05:21.200
So what exactly us up on here?

111
00:05:22.300 --> 00:05:25.300
Simply by inserting a single quotation mark

112
00:05:25.300 --> 00:05:28.600
 at the end of the email address within the requests as

113
00:05:28.600 --> 00:05:30.600
 we can see on the left side.

114
00:05:31.500 --> 00:05:35.100
It tests whether the web application is vulnerable to

115
00:05:34.100 --> 00:05:36.900
 an SQL injection vs attack.

116
00:05:38.200 --> 00:05:41.800
Now, let's take a look at a response more carefully.

117
00:05:45.300 --> 00:05:47.300
If you notice at line 14.

118
00:05:48.100 --> 00:05:51.400
Well, actually at line 15, we got an honor

119
00:05:51.400 --> 00:05:52.700
 recognized tucan.

120
00:05:54.200 --> 00:05:57.200
This honor recognize token specifies that there's

121
00:05:57.200 --> 00:05:58.500
 an SQL light error.

122
00:05:59.700 --> 00:06:02.500
And at line 21, we can

123
00:06:02.500 --> 00:06:05.900
 see the actual SQL statement that

124
00:06:05.900 --> 00:06:08.200
 was sent from the web application to the

125
00:06:08.200 --> 00:06:09.400
 backend database.

126
00:06:11.200 --> 00:06:14.600
Because we inserted a single quotation after the email

127
00:06:14.600 --> 00:06:18.000
 address. It will simply tell their scroll

128
00:06:17.500 --> 00:06:20.700
 database or the web application to Simply ignore

129
00:06:20.700 --> 00:06:23.600
 everything else that follows after that single

130
00:06:23.600 --> 00:06:24.100
 quotation.

131
00:06:25.200 --> 00:06:26.700
So you could try to exploit this.

132
00:06:28.200 --> 00:06:31.700
Let's head over back to the web application on our

133
00:06:31.700 --> 00:06:32.600
 web browser like so

134
00:06:34.200 --> 00:06:38.300
Actually, let's click on proxy. Let's

135
00:06:37.300 --> 00:06:40.200
 forward all the request messages.

136
00:06:42.200 --> 00:06:42.600
Great.

137
00:06:43.900 --> 00:06:45.400
back to our web application

138
00:06:47.500 --> 00:06:50.000
Let's change our user credentials.

139
00:06:52.500 --> 00:06:55.200
This time at the end of the email address.

140
00:06:55.200 --> 00:06:56.400
 We are going to insert.

141
00:06:57.200 --> 00:07:01.500
A single quotation like so we'll specify or lose

142
00:07:00.500 --> 00:07:03.000
 specify one equal one.

143
00:07:04.000 --> 00:07:05.000
semicolon

144
00:07:06.100 --> 00:07:08.600
space dash dash like so

145
00:07:09.600 --> 00:07:10.700
and now let's click login.

146
00:07:11.600 --> 00:07:14.400
At this point it should capture the new

147
00:07:14.400 --> 00:07:17.000
 web requests. Let's hello back to boost Suite.

148
00:07:17.900 --> 00:07:20.500
Let's click on forward a few times until

149
00:07:20.500 --> 00:07:22.200
 we see this new web request.

150
00:07:24.500 --> 00:07:27.600
Great currently we can see the new user input.

151
00:07:27.600 --> 00:07:30.800
 Let's right click and send this to repeater

152
00:07:30.800 --> 00:07:31.300
 once more.

153
00:07:32.200 --> 00:07:33.200
Let's click on repeater.

154
00:07:34.200 --> 00:07:37.300
So now we have an entirely new requests of

155
00:07:37.300 --> 00:07:38.100
 your Center repeater.

156
00:07:38.700 --> 00:07:39.000
create

157
00:07:39.900 --> 00:07:43.400
Own repeater let's click Send. So right

158
00:07:42.400 --> 00:07:45.500
 now both so you will actually send this

159
00:07:45.500 --> 00:07:48.600
 request to the web server and

160
00:07:48.600 --> 00:07:50.200
 we'll take a look at what responses.

161
00:07:51.800 --> 00:07:55.900
And notice this time we actually got authentication and

162
00:07:54.900 --> 00:07:57.700
 we have an authentication token.

163
00:07:59.100 --> 00:08:00.100
So what does this mean?

164
00:08:01.300 --> 00:08:05.000
Well, this means that what we have just done is

165
00:08:04.500 --> 00:08:06.800
 we have performed on SQL injection.

166
00:08:07.700 --> 00:08:10.200
On the web application and we are

167
00:08:10.200 --> 00:08:13.600
 successfully evil to gain access to the administrator

168
00:08:13.600 --> 00:08:14.100
 account.

169
00:08:14.800 --> 00:08:17.300
And we have an authentication token that

170
00:08:17.300 --> 00:08:20.800
 we can use to log in to the user account.

171
00:08:21.800 --> 00:08:22.900
Let's click on proxy.

172
00:08:24.300 --> 00:08:25.900
Let's follow all of the requests.

173
00:08:28.900 --> 00:08:31.600
Now let's head over back to our web browser

174
00:08:31.600 --> 00:08:34.300
 and detailing weather. We have completed a challenge

175
00:08:34.300 --> 00:08:35.100
 or not.

176
00:08:35.500 --> 00:08:38.400
And currently we can see your successfully solved the

177
00:08:38.400 --> 00:08:38.600
 challenge.

178
00:08:39.500 --> 00:08:40.900
for login admin

179
00:08:41.700 --> 00:08:42.700
Let's click on account.

180
00:08:43.600 --> 00:08:46.300
And notice now that we have more available options.

181
00:08:47.200 --> 00:08:48.200
We can simply see.

182
00:08:49.700 --> 00:08:50.300
the orders

183
00:08:51.300 --> 00:08:54.500
and received addresses the digital wallet. We

184
00:08:54.500 --> 00:08:57.500
 can even log out from the actual administrator account.

185
00:08:58.500 --> 00:08:58.800
Great.

186
00:08:59.700 --> 00:09:02.600
So we have completed a challenge on the scoreboard.

187
00:09:03.400 --> 00:09:06.200
If we had over back to the scoreboard we should see.

188
00:09:06.900 --> 00:09:08.000
We have some points.

189
00:09:10.100 --> 00:09:10.800
and here you can see

190
00:09:11.700 --> 00:09:13.200
we have solved this challenge.

191
00:09:17.200 --> 00:09:21.100
During this video you have learned how to perform manual SQL

192
00:09:20.100 --> 00:09:24.100
 injection on a vulnerable web application in

193
00:09:23.100 --> 00:09:26.100
 the next video. You will learn how to perform

194
00:09:26.100 --> 00:09:29.700
 brukon authentication attacks. I hope

195
00:09:29.700 --> 00:09:32.300
 this video has been a formative for you and I

196
00:09:32.300 --> 00:09:33.700
 will see you in the next one.
