Nessus’un beðendiðim ozelliklerinden biri de komut satirindan kullanilabilmesidir. Böylece komut satýrýnýn gücünü de kullanarak nessus taramalarýný istediðimiz gibi þekillendirebiliyoruz.
Mesela kullandýðýmýz sistemleri her gece saat xx de otomatik olarak belirli açýklýklara karþý tarayýp alarm üretebiliyoruz ya da yeni Nessus’un pluginlerini güncel tutup yeni bir açýklýk çýktýðýnda bu açýklýðýn hangi sistemlerimizde olduðunu kolayca öðrenebiliriz.
Komut satýrý Nessus kullanýmý için nessuscmd komutu kullanýlýr. Hem Linux hem de Windows için kullanýlabilir.(nessuscmd)
Komut satýrýndan hangi tür taramalar yapýlabilir?
- Host Keþfi
Port Taramalarý Zaafiyet tarama Yerel güvenlik açýklýklarýnýn taranmasý(user/pass/sertifika ister)
Nessus’un çalýþma mantýðýný hatýrlayacak olursak istemci-sunucu mimarisinde çalýþýrdý. Yani Nessus taramalarini yapan bir motor ve bu motoru yoneten istemci programi. Nessuscmd burada istemci tarafýný oynadýðý için oyunun tamamlanabilmesi için Nessus motoru(sunucu tarafý)nun da çalýþýyor olmasý gerekir.
NOTE: Nessuscmd’nin çalýþmasý için nessus motorunun ayný hostta çalýþmasýna gerek yoktur, uzaktaki bir Nessus motoruna baðlanarak da çalýþabilir. Bunun için aþaðýdaki parametrelerin verilmesi yeterli olacaktýr.
Connecting to a remote Nessus scanner : ————————————— –remote : Connect to the remote Nessus host –remote-port : Connect to the remote Nessus on port –login : Connect to the remote Nessus with the login [optional] –password : Connect to the remote Nessus with the password [optional]
Nessus motoru çalýþmadan yapýlacak bir tarama aþaðýdakine benzer bir çýktý verecektir.
# nessuscmd -sT localhost
Could not open /opt/nessus//var/nessus/nessus.sock (Connection refused) Make sure nessusd is running and that you have the privileges to open this socket
Ayný taramayý Nessus motorunu çalýþtýrarak yapalým.
# /opt/nessus/sbin/nessusd &
[1] 17288 bt ~ # nessusd (Nessus) 3.2.1. for Linux (C) 1998 – 2008 Tenable Network Security, Inc.
Processing the Nessus plugins… [##################################################]
All plugins loaded
# nessuscmd -sT localhost
Starting nessuscmd 3.2.1 Scanning ‘localhost’…
+ Results found on localhost : - Port ssh (22/tcp) is open - Port http (80/tcp) is open - Port nessus (1241/tcp) is open
Nessuscmd ile Port Tarama
Nessuscmd, Nmap benzeri bir port tarama listesi kullanýr fakat tarama seçenekleri Nmap’inki kadar detaylý ve esnek deðildir.
Port tarama seçenekleri
—————— -p : Enable the port scanner and scan this port range (use ‘default’ for the Nessus default port range) -sT : Perform a TCP connect() -sS : Perform a SYN scan -sP : Perform a PING scan
-O : Enable OS Fingerprinting
—————–
Nessuscmd ile belirli bir açýklýðý taramak
Nessus’da tüm açýklýklar bir id ile belirtilir. Mesela yeni çýkan Microsoft MS08-067 açýklýðý için kullanýlacak Nessus plugin’inin id’si #34477. Ben hedef sistemlerde sadece bu açýklýðý test etmek istersem aþaðýdaki gibi bir komut iþimi görecektir.
#nessuscmd -i 34477 hedef_ip adresi
Birden fazla plugini denemek için -i parametresinden sonra pluginler arasýna , koyulur.
#nessuscmd 192.168.1.1 -i 15000,1700,18000,19000 gibi.
Ek olarak birden fazla açýklýðý birden fazla sistem üzerinde denemek için
#nessuscmd 192.168.1.0/24 -p 20-80 -i 20000,20001,20002
gibi bir komut yeterli olacaktir.
Yerel sistem açýklýklarýný test etmek
# nessuscmd -vv -i 22869 –ssh-login root –ssh-password parolam 10.0.0.100
Nessuscmd ile birlikte gelen diðer kullaným özelliklerini öðrenmek için
# nessuscmd -h
nessuscmd 3.2.1 – (C) 2006 – 2008 Tenable Network Security, Inc.
Usage: nessuscmd target…
Port Scan options: —————— -p : Enable the port scanner and scan this port range (use ‘default’ for the Nessus default port range) -sT : Perform a TCP connect() -sS : Perform a SYN scan -sP : Perform a PING scan
-O : Enable OS Fingerprinting
Ping options: ————– -P0 : Do not ping the remote hosts prior to a scan -PI : Do an ICMP ping -PT : Do a TCP ping -PA : Do an ARP ping (only on the local subnet) Ping options can be combined – ie: -PIT performs a TCP and an ICMP ping
Vulnerability Scan options: ————————— -i : Enable plugin This option can be used multiple times – ie: -i 12209 -i 20368 -i 16337,10884 See http://www.nessus.org/scripts.php for a list of plugins -N : do NOT enable plugin dependencies -V : Display the complete report of the plugins -q : Only display wether a plugin matches or not -U : DISABLE safe checks
Credentials: ————————— SMB : (Windows) –smb-login : SMB login –smb-password : SMB password to use
–smb-domain : SMB domain to log into
–smbi : Interactively ask for SMB credentials
SSH : –ssh-login : SSH login –ssh-password : SSH password to use –ssh-pubkey : SSH public key to use –ssh-privkey : SSH private key to use –ssh-passphrase : Passphrase for the SSH key to use –sshi : Interactively ask for SSH credentials Warning: Using ssh credentials for the scan makes you vulnerable to a mitm attack
Telnet/Rlogin/Rsh: –cleartext-login : Clear text login –cleartext-password : Clear text password to use Warning: Using clear text credentials for a scan is dangerous
Using a .audit file: ————————————— –unix-audit : .audit file to use for the local Unix compliance checks –windows-audit : .audit file to use for the local Unix compliance checks
Connecting to a remote Nessus scanner : ————————————— –remote : Connect to the remote Nessus host –remote-port : Connect to the remote Nessus on port –login : Connect to the remote Nessus with the login [optional] –password : Connect to the remote Nessus with the password [optional]
Other options: ————– -v : Be verbose during the scan -h : Display this help
–recv-timeout : Plugins recv() timeout –max-hosts : Number of hosts to scan in parallel -o name=value : nessusd option -f /path/to/socket : use an alternative Unix socket Examples : ———- nessuscmd -p 1-1024 localhost nessuscmd -O 10.0.1.2 nessuscmd -V -i 10884 172.1
Saygýlar..
|