Nc/netcat/ncat/nmap/socat Tips
[Overview]
To be clear, nc and netcat are the same thing, ncat is part of the nmap suite, and ncat and socat both claim to be enhanced versions of nc.
Scocat ports release slowly.
[Echo]
1. TCP echo
1.1 Only echo, not print.
ncat -c cat -k -l 6666ncat -e /bin/cat -k -l 6666
1.2, echo and print.
socat -d -d -v tcp-l:6666,fork exec:'/bin/cat' #Two-d's to show connection status
2. UDP echo.
ncat -c cat -k -u -l 6666ncat -e /bin/cat -k -u -l 6666
[Chat]
1. Ncat one-on-one chat. (Print does not echo)
host1$ ncat -lp 6666host2$ ncat host1 6666
2, NC one-on-one chat. (Same as NCAT)
host1$ nc -lp 6666host2$ nc host1 6666
[Port forwarding]
TCP port forwarding. (ncat port forwarding)
#Listen on native port 7777 and forward data to 192.168.7.8 port 8888 ncat --sh-exec "ncat 192.168.7.8 8888" -l 7777 --keep-open
[nmap common scanning command]
#Quickly scan the famous ports of one host nmap -F -n -sTU -v 192.168.0.xx#Quickly scan the famous ports of multiple hosts nmap -F -n -sTU -v 192.168.0.130-168#Scan the ports of 20-200 nmap -n -sTU -v -p 20-200 192.168.0.xx
[Scan dhcp server]
1. DHCP protocol details
2, Nmap scanning tutorial network basic services DHCP service class
#broadcast (broadcast-dhcp-discover) nmap --script broadcast-dhcp-discover#Specify host.(dhcp-discover)nmap -sU -p 67 --script=dhcp-discover 192.168.0.xx
Related Reading: King of Port Scanning--nmap Introduction (1)
*** walker ***