Nsm Console 1
NSM Console (Network Security Monitoring Console) network paketlerini analiz etmek için geliştirilmiş bir framework. Opensource tcp/ip analiz araçlarının bir araya getirilerek oluşturulduğu framework modüler bir yapıya sahip, ileri düzey programlama bilgisine sahip olmadan ek moduller geliştirmenizi mümkün kılıyor.
Sık kullanılan bazı komutlar ;
toogle = Modülü aktif/deaktif etmenizi sağlar
file = Analiz edeceğiniz pcap formatındaki dosyayı tanımlar
list = Modülleri ve durumlarını listeler
run = Seçili modül/ler ile analiz işlemini başlatır
info = Modül hakkında bilgi verir
exec= Komut çalıştırmayı sağlar
Analiz işlemi için Tshark ile bir süre networkü dinleyip tüm paketleri lol.pcap dosyasına yazdıralım ;
coslat@ubuntucuk:~/pcap$ sudo tshark -i eth0 -w lol.pcap
Running as user “root” and group “root”. This could be dangerous.
Capturing on eth0
3483
Kaydettiğimiz trafikten resim dosyaları, ofis dökümanları, sıkıştırılmış dosyalar vs. gibi verileri ayıklamak ve bir kopyasını almak istiyor olalım.
Bunun için tcpxtract modülünü aktif edip lol.pcap dosyasını analiz edebiliriz.
coslat@ubuntucuk:~/İndirilenler/nsm-console$ sudo ./nsm
[sudo] password for coslat:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
,.—.
,,,, / _ `.
\\\\ / \ )
|||| /\/“-.__\/ NSM
::::/\/_
{{`-.__.-‘(`(^^(^^^(^ 9 `.=========’
{{{{{{ { ( ( ( ( (—–:=
{{.-‘~~’-.(,(,,(,,,(__6_.’=========.
::::\/\
|||| \/\ ,-‘/\ console
//// \ “ _/ )
”” \ ` /
`—”
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
NSM Console version 0.7
Loading modules from: modules
Loading ngrep.module…done.
Loading snort.module…done.
Loading harimau.module…done.
Loading chaosreader.module…done.
Loading iploc.module…done.
Loading foremost.module…done.
Loading yahsnarf.module…done.
Loading tcpdstat.module…done.
Loading bro-ids-stream.module…done.
Loading trace-summary.module…done.
Loading bro-ids-protocol.module…done.
Loading tshark.module…done.
Loading tcpick.module…done.
Loading tcpxtract.module…done.
Loading ip2asn.module…done.
Loading tcpflow.module…done.
Loading hash.module…done.
Loading flowtag.module…done.
Loading p0f.module…done.
Loading honeysnap.module…done.
Loading tcptrace.module…done.
Loading fl0p.module…done.
Loading flowtime.module…done.
Loading bro-ids-conn.module…done.
Loading capinfos.module…done.
Loading pads.module…done.
Loading argus-basic.module…done.
Loading aimsnarf.module…done.
Loading clamscan.module…done.
29 modules loaded.
Loading categories from modules/categories
Loading nsm…done.
Loading flow…done.
Loading statistics…done.
Loading forensics…done.
Loading IDS…done.
5 categories loaded.
Logging to logs/nsm-log.2010526.log
Default ${OUTPUT_DIR} is ‘${PCAP_BASE}-output’
Default ${MODULE_DIR} is ‘modules’
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Welcome to NSM Console, type ‘help’ to see available commands
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Note: All modules are DISABLED by default, use ‘list’ to list available
modules and ‘toggle <module>’ to disable/enable a module.
nsm> toggle capinfos
capinfos module turned on.
nsm> run capinfos
===> module capinfos running…
Directory lol.pcap-output/capinfos already exists, not recreating
–> capinfos /home/coslat/pcap/lol.pcap >> lol.pcap-output/capinfos/lol.pcap.capinfos
nsm> exec cat /home/coslat/nsm-console/lol.pcap-output/capinfos/lol.pcap.capinfos
Executing: cat /home/coslat/nsm-console/lol.pcap-output/capinfos/lol.pcap.capinfos
File name: /home/coslat/pcap/lol.pcap
File type: Wireshark/tcpdump/… – libpcap
File encapsulation: Ethernet
Number of packets: 3483
File size: 862335 bytes
Data size: 806583 bytes
Capture duration: 95 seconds
Start time: Wed May 26 10:43:21 2010
End time: Wed May 26 10:44:57 2010
Data byte rate: 8455.64 bytes/sec
Data bit rate: 67645.11 bits/sec
Average packet size: 231.58 bytes
Average packet rate: 36.51 packets/sec
Exit status: 0
nsm> file /home/coslat/pcap/lol.pcap
Setting ${PCAP_FILE} = /home/coslat/pcap/lol.pcap
Setting ${PCAP_BASE} = lol.pcap
nsm> info tcpxtract
The tcpxtract module attempts to extract files from a pcap file.
http://tcpxtract.sourceforge.net/
To edit the extraction settings, change the ${MODULE_DIR}/${MODULE_NAME}.module/tcpxtract.conf
file.
nsm> toggle tcpxtract
tcpxtract module turned on.
nsm> run
Executing analysis…
===> module tcpxtract running…
Creating directory lol.pcap-output/tcpxtract
–> tcpxtract -f /home/coslat/pcap/lol.pcap -c modules/tcpxtract.module/rp-tcpxtract.conf -o lol.pcap-output/tcpxtract
Found file of type “png” in session [192.168.5.205:10624 -> 65.54.48.173:18183], exporting to lol.pcap-output/tcpxtract/00000000.png
Found file of type “gzip” in session [209.85.227.99:20480 -> 192.168.5.205:9956], exporting to lol.pcap-output/tcpxtract/00000001.gzip
===> module tcpxtract finished.