WEBVTT - This file was automatically generated by VIMEO

0
00:00:13.600 --> 00:00:14.200
Hello, everyone.

1
00:00:15.800 --> 00:00:18.500
So in this video we are going to see an

2
00:00:18.500 --> 00:00:21.800
 amazing software, which is n diff.

3
00:00:22.700 --> 00:00:25.500
This particular tool is used for seeing the

4
00:00:25.500 --> 00:00:28.400
 difference in nmaps output.

5
00:00:29.500 --> 00:00:32.500
One of the amazing tool that I constantly use

6
00:00:32.500 --> 00:00:33.800
 for my Recon process.

7
00:00:34.600 --> 00:00:35.200
wherein

8
00:00:35.700 --> 00:00:38.400
let's say I have scanned a particular Target and I

9
00:00:38.400 --> 00:00:41.200
 have enumerated all the ports as well as

10
00:00:41.200 --> 00:00:44.000
 the services which are running one month ago.

11
00:00:44.900 --> 00:00:47.300
Let's say today. There is a exploit which

12
00:00:47.300 --> 00:00:50.700
 has come for that particular version of

13
00:00:50.700 --> 00:00:53.300
 software, which is running on that particular Target.

14
00:00:54.800 --> 00:00:57.700
I again scan that particular Target and I

15
00:00:57.700 --> 00:01:00.100
 do the comparison between both.

16
00:01:01.400 --> 00:01:04.900
The output that I've saved into my computer and

17
00:01:04.900 --> 00:01:07.500
 I come to know okay, so they have opened some

18
00:01:07.500 --> 00:01:10.800
 New Ports or they have closed some old ports. Also

19
00:01:10.800 --> 00:01:13.500
 they have opened some vulnerable New Ports

20
00:01:13.500 --> 00:01:16.200
 and they have installed some applications or they have

21
00:01:16.200 --> 00:01:19.200
 upgraded or degraded like that so I can

22
00:01:19.200 --> 00:01:20.800
 constantly keep a watch.

23
00:01:22.800 --> 00:01:23.800
and monitor

24
00:01:24.600 --> 00:01:25.300
the ports

25
00:01:26.100 --> 00:01:26.800
the services

26
00:01:27.800 --> 00:01:30.400
and if there are any new changes on to

27
00:01:30.400 --> 00:01:32.000
 that particular Target server.

28
00:01:33.200 --> 00:01:35.200
So, let's see quickly. How can we achieve that?

29
00:01:36.800 --> 00:01:39.300
So what I have done is on my computer. I have opened

30
00:01:39.300 --> 00:01:42.200
 up a port which is Port 80. And also I have

31
00:01:42.200 --> 00:01:45.600
 put open a port which is Port 1337.

32
00:01:46.800 --> 00:01:49.100
So let us quickly scan.

33
00:01:50.400 --> 00:01:51.800
our Local Host machine

34
00:01:52.800 --> 00:01:55.200
So I'm making a folder and I'm going

35
00:01:55.200 --> 00:01:57.900
 to run all my scans from this folder, which is n diff.

36
00:01:58.800 --> 00:02:01.400
Okay, so I'm going to scan my local

37
00:02:01.400 --> 00:02:02.800
 machine using.

38
00:02:03.800 --> 00:02:06.300
Hyphen, f which is fast scan.

39
00:02:07.500 --> 00:02:08.800
hyphen SV to see the output in

40
00:02:10.300 --> 00:02:13.100
Version detection mode hyphen V to see the output

41
00:02:13.100 --> 00:02:16.700
 inverse mode and let me save the output in XML

42
00:02:16.700 --> 00:02:18.800
 format. Let's say the file name is XML.

43
00:02:19.400 --> 00:02:22.800
Output 1.xml. Okay, let's wait

44
00:02:22.800 --> 00:02:24.000
 for this can to complete.

45
00:02:24.700 --> 00:02:27.600
And then what we are going to do is we are going to stop this

46
00:02:27.600 --> 00:02:28.400
 particular port.

47
00:02:29.600 --> 00:02:33.000
And we are going to scan again. Our localhost machine save

48
00:02:32.200 --> 00:02:35.400
 the output this time as XML output

49
00:02:35.400 --> 00:02:39.200
 2.xml and then do a comparison.

50
00:02:40.400 --> 00:02:43.100
I know that doing the comparison by our Naked Eyes

51
00:02:43.100 --> 00:02:46.300
 is very different as we will not be able to make out the difference.

52
00:02:46.300 --> 00:02:49.900
 That's why we are going to do the comparison

53
00:02:49.900 --> 00:02:51.200
 using n-diff.

54
00:02:52.400 --> 00:02:52.600
so

55
00:02:53.500 --> 00:02:56.800
we have run this command and we have got the output. So let's

56
00:02:56.800 --> 00:02:59.500
 quickly stop this particular Port from running.

57
00:02:59.500 --> 00:03:02.800
 So we are going to stop it as you can see we stopped

58
00:03:02.800 --> 00:03:05.400
 it give a keyboard interrupt and now we

59
00:03:05.400 --> 00:03:05.800
 are going to

60
00:03:06.800 --> 00:03:09.900
scan again, but we are going to save the

61
00:03:09.900 --> 00:03:12.700
 output into a new file, which is

62
00:03:12.700 --> 00:03:15.100
 XML output two dot XML this

63
00:03:15.100 --> 00:03:15.300
 time.

64
00:03:16.500 --> 00:03:19.200
Okay, this the scan is running and the new

65
00:03:19.200 --> 00:03:23.200
 output is being saved into the new file. Once

66
00:03:22.200 --> 00:03:26.100
 the scan has been successfully completed. We

67
00:03:25.100 --> 00:03:28.700
 are going to do comparison of both the

68
00:03:28.700 --> 00:03:31.500
 output of the XML using NF and

69
00:03:31.500 --> 00:03:34.800
 we will understand that is and

70
00:03:34.800 --> 00:03:38.000
 if able to catch the difference between both the XML formats.

71
00:03:39.200 --> 00:03:41.600
So here we go. We have seen the output.

72
00:03:42.600 --> 00:03:45.300
The scan has successfully completed. Let me

73
00:03:45.300 --> 00:03:48.600
 clear the screen and let me start n diff.

74
00:03:48.600 --> 00:03:51.100
 So the syntax of using and diff is very

75
00:03:51.100 --> 00:03:54.300
 very simple. You just have to type end. If you do

76
00:03:54.300 --> 00:03:57.300
 not have to do any installation. It comes free installed with

77
00:03:57.300 --> 00:04:00.600
 nmap whenever you do a installation of nmap. This

78
00:04:00.600 --> 00:04:02.100
 automatically gets installed.

79
00:04:02.800 --> 00:04:05.500
All right. So the first XML file

80
00:04:06.300 --> 00:04:10.200
The first output file which is XML op1.xml and

81
00:04:09.200 --> 00:04:12.800
 the second output XML file.

82
00:04:15.200 --> 00:04:19.200
Then you just have to hit enter and you can see the compad output

83
00:04:18.200 --> 00:04:21.400
 over here as you can see over here.

84
00:04:21.400 --> 00:04:22.900
 The first is

85
00:04:24.100 --> 00:04:27.800
the end map scan which rain on for 356 as

86
00:04:27.800 --> 00:04:30.300
 you can see the time over here and the next is at

87
00:04:30.300 --> 00:04:31.500
 four four seven.

88
00:04:32.600 --> 00:04:33.000
All right.

89
00:04:34.600 --> 00:04:37.300
So this two scans the comparison which we

90
00:04:37.300 --> 00:04:41.200
 are going to look as you can see there is a difference not show

91
00:04:40.200 --> 00:04:43.900
 96 close ports and then 97 close

92
00:04:43.900 --> 00:04:46.700
 ports one close Port increase because

93
00:04:46.700 --> 00:04:49.200
 we deliberately closed one of

94
00:04:49.200 --> 00:04:52.200
 the port that was Port 80 that we started using the

95
00:04:52.200 --> 00:04:53.200
 python server.

96
00:04:54.400 --> 00:04:57.500
As we can see the result over here first Port

97
00:04:57.500 --> 00:05:00.400
 80 was open and the difference is

98
00:05:00.400 --> 00:05:03.300
 actually the port 80 between both of them as

99
00:05:03.300 --> 00:05:06.400
 you can see over here. The simple HTTP server

100
00:05:06.400 --> 00:05:08.600
 was running then it suddenly stopped.

101
00:05:10.700 --> 00:05:13.800
This is the same between both of them as you can see both

102
00:05:13.800 --> 00:05:16.600
 were running fine on Port 88 only.

103
00:05:16.600 --> 00:05:19.400
 The difference was Port 80 was found

104
00:05:19.400 --> 00:05:22.500
 to be closed into the second output XML.

105
00:05:23.100 --> 00:05:26.700
So this is how you can do comparison of two particular

106
00:05:26.700 --> 00:05:29.700
 outputs at two different times. You can

107
00:05:29.700 --> 00:05:32.200
 utilize this for your recon purposes as well.

108
00:05:32.200 --> 00:05:35.500
 Whenever you are scanning a Target later on after a

109
00:05:35.500 --> 00:05:37.000
 month or two month you go back.

110
00:05:37.800 --> 00:05:40.700
You scan it you go back to the first output you

111
00:05:40.700 --> 00:05:43.200
 do the comparison and you come to know if they have

112
00:05:43.200 --> 00:05:46.000
 applied any changes into their production server.

113
00:05:46.900 --> 00:05:49.400
So I hope you guys understood this and it will be very helpful

114
00:05:49.400 --> 00:05:52.600
 for every one of you for your recon for pen

115
00:05:52.600 --> 00:05:54.600
 testing as well as bug Bounty. Thank you.
