WEBVTT - This file was automatically generated by VIMEO

0
00:00:13.170 --> 00:00:17.150
Hi, and welcome to Section five Netcat Penetration Test.

1
00:00:17.930 --> 00:00:22.350
In this video, we are going to talk about sniffing traffic using netcat.

2
00:00:23.320 --> 00:00:27.940
Netcat is a versatile software and unfortunately it can be used in illegal

3
00:00:28.050 --> 00:00:31.140
operation. And because of these malicious operations,

4
00:00:31.410 --> 00:00:36.060
this can be flagged by other software that are checking for malicious activities

5
00:00:36.170 --> 00:00:40.760
running on the computer. Netcat can be used as a traffic sniffer.

6
00:00:41.230 --> 00:00:46.000
This test can be done running netcat as a normal user as long

7
00:00:46.060 --> 00:00:50.440
as we use it to listen at port higher than 123

8
00:00:50.950 --> 00:00:52.720
that are the well-known ports.

9
00:00:53.080 --> 00:00:57.440
Sniffers can be used to capture the traffic in incoming traffic

10
00:00:58.060 --> 00:01:00.160
and outgoing traffic. In net.

11
00:01:00.160 --> 00:01:04.520
CAT is able to do this and additionally can perform additional tasks

12
00:01:05.480 --> 00:01:07.580
to sniff traffic. To gather information.

13
00:01:08.120 --> 00:01:12.900
Net CAT can relocate a service already on the system to a

14
00:01:12.900 --> 00:01:15.900
different port or net CAT can transmit information to a,

15
00:01:15.900 --> 00:01:17.580
an application running in background.

16
00:01:18.160 --> 00:01:23.100
The idea of relocating a service is to alter the traffic flow

17
00:01:23.200 --> 00:01:26.780
on our web server to get sensitive pieces of information.

18
00:01:27.080 --> 00:01:31.660
If this operation is done on, well, no port like 80, we have to,

19
00:01:31.880 --> 00:01:35.420
to have a root access. But if you use high ports,

20
00:01:35.420 --> 00:01:37.180
that is no need to root access.

21
00:01:37.560 --> 00:01:42.460
And in our redirect links we have to use pointing to a high

22
00:01:42.490 --> 00:01:46.780
port like 80 80 for example. For example, we have this, uh,

23
00:01:46.980 --> 00:01:51.950
U L U L I and the example and we have

24
00:01:52.310 --> 00:01:56.510
a server.com, for example. And, uh, a port,

25
00:01:56.980 --> 00:01:58.350
this will be a new port.

26
00:01:58.530 --> 00:02:03.230
So this kind of attack is used often and un unaware people

27
00:02:03.450 --> 00:02:05.150
are couching frequently, for example.

28
00:02:05.610 --> 00:02:09.350
So we have the right name of the host of a site or, or a server.

29
00:02:09.810 --> 00:02:11.910
We have a redirect porting.

30
00:02:12.490 --> 00:02:16.670
So for this hack server, for example, is any,

31
00:02:18.090 --> 00:02:20.110
any server. We have the Port 80,

32
00:02:20.930 --> 00:02:23.470
but in this example here we have a redirect.

33
00:02:23.580 --> 00:02:28.470
This serves to another port for a high port like 80 80, okay. For example,

34
00:02:28.730 --> 00:02:32.150
if we are using some configuration in the Apache,

35
00:02:32.660 --> 00:02:37.290
this is the path on Linux for change. Uh,

36
00:02:37.470 --> 00:02:41.770
the, the port that servers listen. So here we are using, uh,

37
00:02:41.770 --> 00:02:45.850
Catalytics environment to do this task. So the,

38
00:02:45.950 --> 00:02:50.290
the task here is to use net CAT to head direct a service

39
00:02:51.070 --> 00:02:54.650
and use net CAT two to log the,

40
00:02:54.790 --> 00:02:57.520
all the information of this traffic. Okay,

41
00:02:57.700 --> 00:03:02.160
so we we're gonna use Apache h h P server as our example,

42
00:03:02.660 --> 00:03:06.400
and that's it. We will, we will redirect the, the service. First of all,

43
00:03:06.860 --> 00:03:10.800
we have to verify if the service for Apache is running or not.

44
00:03:10.940 --> 00:03:15.440
So we're gonna use pseudo service Apache two status.

45
00:03:16.900 --> 00:03:21.320
So these views show to us if the, the service is active or not.

46
00:03:22.300 --> 00:03:26.840
So in this case, this, the service is active. Okay?

47
00:03:28.220 --> 00:03:32.160
So let's start this service using the word start.

48
00:03:33.660 --> 00:03:38.460
And let's query again to verify if the service

49
00:03:39.200 --> 00:03:43.170
is starting or not and the service running is active.

50
00:03:43.910 --> 00:03:48.690
And we can use a web browser to access a local host address

51
00:03:50.450 --> 00:03:53.390
to verify if the service is running or not.

52
00:03:54.430 --> 00:03:57.450
So the Apache service is running,

53
00:03:57.680 --> 00:04:02.490
this is the full page. Okay? And let's start our,

54
00:04:02.710 --> 00:04:07.290
as a cushion of transferring the service and logging the

55
00:04:07.290 --> 00:04:10.850
information. To start our task, we have to,

56
00:04:10.850 --> 00:04:15.250
first we have to stop the service. So we are going to repeat the,

57
00:04:15.350 --> 00:04:19.240
the same comment, but use the word stop like this.

58
00:04:20.420 --> 00:04:24.380
So the ServiceNow is not active. So

59
00:04:27.000 --> 00:04:31.360
we, we can see in the web browser that the service not access

60
00:04:32.260 --> 00:04:36.620
anymore. And to change the head direct to service,

61
00:04:36.800 --> 00:04:40.940
we have to access our specific file and change

62
00:04:41.680 --> 00:04:44.500
the full port for this task, for this operation.

63
00:04:44.840 --> 00:04:49.680
So here in our Color Links environment, the full command is

64
00:04:51.550 --> 00:04:56.280
CD atc slash apache two.

65
00:04:57.770 --> 00:05:02.050
The specific file is port com.

66
00:05:02.640 --> 00:05:06.450
Okay, so let, let's show what we have in this port,

67
00:05:07.150 --> 00:05:09.690
in this file. This file is, uh,

68
00:05:09.790 --> 00:05:14.430
listen the file to verify and to map the four

69
00:05:14.660 --> 00:05:18.230
port 80 like this for H TT P request,

70
00:05:19.050 --> 00:05:22.430
and 4 4 3 for eight 80 TT p s requests.

71
00:05:23.320 --> 00:05:25.990
So to head direct,

72
00:05:26.170 --> 00:05:29.070
we have to make a configuration,

73
00:05:29.870 --> 00:05:31.910
specific configuration in this folder. In this file.

74
00:05:32.130 --> 00:05:36.530
So let me access this file and change the

75
00:05:36.730 --> 00:05:40.050
configuration for port.

76
00:05:41.300 --> 00:05:45.760
So here we have to change this, this lesson, we'll,

77
00:05:45.760 --> 00:05:48.680
we'll update for 80 80 and we,

78
00:05:48.770 --> 00:05:51.400
we'll change the configuration.

79
00:05:52.140 --> 00:05:57.000
So now we have to restart our H H p a H

80
00:05:57.040 --> 00:05:58.960
h H P Apache server.

81
00:05:59.970 --> 00:06:04.420
So let repeat the common service,

82
00:06:05.620 --> 00:06:08.040
pseudo service AP two start.

83
00:06:09.440 --> 00:06:13.500
Now the Apache is running, let's access the full page.

84
00:06:14.320 --> 00:06:18.390
But the difference here is we have to, the full page,

85
00:06:19.350 --> 00:06:22.450
the full port is the 80, but we have changed it.

86
00:06:23.140 --> 00:06:25.480
So we have to change the protocols.

87
00:06:25.780 --> 00:06:29.840
HT p and l a specific port 88.

88
00:06:30.540 --> 00:06:35.020
And the page is accessible. Okay? We have to, this is the,

89
00:06:35.680 --> 00:06:39.340
for the, the format, we have the protocol, H T T P.

90
00:06:39.340 --> 00:06:43.440
Here we have the, a host and we have a port.

91
00:06:44.580 --> 00:06:48.310
Okay? So now the, the full page is accessible,

92
00:06:48.770 --> 00:06:52.910
but we have to add a specific port. 80. 80, okay?

93
00:06:52.970 --> 00:06:57.830
So now what we have to do is to use Netcat as

94
00:06:57.910 --> 00:07:01.630
a sniffer. So to, as I could this operation,

95
00:07:01.760 --> 00:07:06.070
we'll use a file to add this task. Okay?

96
00:07:06.410 --> 00:07:10.470
And for this, let me open another tab here. This,

97
00:07:12.770 --> 00:07:17.390
and we have to choose a folder to add our script

98
00:07:17.390 --> 00:07:22.310
because this job will be more easily executed by net cat if you use this

99
00:07:22.310 --> 00:07:26.110
script. So in our example here, we can use for example,

100
00:07:27.640 --> 00:07:28.520
a temporary file.

101
00:07:28.630 --> 00:07:33.480
This is a good option because it's out of

102
00:07:33.780 --> 00:07:37.680
the holders of the operation system, for example.

103
00:07:38.020 --> 00:07:42.240
And this is a good folder to, to our temporary fires for example.

104
00:07:42.560 --> 00:07:47.450
'cause we have, we we're gonna use this operation to,

105
00:07:48.160 --> 00:07:51.410
it's temporary. It's only to head direct and get a log.

106
00:07:51.550 --> 00:07:53.890
So this is a good option to use this folder.

107
00:07:54.430 --> 00:07:57.320
So create this script file.

108
00:07:57.540 --> 00:08:01.810
So we're gonna use a pseudo nano,

109
00:08:02.720 --> 00:08:07.160
a file name. Could be for example, Apache, er,

110
00:08:08.460 --> 00:08:13.270
this is the nano predictor. And we create a simple script file,

111
00:08:13.720 --> 00:08:16.590
batch file. So we'll be d for batch.

112
00:08:16.730 --> 00:08:20.830
That's mean that we have specific path of the, the batch of the batch.

113
00:08:21.530 --> 00:08:25.260
And we use this command here, net cat, first off,

114
00:08:25.260 --> 00:08:29.700
first operation here is to log the all information that

115
00:08:30.200 --> 00:08:34.060
the connection, uh, when the connection was operating.

116
00:08:34.760 --> 00:08:38.230
So we'll use the option

117
00:08:39.730 --> 00:08:41.780
dash o to create a file,

118
00:08:42.610 --> 00:08:46.470
and we have to specify a full path for the file.

119
00:08:48.790 --> 00:08:52.140
So we'll be patchy.

120
00:08:53.980 --> 00:08:58.790
Put, we have now to specify a host and a port.

121
00:08:59.530 --> 00:09:04.150
So now we have the server is running in my local host here.

122
00:09:04.500 --> 00:09:09.070
Okay? Could be another IP address for another, uh, internet address.

123
00:09:09.570 --> 00:09:14.180
But in this example here we are using a local server.

124
00:09:14.600 --> 00:09:19.440
So this is a, a local IP address. And you have,

125
00:09:19.440 --> 00:09:23.520
you have specify a port 80 80, okay?

126
00:09:23.520 --> 00:09:28.260
Because this will be head direct for this port, for this host.

127
00:09:28.280 --> 00:09:32.460
And for, and for this port, we have save and exit,

128
00:09:33.510 --> 00:09:36.570
the Apache file Sniffer, it's here, it's present.

129
00:09:37.400 --> 00:09:42.090
Some operations is a good idea to increase the power of this file.

130
00:09:42.870 --> 00:09:46.490
So for example, you are gonna use this, the C mode,

131
00:09:47.210 --> 00:09:52.170
C mode to elevate the power of this,

132
00:09:53.630 --> 00:09:56.970
of this file to be no, no problem for execute. For example,

133
00:09:57.160 --> 00:10:01.700
this one will be 3, 3, 3, 7, 7, 7.

134
00:10:02.320 --> 00:10:07.040
That's mean that the file here is right

135
00:10:08.180 --> 00:10:11.360
to read, write, and execute here.

136
00:10:12.880 --> 00:10:17.830
And now we will start another instance of netcat here

137
00:10:18.880 --> 00:10:22.700
in the operation lesson port 80.

138
00:10:23.850 --> 00:10:28.340
And we use option A to as execute file.

139
00:10:29.250 --> 00:10:30.083
So we'll be

140
00:10:31.640 --> 00:10:35.980
our file that we have created right now. So,

141
00:10:36.650 --> 00:10:38.700
okay, this, listen, what's the point here?

142
00:10:38.720 --> 00:10:42.740
The point is the client will access the full webpage

143
00:10:43.720 --> 00:10:48.100
for Apache, do the full page run in the port 80.

144
00:10:48.900 --> 00:10:53.590
Okay? But I have transferred the service for another port,

145
00:10:53.810 --> 00:10:56.270
and I create a net cat here.

146
00:10:57.130 --> 00:11:01.090
That will be listen for port 80 here.

147
00:11:02.210 --> 00:11:06.790
And I'll pointing and I'll execute a file as

148
00:11:07.390 --> 00:11:11.250
a script. This script will create,

149
00:11:11.990 --> 00:11:16.540
we'll run a netcat to log all the information that

150
00:11:16.960 --> 00:11:20.980
the connection is tracking, tracking all, all our information, okay?

151
00:11:22.350 --> 00:11:26.670
And this connection will be head direct for the page,

152
00:11:26.730 --> 00:11:30.630
for the server with another port that we have transferred. Okay?

153
00:11:30.730 --> 00:11:33.590
So this is the point. The client, he will access,

154
00:11:34.460 --> 00:11:39.030
he's thinking that he's accessed the full webpage HT P webpage for

155
00:11:39.250 --> 00:11:40.083
Apache.

156
00:11:40.290 --> 00:11:45.030
But the client will be held direct to another port and uh,

157
00:11:45.030 --> 00:11:47.590
to another host and, and port. Okay?

158
00:11:48.370 --> 00:11:52.910
And this connection will be, so this is the, the point.

159
00:11:53.620 --> 00:11:55.320
So in this operation here,

160
00:11:55.810 --> 00:11:59.640
we'll use Netcat to sniffing the traffic. Okay?

161
00:12:00.300 --> 00:12:04.920
So for example, I will open a new tab here and I will access,

162
00:12:06.870 --> 00:12:09.360
then we'll be a redirect to report 80 80.

163
00:12:09.820 --> 00:12:14.520
And Netcat will be able to log all the information about this

164
00:12:14.520 --> 00:12:15.353
connection

165
00:12:23.980 --> 00:12:28.200
in this video we saw about sniffing traffic using netcat.

166
00:12:28.660 --> 00:12:32.840
In the next video, we'll take a look at rogue tunnel attacks.

167
00:12:33.520 --> 00:12:34.280
I hope to see you there.
