WEBVTT - This file was automatically generated by VIMEO

0
00:00:04.700 --> 00:00:07.500
Hello, everyone, as we

1
00:00:07.500 --> 00:00:10.200
 are discussing about race conditions. Let's see

2
00:00:10.200 --> 00:00:13.000
 a hacker one report for this vulnerability.

3
00:00:14.200 --> 00:00:17.300
As you can see over here race condition allows to

4
00:00:17.300 --> 00:00:20.400
 redeem multiple times gift card, which can lead to free

5
00:00:20.400 --> 00:00:20.600
 money.

6
00:00:21.500 --> 00:00:22.200
interesting

7
00:00:22.900 --> 00:00:25.500
so you can see the security researcher was

8
00:00:25.500 --> 00:00:28.600
 able to identify a race condition on this

9
00:00:28.600 --> 00:00:31.500
 website at an endpoint

10
00:00:31.500 --> 00:00:32.500
 which is redeem.

11
00:00:33.500 --> 00:00:36.700
This is the raw request that can be seen which is

12
00:00:36.700 --> 00:00:39.200
 a post request sent to a

13
00:00:39.200 --> 00:00:42.300
 endpoint which is f i redeem in the body.

14
00:00:42.300 --> 00:00:45.600
 You can see there is a token which

15
00:00:45.600 --> 00:00:46.800
 says gift card.

16
00:00:47.800 --> 00:00:50.700
Once he was able to send this request multiple times

17
00:00:50.700 --> 00:00:53.600
 using turbo Intruder. He was

18
00:00:53.600 --> 00:00:57.000
 able to see a 200. Okay multiple responses

19
00:00:56.400 --> 00:00:58.400
 as can be seen over here.

20
00:00:59.200 --> 00:01:02.800
If we count this, this is equals to 1 2 3

21
00:01:02.800 --> 00:01:05.900
 4 5 6 7 so

22
00:01:05.900 --> 00:01:09.600
 he was able to successfully get or

23
00:01:08.600 --> 00:01:12.100
 redeem his gift card

24
00:01:11.100 --> 00:01:13.500
 seven times.

25
00:01:14.200 --> 00:01:17.500
As you can see over here, he used one

26
00:01:17.500 --> 00:01:21.000
 coupon, but he was able to redeem it multiple

27
00:01:20.200 --> 00:01:23.300
 times and this indeed is known as

28
00:01:23.300 --> 00:01:26.500
 race condition as you can see. He was rewarded with

29
00:01:26.500 --> 00:01:29.500
 a handsome amount of bounty for this issue.

30
00:01:31.100 --> 00:01:35.200
So let us try to replicate the same issue again or

31
00:01:34.200 --> 00:01:37.300
 let us at least understand how you can

32
00:01:37.300 --> 00:01:40.600
 write your own custom nuclei template for

33
00:01:40.600 --> 00:01:41.500
 issue like this.

34
00:01:42.700 --> 00:01:45.500
So let's first quickly understand the

35
00:01:45.500 --> 00:01:49.000
 raw request. So this is a post method

36
00:01:48.400 --> 00:01:51.500
 to this endpoint with this body.

37
00:01:51.500 --> 00:01:54.700
 So I'm going to copy this and go to

38
00:01:54.700 --> 00:01:55.300
 our

39
00:01:57.600 --> 00:01:57.900
Sublime Text

40
00:01:58.800 --> 00:02:01.700
I have created a block which is ID race

41
00:02:01.700 --> 00:02:04.900
 condition info and in request as

42
00:02:04.900 --> 00:02:07.300
 we are using a raw request. I have used Raw.

43
00:02:08.700 --> 00:02:11.400
And I have added the request over here.

44
00:02:12.100 --> 00:02:15.900
Here just for testing. I'm adding the token

45
00:02:15.900 --> 00:02:19.500
 value as test coupon 10 and we

46
00:02:18.500 --> 00:02:21.500
 are keeping the race counters 10.

47
00:02:22.100 --> 00:02:25.400
Let us just try to see and match how many 200 OK

48
00:02:25.400 --> 00:02:28.200
 requests we get when we try to redeem this

49
00:02:28.200 --> 00:02:31.800
 now keep in mind as we have not created an

50
00:02:31.800 --> 00:02:34.800
 account on this website. We do not supply a

51
00:02:34.800 --> 00:02:37.400
 csrf token the request might not

52
00:02:37.400 --> 00:02:40.600
 go through but still you would learn how

53
00:02:40.600 --> 00:02:43.400
 you can write a quick template for testing the

54
00:02:43.400 --> 00:02:43.900
 same issue.

55
00:02:45.100 --> 00:02:48.500
Let's go to the browser. This is the endpoint which

56
00:02:48.500 --> 00:02:51.200
 still works as you can see where you can redeem your

57
00:02:51.200 --> 00:02:54.300
 River gift card. Let's run this quickly

58
00:02:54.300 --> 00:02:57.300
 on our terminal and let's see the output. So I'm

59
00:02:57.300 --> 00:03:01.400
 going to save this template and I'm going to say nuclei -

60
00:03:01.400 --> 00:03:04.400
 Q let's provide the target. So the

61
00:03:04.400 --> 00:03:07.700
 Target that we are going to supply is this

62
00:03:10.200 --> 00:03:12.200
we need to supply the protocol.

63
00:03:14.800 --> 00:03:17.900
Let us apply the template that we have created right

64
00:03:17.900 --> 00:03:18.300
 now.

65
00:03:21.500 --> 00:03:25.000
So the template that we have created is race demo.yml

66
00:03:24.300 --> 00:03:26.400
 and let's hit enter.

67
00:03:28.500 --> 00:03:32.300
You can see all those requests would go simultaneously

68
00:03:31.300 --> 00:03:34.000
 altogether. We can see

69
00:03:34.300 --> 00:03:37.700
 all the requests were sent together. And for none of the request. We

70
00:03:37.700 --> 00:03:40.500
 got a 200. Okay, and that's okay because

71
00:03:40.500 --> 00:03:43.200
 we did not create an account and not supply

72
00:03:43.200 --> 00:03:45.600
 a valid csrf token, but that's fine.

73
00:03:46.500 --> 00:03:49.200
But you got an idea of how you can also

74
00:03:49.200 --> 00:03:53.300
 write your own custom race condition template using

75
00:03:52.300 --> 00:03:54.900
 this technique. Thank you.
