WEBVTT - This file was automatically generated by VIMEO

0
00:00:08.640 --> 00:00:13.520
Hi and welcome back to Section five Blackhead Tricks

1
00:00:13.580 --> 00:00:14.413
my Net Cat.

2
00:00:15.160 --> 00:00:19.980
In this video we are going to talk about Net Cat common Cheat Sheet.

3
00:00:21.020 --> 00:00:25.990
This cheat sheet provides various tips for using Net Cat on both

4
00:00:26.310 --> 00:00:27.590
Linux and Microsoft Windows.

5
00:00:27.890 --> 00:00:31.630
So let's do a recap about the basic comments of Net Cat. First of all,

6
00:00:31.770 --> 00:00:34.830
we have the operation modes that Netcat works,

7
00:00:35.680 --> 00:00:37.210
it's client and server.

8
00:00:37.670 --> 00:00:42.370
You can run a instance of netcat in a client mode in a server mode.

9
00:00:42.670 --> 00:00:46.730
So this is the the template for running atca.

10
00:00:46.950 --> 00:00:51.930
We have Netcat and C for the version available in the Linux environment.

11
00:00:52.110 --> 00:00:56.440
So we have the common netcat, we have the first options,

12
00:00:57.550 --> 00:00:59.570
the first options that we have.

13
00:01:00.280 --> 00:01:05.250
Then we have to specify a host name and then port in the

14
00:01:05.320 --> 00:01:10.170
options that we can use in netcat we have dash H or

15
00:01:10.170 --> 00:01:15.010
help and get the version dash V to get the control verbosity of

16
00:01:15.030 --> 00:01:16.730
the AMLO information.

17
00:01:17.190 --> 00:01:21.610
So in this dash v we are able to get more details

18
00:01:22.040 --> 00:01:24.330
when we are running the software,

19
00:01:24.350 --> 00:01:29.290
the the Red Cat and we have the dash V W V to get more details in the

20
00:01:29.290 --> 00:01:31.250
implementation. That takes for example, uh,

21
00:01:31.390 --> 00:01:35.530
the main document about the sockets so is uh, internal implementation.

22
00:01:35.830 --> 00:01:40.690
We have a dash L for listen this specify that we are running that

23
00:01:40.690 --> 00:01:41.890
cat in several modes.

24
00:01:42.030 --> 00:01:46.370
We have the option dash E for alumni cat with acute specific common

25
00:01:46.760 --> 00:01:50.930
when a client connected to it. So we can open, for example,

26
00:01:51.290 --> 00:01:55.970
a specific program or running a dash. We gonna see this.

27
00:01:56.270 --> 00:01:57.930
So this is very powerful options.

28
00:01:58.120 --> 00:02:02.930
Dash k to reopen Netcat with the same common line after the original connect is

29
00:02:02.930 --> 00:02:05.450
closed. For example, if we connect NaCl,

30
00:02:05.630 --> 00:02:09.650
if we run Netcat to seven mode and someone connect,

31
00:02:09.760 --> 00:02:14.450
make a quick connect to listen to verify if the port is open.

32
00:02:14.470 --> 00:02:15.303
For example,

33
00:02:15.350 --> 00:02:20.330
the dash key is very interesting because this keep the door open for this

34
00:02:20.330 --> 00:02:25.330
connection dash o to get X dump on Netcat traffic to

35
00:02:25.370 --> 00:02:28.410
a fire for example. So this is like a,

36
00:02:28.530 --> 00:02:33.050
a log mode on netcat when we are using connection with Net cat,

37
00:02:33.150 --> 00:02:38.010
we have two protocols for transport layer for the

38
00:02:38.010 --> 00:02:42.010
full protocol that netcat use is to c p. But we have used,

39
00:02:42.630 --> 00:02:46.570
we have available uh, dash U U D P mode. For example,

40
00:02:46.930 --> 00:02:51.810
U D P is a connection like protocol and dash w v to

41
00:02:51.910 --> 00:02:54.850
set network activity time out.

42
00:02:54.910 --> 00:02:58.810
So this is very interesting to set a time out in our connection.

43
00:02:59.300 --> 00:03:01.720
For the examples with Netcat, we have a,

44
00:03:01.960 --> 00:03:06.920
a very basic version option is a simple shut interface

45
00:03:07.100 --> 00:03:11.720
that's mean that we have two instance of Netcat one running in the server

46
00:03:11.870 --> 00:03:14.720
mode and another one run in the client mode.

47
00:03:14.780 --> 00:03:19.200
In a server mode we have this template here that's mean is a netcat

48
00:03:19.350 --> 00:03:20.800
options and Port.

49
00:03:21.020 --> 00:03:26.000
So the option for host name is Hide because we are running

50
00:03:26.200 --> 00:03:31.160
a server mode and the host name the IP is the actual I IP of the machine that

51
00:03:31.160 --> 00:03:35.800
we are running these server mode of netcat.

52
00:03:36.100 --> 00:03:40.240
And the template for the client mode is options, host,

53
00:03:40.270 --> 00:03:41.240
name and port.

54
00:03:41.620 --> 00:03:46.200
That's mean that the host name is the IP of the host of the machine

55
00:03:46.670 --> 00:03:50.200
that we order server that we want to connect.

56
00:03:50.260 --> 00:03:54.880
So we have this example here in a server mode we have the option

57
00:03:55.440 --> 00:03:56.273
V L P,

58
00:03:56.460 --> 00:04:01.360
that's mean that we have V to get my formation L or

59
00:04:01.360 --> 00:04:02.320
specify a lesson.

60
00:04:02.380 --> 00:04:06.840
That's mean that net get running several mode and P to specify

61
00:04:07.880 --> 00:04:08.460
a port.

62
00:04:08.460 --> 00:04:13.120
So that's mean that in this local machine we are

63
00:04:13.120 --> 00:04:16.960
running netcat in a certain mode in this port

64
00:04:17.180 --> 00:04:18.360
1, 2, 3, 4, 5.

65
00:04:18.700 --> 00:04:22.640
And for the client mode we have netcat dash V.

66
00:04:22.860 --> 00:04:24.840
That's mean that we have more details.

67
00:04:25.140 --> 00:04:29.080
And for this connection the host name is local host.

68
00:04:29.500 --> 00:04:31.280
That's mean that we are running the,

69
00:04:31.850 --> 00:04:35.680
these both instance of Net Cat are running the same machine.

70
00:04:36.180 --> 00:04:39.690
But if we are running the seven mode in a different machine,

71
00:04:40.200 --> 00:04:42.610
this op local host gets me,

72
00:04:42.610 --> 00:04:47.450
the host name will be IP of this machine running net

73
00:04:47.450 --> 00:04:51.770
cat in seven mode and the port 1, 2, 3, 4, 5,

74
00:04:51.870 --> 00:04:56.450
that's mean that this is the port that we are connecting for the option for PO

75
00:04:56.690 --> 00:04:57.430
scanning.

76
00:04:57.430 --> 00:05:02.090
We have some options that is very interesting to use.

77
00:05:02.670 --> 00:05:04.450
In a port scan for example,

78
00:05:04.510 --> 00:05:08.930
we have the dash V that's mean network in an activity

79
00:05:09.120 --> 00:05:12.770
timeout we have the dash Z, that's mean the two,

80
00:05:12.800 --> 00:05:17.050
there's no latency zero IO dash I to set a delay

81
00:05:17.690 --> 00:05:19.170
interval between port scanning.

82
00:05:19.390 --> 00:05:24.050
So that's mean we have two or three seconds for port scan each port dash

83
00:05:24.330 --> 00:05:26.290
n to prevent d n s lookup.

84
00:05:26.310 --> 00:05:31.250
That's mean that no need to resolve D N Ss for a specific host

85
00:05:31.250 --> 00:05:31.750
name.

86
00:05:31.750 --> 00:05:36.410
And we have dash R to scan portion randomly.

87
00:05:36.590 --> 00:05:40.250
The template for this option for port scanning is

88
00:05:41.380 --> 00:05:45.000
the n c, the common, not yet a portion for options.

89
00:05:45.760 --> 00:05:50.760
A portion to specify a host name and a portion to specify a range of ports.

90
00:05:51.020 --> 00:05:55.880
So in the example that we have here, we have the net,

91
00:05:57.020 --> 00:06:00.280
all the set of commons, we have a host name.

92
00:06:00.500 --> 00:06:02.920
In this case this is external ip.

93
00:06:03.020 --> 00:06:07.120
It is in the same network but it's not the local host. For example,

94
00:06:07.340 --> 00:06:11.880
we have the option dash Z to get no latency

95
00:06:12.460 --> 00:06:16.880
and the range of port to port one two, port 2000 for example.

96
00:06:17.340 --> 00:06:21.160
We saw also that Netcat is using for transferring files.

97
00:06:21.420 --> 00:06:26.280
So Netcat has the ability to both pull and push files and we have this

98
00:06:26.520 --> 00:06:29.120
template here. First one for example, the first template,

99
00:06:29.140 --> 00:06:32.880
we have the options port, the port two,

100
00:06:33.420 --> 00:06:38.200
and we have this design to specify the direction that we are

101
00:06:38.200 --> 00:06:40.320
passing the file, the file name.

102
00:06:40.340 --> 00:06:45.240
So in this case we are running in the server and when someone's connecting the

103
00:06:45.240 --> 00:06:48.360
server, we'll receive a file name. Okay,

104
00:06:48.660 --> 00:06:53.280
so the next template that we have is for the client mode

105
00:06:53.620 --> 00:06:56.160
is when the net cat connect the server.

106
00:06:56.700 --> 00:06:58.920
So we have the portion for options,

107
00:06:59.420 --> 00:07:04.280
we have the portion for host name to specify a host name portion for port.

108
00:07:04.980 --> 00:07:09.800
And we have the opposite sign that we have in the server

109
00:07:09.910 --> 00:07:13.280
mode. That's mean that when we receive a file,

110
00:07:13.870 --> 00:07:18.400
this input in the left will be our output in the right.

111
00:07:18.580 --> 00:07:23.560
So this will be the file that we are receiving. So we have option for example,

112
00:07:23.700 --> 00:07:28.440
to change the name of the file. So we have some options here. For example,

113
00:07:28.700 --> 00:07:33.240
the, the instance of this is the net cat dash vlp.

114
00:07:33.500 --> 00:07:37.800
That's mean that we are running net cat in server mode in the port

115
00:07:37.860 --> 00:07:38.920
1, 2, 3, 4, 5.

116
00:07:39.220 --> 00:07:42.920
We have the sign to specify the file,

117
00:07:43.300 --> 00:07:48.080
the file that will be passed or who connect the server in the client

118
00:07:48.230 --> 00:07:49.480
mode. We have uh,

119
00:07:49.480 --> 00:07:54.000
dash V to get get one formation w V two.

120
00:07:54.260 --> 00:07:58.560
That's mean that we have a timeout for two seconds. We have a specified uh,

121
00:07:58.590 --> 00:08:00.400
host name. There's a ip,

122
00:08:00.540 --> 00:08:03.760
we have the port and we have the opus of the sign.

123
00:08:03.760 --> 00:08:08.680
That's mean that what we receive in the left will be a result of the

124
00:08:08.680 --> 00:08:11.880
right file. We saw also that we have the option,

125
00:08:12.260 --> 00:08:16.880
we have a tool in Linux to get the MD five

126
00:08:17.700 --> 00:08:18.800
sum. That's mean that we,

127
00:08:18.980 --> 00:08:23.480
we we calculate the integrity of the file and we saw too that

128
00:08:23.650 --> 00:08:27.920
these are interesting option to get a collection of files.

129
00:08:28.710 --> 00:08:31.760
When we use the tar, it's mean that we are uh,

130
00:08:31.790 --> 00:08:36.680
compact the files and pass to the net cat and the

131
00:08:36.680 --> 00:08:41.400
client will will connect with the server and Will is compact this

132
00:08:41.470 --> 00:08:43.440
file. So this is a very interesting,

133
00:08:44.270 --> 00:08:49.240
very efficient way to get a collection of fires in one time

134
00:08:49.300 --> 00:08:49.900
for example.

135
00:08:49.900 --> 00:08:54.840
So this is very efficient way to do this for the possibility of bone and

136
00:08:55.080 --> 00:08:55.913
grabbing.

137
00:08:56.100 --> 00:09:00.360
We saw that net CAT can be used to verify more details

138
00:09:00.890 --> 00:09:05.120
about a server in a specific port. So we saw that for example,

139
00:09:05.460 --> 00:09:10.400
we can run start the Apache two version in our machine

140
00:09:11.060 --> 00:09:15.880
and get the status and we have a port scanning port meaning a

141
00:09:16.080 --> 00:09:18.840
specific port is one single port.

142
00:09:19.100 --> 00:09:24.080
So this is a very interesting option to verify for example if the server

143
00:09:24.660 --> 00:09:28.480
in this port is open or not. So this is very interesting option.

144
00:09:28.780 --> 00:09:33.760
We saw that there's a possibility to get more information about the

145
00:09:33.760 --> 00:09:36.600
servers that are running in this specific port.

146
00:09:36.780 --> 00:09:39.960
So we saw too in the HTTP server for example,

147
00:09:40.340 --> 00:09:45.240
we have a combination of comments to get more information about

148
00:09:45.240 --> 00:09:46.073
this server.

149
00:09:46.140 --> 00:09:50.320
So in this example here we have a combination of commands.

150
00:09:50.580 --> 00:09:54.920
We have the common print F to print something in the terminal

151
00:09:55.660 --> 00:10:00.560
and we have a little header when that is use it in

152
00:10:00.560 --> 00:10:03.520
the HTP server. We have the, for example,

153
00:10:03.540 --> 00:10:06.200
in this example we have the head that's mean that uh,

154
00:10:06.340 --> 00:10:11.280
is a common H T P command to get only the head of the H T

155
00:10:11.320 --> 00:10:13.920
P request. So we have the common head,

156
00:10:14.620 --> 00:10:18.200
we have the the dash to specify the host the root,

157
00:10:18.630 --> 00:10:20.800
okay the version of the H T P.

158
00:10:21.020 --> 00:10:24.520
And we have to specify a host and we have the option pipe.

159
00:10:24.820 --> 00:10:29.160
That's mean that what we have in left will be the input what we have in the

160
00:10:29.160 --> 00:10:29.500
right.

161
00:10:29.500 --> 00:10:34.480
So in this case we have a net cat connecting in a specific host

162
00:10:34.580 --> 00:10:37.840
and port. So below we have an instance of this template.

163
00:10:37.860 --> 00:10:41.200
We have the command print f printing, the option for head.

164
00:10:41.260 --> 00:10:42.200
That's mean that we have,

165
00:10:42.500 --> 00:10:46.920
we get only the option of the head of H G P command request. Okay?

166
00:10:47.420 --> 00:10:49.480
And this example, the host will be the site,

167
00:10:49.540 --> 00:10:53.960
the website of Microsoft in the print in the left common in the right,

168
00:10:54.140 --> 00:10:54.973
the pipe common.

169
00:10:55.220 --> 00:11:00.120
We have a net cat connecting in the port 18 in the HT

170
00:11:00.120 --> 00:11:01.520
P server for Microsoft.

171
00:11:01.580 --> 00:11:06.280
That's mean that the net cat will connect in the port 80 or the Microsoft

172
00:11:06.430 --> 00:11:09.800
website. And then we as execute a command for print F.

173
00:11:09.900 --> 00:11:14.560
So this is interesting because this command will print the only had

174
00:11:14.830 --> 00:11:19.760
part of the H G P request and we get more information about

175
00:11:20.140 --> 00:11:24.040
the service that is running in this web server. So for example,

176
00:11:24.220 --> 00:11:28.200
the version of the this, the web server that they're running,

177
00:11:28.380 --> 00:11:30.160
if it's a patch or not for example.

178
00:11:30.580 --> 00:11:35.400
So this is very interesting to get more details about the sales that is

179
00:11:35.400 --> 00:11:40.240
running. Another very useful option that we saw about remote Bash.

180
00:11:40.550 --> 00:11:44.920
It's mean that we have a template like this. Like we have the option part,

181
00:11:45.220 --> 00:11:49.320
the port part two dash a and the dash path.

182
00:11:49.540 --> 00:11:50.373
So in the,

183
00:11:50.420 --> 00:11:55.280
in Microsoft's environment is a CMD aza and for Linux

184
00:11:55.280 --> 00:11:58.360
environment we have the slash being slash bash.

185
00:11:58.510 --> 00:12:03.320
This is very powerful because when you connect Net Cat in a several instance

186
00:12:03.500 --> 00:12:07.840
we are say hey when connected in Net Cat we can execute a bash.

187
00:12:07.980 --> 00:12:11.240
So these are are a remote bash in another machine in another,

188
00:12:11.280 --> 00:12:12.440
a host name for example.

189
00:12:13.180 --> 00:12:17.560
So this give a powerful option for the client.

190
00:12:17.590 --> 00:12:19.280
When the client connect with this,

191
00:12:19.940 --> 00:12:22.960
the client will receive a remote pash.

192
00:12:23.580 --> 00:12:28.440
So he has all the power of the pash of the terminal of

193
00:12:28.440 --> 00:12:29.273
the console.

194
00:12:29.580 --> 00:12:34.440
So the client is able to execute commons a remote commons in

195
00:12:34.440 --> 00:12:36.600
this machine and this is very powerful.

196
00:12:37.580 --> 00:12:41.280
In another option is using that cat for port forwarding.

197
00:12:41.500 --> 00:12:46.230
So that's mean that we have a forward of port.

198
00:12:46.930 --> 00:12:51.630
So we have the source computing and the computer and we have

199
00:12:52.030 --> 00:12:53.830
a think plate for these options.

200
00:12:54.290 --> 00:12:57.190
So we have host name of relay in a part number,

201
00:12:57.210 --> 00:13:01.950
number one for example and for the relay computer we have the same

202
00:13:02.380 --> 00:13:05.910
part number for the source computer part. Uh, pipe.

203
00:13:06.100 --> 00:13:09.750
That means we are running another instance of netcat.

204
00:13:10.210 --> 00:13:15.150
We specify another host name of the target and a second part name

205
00:13:15.290 --> 00:13:16.830
number. So for example,

206
00:13:16.850 --> 00:13:21.430
in the instance below we have Netcat command running the host name

207
00:13:22.050 --> 00:13:23.710
in the part 1, 2, 3, 4, 5.

208
00:13:24.140 --> 00:13:28.510
Then we have a Netcat listen in this port

209
00:13:28.610 --> 00:13:33.520
1, 2, 4, 5 and in a pipe another command

210
00:13:33.620 --> 00:13:38.280
of Netcat for the host name of the another machine and

211
00:13:38.450 --> 00:13:42.960
connecting to order another port five, port 3, 2, 1.

212
00:13:43.420 --> 00:13:46.640
That's mean that we have three machines in this history.

213
00:13:46.900 --> 00:13:49.680
We have a machine with our initial connection,

214
00:13:50.140 --> 00:13:54.880
we have an intermediate machine connecting the first machine.

215
00:13:55.230 --> 00:13:59.200
Then we have a forward passing for the third machine.

216
00:13:59.420 --> 00:14:01.280
So this is very interesting for example,

217
00:14:01.700 --> 00:14:05.640
to break some tracking 'cause we have machine item,

218
00:14:05.640 --> 00:14:09.600
energy machine connecting with a computer. Number one for example.

219
00:14:09.940 --> 00:14:13.080
But the connection will be passed to a third machine.

220
00:14:13.340 --> 00:14:17.400
So this is very interesting scenario or port forwarding.

221
00:14:18.260 --> 00:14:22.600
In this video we saw about net Cat common cheat sheet.

222
00:14:23.140 --> 00:14:28.080
In next video you'll take a look at Net Cat's role in log four J

223
00:14:28.160 --> 00:14:30.520
exploitation. I hope to see you there.
