Scanning and Sniffing
- https://danielmiessler.com/study/tcpdump/
Filtering options
tcpdump -nnSX port 80 # The only command to remember
tcpdump -i eth0 # listen on your interface
tcpdump host 1.1.1.1 # filter on host
tcpdump src 1.1.1.1 # filter on source
tcpdump dst 1.0.0.1 # filter on destination
tcpdump net 1.2.3.0/24 # filter on ... yes you guess it
tcpdump ip6
tcpdump icmp # filter using protocol
tcpdump portrange 21-23
Combining
Combine options using and (&&), or (||) and not (!).
Complex queries need single quotes
Reading and writing to file
Save the file and view the packetsNmap Probing
Windows and UID 0 User on Linux | non-UID 0 on Linux |
---|---|
Same subnet : ARP only | TCP SYN to port 80 |
ICMP Echo Request | TCP SYN to port 443 |
TCP SYN to port 443 | No ICMP used |
TCP ACK to port 80 | |
ICMP Timestamp Request |
-Pn
assume hosts are up
Network Sweep
Optimizing Host Detection
-PSports
use TCP SYN to specified ports-PE
use ICMP Echo Request
One host TCP / UDP
NSE
---script-trace
for detailed output
- --script-args
to pass arguments
Database location
---script-updatedb
update script database
IPv6 support
-6
for IPv6, not supported on all versions {{% /panel %}}
IPv6 discovery
ping6 ff02::1 # All IPv6 hosts multicast address = 255.255.255.255 in IPv4
ping6 ff02::2 # All IPv6 routers multicast address
ip neigh # Show cached neighbors find by ping6
Netcat port
Windows ping sweep
Usage
Usage is similar to Nmap
Output Files
-oB
for binary file output to save space--readscan
to convert to other formats