WEBVTT - This file was automatically generated by VIMEO

0
00:00:06.300 --> 00:00:09.800
Okay guys now it's time for case number

1
00:00:09.800 --> 00:00:13.600
 two race condition reusing a

2
00:00:13.600 --> 00:00:15.200
 one-time discount code.

3
00:00:16.100 --> 00:00:19.400
What I'm gonna present here is more race condition

4
00:00:19.400 --> 00:00:22.900
 exploitation because this is really powerful attack

5
00:00:22.900 --> 00:00:25.300
 and the case here is

6
00:00:25.300 --> 00:00:28.600
 gonna be a very popular case related to

7
00:00:28.600 --> 00:00:32.200
 online shopping in online

8
00:00:31.200 --> 00:00:34.900
 shopping platforms. We can

9
00:00:34.900 --> 00:00:37.900
 redeem one time discount code,

10
00:00:37.900 --> 00:00:41.500
 right? It's very popular functionality and

11
00:00:40.500 --> 00:00:43.600
 well as the name suggests one

12
00:00:43.600 --> 00:00:46.300
 time discount code can be used only

13
00:00:46.300 --> 00:00:50.100
 ones but we are hackers and we

14
00:00:49.100 --> 00:00:53.000
 can use race condition to reuse a

15
00:00:52.300 --> 00:00:55.400
 one-time discount code and at the

16
00:00:55.400 --> 00:00:59.600
 very end, we're gonna have a very nice profit. Okay. So let

17
00:00:58.600 --> 00:01:01.400
 me go to the demo.

18
00:01:01.400 --> 00:01:04.800
 I've got a demo as always the demo is

19
00:01:04.800 --> 00:01:07.700
 located at training the local slash sharp

20
00:01:07.700 --> 00:01:10.600
 in my testing environment and let

21
00:01:10.600 --> 00:01:12.500
 me show you how this attack Works in practice.

22
00:01:15.400 --> 00:01:19.100
Okay, here is my demo. What

23
00:01:18.100 --> 00:01:22.300
 you can see here is a number of one-time discount

24
00:01:22.300 --> 00:01:26.400
 codes first. I'm gonna show you that indeed.

25
00:01:25.400 --> 00:01:28.900
 This codes are one time

26
00:01:28.900 --> 00:01:31.400
 discount codes. Okay, so let

27
00:01:31.400 --> 00:01:34.800
 me for example take this 1% discount

28
00:01:34.800 --> 00:01:35.200
 code.

29
00:01:36.900 --> 00:01:40.000
And I'm gonna copy this guy and

30
00:01:39.400 --> 00:01:42.600
 I'm gonna redeem this discount code.

31
00:01:42.600 --> 00:01:45.000
 Okay, I did it for the first

32
00:01:45.300 --> 00:01:47.400
 time. Let me try for the second time.

33
00:01:48.400 --> 00:01:51.700
And you see invalid discount code and this

34
00:01:51.700 --> 00:01:55.000
 is well a good message because well

35
00:01:54.500 --> 00:01:57.400
 the system works as expected what

36
00:01:57.400 --> 00:02:00.400
 I mean here is that this is a one-time discount

37
00:02:00.400 --> 00:02:03.300
 code so I cannot use it for the second

38
00:02:03.300 --> 00:02:07.100
 time. Okay. Now let me click here reset discount

39
00:02:06.100 --> 00:02:09.700
 code database because I just

40
00:02:09.700 --> 00:02:12.800
 want to show you that. Well, actually

41
00:02:12.800 --> 00:02:15.400
 I can reuse a one-time discount

42
00:02:15.400 --> 00:02:18.100
 code via race condition. So in order,

43
00:02:18.100 --> 00:02:21.400
 you know to start from the very beginning with this demo I

44
00:02:21.400 --> 00:02:24.200
 clicked reset discount code database in my

45
00:02:24.200 --> 00:02:27.300
 testing environment. Okay, great. And you see the message

46
00:02:27.300 --> 00:02:30.700
 discount code database has been reset and my

47
00:02:30.700 --> 00:02:33.400
 discount right now is zero, so I'm starting from

48
00:02:33.400 --> 00:02:34.600
 the scratch with this case.

49
00:02:35.300 --> 00:02:39.400
Okay, the first we have to think

50
00:02:38.400 --> 00:02:43.200
 about this, you know functionality in

51
00:02:42.200 --> 00:02:45.500
 terms of race condition and we

52
00:02:45.500 --> 00:02:48.400
 have to think if race condition can happen here

53
00:02:48.400 --> 00:02:51.200
 or not. I explained to you in details

54
00:02:51.200 --> 00:02:54.200
 what the race condition is how it works and

55
00:02:54.200 --> 00:02:57.300
 stuff like that. I presented some you know drawings on

56
00:02:57.300 --> 00:03:00.600
 the Whiteboard, but here if you just take

57
00:03:00.600 --> 00:03:03.300
 the knowledge from the previous case and try to apply this

58
00:03:03.300 --> 00:03:06.300
 knowledge in this case, then you will realize something like

59
00:03:06.300 --> 00:03:10.400
 this that well indeed. There is a possibility

60
00:03:09.400 --> 00:03:12.700
 of launching our race

61
00:03:12.700 --> 00:03:17.000
 condition attack here because race

62
00:03:15.200 --> 00:03:18.900
 condition is gonna happen here

63
00:03:18.900 --> 00:03:21.400
 when accepting the

64
00:03:21.400 --> 00:03:24.300
 requests with a discount code

65
00:03:24.300 --> 00:03:27.600
 is faster than redeeming of

66
00:03:27.600 --> 00:03:30.500
 a discount code. Okay, I believe that it

67
00:03:30.500 --> 00:03:33.500
 makes sense for you. You always have to figure out about

68
00:03:33.500 --> 00:03:34.800
 what's gonna happen.

69
00:03:35.200 --> 00:03:38.700
The system when we provide a one-time

70
00:03:38.700 --> 00:03:41.400
 discount code and try to imagine if this

71
00:03:41.400 --> 00:03:44.500
 race condition can happen or not. Right? So just take

72
00:03:44.500 --> 00:03:47.200
 a look at the functionality. Now, you've got a knowledge

73
00:03:47.200 --> 00:03:50.500
 about race condition race condition exploitation and

74
00:03:50.500 --> 00:03:53.800
 how it works and try to imagine if this is possible and here

75
00:03:53.800 --> 00:03:56.200
 in indeed. There is a chance that it's gonna

76
00:03:56.200 --> 00:03:59.500
 work. So let me repeat this stuff race condition

77
00:03:59.500 --> 00:04:02.700
 can happen when accepting the

78
00:04:02.700 --> 00:04:05.600
 requests with a discount code is

79
00:04:05.600 --> 00:04:08.500
 faster than redeeming of a discount code.

80
00:04:08.500 --> 00:04:11.300
 Okay chances are that it will work.

81
00:04:11.300 --> 00:04:14.500
 So yeah, let's do it. Let me repeat this

82
00:04:14.500 --> 00:04:17.200
 steps, you know from the previous case so that we

83
00:04:17.200 --> 00:04:20.500
 can exercise it even more. I mean

84
00:04:20.500 --> 00:04:23.100
 this race condition exploitation.

85
00:04:24.300 --> 00:04:28.100
And let's check out what we're gonna see at the

86
00:04:27.100 --> 00:04:30.800
 very end. Okay, so I'm gonna take this 1%

87
00:04:30.800 --> 00:04:32.100
 discount code.

88
00:04:33.400 --> 00:04:34.800
I'm gonna copy it here.

89
00:04:35.500 --> 00:04:38.700
And I'm gonna click redeem

90
00:04:38.700 --> 00:04:41.800
 a discount code and I'm gonna actually intercept the

91
00:04:41.800 --> 00:04:44.400
 outgoing request because as you already know

92
00:04:44.400 --> 00:04:47.900
 from the previous case, we're gonna launch some multifredded

93
00:04:47.900 --> 00:04:50.500
 attack here in ovas zap. So first, I

94
00:04:50.500 --> 00:04:53.500
 need to intercept the outgoing request with

95
00:04:53.500 --> 00:04:56.400
 my one time discount code. Okay, so let

96
00:04:56.400 --> 00:04:58.100
 me go to ovas zap.

97
00:04:58.800 --> 00:05:02.000
What I can see here is the request intercepted

98
00:05:01.200 --> 00:05:04.600
 from the previous case. So

99
00:05:04.600 --> 00:05:09.200
 yeah, let me forward it and let

100
00:05:07.200 --> 00:05:10.300
 me turn on

101
00:05:10.300 --> 00:05:13.400
 the Interceptor, right so the Interceptor is turned

102
00:05:13.400 --> 00:05:13.400
 on.

103
00:05:14.800 --> 00:05:17.800
Now I'm gonna click redeem a

104
00:05:17.800 --> 00:05:18.500
 discount code.

105
00:05:20.500 --> 00:05:20.700
and

106
00:05:22.600 --> 00:05:26.300
here is my intercepted request

107
00:05:25.300 --> 00:05:28.600
 with one time discount

108
00:05:28.600 --> 00:05:31.400
 code and the next step is I'm

109
00:05:31.400 --> 00:05:34.200
 gonna click right here fuzz.

110
00:05:34.700 --> 00:05:37.300
And I want to send this request,

111
00:05:37.300 --> 00:05:40.600
 you know, let it be 100 times.

112
00:05:40.600 --> 00:05:43.100
 Okay, so let's go to

113
00:05:43.100 --> 00:05:44.300
 payloads.

114
00:05:45.100 --> 00:05:45.300
and

115
00:05:47.600 --> 00:05:50.400
and let's choose empty now

116
00:05:50.400 --> 00:05:55.000
 as a payload and the number of repetitions 100, okay.

117
00:05:56.200 --> 00:05:59.500
So I'm just repeating the steps that I presented

118
00:05:59.500 --> 00:06:03.100
 to you in the previous case and just a

119
00:06:02.100 --> 00:06:05.500
 reminder for you. I have chosen

120
00:06:05.500 --> 00:06:09.200
 empty null as a payload because well,

121
00:06:08.200 --> 00:06:11.300
 I just want to take this

122
00:06:11.300 --> 00:06:14.200
 request and send in many times in the

123
00:06:14.200 --> 00:06:17.100
 multifred attack scenario. Okay. I don't want to

124
00:06:17.100 --> 00:06:20.800
 change anything in this request. So I didn't indicate any,

125
00:06:20.800 --> 00:06:23.400
 you know payload position

126
00:06:23.400 --> 00:06:23.700
 here.

127
00:06:24.600 --> 00:06:27.300
I wanted to be sent

128
00:06:27.300 --> 00:06:30.900
 100 times and now let me go to options and

129
00:06:30.900 --> 00:06:35.600
 let me configure this a multi-fredded

130
00:06:34.600 --> 00:06:37.200
 behavior. Okay?

131
00:06:38.200 --> 00:06:41.500
So I'm gonna just again 20 so

132
00:06:41.500 --> 00:06:44.400
 concurrence scanning Frets per scam

133
00:06:44.400 --> 00:06:47.300
 is gonna be 20. So I've got right now

134
00:06:47.300 --> 00:06:50.500
 the multifredding configured in my

135
00:06:50.500 --> 00:06:54.600
 attack. So let me click Start father.

136
00:06:55.900 --> 00:06:58.300
Yeah, it is blazing fast.

137
00:06:59.500 --> 00:07:02.700
And now it is finished. So indeed,

138
00:07:02.700 --> 00:07:07.800
 it was really really fast. Now, I'm gonna release this

139
00:07:07.800 --> 00:07:11.000
 Interceptor and I'm gonna

140
00:07:11.900 --> 00:07:14.100
refresh this web application here. Okay.

141
00:07:15.300 --> 00:07:18.900
And what you can see is that your discount is

142
00:07:18.900 --> 00:07:20.200
 13%

143
00:07:21.300 --> 00:07:24.900
So yeah, I've got a nice benefit from

144
00:07:24.900 --> 00:07:27.300
 this attack that I was able to

145
00:07:27.300 --> 00:07:31.400
 reuse a one-time discount code. I had

146
00:07:30.400 --> 00:07:33.600
 a 1% discount code

147
00:07:33.600 --> 00:07:36.400
 and I was supposed to see

148
00:07:36.400 --> 00:07:39.600
 1% discount but I launched

149
00:07:39.600 --> 00:07:43.200
 a race condition attack and Via

150
00:07:42.200 --> 00:07:46.100
 race condition. I was able to actually get

151
00:07:45.100 --> 00:07:48.300
 a much better discount which

152
00:07:48.300 --> 00:07:52.800
 is 13% Right? And again, this is

153
00:07:52.800 --> 00:07:55.800
 non-deterministic attacks. So I launch

154
00:07:55.800 --> 00:07:58.200
 it and you know here and this is

155
00:07:58.200 --> 00:08:03.100
 13% but dependently on different

156
00:08:01.100 --> 00:08:05.100
 things like network connection

157
00:08:04.100 --> 00:08:08.100
 and the speed of network connection the delays

158
00:08:07.100 --> 00:08:10.100
 out there. So the performance of the

159
00:08:10.100 --> 00:08:13.200
 network in general right or the performance of the

160
00:08:13.200 --> 00:08:16.800
 system where the web application is hosted like swapping I

161
00:08:16.800 --> 00:08:19.700
 told you in the previous case that swapping can have an

162
00:08:19.700 --> 00:08:20.700
 impact, you know on the

163
00:08:21.200 --> 00:08:24.400
Of the system and and while the race conditions are

164
00:08:24.400 --> 00:08:27.400
 about fractions of milliseconds. So the question is,

165
00:08:27.400 --> 00:08:30.900
 you know, how many requests are

166
00:08:30.900 --> 00:08:33.900
 gonna win this race right here. So

167
00:08:33.900 --> 00:08:36.100
 I explained you all the details in the

168
00:08:36.100 --> 00:08:40.300
 previous case. So right now I'm just presenting you the next

169
00:08:40.300 --> 00:08:43.600
 case. So yeah, this is how it works. So you

170
00:08:43.600 --> 00:08:46.900
 see that indeed our attack works

171
00:08:46.900 --> 00:08:50.700
 and we are able to actually

172
00:08:49.700 --> 00:08:52.800
 reuse our one-time

173
00:08:52.800 --> 00:08:55.700
 discount code many times. And yeah, there

174
00:08:55.700 --> 00:08:59.700
 is a very nice profit. So this

175
00:08:59.700 --> 00:09:02.500
 is it. Let me right now jump to

176
00:09:02.500 --> 00:09:05.200
 the slides because I want to wrap up everything here.

177
00:09:06.400 --> 00:09:09.600
So I presented to you very popular

178
00:09:09.600 --> 00:09:12.400
 functionality in

179
00:09:12.400 --> 00:09:16.700
 modern eshopping which is redeeming discount

180
00:09:15.700 --> 00:09:18.700
 code here. I

181
00:09:18.700 --> 00:09:21.500
 had one time discount codes. So

182
00:09:21.500 --> 00:09:24.400
 this discount code can be used only once

183
00:09:24.400 --> 00:09:28.200
 as the name suggests, but I launched race

184
00:09:27.200 --> 00:09:30.300
 condition attack and I was

185
00:09:30.300 --> 00:09:34.400
 actually able to reuse this one time discount code. So I

186
00:09:33.400 --> 00:09:36.600
 used many concurrent requests to

187
00:09:36.600 --> 00:09:39.800
 redeem this one time discount code.

188
00:09:39.800 --> 00:09:43.500
 And as I told you and the

189
00:09:42.500 --> 00:09:45.900
 race condition happens when

190
00:09:45.900 --> 00:09:48.700
 accepting the requests with

191
00:09:48.700 --> 00:09:51.700
 a discount code is faster than

192
00:09:51.700 --> 00:09:55.600
 redeeming of a discount code and I

193
00:09:54.600 --> 00:09:57.700
 always recommend you to think

194
00:09:57.700 --> 00:10:01.000
 about the potential race condition exploitation

195
00:10:00.600 --> 00:10:03.700
 scenario when you've got a given functionality

196
00:10:03.700 --> 00:10:06.100
 in front of your eyes. Okay, so you have to think

197
00:10:06.400 --> 00:10:09.800
There is a potential of this kind of attack. And when I

198
00:10:09.800 --> 00:10:12.900
 started presenting this demo I explained to you why I

199
00:10:12.900 --> 00:10:15.700
 think that race condition can be really

200
00:10:15.700 --> 00:10:18.200
 an issue here, right? That's why I launched this

201
00:10:18.200 --> 00:10:21.200
 attack. That's why I want to check if this is really

202
00:10:21.200 --> 00:10:23.200
 possible or not.

203
00:10:24.200 --> 00:10:28.000
So finally I was able to

204
00:10:27.700 --> 00:10:30.400
 reuse a one-time discount code via race

205
00:10:30.400 --> 00:10:33.400
 condition. And this is it. So you see

206
00:10:33.400 --> 00:10:36.900
 how it works. I I believe that this is clear for you you had

207
00:10:36.900 --> 00:10:39.100
 an opportunity to see yet or another

208
00:10:39.100 --> 00:10:43.300
 race condition exploitation or really popular now one,

209
00:10:42.300 --> 00:10:45.800
 you know in modern web applications.

210
00:10:45.800 --> 00:10:48.900
 So I believe that this is clear for

211
00:10:48.900 --> 00:10:51.300
 you. I believe that you like it we are done with

212
00:10:51.300 --> 00:10:54.100
 this case. So let me right now jump to the next

213
00:10:54.100 --> 00:10:54.400
 video.
