Shell commands focused on network
Debian
apt install -y iputils-ping # for ping
apt install -y dnsutils # for dig, etc.
apt install -y net-tools # for netstat, etc.
apt install -y nmap
CentOS
yum install -y bind-utils # for nslookup, etc.
yum install -y nmap # for ncat, etc.
Basic commands
ping example.com
traceroute example.com
lsof -i -P -n
lsof -i -P -n | grep LISTEN
nc -l -p 1337 # the receiver
nc localhost 1337 # the sender
# then type something, then enter, it should be transfered to the receiver
Telnet method
Nmap method (/!\ may bypass restrictions)
nmap -Pn -p 4648 15.0.0.93
Nmap method
ARP method
sudo arp-scan --interface=<current_interface> --localnet
tcpdump -i any host 10.0.5.37
tcpdump -i any port 443
tcpdump -i any port 443 and host 10.0.0.1 or host 10.0.0.2 or host 10.0.0.3
tcpdump -ni any port 443 and host 10.0.0.1 or host 10.0.0.2 or host 10.0.0.3
iptables -L -t nat
# pour faire un clean
iptables -F -t nat