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 rulesalert 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;)
Snort 3
Try these rulesalert 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. | Time | Source | Destination | Protocol | Info |
|---|---|---|---|---|---|
| 1 | 0.000 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | SYN |
| 2 | 0.012 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | SYN ACK |
| 3 | 0.024 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 4 | 0.036 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 220 (vsFTPd 3.0.5) |
| 5 | 0.048 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 6 | 0.060 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | PSH ACK, USER anonymous |
| 7 | 0.072 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | ACK |
| 8 | 0.084 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 331 Please specify the password. |
| 9 | 0.096 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 10 | 0.108 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | PSH ACK, PASS guest@ |
| 11 | 0.120 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | ACK |
| 12 | 0.132 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 230 Login successful. |
| 13 | 0.144 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 14 | 0.156 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | PSH ACK, TYPE I |
| 15 | 0.168 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | ACK |
| 16 | 0.180 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 200 Switching to Binary mode. |
| 17 | 0.192 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 18 | 0.204 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | PSH ACK, PASV |
| 19 | 0.216 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | ACK |
| 20 | 0.228 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 227 Entering Passive Mode (198,51,100,20,195,80). |
| 21 | 0.240 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 22 | 0.252 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | PSH ACK, RETR tools/update.exe |
| 23 | 0.264 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | ACK |
| 24 | 0.276 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 150 Opening BINARY mode data connection for tools/update.exe (166 bytes) |
| 25 | 0.288 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 26 | 0.300 | 192.0.2.10:51322 | 198.51.100.20:50000 | TCP | SYN |
| 27 | 0.312 | 198.51.100.20:50000 | 192.0.2.10:51322 | TCP | SYN ACK |
| 28 | 0.324 | 192.0.2.10:51322 | 198.51.100.20:50000 | TCP | ACK |
| 29 | 0.336 | 198.51.100.20:50000 | 192.0.2.10:51322 | TCP | PSH ACK, 169 bytes |
| 30 | 0.348 | 192.0.2.10:51322 | 198.51.100.20:50000 | TCP | ACK |
| 31 | 0.360 | 198.51.100.20:50000 | 192.0.2.10:51322 | TCP | FIN ACK |
| 32 | 0.372 | 192.0.2.10:51322 | 198.51.100.20:50000 | TCP | FIN ACK |
| 33 | 0.384 | 198.51.100.20:50000 | 192.0.2.10:51322 | TCP | ACK |
| 34 | 0.396 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 226 Transfer complete. |
| 35 | 0.408 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 36 | 0.420 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | PSH ACK, QUIT |
| 37 | 0.432 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | ACK |
| 38 | 0.444 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | PSH ACK, 221 Goodbye. |
| 39 | 0.456 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
| 40 | 0.468 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | FIN ACK |
| 41 | 0.480 | 198.51.100.20:21 | 192.0.2.10:51321 | TCP | FIN ACK |
| 42 | 0.492 | 192.0.2.10:51321 | 198.51.100.20:21 | TCP | ACK |
More Email and file transfer samples
- SMTP email with a script attachment: An email with a base64-encoded JavaScript attachment, invoice_4471.js.