WEBVTT - This file was automatically generated by VIMEO

0
00:00:04.700 --> 00:00:07.500
Alright, so hello everyone. So in the previous lesson

1
00:00:07.500 --> 00:00:11.200
 we have seen how we were able to run a nuclei

2
00:00:10.200 --> 00:00:13.600
 version detect template on to our

3
00:00:13.600 --> 00:00:16.700
 Target which helped us identify the

4
00:00:16.700 --> 00:00:20.000
 specific nginx version for the specific

5
00:00:19.600 --> 00:00:21.400
 URL that we supplied.

6
00:00:22.900 --> 00:00:25.600
Now, let's see the template of

7
00:00:25.600 --> 00:00:26.400
 how it works.

8
00:00:27.500 --> 00:00:30.300
We are going to see in depth about how you can

9
00:00:30.300 --> 00:00:33.400
 write your own template as well based on

10
00:00:33.400 --> 00:00:34.200
 different blocks.

11
00:00:34.900 --> 00:00:36.300
But let us get in.

12
00:00:36.800 --> 00:00:39.700
Quick overview about this template so you

13
00:00:39.700 --> 00:00:42.200
 can see over here. The template has an ID

14
00:00:42.200 --> 00:00:45.400
 block, which is nginx version has a info block

15
00:00:45.400 --> 00:00:46.300
 which you can see.

16
00:00:47.500 --> 00:00:50.600
Has these details like name author severity description and

17
00:00:50.600 --> 00:00:53.900
 tags has a request block with specifies

18
00:00:53.900 --> 00:00:57.000
 the method of the HTTP request

19
00:00:56.100 --> 00:00:59.800
 that is going to be sent. It could be get post

20
00:00:59.500 --> 00:01:02.300
 Etc the base URL that

21
00:01:02.300 --> 00:01:05.300
 is going to be supplied. Remember the base URL is

22
00:01:05.300 --> 00:01:08.300
 the URL of your target that you supply on

23
00:01:08.300 --> 00:01:10.500
 the command line to nuclei.

24
00:01:11.200 --> 00:01:14.200
The matches condition is and which means there are going

25
00:01:14.200 --> 00:01:17.500
 to be two conditions for nuclei to

26
00:01:17.500 --> 00:01:18.700
 be matching.

27
00:01:20.100 --> 00:01:23.200
The matches condition is and that means there were two conditions.

28
00:01:24.200 --> 00:01:26.800
That should match successfully to give you an output.

29
00:01:27.700 --> 00:01:30.200
The matches block says they should be a type

30
00:01:30.200 --> 00:01:33.500
 rejects, which means we want to extract something from the header.

31
00:01:33.500 --> 00:01:37.300
 The rejects is nginx slash 0 to

32
00:01:36.300 --> 00:01:38.000
 9 Dot

33
00:01:39.200 --> 00:01:42.500
Then we are going to match something in the status, which is the status code, which

34
00:01:42.500 --> 00:01:46.100
 should be 200. Okay, and finally the extractors.

35
00:01:46.600 --> 00:01:49.600
Due to extractors we were able to extract that information

36
00:01:49.600 --> 00:01:52.400
 which we have matched previously and show

37
00:01:52.400 --> 00:01:55.300
 it as output on our terminal and we

38
00:01:55.300 --> 00:01:59.100
 can see we are extracting the nginx version

39
00:01:58.100 --> 00:02:01.500
 based on the rejects from the header.

40
00:02:02.100 --> 00:02:05.800
Let's go back over here and we can see we are able to extract the

41
00:02:05.800 --> 00:02:08.600
 engine X version from the header.

42
00:02:09.800 --> 00:02:13.400
Let us now. Also extract the

43
00:02:13.400 --> 00:02:16.100
 PHP version as we can see over here.

44
00:02:17.600 --> 00:02:20.600
So let us quickly write a quick template to see

45
00:02:20.600 --> 00:02:23.300
 if we can also write a valid template

46
00:02:23.300 --> 00:02:24.500
 to extract this information.

47
00:02:25.700 --> 00:02:28.400
So I'm going to go back over here and I'm going to copy

48
00:02:28.400 --> 00:02:31.100
 this template as a base template right now.

49
00:02:32.500 --> 00:02:35.500
So I'm going to copy the raw version of this template and

50
00:02:35.500 --> 00:02:38.400
 I'm going to paste it into any editor that

51
00:02:38.400 --> 00:02:40.800
 you have. I'm going to use Sublime.

52
00:02:49.100 --> 00:02:50.100
I'm going to paste it over here.

53
00:02:50.800 --> 00:02:52.400
Let us save this with the name.

54
00:02:54.200 --> 00:02:58.400
Let's give a name as PHP detect Dot yaml.

55
00:03:00.600 --> 00:03:03.600
Now let us modify that this time

56
00:03:03.600 --> 00:03:06.500
 we don't want to match nginx, but we are interested

57
00:03:06.500 --> 00:03:09.700
 in identifying the PHP version. So let's change

58
00:03:09.700 --> 00:03:10.400
 this to PHP.

59
00:03:11.800 --> 00:03:14.700
We also want to extract the PHP version

60
00:03:14.700 --> 00:03:15.200
 from there.

61
00:03:17.200 --> 00:03:20.400
Also, let's modify the template name, let's call

62
00:03:20.400 --> 00:03:23.100
 it as PHP version detect this time

63
00:03:24.700 --> 00:03:27.600
Let's modify this as well and let's keep everything

64
00:03:27.600 --> 00:03:29.400
 else as it is.

65
00:03:31.200 --> 00:03:33.000
And I think it's good to go.

66
00:03:34.600 --> 00:03:37.600
Now keep in mind whenever you create templates or

67
00:03:37.600 --> 00:03:40.000
 modify existing templates.

68
00:03:40.600 --> 00:03:43.800
You might create mistakes in the template. So

69
00:03:43.800 --> 00:03:46.200
 this is one of the very good

70
00:03:46.200 --> 00:03:49.800
 resource that you can go and check if your

71
00:03:49.800 --> 00:03:52.300
 template contains any error or no.

72
00:03:53.100 --> 00:03:56.300
I'm going to hit go and check if you see a green message

73
00:03:56.300 --> 00:03:59.400
 like this, which says valid. Yml. That means

74
00:03:59.400 --> 00:04:01.300
 your template is correct to be used.

75
00:04:03.200 --> 00:04:06.400
Do not worry. We are going to understand more about template Creation in

76
00:04:06.400 --> 00:04:08.300
 depth in the future sessions.

77
00:04:09.300 --> 00:04:12.200
I'm going to copy this template right now. I'm going to go to

78
00:04:12.200 --> 00:04:16.200
 my terminal and I'm going to create a file called as PHP

79
00:04:15.200 --> 00:04:18.200
 hyphen detect Dot. Yml.

80
00:04:19.500 --> 00:04:22.400
There's already a template so I'm going to delete everything from here quickly.

81
00:04:24.800 --> 00:04:27.500
And paste what we have created just now

82
00:04:27.500 --> 00:04:30.500
 now I'm going to run this template

83
00:04:30.500 --> 00:04:32.400
 on my Target and hit enter.

84
00:04:34.200 --> 00:04:37.200
We are expecting this template to run correctly and extract out

85
00:04:37.200 --> 00:04:38.500
 the PHP version for us.

86
00:04:39.600 --> 00:04:42.300
And you can see that template has successfully ranked correctly

87
00:04:42.300 --> 00:04:46.100
 the first reach access matched correctly PHP

88
00:04:45.100 --> 00:04:48.800
 version 5.6.40. Let's

89
00:04:48.800 --> 00:04:51.100
 verify if this information is correct.

90
00:04:51.900 --> 00:04:55.300
And you can see PHP version 5.6.40 is

91
00:04:54.300 --> 00:04:57.300
 absolutely correct, which means the

92
00:04:57.300 --> 00:05:00.700
 first template that we created as a baseline to

93
00:05:00.700 --> 00:05:03.000
 identify the PHP version was correct.

94
00:05:04.200 --> 00:05:07.400
The second match a condition was the status code which has matched

95
00:05:07.400 --> 00:05:08.400
 correctly as well.

96
00:05:09.500 --> 00:05:11.300
Let us crawl up and see this.

97
00:05:11.900 --> 00:05:14.500
You can see it has been highlighted in green color

98
00:05:14.500 --> 00:05:17.100
 what we are currently trying to match.

99
00:05:18.500 --> 00:05:21.600
This was the HTTP request that was sent similarly.

100
00:05:21.600 --> 00:05:24.700
 This was the HTTP response that we received and

101
00:05:24.700 --> 00:05:27.600
 correctly matched the matcher condition

102
00:05:27.600 --> 00:05:29.300
 that we gave in our template.

103
00:05:31.200 --> 00:05:34.400
I hope you guys understood this that how you can quickly write your first

104
00:05:34.400 --> 00:05:38.000
 template validate the template from ymlint and

105
00:05:37.100 --> 00:05:39.500
 then run it onto your target.

106
00:05:40.700 --> 00:05:43.300
It is so useful and super simple

107
00:05:43.300 --> 00:05:46.300
 to write your templates like this. Also, you can

108
00:05:46.300 --> 00:05:49.800
 add complex templates as well that

109
00:05:49.800 --> 00:05:53.000
 can help you automate most of your Works while

110
00:05:52.200 --> 00:05:55.200
 you are doing research on your bug Bounty programs.

111
00:05:56.300 --> 00:05:56.400
Thank you.
