IP Forwarding
Info
Detects whether the remote device has ip forwarding or "Internet connection sharing" enabled, by sending an ICMP echo request to a given target using the scanned host as default gateway.
Check status
enable ip forwarding
How to identify systems on the local LAN
Use your favourite ARP scanning to identify systems on the local LAN. Save the output (I use to arp.txt in the example below).
For IPv4
arp-scan -l
arp-scan -l
arp
arp -a
For IPv6
ip
ip -6 neighbor
Nmap Usage
sudo nmap -sn --script ip-forwarding --script-args='target=www.example.com'
Example:
Nessus
Look for 'IP Forwarding Enabled'
Gateway Finder
https://github.com/pentestmonkey/gateway-finder
Gateway-finder is a scapy script that will help you determine which of the systems on the local LAN has IP forwarding enabled and which can reach the Internet.
Usage
Collet mac address of the hosts you want to check
arp-scan -l | tee arp.txt
Step 2: Run gateway-finder on the list of local systems
Gateway-finder needs two bits of input from you:
The MAC addresses of the potential gateways
The IP address of a system on the Internet (I use a google.com address in the example below):
If arp.txt also contains an IP of each system on the same line as the MAC, you'll get much nicer output. If you need to use a different network interfaces, use the -I option.
python gateway-finder.py -f arp.txt -i 209.85.227.99
Gateway Finder imp
Link: https://github.com/whitel1st/gateway-finder-imp
Usage:
sudo python3 gateway-finder-imp.py
-h
- help-M <MAC>
- use file with next-hop MACs-m <file_with_MACs>
- use selected next-hop MAC-d <IP>
- use selected destination IPs-D <file_with_IPs>
- use file with selected destination IPs-i <interface_name>
- use selected network interface-p <port_1> <port_2> ... <port_n>
- use ports--v
- verbose mode--vv
- maximum verbosity
examples
gateway-finder-imp.py -d 8.8.8.8 -m de:ad:be:af:de:ad -i enp0s31f6
use selected next-hop MAC and selected destination IPgateway-finder-imp.py -D dst_hosts.txt -M next_hop_macs.txt -i wlp3s0
- use selected next-hop MAC and file with selected destination IPsgateway-finder-imp.py -d 8.8.8.8 -M next_hop_macs.txt -i eth0
- use file with next-hop MACs and file with selected destination IPsgateway-finder-imp.py -D file_with_dst_IPs.txt -M file_with_nex_hop_MACs.txt -i eth1 -p 22 443 80 8080 23
gateway-finder-imp.py -d 2a00:1450:4010:c05::64 -M mac_with_ipv6_0.txt -i wlp3s0 -p 443 80 -6 --vTries to find a layer-3 gateway to the Internet. Attempts to reach an IP
Last updated