Linux sistemlerde fiziksel bellekten veri okuma (memory forensic)

Bilişim suçu işlenirken kullanılmış sistemler incelenirken en önemli adımlardan biri sistemin o an çalışan imajının alınmasıdır. Bu imajda en önemli parçayı fiziksel hafıza/belleğin kopyası oluşturmaktadır. Linux sistemlerde fiziksel belleğin bir kopyasını çıkarmak oldukça kolaydır. Fiziksel belleğin bir kopyası dosyaya yazıldıktan sonra hashi alınarak üzerinde çalışılabilir.

Örnek: Linux makinedeki bir kullanıcı(netsec kullanıcısı) 192.168.1.107 IP adresine SSH ile bağlanmış olsun. SSH ile bağlanma esnasında username/pass bilgileri bellekte tutulacağı için bağlantı esnasında birileri memory dump işlemi gerçekleştirirse ilgili hesaba ait erişim bilgilerini edinebilir.

# ssh ne[email protected]
The authenticity of host ‘192.168.1.107 (192.168.1.107)’ can’t be established.
RSA key fingerprint is 23:10:41:2f:62:c6:a5:30:3d:a6:6d:e9:a6:81:83:1a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.107′ (RSA) to the list of known hosts.
[email protected]’s password:
BackTrack 4 (PwnSauce) Penetration Testing and Auditing Distribution
Could not chdir to home directory /home/netsec: No such file or directory
[email protected]:/$

Aynı sistemde memory dump işlemi gerçekleştirelim:

Linux sistemlerde sistem çalışırken hafızasını bir dosyaya boşaltabiliriz, bunun için çeşitli araçlar kullanılabilir. Bu araçlardan biri de memdump’dır.

#memdump > FDUMP

Memdump ile dosyaya aktardığımız hafıza bilgilerini string komutu ve grep komutunu kullanarak inceleyebiliriz.

#strings FDUMP |grep netsec

[email protected]
netsec
sshd: [email protected]/6
netsec
USER=netsec
MAIL=/var/mail/netsec
HOME=/home/netsec
LOGNAME=netsec
/var/mail/netsec
[email protected]:/$

Bellekte bulunan herhangi bir dosyayı elde etmek için scalpel gibi bir araç kullanabiliriz. Mesela bellekte bulunan PNG ve HTM formatındaki dosyaları tekrar oluşturmak için aşağıdaki komut iş görecektir.

[email protected]:/pentest/test# scalpel FDUMP -c /etc/scalpel/scalpel.conf
Scalpel version 1.60
Written by Golden G. Richard III, based on Foremost 0.69.

Opening target “/pentest/FDUMP”

Image file pass 1/2.
/pentest/FDUMP: 100.0% |**********************************************************************| 511.9 MB 00:00 ETAAllocating work queues…
Work queues allocation complete. Building carve lists…
Carve lists built. Workload:
png with header “\x50\x4e\x47\x3f” and footer “\xff\xfc\xfd\xfe” –> 7 files
htm with header “\x3c\x68\x74\x6d\x6c” and footer “\x3c\x2f\x68\x74\x6d\x6c\x3e” –> 64 files
Carving files from image.
Image file pass 2/2.
/pentest/FDUMP: 100.0% |***************************************************************************| 511.9 MB 00:00 ETAProcessing of image file complete. Cleaning up…
Done.
Scalpel is done, files carved = 71, elapsed = 13 seconds.

Aynı dizindeki scalpel-output alt dizini incelenirse bellek görüntüsü alındığı anda açık olan(veya daha önce açılmış) PNG, HTM dosyaların bir kopyasının oluştuğu görülecektir.

# ls scalpel-output/png-0-0/
00000000.png 00000001.png 00000002.png 00000003.png 00000004.png 00000005.png 00000006.png

This entry was posted in Forensic and tagged . Bookmark the permalink.

1 Response to Linux sistemlerde fiziksel bellekten veri okuma (memory forensic)

  1. Pingback: Sayı28: Dikkat Çeken Yazılar | NETSEC AĞ VE BİLGİ GÜVENLİĞİ TOPLULUĞU

Leave a Reply

Your email address will not be published. Required fields are marked *

14 + twelve =