WEBVTT - This file was automatically generated by VIMEO

0
00:00:13.800 --> 00:00:16.300
Hi everyone. So in this lesson we are

1
00:00:16.300 --> 00:00:20.100
 going to understand about simple post-based matcher.

2
00:00:20.700 --> 00:00:23.300
So far we have learned about how we

3
00:00:23.300 --> 00:00:27.100
 can send in match get based request. But

4
00:00:26.100 --> 00:00:29.700
 now we are going to understand and learn

5
00:00:29.700 --> 00:00:32.400
 about post-based requests and

6
00:00:32.400 --> 00:00:33.600
 how to match them.

7
00:00:34.500 --> 00:00:38.300
So this specific lesson focuses on post-based

8
00:00:37.300 --> 00:00:39.900
 matcher in the body.

9
00:00:40.900 --> 00:00:43.500
So you can see on the screen currently. There is

10
00:00:43.500 --> 00:00:46.900
 a sample template in which we can see that the

11
00:00:46.900 --> 00:00:50.000
 method that has been used is post and

12
00:00:49.200 --> 00:00:52.600
 we are matching a condition Apple in the

13
00:00:52.600 --> 00:00:55.200
 matches condition block, which has been

14
00:00:55.200 --> 00:00:56.400
 supplied in the body.

15
00:00:57.800 --> 00:01:00.200
So it is the Practical time and let us see

16
00:01:00.200 --> 00:01:01.900
 how we can do this practically.

17
00:01:03.100 --> 00:01:07.800
So I have already written a simple post body.yml template

18
00:01:07.800 --> 00:01:09.200
 as you can see over here.

19
00:01:10.200 --> 00:01:13.200
So let's understand this template quickly. The first

20
00:01:13.200 --> 00:01:16.300
 is the ID block. The second is the info block

21
00:01:16.300 --> 00:01:20.000
 which says the name of the template which is simple post-based

22
00:01:19.400 --> 00:01:20.900
 matched in the body.

23
00:01:21.800 --> 00:01:24.500
The most important part comes here now, which is

24
00:01:24.500 --> 00:01:27.300
 the request Block in which we can see we have

25
00:01:27.300 --> 00:01:30.800
 changed the method from get to post

26
00:01:30.800 --> 00:01:33.300
 which means we are going to submit a

27
00:01:33.300 --> 00:01:33.900
 form data.

28
00:01:34.500 --> 00:01:38.000
The path is the base URL / nuclei

29
00:01:37.700 --> 00:01:40.700
 test underscore post dot

30
00:01:40.700 --> 00:01:41.300
 PHP.

31
00:01:42.100 --> 00:01:45.500
You can see we are also supplying a body in which

32
00:01:45.500 --> 00:01:48.700
 we are giving a parameter called as search and

33
00:01:48.700 --> 00:01:51.200
 a value which is apple as we

34
00:01:51.200 --> 00:01:54.500
 can see over here and we have learned already. That body

35
00:01:54.500 --> 00:01:57.400
 is always in the form of a key pair

36
00:01:57.400 --> 00:01:57.800
 value.

37
00:01:58.700 --> 00:02:01.300
We are also supplying some headers over here.

38
00:02:01.300 --> 00:02:04.400
 You can see a Content length header

39
00:02:04.400 --> 00:02:07.800
 content type header and accept header

40
00:02:07.800 --> 00:02:08.500
 over here.

41
00:02:10.200 --> 00:02:13.000
Let's see the matches condition now in the

42
00:02:13.700 --> 00:02:16.500
 matches condition. We have specified that we want to

43
00:02:16.500 --> 00:02:19.900
 match two conditions. The first matcher is

44
00:02:19.900 --> 00:02:22.500
 a word type which is Apple

45
00:02:22.500 --> 00:02:24.100
 and the second one is

46
00:02:25.100 --> 00:02:27.300
This status code which is 200, okay.

47
00:02:28.700 --> 00:02:32.100
Look carefully we are matching the word which

48
00:02:31.100 --> 00:02:34.000
 is Apple in the body.

49
00:02:34.800 --> 00:02:37.700
So let's save this quickly and let's

50
00:02:37.700 --> 00:02:39.700
 run this template on our Target.

51
00:02:41.100 --> 00:02:44.400
Now for testing that this template has been

52
00:02:44.400 --> 00:02:47.400
 created correctly or no, you can always

53
00:02:47.400 --> 00:02:50.200
 go back to ymlint paste your

54
00:02:50.200 --> 00:02:54.400
 template over here and see this green valid yml

55
00:02:53.400 --> 00:02:56.700
 message if you get that message, which

56
00:02:56.700 --> 00:03:00.000
 means your template is correct and valid without

57
00:02:59.300 --> 00:03:00.900
 any errors.

58
00:03:01.700 --> 00:03:03.800
Now we are going to use this template over here.

59
00:03:04.700 --> 00:03:07.800
At this endpoint which is nuclei test

60
00:03:07.800 --> 00:03:10.200
 underscore post.php.

61
00:03:10.900 --> 00:03:13.100
Here we can see that there is a search

62
00:03:13.100 --> 00:03:16.500
 box. So I'm going to search here something. So let's

63
00:03:16.500 --> 00:03:18.200
 say I search for Apple.

64
00:03:19.200 --> 00:03:22.600
When I do that, you can see up reflection that

65
00:03:22.600 --> 00:03:25.800
 we get which gives us a message which means

66
00:03:25.800 --> 00:03:28.600
 you searched the results for Apple.

67
00:03:28.600 --> 00:03:31.500
 Let's capture this request as

68
00:03:31.500 --> 00:03:32.400
 well. So

69
00:03:33.500 --> 00:03:34.700
I'm going to quickly go.

70
00:03:35.600 --> 00:03:37.300
in my burp suit

71
00:03:39.200 --> 00:03:40.100
open the browser.

72
00:03:44.400 --> 00:03:47.100
Let me start The Intercept on let me

73
00:03:47.100 --> 00:03:48.500
 search for Apple again.

74
00:03:49.600 --> 00:03:53.400
And you can see a request was successfully captured.

75
00:03:52.400 --> 00:03:55.700
 This is a post request to

76
00:03:55.700 --> 00:03:58.900
 a specific endpoint that we are currently sending

77
00:03:58.900 --> 00:04:01.500
 a request to and in the body you

78
00:04:01.500 --> 00:04:03.800
 can see search equals to Apple.

79
00:04:04.500 --> 00:04:06.500
Let's in this request to repeater.

80
00:04:08.400 --> 00:04:11.300
Let's see the response for this we can see we got a

81
00:04:11.300 --> 00:04:14.300
 200 response and exactly the same output that

82
00:04:14.300 --> 00:04:17.100
 we saw on our browser which gives us

83
00:04:17.100 --> 00:04:20.400
 the result saying your searched results

84
00:04:20.400 --> 00:04:21.600
 for Apple.

85
00:04:23.500 --> 00:04:26.900
Nice, let us change this to Batman and

86
00:04:26.900 --> 00:04:29.000
 let's hit send and you can

87
00:04:29.100 --> 00:04:32.300
 see we get the output as we have

88
00:04:32.300 --> 00:04:33.900
 searched for Batman.

89
00:04:35.400 --> 00:04:38.800
Alright, so let us test our template now,

90
00:04:38.800 --> 00:04:40.800
 so let's go to http history.

91
00:04:44.200 --> 00:04:47.900
And let's run our template that we have written. Let's

92
00:04:47.900 --> 00:04:49.000
 save this template.

93
00:04:49.600 --> 00:04:52.900
The name of the template is simple underscore get

94
00:04:52.900 --> 00:04:54.200
 Dot. Yml.

95
00:04:55.300 --> 00:04:56.300
Let's go to the terminal.

96
00:04:59.900 --> 00:05:03.400
The template name is simple post body Dot.

97
00:05:02.400 --> 00:05:03.900
 Yml.

98
00:05:04.600 --> 00:05:04.900
so

99
00:05:06.400 --> 00:05:09.200
we're going to specify the same name and hit enter.

100
00:05:11.600 --> 00:05:14.900
Let's wait for this to run and you can see we were

101
00:05:14.900 --> 00:05:17.900
 successfully able to find based on

102
00:05:17.900 --> 00:05:20.900
 the matches condition that we have specified in

103
00:05:20.900 --> 00:05:22.300
 our template.

104
00:05:23.200 --> 00:05:25.800
Let us also debug this and hit enter.

105
00:05:27.600 --> 00:05:31.000
Here you can see this is the output of debug in

106
00:05:30.200 --> 00:05:34.000
 which we can see the protocol response variables.

107
00:05:33.800 --> 00:05:36.600
 You can see the curl command the Matched

108
00:05:36.600 --> 00:05:39.300
 condition the host name

109
00:05:39.300 --> 00:05:42.600
 for which the request was sent the header

110
00:05:42.600 --> 00:05:46.400
 date body server fully

111
00:05:45.400 --> 00:05:49.100
 qualified domain name scheme HTTP

112
00:05:48.100 --> 00:05:52.000
 used top level domain Arc Port

113
00:05:51.500 --> 00:05:54.900
 80 status code 200 exetera.

114
00:05:54.900 --> 00:05:57.100
 So this is additional information that you

115
00:05:57.100 --> 00:06:01.200
 can see that has been sent in the background which can

116
00:06:00.200 --> 00:06:03.600
 be seen with the help of hyphen Deepak

117
00:06:03.600 --> 00:06:03.900
 flag.

118
00:06:05.400 --> 00:06:08.200
Let's scroll down and see you can see this is

119
00:06:08.200 --> 00:06:12.200
 the HTTP response and in the response, it

120
00:06:11.200 --> 00:06:14.500
 has successfully matched Apple in the

121
00:06:14.500 --> 00:06:15.100
 body.

122
00:06:16.200 --> 00:06:19.700
Let's go back to Pursuit and let's see the request

123
00:06:19.700 --> 00:06:20.800
 here as well.

124
00:06:21.800 --> 00:06:24.600
We can see the new request over here that

125
00:06:24.600 --> 00:06:26.400
 was sent via nuclei.

126
00:06:27.900 --> 00:06:29.200
Which was a post request.

127
00:06:30.500 --> 00:06:33.200
Which had search equals to Apple in the

128
00:06:33.200 --> 00:06:34.200
 template itself.

129
00:06:35.200 --> 00:06:38.700
And we can see it successfully matched Apple over

130
00:06:38.700 --> 00:06:39.700
 here as well.

131
00:06:40.600 --> 00:06:43.700
So I hope you guys understood that how you

132
00:06:43.700 --> 00:06:45.900
 can write quickly your first.

133
00:06:46.900 --> 00:06:50.300
Post-based matcher body template.

134
00:06:49.300 --> 00:06:51.000
 Thank you.
