PCAP Dosyaları Üzerinden SMTP Trafik Analizi

PCAP Dosyaları Üzerinden SMTP Trafik Analizi
[EXHIBIT_A] Featured evidence

Network üzerinden adli analiz gerçekleştirilmesi gereken durumlarda analiz edilebilecek en değerli sayısal delil ağ üzerinden yakalanan tam paket verisidir ve bu veriler genellikle biz adli bilişim uzmanlarına PCAP formatında sunulur. Bu ağ paketleri tam paket bilgisi içerecek şekilde kaydedilmişse çok daha kıymetlidir ve gerçekleştirilecek adli analizin sonucunda elde edebileceğimiz sonuçları oldukça önemli ölçüde pozitif şekilde etkiler.

Bu makalede bir PCAP dosyası içinde yer alan STMP trafiğini analiz edebileceğimiz bir kaç araçtan bahsedeceğim. Bu araçlardan ilki smtpdump ve http://www.aldeid.com/wiki/Smtpdump adresinden indirebilirsiniz. Kurulumla ilgili bilgiler de ilgili sayfada yer alıyor. Kurulumu gerçekleştirdikten sonra herhangi bir parametre kullanmadan çalıştırdığınızda karşınıza aşağıdaki gibi bir yardım menüsü çıkacaktır.

(Örnek olarak kullanılan pcap dosyasını http://forensicscontest.com/contest02/evidence02.pcap adresinden indirebilirsiniz.)

exhibit_viewer.exe
Smtpdump-01
[EXHIBIT] Smtpdump-01

Bu aracın bize sunmuş olduğu özelliklerin başında PCAP içinde yer alan SMTP trafiğindeki kimlik doğrulama bilgilerini kolay bir şekilde bize sunması. Bunun için -A parametresi ile uygulamayı çalıştırmamız yeterli olacaktır. Bu parametresini örnek kullanımı ve örnek çıktı aşağıdaki ekran çıktısında yer almaktadır.

exhibit_viewer.exe
Smtpdump-02
[EXHIBIT] Smtpdump-02

Yukarıdaki örnek çıktıdan da görülebileceği üzere 192.168.1.159 IP adresinden 64.12.102.142 adresinde koşan SMTP sunucusuna iki kez bağlantı gerçekleştirmiş ve bu bağlantı sırasında kullanılan kullanıcı adı ve şifre bilgisi de ekran çıktısında yer almaktadır. Smtpdump’ın bir diğer özelliği ise ilgili PCAP dosyasında yer alan SMTP trafiği içindeki mail eklentilerini çıkartıp diske kaydedebilmesi. Bu özelliğe ilişkin örnek kullanıma ait ekran görüntüsü de aşağıda yer almaktadır.

exhibit_viewer.exe
Smtpdump-03
[EXHIBIT] Smtpdump-03

SMTP trafiğini PCAP dosyaları üzerinden analiz etmek için kullanabileceğimiz bir diğer yazılım ise findsmtpinfo.py. Bu uygulamayı https://bitbucket.org/jrossi/forensicscontest/src/d447c0539d03/contest-2/findsmtpinfo.py adresinden indirebilirsiniz. Herhangi bir parametre girmeden uygulamayı çalıştırdığınızda sizden girdi olarak bir pcap dosyası belirtmenizi isteyen bir mesaj çıkar karşınıza. Yukarıdaki örnekte kullandığımız pcap dosyasını bu uygulamaya da girdi olarak verdiğimizde aşağıda yer alan çıktı ile karşılaşırız.

BASH
1sansforensics@siftworkstation:/opt/smtpdump$ sudo ./findsmtpinfo.py -p evidence02.pcap—————————————-Report: 192.168.001.159.01036-064.012.102.142.00587
2—————————————-
3Found SMTP Session data
4SMTP AUTH Login: [email protected]
5SMTP AUTH Password: 558r00lz
6SMTP MAIL FROM:
7SMTP RCPT TO:
8Found email Messages
9– Writing to file: ./report/messages/1/192.168.001.159.01036-064.012.102.142.00587.msg
10– MD5 of msg: e295a3990b3987a8864383832fea6df9
11– Found Attachment
12– Writing to filename: ./report/messages/1/part-001.ksh
13– Type of Attachement: text/plain
14– MDS of Attachement: 541812ed71a51b9c1ae07741ed5ae63c
15– Found Attachment
16– Writing to filename: ./report/messages/1/part-001.html
17– Type of Attachement: text/html
18– MDS of Attachement: 18d3f88dbc6b152aba923e8c083033f9
19—————————————-
20Report: 064.012.102.142.00587-192.168.001.159.01038
21—————————————-
22Found SMTP Session data
23—————————————-
24Report: 064.012.102.142.00587-192.168.001.159.01036
25—————————————-
26Found SMTP Session data
27—————————————-
28Report: 192.168.001.159.01038-064.012.102.142.00587
29—————————————-
30Found SMTP Session data
31SMTP AUTH Login: [email protected]
32SMTP AUTH Password: 558r00lz
33SMTP MAIL FROM:
34SMTP RCPT TO:
35Found email Messages
36– Writing to file: ./report/messages/2/192.168.001.159.01038-064.012.102.142.00587.msg
37– MD5 of msg: 844661d8332eb00e537a8b15deedf269
38– Found Attachment
39– Writing to filename: ./report/messages/2/part-001.ksh
40– Type of Attachement: text/plain
41– MDS of Attachement: ba2c98f65f3f678b6a71570adcf362f4
42– Found Attachment
43– Writing to filename: ./report/messages/2/part-001.html
44– Type of Attachement: text/html
45– MDS of Attachement: d07c3b721fed36a725c01e4827c1a563
46– Found Attachment
47– Writing to filename: ./report/messages/2/secretrendezvous.docx
48– Type of Attachement: application/octet-stream
49– MDS of Attachement: 9e423e11db88f01bbff81172839e1923
50– ZIP Archive attachment extracting
51– Found file
52– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/[Content_Types].xml
53– Type of file: application/xml
54– MDS of File: f7a7f13f9d124fcc3527e57f342a0979
55– Found file
56– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/_rels/.rels
57– Type of file: None
58– MDS of File: 77bf61733a633ea617a4db76ef769a4d
59– Found file
60– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/_rels/document.xml.rels
61– Type of file: None
62– MDS of File: c9c49c2d0f5b9a5ce63d1e0d86bb5e25
63– Found file
64– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/document.xml
65– Type of file: application/xml
66– MDS of File: 5b1a947f30db83f4170b009dedd38fab
67– Found file
68– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/media/image1.png
69– Type of file: image/png
70– MDS of File: aadeace50997b1ba24b09ac2ef1940b7
71– Found file
72– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/theme/theme1.xml
73– Type of file: application/xml
74– MDS of File: 9d84374caf9c73ec77677afd23cb7b22
75– Found file
76– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/settings.xml
77– Type of file: application/xml
78– MDS of File: 4788c0aa840fb18d7e5bd74936317dcc
79– Found file
80– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/webSettings.xml
81– Type of file: application/xml
82– MDS of File: 15065d2de3eddbb09d84337a09fd7985
83– Found file
84– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/styles.xml
85– Type of file: application/xml
86– MDS of File: d0c2c9bec6e9c2597b174ababf1b2191
87– Found file
88– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/docProps/core.xml
89– Type of file: application/xml
90– MDS of File: 32ecd3799f69751a53ce10825372fd36
91– Found file
92– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/numbering.xml
93– Type of file: application/xml
94– MDS of File: 5583fc19ed6bdf4ee5402f32ef42c492
95– Found file
96– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/word/fontTable.xml
97– Type of file: application/xml
98– MDS of File: de2ae9c06e07370391b996f069f1dfba
99– Found file
100– Writing to filename: ./report/messages/2/secretrendezvous.docx.unzipped/docProps/app.xml
101– Type of file: application/xml
102– MDS of File: b3923a08674ac7c56babca89c3409107
103—————————————-
104Writing complete report to: ./report/output-report.txt
105MD5 Hash of report: c438ddd8d1e70f0c46a76ea2001273d9
106Finished
107sansforensics@siftworkstation:/opt/smtpdump$

Uygulama çalıştırıldığında ./report dizini altına da bulguların yer aldığı txt formatında bir dosya oluşturur ve bu raporda yer alan bilgiler uygulamanın ekrana bastığı çıktıların aynısıdır. Örnek bir rapor çıktısı aşağıdaki ekran görüntüsünde yer almaktadır.

exhibit_viewer.exe
Smtpdump-04
[EXHIBIT] Smtpdump-04
AUTHOR
Halil Öztürkci

Halil Öztürkci

Cybersecurity expert with 25 years of hands-on experience across the full attack-defense spectrum.

I've spent my career on both sides of the battlefield—investigating breaches through digital forensics, hunting APT groups through threat intelligence, building and leading security operations, dissecting malware, and executing red team engagements. Now I'm focused on the next frontier: LLM security, AI red teaming, and building secure AI/ML pipelines.

From incident response to adversary simulation, from SOC architecture to AI-powered threat detection—I decode complex security challenges and translate them into actionable defense.

enjoyed this? get more like it.