Sample captures, Email and file transfer

FTP download in passive mode

An anonymous FTP login and a RETR of update.exe over a passive data connection.

Packets
42
Duration
0.492 s
Size
3.4 KB
Protocols
TCP, FTP
License
CC0

What it shows

Two connections: the FTP control channel on port 21 (anonymous login, PASV, RETR tools/update.exe) and the data connection to port 50000 that the PASV answer announced, which carries the file.

The commands are on one connection and the file on another, so the rules for each look at different flows.

Rules for this capture

Suricata 8 and 7

Try these rules
alert ftp any any -> any any (msg:"FTP RETR of an .exe"; flow:established,to_server; content:"RETR "; startswith; content:".exe"; distance:0; sid:1000001; rev:1;)
alert ftp-data any any -> any any (msg:"Windows executable over FTP data"; file.data; content:"MZ"; startswith; sid:1000002; rev:1;)
alert tcp any any -> any 21 (msg:"FTP RETR of an .exe"; flow:established,to_server; content:"RETR "; content:".exe", distance 0; sid:1000001; rev:1;)
alert tcp any any -> any any (msg:"Windows executable over FTP data"; flow:established; file_data; content:"MZ", depth 2; sid:1000002; rev:1;)

Packets

No.TimeSourceDestinationProtocolInfo
10.000192.0.2.10:51321198.51.100.20:21TCPSYN
20.012198.51.100.20:21192.0.2.10:51321TCPSYN ACK
30.024192.0.2.10:51321198.51.100.20:21TCPACK
40.036198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 220 (vsFTPd 3.0.5)
50.048192.0.2.10:51321198.51.100.20:21TCPACK
60.060192.0.2.10:51321198.51.100.20:21TCPPSH ACK, USER anonymous
70.072198.51.100.20:21192.0.2.10:51321TCPACK
80.084198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 331 Please specify the password.
90.096192.0.2.10:51321198.51.100.20:21TCPACK
100.108192.0.2.10:51321198.51.100.20:21TCPPSH ACK, PASS guest@
110.120198.51.100.20:21192.0.2.10:51321TCPACK
120.132198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 230 Login successful.
130.144192.0.2.10:51321198.51.100.20:21TCPACK
140.156192.0.2.10:51321198.51.100.20:21TCPPSH ACK, TYPE I
150.168198.51.100.20:21192.0.2.10:51321TCPACK
160.180198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 200 Switching to Binary mode.
170.192192.0.2.10:51321198.51.100.20:21TCPACK
180.204192.0.2.10:51321198.51.100.20:21TCPPSH ACK, PASV
190.216198.51.100.20:21192.0.2.10:51321TCPACK
200.228198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 227 Entering Passive Mode (198,51,100,20,195,80).
210.240192.0.2.10:51321198.51.100.20:21TCPACK
220.252192.0.2.10:51321198.51.100.20:21TCPPSH ACK, RETR tools/update.exe
230.264198.51.100.20:21192.0.2.10:51321TCPACK
240.276198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 150 Opening BINARY mode data connection for tools/update.exe (166 bytes)
250.288192.0.2.10:51321198.51.100.20:21TCPACK
260.300192.0.2.10:51322198.51.100.20:50000TCPSYN
270.312198.51.100.20:50000192.0.2.10:51322TCPSYN ACK
280.324192.0.2.10:51322198.51.100.20:50000TCPACK
290.336198.51.100.20:50000192.0.2.10:51322TCPPSH ACK, 169 bytes
300.348192.0.2.10:51322198.51.100.20:50000TCPACK
310.360198.51.100.20:50000192.0.2.10:51322TCPFIN ACK
320.372192.0.2.10:51322198.51.100.20:50000TCPFIN ACK
330.384198.51.100.20:50000192.0.2.10:51322TCPACK
340.396198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 226 Transfer complete.
350.408192.0.2.10:51321198.51.100.20:21TCPACK
360.420192.0.2.10:51321198.51.100.20:21TCPPSH ACK, QUIT
370.432198.51.100.20:21192.0.2.10:51321TCPACK
380.444198.51.100.20:21192.0.2.10:51321TCPPSH ACK, 221 Goodbye.
390.456192.0.2.10:51321198.51.100.20:21TCPACK
400.468192.0.2.10:51321198.51.100.20:21TCPFIN ACK
410.480198.51.100.20:21192.0.2.10:51321TCPFIN ACK
420.492192.0.2.10:51321198.51.100.20:21TCPACK

More Email and file transfer samples