Nmap
Jump to navigation
Jump to search
( ) /\ _ ( \ | ( \ ( \.( ) _____ \ \ \ ` ` ) \ ( ___ / _ \ (_` \+ . x ( .\ \/ \____-----------/ (o) \_ - .- \+ ; ( O \____ (__ +- .( -'.- <. \_____________ ` \ / (_____ ._._: <_ - <- _- _ VVVVVVV VV V\ \/ . /./.+- . .- / +-- - . (--_AAAAAAA__A_/ | (__ ' /x / x _/ ( \______________//_ \_______ , x / ( ' . / . / \___' \ / / / _/ / + | \ / ' (__/ / \/ / \ NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND RESPONSIBLY
Links
- http://nmap.org/man/de/
- http://nmap.org/svn/docs/
- http://www.Netzmafia.de/software/net-doku.html#nmap
utrace
IP-Adressen und Domainnamen lokalisieren
sitedossier.com
Subdomains finden, Domains nach IP finden:
Parameter
nmap -sT 192.168.178.0/24 -p 22 -oG ssh & cat ssh
nmap -sT -PN 192.168.178.0/24 -n -p22 -v --open nmap -sT -PN 93.132.0-10.2-253 -n -p22 --open -v | grep "Discovered open port 22/tcp" | cut -d" " -f6 > /games/hosts nmap -sT -PN -p22 123.123.1-254.1-254 --open -n | grep -v filtered | grep -v closed | grep -v ^$ >/tmp/vulns cut /tmp/vulns -d" " -f4 | grep -v "STATE" | grep -v "ssh" | grep -v \( | tr -d ':' >> /tmp/hosts.txt cat /tmp/hosts.txt | sort | uniq > /tmp/tmp mv /tmp/tmp /tmp/hosts.txt
nmap --script=smb-enum-users 192.168.0.3 -p 445|perl -le 'while(<STDIN>){if(/^.*?\\(\w+)\s+.*/) { print "$1"; }}' >> userlist #Scan TCP with OS detection nmap -sT -O 127.0.0.1 #Scan UDP with OS detection nmap -sU -O 127.0.0.1 #Scan SSH & SMTP in verbose mode nmap -sV 127.0.0.1 -p 22,25
#MAC Adressem auslesen nmap -sP 192.168.189.0/24 Starting Nmap 5.00 ( http://nmap.org ) at 2011-06-12 16:52 CEST Host 192.168.0.1 is up (0.00024s latency). MAC Address: 00:50:56:47:3C:31 (VMWare)
Scan Methoden
- sS SYN-Scan. Auch dabei beginnt der Scanner mit einem SYN-Segment. Es wird jedoch keine vollständige TCP-Session aufgebaut. Ist der Port auf dem Zielhost im LISTENING und antwortet mit einem SYN/ACK, sendet Nmap sofort ein RST-Segment (RESET). Dadurch wird die halboffene (half-open) Verbindung wieder abgebaut. Mit der SYN-Scan Technik kann unter Umständen eine Erkennung des Portscans durch das Target vermieden werden.
- sF FIN-Scan. Nmap sendet dazu FIN-Segmente an das Target. Diese werden eigentlich zum Beenden einer TCP-Sitzung genutzt. Das Zielsystem sollte an geschlossenen Ports mit einem RST reagieren und auf listening (abhören) Ports das FIN-Segment einfach verwerfen.
- Xmas-Tree-Scan (Option -sX) sind in einem Segment das FIN, URG und PSH-Flag gesetzt. Je nach Implementierung reagieren die Zielsysteme recht verschieden auf ein solches Segment.
- sN Null-Scan. Nmap sendet Segmente ohne gesetzte Flags an das Target.
Wie bei allen Scan-Techniken können die Resultate durch Firewalls und Filter zwischen Nmap und Target beeinflusst werden. Auf jeden Fall sollte der Admin das Verhalten seiner eigenen Systeme bei diesen Portscans kennen.
- UDP Portscans -sU. UDP ist das verbindungslose Protokoll der TCP/IP-Suite. Normalerweise sollte ein System auf ein UDP-Segment an einen geschlossenen Port mit einem "ICMP Port Unreachable" reagieren. Offene UDP-Ports sollten keine Reaktion erzeugen. Heute wird allerdings ICMP oft rigoros gefiltert. Dadurch sind UDP-Scans mitunter nicht sehr zuverlässig. Viele Betriebssysteme begrenzen die Rate von ICMP-Paketen. Dadurch sind UDP-Scans bei vielen Systemen sehr langsam.
Allgemeine Optionen
- Kein Ping -P0
- Fingerprint -O
- Fragmentierung -f
- Verbose -v
- Port-Bereiche -p
- Quell-IP-Adresse -S
- Interface -e
[root] ~ $ nmap -sT -O m0n0 Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2005-05-01 17:59 CEST Interesting ports on m0n0 (10.0.0.1): (The 1610 ports scanned but not shown below are in state: closed) Port State Service 80/tcp open http Remote operating system guess: FreeBSD 4.7-RELEASE Uptime 30.096 days (since Fri Apr 1 15:41:28 2005) Nmap run completed -- 1 IP address (1 host up) scanned in 17.254 seconds
root ~ $ nmap -sT work.example.org Starting nmap V. 2.54BETA31 ( www.insecure.org/nmap/ ) Failed to lookup device subnet/netmask: eth0: no IPv4 address assigned QUITTING!
Eigentlich nutzt dieser vServer das Interface eth0:vs4 mit der IP-Adresse 10.0.0.4: root ~ $ nmap -sT -e eth0:vs4 -S 10.0.0.4 work.example.org Starting nmap V. 2.54BETA31 ( www.insecure.org/nmap/ ) WARNING: If -S is being used to fake your source address, you may also have to use -e and -P0. WARNING: -S will not affect the source address used in a connect() scan. (The 1549 ports scanned but not shown below are in state: closed) Port State Service 22/tcp open ssh 80/tcp open http Nmap run completed -- 1 IP address (1 host up) scanned in 0 seconds
- Mit Timing -T Paranoid|Sneaky|Polite|Normal|Aggressive|Insane kann das Timing von Nmap verändert werden. Mit -T Paranoid wartet Nmap bis zu 5 Minuten zwischen den einzelnen Packeten. Dadurch soll die Entdeckung durch ein IDS erschwert werden.
- Bei "Insane" wird das Target praktisch mit Packeten bombardiert.
IP-Netze können in CIDR-Notation (z.B. /24) oder mit Sternchen (z.B. 192.168.*.*) angegeben werden.
// Hier werden alle Adressen von 10.0.0.0 und 10.0.0.255 mit einem FIN-Scan überprüft
[root] ~ $ nmap -sF -T insane 10.0.0.0/24 Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2005-05-01 18:49 CEST Host 10.0.0.0 seems to be a subnet broadcast address (returned 1 extra pings). Skipping host. All 1611 scanned ports on m0n0 (10.0.0.1) are: filtered RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 Interesting ports on wrt54g (10.0.0.55): (The 1610 ports scanned but not shown below are in state: closed) Port State Service 80/tcp open http Interesting ports on 10.0.0.101: (The 1610 ports scanned but not shown below are in state: closed) Port State Service 6000/tcp open X11 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 All 1611 scanned ports on 10.0.0.120 are: closed Host 10.0.0.255 seems to be a subnet broadcast address (returned 1 extra pings). Skipping host. Nmap run completed -- 256 IP addresses (4 hosts up) scanned in 238.816 seconds // SYN Stealth Scan auf eine m0n0wall (IP 10.0.0.1) mit Erkennung des Betriebssystems [root] ~ $ nmap -sS -O -v -T insane 10.0.0.1 Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2005-05-01 18:58 CEST Host m0n0 (10.0.0.1) appears to be up ... good. Initiating SYN Stealth Scan against m0n0 (10.0.0.1) at 18:58 Adding open port 80/tcp The SYN Stealth Scan took 148 seconds to scan 1611 ports. For OSScan assuming that port 80 is open and port 1 is closed and neither are firewalled Insufficient responses for TCP sequencing (2), OS detection may be less accurate Interesting ports on m0n0 (10.0.0.1): (The 1610 ports scanned but not shown below are in state: closed) Port State Service 80/tcp open http Remote operating system guess: FreeBSD 4.7-RELEASE Uptime 30.139 days (since Fri Apr 1 15:41:28 2005) Nmap run completed -- 1 IP address (1 host up) scanned in 154.481 seconds