Linux Network Commands: RTFM


Some handy little network commands you should know.

$ watch ss -tp
$ netstat -ant
$ netstat -tulpn
$ lsof -i
$ smb:// ip /share
$ share user x.x.x.x c$
$ smbclient -U user\\\\ ip \\ share
$ ifconfig eth# ip / cidr
$ ifconfig ethO:l ip / cidr
$ route add default gw gw_ip
$ ifconfig eth# mtu [size]
$ export MAC=XX:XX:XX:XX:XX:XX
$ ifconfig int hw ether MAC
$ macchanger -m MAC int
$ iwlist int scan
$ dig -x ip
$ host ip
$ host -t SRV _service_tcp.url.com
$ dig @ ip domain -t AXFR
$ host -l domain namesvr
$ ip xfrm state list
$ ip addr add ip / cidr dev ethO
$ /var/log/messages | grep DHCP
$ tcpkill host ip and port port
$ echo "1" /proc/sys/net/ipv4/ip_forward
$ echo "nameserver x.x.x.x" /etc/resolv.conf

Thanks to Red Team.

 

Advertisements