WEBVTT - This file was automatically generated by VIMEO

0
00:00:13.400 --> 00:00:14.000
Hello, everyone.

1
00:00:14.800 --> 00:00:19.100
So in this lesson, we are going to understand about nuclei

2
00:00:17.100 --> 00:00:20.300
 file based templates.

3
00:00:21.200 --> 00:00:24.200
We have seen so far that with the help of nuclei. We

4
00:00:24.200 --> 00:00:27.100
 are able to create templates and send it for

5
00:00:27.100 --> 00:00:29.400
 HTTP request and responses.

6
00:00:30.200 --> 00:00:33.500
But with the help of nuclei we can not only send

7
00:00:33.500 --> 00:00:36.200
 HTTP request, but we can search for

8
00:00:36.200 --> 00:00:37.600
 files as well.

9
00:00:38.900 --> 00:00:41.300
This is really amazing. When you have

10
00:00:41.300 --> 00:00:44.400
 a bunch of code a bunch of files and you

11
00:00:44.400 --> 00:00:48.300
 want to search and match or extract specific

12
00:00:47.300 --> 00:00:48.700
 words.

13
00:00:50.200 --> 00:00:53.300
So all nuclei templates using the file block starts from

14
00:00:53.300 --> 00:00:54.800
 file colon.

15
00:00:56.700 --> 00:01:00.000
Nuclei file template extensions are also

16
00:00:59.400 --> 00:01:02.800
 there which means you can match specific

17
00:01:02.800 --> 00:01:05.300
 extensions with the particular file as well.

18
00:01:06.400 --> 00:01:10.000
If you want to match for all you can specify hyphen all

19
00:01:09.200 --> 00:01:12.700
 which will match all extensions or else

20
00:01:12.700 --> 00:01:16.400
 you can specify extension schooling by go

21
00:01:15.400 --> 00:01:18.400
 txt Etc.

22
00:01:21.200 --> 00:01:24.200
Matches are the keywords that match a particular

23
00:01:24.200 --> 00:01:26.800
 content inside any file.

24
00:01:27.600 --> 00:01:30.900
So there are two types of matches in file-based templates.

25
00:01:30.900 --> 00:01:33.200
 The first one is the word and the second

26
00:01:33.200 --> 00:01:34.500
 one is a Rejects.

27
00:01:35.400 --> 00:01:38.400
both matcha types match in the entire request and

28
00:01:38.400 --> 00:01:39.000
 response

29
00:01:40.100 --> 00:01:43.400
word matches the exact same word in

30
00:01:43.400 --> 00:01:47.200
 the whole file in the whole word. Whereas rejax

31
00:01:46.200 --> 00:01:49.400
 matches for a reach X word into that

32
00:01:49.400 --> 00:01:49.800
 file.

33
00:01:52.100 --> 00:01:55.400
There are some other options that you can use while you're

34
00:01:55.400 --> 00:01:58.800
 running a file based template, which is Max size,

35
00:01:58.800 --> 00:02:01.100
 which allows to provide a limit of

36
00:02:01.100 --> 00:02:04.700
 the size file that nuclei can read if I

37
00:02:04.700 --> 00:02:08.000
 don't want to read a file which is greater than 5 MB

38
00:02:07.400 --> 00:02:09.800
 you can specify that as well.

39
00:02:11.600 --> 00:02:14.300
No, recursive disables recursively enumeration of

40
00:02:14.300 --> 00:02:17.600
 files and folders inside multiple directories.

41
00:02:19.200 --> 00:02:22.500
So it is the Practical time and let's see how you can use this.

42
00:02:25.400 --> 00:02:28.600
So currently I am onto my terminal and

43
00:02:28.600 --> 00:02:31.700
 I have created some files inside the

44
00:02:31.700 --> 00:02:33.100
 files folder

45
00:02:34.500 --> 00:02:37.700
It's cool with there and let's see some files. You can

46
00:02:37.700 --> 00:02:40.600
 see file 1 File 2 file 3 4 and

47
00:02:40.600 --> 00:02:40.800
 5.

48
00:02:42.300 --> 00:02:42.800
alright

49
00:02:43.500 --> 00:02:46.300
So now we are going to write our first

50
00:02:46.300 --> 00:02:48.300
 file based template.

51
00:02:49.100 --> 00:02:52.600
Let's give it a name as file underscore txt.yml.

52
00:02:53.500 --> 00:02:56.800
The ID block b simple filematcher. This

53
00:02:56.800 --> 00:02:58.100
 is the information block.

54
00:02:59.200 --> 00:02:59.600
and now

55
00:03:00.700 --> 00:03:03.800
this would not contain request block

56
00:03:03.800 --> 00:03:07.000
 instead would contain a file block. So

57
00:03:06.500 --> 00:03:09.400
 file colon. We only want

58
00:03:09.400 --> 00:03:13.900
 to match extensions of file that have txt. You

59
00:03:12.900 --> 00:03:15.500
 can replace this

60
00:03:15.500 --> 00:03:18.300
 with all as well. If you want to match all the

61
00:03:18.300 --> 00:03:22.000
 files currently. Let's stick to txt only.

62
00:03:22.700 --> 00:03:26.100
I'm also specifying the max size as 1024 only.

63
00:03:26.900 --> 00:03:29.500
In the matches. I'm also specifying the

64
00:03:29.500 --> 00:03:32.300
 word type that I want to match which is Apple.

65
00:03:34.900 --> 00:03:37.700
So this would find the word Apple in

66
00:03:37.700 --> 00:03:39.700
 the files as a whole word.

67
00:03:40.900 --> 00:03:41.800
So let's run this.

68
00:03:42.700 --> 00:03:45.300
So I'm going to specify nuclei and the

69
00:03:45.300 --> 00:03:48.600
 template that we have written. So the template

70
00:03:48.600 --> 00:03:49.000
 name is

71
00:03:50.500 --> 00:03:53.900
File underscore txt dot yml, let's specify

72
00:03:53.900 --> 00:03:56.400
 the target as well, which is our

73
00:03:56.400 --> 00:03:59.300
 files folder and let's hit enter.

74
00:04:02.100 --> 00:04:05.600
Once we do that you can see we are successfully able

75
00:04:05.600 --> 00:04:06.100
 to find

76
00:04:07.100 --> 00:04:10.900
Apple matches into file 1 and file

77
00:04:10.900 --> 00:04:12.800
 3 let us also

78
00:04:13.700 --> 00:04:16.300
run this in verbose more. So let's

79
00:04:16.300 --> 00:04:19.300
 run it in verbose mode first and you

80
00:04:19.300 --> 00:04:22.500
 can see it's successfully mashed in file one and file 3.

81
00:04:22.500 --> 00:04:25.300
 Let's run this in debug mode only.

82
00:04:29.100 --> 00:04:32.100
And you can see this is the response that we have got.

83
00:04:34.200 --> 00:04:37.800
Here we can identify that it matched Apple in

84
00:04:37.800 --> 00:04:40.100
 file 3 at line number 5.

85
00:04:41.000 --> 00:04:41.500
excellent

86
00:04:42.300 --> 00:04:45.800
Here we can see file 1 at line. Number one apple

87
00:04:45.800 --> 00:04:47.500
 was matched successfully.

88
00:04:48.200 --> 00:04:52.000
This can be super useful if you want to identify hard-coded

89
00:04:51.600 --> 00:04:54.800
 usernames passwords API Keys

90
00:04:54.800 --> 00:04:57.600
 tokens Etc in multiple files

91
00:04:57.600 --> 00:04:58.000
 as well.

92
00:04:59.100 --> 00:05:02.700
So I hope you guys understood how you can use file based

93
00:05:02.700 --> 00:05:03.200
 template.

94
00:05:04.300 --> 00:05:07.300
In our upcoming lesson. We are going to see how we

95
00:05:07.300 --> 00:05:11.200
 can not only match for a specific word, but

96
00:05:10.200 --> 00:05:14.000
 extract it as well. Thank

97
00:05:13.000 --> 00:05:14.100
 you.
