Networking

Routing

1
# Check Routes
2
sudo route
3
​
4
# Add route with route
5
sudo route add -net 192.168.222.0 netmask 255.255.255.0 gw 10.175.34.1 tap0
6
​
7
# Remove route with route
8
sudo route del -net 192.168.222.0 netmask 255.255.255.0 gw 10.175.34.1 tap0
9
​
10
# Add route with ip
11
sudo ip route add 192.168.222.0/24 via 10.175.34.1
12
​
13
# Remove route with ip
14
sudo ip route del 192.168.222.0/24 via 10.175.34.1
Copied!

Arp Spoofing

1
sudo apt-get install dsniff
2
sudo arpspoof
3
​
4
echo 1 > /proc/sys/net/ipv4/ip_forward
5
arpspoof -i <INTERFACE> -t <TARGETSERVER> -r <TARGETCLIENT>
Copied!

Port Scanning

Nmap

1
# Full port scan
2
nmap -sS -p- -A <host> -T5 -oN outputfilename
3
​
4
# Ping sweep
5
nmap -sn <host>
6
​
7
# Host discovery, no ping
8
nmap -n -sn -PS22,135,443,445 <host>
9
​
10
# DNS discovery
11
sudo nmap -sS -sU -p53 -n <host>
Copied!

Hping / Hping3

1
​
Copied!

DNS

1
nslookup
2
> server <IP>
3
> set q=NS (Or any other type, MX, A etc)
4
> <DNSName, eg google.com)
5
​
6
# Dig
7
dig @<serverIP> <DNSname> -t AXFR +nocookie
8
​
9
# Host
10
host -t axfr <DNSName> <SERVERIP>
Copied!
Last modified 11mo ago