Last active
April 16, 2020 14:20
-
-
Save CallMarl/7070de2fb0f110db0ba47f6899538df0 to your computer and use it in GitHub Desktop.
Linux networking command (debian)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display all know device with hostname if it's know | |
arp | |
# Display all entry about revelant hostname or ip | |
arp -a hostname | |
arp -a ipaddr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the ip address of URL | |
dig www.google.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display networking information | |
ip a | |
# Clean interface addresses | |
ip addr flush eth0 | |
# Bring up the interface | |
# (if the hotplug option is activate, ask for dhcp serveur) | |
ifup eth0 | |
# Bring down the interface | |
# (if the interface is connected by dhcp lease, remove the dhcp lease) | |
ifdown eth0 | |
# show routing table | |
ip route list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display listening tcp port | |
netstat -tnlp | |
# Display listenig udp port | |
netstat -unlp | |
# Display Ipv4 only | |
netstat -utnlp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Scan port to 1024 | |
nmap 127.0.0.1 | |
# Scan port range | |
nmap -p 0-65535 | |
# Scan local network | |
nmap -T4 -sP 192.168.1.0/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install -y \ | |
net-tools \ | |
tcpdump \ | |
dnsutils \ | |
nmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Try to join specific ip | |
ping 8.8.8.8 | |
# Check dns by ping with domaine name | |
ping www.google.com | |
# Flood with ping (run as administatoe only) | |
ping -f 127.0.0.1 | |
# Ping one time | |
ping -c 1 8.8.8.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display the current route | |
route -n | |
# Adding routing rule | |
route add -net 192.168.2.0 gw 0.0.0.0 dev eth0 | |
# Removing routing rule | |
route del -net 192.168.2.0 gw 0.0.0.0 dev eth0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dump all trafic | |
tcpdump | |
# Dump all trafic except ssh port | |
tcpdump not port 22 | |
# Dump trafic of specific interface | |
tcpdump -i eth0 | |
tcpdump -i eth0 not port 22 | |
# Dump specific ports | |
tcpdump port 80 and port 443 | |
tcpdump port 53 | |
# Dump arp traffic | |
tcpdump -i eth0 arp | |
# Set verbosity from 1 to 6 | |
tcpdump -v | |
tcpdump -vvvvvv | |
# Display paquet content ascii | |
tcpdump -i eth0 -A | |
# Display pasquet content hex + ascii | |
tcpdump -i eth0 -X | |
# Store dump in file | |
tcpdump -w dump.pcap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Traceroute to destination | |
traceroute 8.8.8.8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment