Sample captures, Email and file transfer
SMTP email with a script attachment
An email with a base64-encoded JavaScript attachment, invoice_4471.js.
- Packets
- 32
- Duration
- 0.372 s
- Size
- 3.2 KB
- Protocols
- TCP, SMTP
- License
- CC0
What it shows
A complete SMTP session: EHLO, MAIL FROM, RCPT TO, and a MIME message with a text part and an attachment, invoice_4471.js, encoded in base64. The script only prints a line.
The attachment's text is only readable after MIME decoding. Suricata matches it with file.data and the file name with file.name. Snort 3 decodes it into file_data.
Rules for this capture
Suricata 8 and 7
Try these rulesalert smtp any any -> any any (msg:"JavaScript attachment"; flow:established,to_server; file.name; content:".js"; endswith; sid:1000001; rev:1;) alert smtp any any -> any any (msg:"WScript.Shell in a decoded attachment"; flow:established,to_server; file.data; content:"WScript.Shell"; sid:1000002; rev:1;)
Snort 3
Try these rulesalert tcp any any -> any 25 (msg:"JavaScript attachment"; flow:established,to_server; content:"Content-Disposition: attachment"; content:".js|22|", distance 0; sid:1000001; rev:1;) alert tcp any any -> any 25 (msg:"WScript.Shell in a decoded attachment"; flow:established,to_server; file_data; content:"WScript.Shell"; sid:1000002; rev:1;)
Packets
| No. | Time | Source | Destination | Protocol | Info |
|---|---|---|---|---|---|
| 1 | 0.000 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | SYN |
| 2 | 0.012 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | SYN ACK |
| 3 | 0.024 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 4 | 0.036 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | PSH ACK, 220 mail.example.com ESMTP Postfix |
| 5 | 0.048 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 6 | 0.060 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | PSH ACK, EHLO billing-pc |
| 7 | 0.072 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | ACK |
| 8 | 0.084 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | PSH ACK, 250-mail.example.com |
| 9 | 0.096 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 10 | 0.108 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | PSH ACK, MAIL FROM:<billing@badexample.net> |
| 11 | 0.120 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | ACK |
| 12 | 0.132 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | PSH ACK, 250 2.1.0 Ok |
| 13 | 0.144 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 14 | 0.156 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | PSH ACK, RCPT TO:<ap@example.com> |
| 15 | 0.168 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | ACK |
| 16 | 0.180 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | PSH ACK, 250 2.1.5 Ok |
| 17 | 0.192 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 18 | 0.204 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | PSH ACK, DATA |
| 19 | 0.216 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | ACK |
| 20 | 0.228 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | PSH ACK, 354 End data with <CR><LF>.<CR><LF> |
| 21 | 0.240 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 22 | 0.252 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | PSH ACK, From: "Billing" <billing@badexample.net> |
| 23 | 0.264 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | ACK |
| 24 | 0.276 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | PSH ACK, 250 2.0.0 Ok: queued as 4F2A81C0B3 |
| 25 | 0.288 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 26 | 0.300 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | PSH ACK, QUIT |
| 27 | 0.312 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | ACK |
| 28 | 0.324 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | PSH ACK, 221 2.0.0 Bye |
| 29 | 0.336 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
| 30 | 0.348 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | FIN ACK |
| 31 | 0.360 | 198.51.100.20:25 | 192.0.2.10:51025 | TCP | FIN ACK |
| 32 | 0.372 | 192.0.2.10:51025 | 198.51.100.20:25 | TCP | ACK |
More Email and file transfer samples
- FTP download in passive mode: An anonymous FTP login and a RETR of update.exe over a passive data connection.