p0f (Passive OS fingerprinting)
İşletim sistemini tespit etmenin sık kullanılan iki yöntemi vardır.
Aktif İşletim Sistemi Tespiti (Active OS fingerprinting) : Hedef sistem aktif ve ulaşılabilir olmalıdır.Hedef sisteme anormal paketler gönderip dönen cevaplara göre işletim sistemi tespit edilmeye çalışılır.
Uzak bir ağdaki aktif sistemi tespit etmek için ideal, fakat güvenlik duvarı , saldırı tespit ve engelleme sistemlerine takılmanız kuvvetle muhtemel
Pasif İşletim Sistemi Tespiti (Passive OS fingerprinting) : Kaydedilmiş trafikten veya pasif modda trafiği dinleyip işetim sistemi tespit etmeyi sağlayan etkili bir yöntem.
Pasif işletim sistemi tespiti sağlayan gelişmiş araçlardan p0f ile farklı senaryolar üzerinden bu methodu inceleyelim ;
root@ubuntucuk:/home/coslat/pcap# p0f -h
p0f: invalid option — ‘h’
Usage: p0f [ -f file ] [ -i device ] [ -s file ] [ -o file ]
[ -w file ] [ -Q sock [ -0 ] ] [ -u user ] [ -FXVNDUKASCMROqtpvdlrx ]
[ -c size ] [ -T nn ] [ -e nn ] [ ‘filter rule’ ]
-f file – read fingerprints from file
-i device – listen on this device
-s file – read packets from tcpdump snapshot
-o file – write to this logfile (implies -t)
-w file – save packets to tcpdump snapshot
-u user – chroot and setuid to this user
-Q sock – listen on local socket for queries
-0 – make src port 0 a wildcard (in query mode)
-e ms – pcap capture timeout in milliseconds (default: 1)
-c size – cache size for -Q and -M options
-M – run masquerade detection
-T nn – set masquerade detection threshold (1-200)
-V – verbose masquerade flags reporting
-F – use fuzzy matching (do not combine with -R)
-N – do not report distances and link media
-D – do not report OS details (just genre)
-U – do not display unknown signatures
-K – do not display known signatures (for tests)
-S – report signatures even for known systems
-A – go into SYN+ACK mode (semi-supported)
-R – go into RST/RST+ACK mode (semi-supported)
-O – go into stray ACK mode (barely supported)
-r – resolve host names (not recommended)
-q – be quiet – no banner
-v – enable support for 802.1Q VLAN frames
-p – switch card to promiscuous mode
-d – daemon mode (fork into background)
-l – use single-line output (easier to grep)
-x – include full packet dump (for debugging)
-X – display payload string (useful in RST mode)
-C – run signature collision check
-t – add timestamps to every entry
‘Filter rule’ is an optional pcap-style BPF expression (man tcpdump).
Ağ arabirimini üzerinden geçen trafiği dinleyip anlık olarak sonuç verebilir.
-S : Bilinen sistemler için imzaları raporla
-v : 802.1q Vlan frame desteğini aktif eder.
-l : Çıktıyı satır satır ver.
root@ubuntucuk:/home/coslat/pcap# p0f -S -v -l
p0f – passive os fingerprinting utility, version 2.0.8
(C) M. Zalewski <[email protected]>, W. Stearns <[email protected]>
p0f: listening (SYN) on ‘eth0’, 262 sigs (14 generic, cksum 0F1F5CA2), rule: ‘all’.
192.168.5.205:50969 – Linux 2.6 (newer, 2) (up: 15 hrs) Signature: [S4:64:1:60:M1460,S,T,N,W6:.] -> 209.85.227.106:80 (distance 0, link: ethernet/modem)
192.168.5.205:50970 – Linux 2.6 (newer, 2) (up: 15 hrs) Signature: [S4:64:1:60:M1460,S,T,N,W6:.] -> 209.85.227.106:80 (distance 0, link: ethernet/modem)
192.168.5.205:54475 – Linux 2.6 (newer, 2) (up: 15 hrs) Signature: [S4:64:1:60:M1460,S,T,N,W6:.] -> 209.85.227.138:80 (distance 0, link: ethernet/modem)
^C+++ Exiting on signal 2 +++
[+] Average packet ratio: 60.00 per minute.
Dinlediği ağ arabirimi üzerinden “192.168.5.205” ip adresine ait sistemin “Linux 2.6” çekirdeğine sahip olduğunu ve bu tespiti [S4:64:1:60:M1460,S,T,N,W6:.] imzasına göre yaptığını söyledi.
Promiscuous modda dinleme yapmak için ;
-p : Promiscuous moda geç.
root@ubuntucuk:/home/coslat/pcap# p0f -S -v -l -p
p0f – passive os fingerprinting utility, version 2.0.8
(C) M. Zalewski <[email protected]>, W. Stearns <[email protected]>
p0f: listening (SYN) on ‘eth0’, 262 sigs (14 generic, cksum 0F1F5CA2), rule: ‘all’.
192.168.5.61:1522 – Windows XP/2000 (RFC1323+, w+, tstamp-) [GENERIC] Signature: [65535:128:1:52:M1460,N,W1,N,N,S:.:Windows:?] -> 91.103.140.2:80 (distance 0, link: ethernet/modem)
192.168.5.61:1522 – Windows XP/2000 (RFC1323+, w+, tstamp-) [GENERIC] Signature: [65535:127:1:52:M1460,N,W1,N,N,S:.:Windows:?] -> 91.103.140.2:80 (distance 1, link: ethernet/modem)
192.168.5.61:1523 – Windows XP/2000 (RFC1323+, w+, tstamp-) [GENERIC] Signature: [65535:128:1:52:M1460,N,W1,N,N,S:.:Windows:?] -> 91.103.140.2:80 (distance 0, link: ethernet/modem)
^C+++ Exiting on signal 2 +++
[+] Average packet ratio: 720.00 per minute.
Kaydedilmiş trafiği analiz etmek
-S : Bilinen sistemler için imzaları raporla.
-v : 802.1q Vlan frame desteğini aktif eder.
-o : Çıktıyı dosyaya yaz.
-l : Çıktıyı satır satır ver.
root@ubuntucuk:/home/coslat/pcap# p0f -v -s p0f.pcap -o analiz.log -l
p0f – passive os fingerprinting utility, version 2.0.8
(C) M. Zalewski <[email protected]>, W. Stearns <[email protected]>
p0f: listening (SYN) on ‘p0f.pcap’, 262 sigs (14 generic, cksum 0F1F5CA2), rule: ‘all’.
[+] End of input file.
root@ubuntucuk:/home/coslat/pcap# cat analiz.log
<Wed May 26 17:11:09 2010> 192.168.2.13:1134 – Windows 2000 SP4, XP SP1+ -> 83.66.162.3:80 (distance 1, link: ethernet/modem)
<Wed May 26 17:11:15 2010> 192.168.2.7:1055 – Windows 2000 SP4, XP SP1+ -> 178.18.193.27:80 (distance 0, link: ethernet/modem)
<Wed May 26 17:11:15 2010> 192.168.2.7:1055 – Windows 2000 SP4, XP SP1+ -> 178.18.193.27:80 (distance 1, link: ethernet/modem)
<Wed May 26 17:11:20 2010> 192.168.5.144:3244 – Windows 2000 SP4, XP SP1+ -> 208.78.70.70:8245 (distance 0, link: ethernet/modem)
Farklı bir p0f imza veritabanınız varsa, -f parametresi ile p0f imza veritabanını kullanabilirsiniz
root@ubuntucuk:/home/coslat/pcap# p0f -v -l -f /etc/p0f/p0f.fp -s p0f.pcap -o analiz.log