hping3 -S <IP> -p <port>
= Simple SYN packet to specified port. This will send packets until manually stopped. ADD -c <#> to specify an amount of packets to send.
hping3 -S --scan 1-1000 <IP>
= Scan ports 1-1000
hping3 -S --scan 80,22,3389 <IP>
= Scan specified ports
hping3 -S --scan <all/known>
= Scan all ports or well known ports
-sU
= UDP Scans DONT FORGET TO DO THEM
-sI
= Idle scan.
Determining a zombie
nmap -O -v <IP> -p <KnownOpenPort>
Once a zombie has been identified
If port is OPEN
If port is CLOSED
Sending IDLE scan
nmap -Pn -sI <ZombieIP>:<port> <TargetIP> -v -p <ports>
nmap -S <ZombieIP> <TargetIP> -p <Port> -Pn -n -e <interface> --disable-arp-ping
-n
= No DNS resolution. Speeds up scans and produces less noise
-b
= FTP bounce scan. Will utilize the FTP server to send scans, hiding our original IP.
-sN
= Null scan. No bits are set in the TCP flag header.
-sF
= FIN scan. Only sets TCP FIN bit.
-sX
= XMAS scan. Sets FIN,PSH,URG bits.
-sA
= ACK scan. Used to determine firewall rules.
nmap -sS -Pn --disable-arp-ping -n -d -v -p 80 192.168.0.0/24
hping3 -S -r -p <port> <IP>
= -r dispalys the relative ID field.
hping3 -a <ZombieIP> -S -p <port> <TargetIP>
/usr/share/nmap/scripts
nmap --script-updatedb
= Update script database
nmap --script-help <script>
= Display script usage
nmap --script whois-domain <domain> -sn
= No port scan; obtain whois info from specified domain
nmap --script smb-os-discovery -p 445 <TargetIP>
= SMB discovery of target
nmap --script smb-enum-shares <TargetIP> -p 445
= Enumerate SMB shares and any anonymous permissions
Running categories of scripts against targets:
nmap --script <category> <target>
Netcat:
nc <TargetIP> <Port>
Telnet:
telnet <TargetIP> <Port>
Use NMAP for active fingerprinting with -sV and -O options.
P0f is a passive fingerprinting tool.
p0f
will start the listener
pof -i <interface>
to specify an interface to listen on
http://nmap.org/book/man-bypass-firewalls-ids.html
Fragmentation
Has become obsolete due to modern technology.
nmap -sS -f <Target>
nmap -sS --mtu <8/16/24/32>
- has to be a multiple of 8
nmap -sS --data-length 10 -p <Port> <TargetIP>
= Appends 10 bytes of data to the packet
Decoys
nmap -sS -D <DecoyIP>,<DecoyIP>,<DecoyIP>,ME,<DecoyIP> <TargetIP>
nmap -sS -D RND:<#> -Pn -n --disable-arp-ping <TargetIP>
= Set random decoy IPs
Timing
nmap -sS -T<1-5> <TargetIP>
nmap -sS --scan-delay 1m <TargetIP>
nmap -sS --scan-delay 1m --max-retries 1 -p <Ports> <TargetIP>
hping3 -S --scan <Ports> <TargetIP> -i <seconds>
Source Port
nmap -sS --source-port <Port> <TargetIP>
OR
nmap -sS -g <Port> <TargetIP>
MAC Spoofing
nmap -sS --spoof-mac <Vendor> -Pn --disable-arp-ping <TargetIP>
= Spoof mac to a known vendor MAC address
nmap -sS --spoof-mac 0 -Pn --disable-arp-ping <TargetIP>
= Set random MAC
nmap -sS --spoof-mac <MAC> -Pn --disable-arp-ping <TargetIP>
= Manually set MAC address
Randomize Hosts
nmap -sS -Pn -n --disable-arp-ping -p <Port> <TargetIP> --randomize-hosts