WEBVTT - This file was automatically generated by VIMEO

0
00:00:03.600 --> 00:00:06.200
Hello everyone and welcome to this lesson.

1
00:00:07.100 --> 00:00:10.500
As we are seeing file based templates and

2
00:00:10.500 --> 00:00:13.700
 we have seen how macher Works in this

3
00:00:13.700 --> 00:00:16.700
 lesson. We are going to see how extractor works.

4
00:00:17.500 --> 00:00:20.200
This is basically that you want to match a specific

5
00:00:20.200 --> 00:00:22.800
 word and extract it as well.

6
00:00:23.600 --> 00:00:26.800
For example, if you are matching API key,

7
00:00:26.800 --> 00:00:29.400
 I want to extract the API key

8
00:00:29.400 --> 00:00:32.800
 from the file as well. Not only the word API key.

9
00:00:33.500 --> 00:00:37.800
This can be super useful to identify secret

10
00:00:36.800 --> 00:00:40.000
 or hidden sensitive

11
00:00:39.600 --> 00:00:42.500
 information that have been hard coded

12
00:00:42.500 --> 00:00:44.000
 generally into source code.

13
00:00:45.400 --> 00:00:48.800
So extractors are the keywords that extract some

14
00:00:48.800 --> 00:00:50.800
 content from the provided files.

15
00:00:52.500 --> 00:00:55.600
There are two types of extractors. The first one is the word and

16
00:00:55.600 --> 00:00:57.300
 the second one is Rejects.

17
00:00:57.900 --> 00:01:00.400
Both extractors extract from the

18
00:01:00.400 --> 00:01:03.200
 entire request and response that we are going to send.

19
00:01:04.700 --> 00:01:07.400
So it is the Practical time and let's jump on

20
00:01:07.400 --> 00:01:08.100
 the practical.

21
00:01:10.500 --> 00:01:14.700
Here you can see I have written a file extracted.yml

22
00:01:13.700 --> 00:01:15.000
 template.

23
00:01:15.900 --> 00:01:18.400
As you can see over here the ID block

24
00:01:18.400 --> 00:01:20.500
 and the information block Remains the Same.

25
00:01:22.400 --> 00:01:25.400
Here in the file block we can see I'm matching

26
00:01:25.400 --> 00:01:27.500
 for the extensions which are only txt.

27
00:01:28.300 --> 00:01:31.600
The Mac size is 1024 and here

28
00:01:31.600 --> 00:01:34.300
 instead of matcher. We have specified as

29
00:01:34.300 --> 00:01:37.700
 extractors. We are extracting a Rejects and

30
00:01:37.700 --> 00:01:40.300
 this is the specified rejects that we have supplied.

31
00:01:42.100 --> 00:01:45.400
If you are not familiar with how rejects works, you can

32
00:01:45.400 --> 00:01:49.700
 simply go to this website, which is rejects 101.com and

33
00:01:48.700 --> 00:01:51.100
 you can paste your reach X over here.

34
00:01:52.700 --> 00:01:53.600
Here we can see.

35
00:01:54.600 --> 00:01:57.200
this matches the character a

36
00:01:58.300 --> 00:02:01.500
here A to Z means it matches a

37
00:02:01.500 --> 00:02:04.300
 single character in the range between a to z.

38
00:02:05.300 --> 00:02:08.700
And 4 is a quantifier which matches the

39
00:02:08.700 --> 00:02:11.400
 previous token value exactly four times.

40
00:02:13.900 --> 00:02:16.400
Let's run this and see what is

41
00:02:16.400 --> 00:02:18.400
 the output that we will receive.

42
00:02:19.800 --> 00:02:22.600
So I'm going to go to my terminal and quickly.

43
00:02:22.600 --> 00:02:25.400
 I'm going to change the template that we

44
00:02:25.400 --> 00:02:26.000
 want to run.

45
00:02:32.500 --> 00:02:35.600
We have written a file extracted template and we

46
00:02:35.600 --> 00:02:38.400
 are going to supply it to nuclei and our Target

47
00:02:38.400 --> 00:02:41.400
 is going to be the folder which is files.

48
00:02:42.400 --> 00:02:44.300
Let's hit enter and let's wait.

49
00:02:45.700 --> 00:02:49.300
You can see over here. We are able to successfully extract

50
00:02:48.300 --> 00:02:51.700
 the word as well, which is Apple.

51
00:02:52.900 --> 00:02:55.700
Similarly, you would be able to extract more

52
00:02:55.700 --> 00:02:58.600
 sensitive information that you want from the

53
00:02:58.600 --> 00:02:59.600
 files as well.

54
00:03:03.200 --> 00:03:06.300
For demonstration, let us take an example of this.

55
00:03:09.100 --> 00:03:12.700
I'm going to download this GitHub repository which is known as

56
00:03:12.700 --> 00:03:16.200
 GitHub leak which contains a secret.js

57
00:03:15.200 --> 00:03:18.200
 file and which also contains the

58
00:03:18.200 --> 00:03:21.800
 secret dot yml file which contains some information over

59
00:03:21.800 --> 00:03:23.900
 here that might be useful for me.

60
00:03:25.100 --> 00:03:27.800
So I'm going to quickly get clone this into this path.

61
00:03:31.100 --> 00:03:35.000
And let us run the file extracted template once

62
00:03:34.100 --> 00:03:38.600
 again, but this time on GitHub leak

63
00:03:37.600 --> 00:03:39.400
 folder.

64
00:03:41.300 --> 00:03:45.000
Before we start running this we will make a small change because

65
00:03:44.200 --> 00:03:47.100
 we are only matching extensions of

66
00:03:47.100 --> 00:03:50.100
 txt. Let's change that to all.

67
00:03:50.900 --> 00:03:52.100
Let's run this once more.

68
00:03:55.700 --> 00:03:58.500
And you can see once we run it we are

69
00:03:58.500 --> 00:04:02.600
 able to identify these places as

70
00:04:01.600 --> 00:04:04.200
 matched in the

71
00:04:04.200 --> 00:04:07.600
 GitHub League folder inside these files

72
00:04:07.600 --> 00:04:09.400
 as can be seen from here.

73
00:04:11.500 --> 00:04:11.800
Thank you.
