Paleidžiant 'nmap' be 'sudo' atliekamas TCP skanavimas, kai su 'sudo' atliekamas SYN skanavimas.
nmap pagalba
$ man nmap
$ nmap
# nmap dokumentacija
http://nmap.org/book/man.html
Komanda '-v' rodo, kas vyksta skanavimo metu
$ nmap -v localhost
Starting Nmap 6.40 ( http://nmap.org ) at 2014-07-25 23:23 EEST
Initiating Ping Scan at 23:23
Scanning localhost (127.0.0.1) [2 ports]
Completed Ping Scan at 23:23, 0.00s elapsed (1 total hosts)
Initiating Connect Scan at 23:23
Scanning localhost (127.0.0.1) [1000 ports]
Discovered open port 139/tcp on 127.0.0.1
Discovered open port 445/tcp on 127.0.0.1
Discovered open port 631/tcp on 127.0.0.1
Completed Connect Scan at 23:23, 0.02s elapsed (1000 total ports)
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00044s latency).
Not shown: 997 closed ports
Prievadai ir portai nustatomi pagal /etc/services
PORT STATE SERVICE
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp
Skanavimo rezultatų išvedimui naudojamas '-oN'(outputNormal), '-oS'(<rIpt kIddi3)
$ nmap -v -oS nmap.log localhost
$ cat nmap.log
$tart1ng nmAP 6.40 ( http://nmap.OrG ) at 2014-07-25 23:41 E3ST
Nmap scaN r3poRT f0r l0caLh0$t (127.0.0.1)
hoSt iS up (0.00048z lAtEncy).
NOt $hoWn: 997 cl0s3D port$
p0RT STaTE S3RV!C3
139/Tcp 0p3n n3tbI0s-SSn
445/tcp Open micR0soFt-ds
631/tcp 0PeN ipp
Detalesnė informacija apie procesą, naudojant 'netstat -ntlp', parodo prievado :631 vykdomą procesą 'cupsd'
$ sudo netstat -ntlp | grep :631
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2652/cupsd
tcp6 0 0 ::1:631 :::* LISTEN 2652/cupsd
Udp portų skanavimas su nmap '-sU'(scanUdp)
netstat komanda su '-nulp'(p -progran_name) parametru, galima peržiūrėti lokalios mašinos prievadus ir palyginti rezultatus
$ sudo nmap -v -sU localhost
...
$ netstat -nulp
...
Nmap komanda atvaizduojanti ip adresus ir mašrutų lentelę
sudo nmap --iflist
-sV rodo servisų versijas
sudo nmap -sV localhost
Starting Nmap 6.40 ( http://nmap.org ) at 2015-04-27 22:27 EEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000023s latency).
Not shown: 995 closed ports
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.7 ((Ubuntu))
139/tcp open netbios-ssn Samba smbd 3.X (workgroup:
Parodo svetainės http turinį:
sudo nmap -p80 --script http-title localhost
Atspausdina surastas http direktorijos failus:
sudo nmap -p80 --script http-enum localhost
Dar detalesnė informacija:
sudo nmap -p80 --script http-enum --script-args http-enum.displayall localhost