Skip to content

Recent version of 'nmap -S <IP>' fail with 'setup_target: failed to determine route to <IP>'. It works on an older version #2955

@tom-crane

Description

@tom-crane

Describe the bug

This command,

nmap -e eth0 -S <source IP> -Pn -p 80,443 <webserver hostname>

works as expected using nmap-5.51. The command is run on a server on a network which has a border firewall. The webserver is on the outside of the firewall. By default all packets are dropped on the firewall. The server has rules on the firewall granting it access to the webserver etc. The motivation is to check the firewall is working and its ruleset is intact. The Source IP address is for an unused IP on the same network as the server. That IP has no access through the firewall.

The same command on the same server fails with nmap-7.92 fails with

setup_target: failed to determine route to webserver IP

To Reproduce
Command as above

Expected behavior
The webserver ports are reported as filtered showing the firewall ruleset is working. This works with nmap-5.51, giving,

PORT STATE SERVICE
80/tcp filtered http
443/tcp filtered https

Version info (please complete the following information):

  • OS: Alma9 linux, kernel 5.14.0-427.40.1.el9_4.x86_64
  • Output of nmap --version:

./nmap --version

Nmap version 5.51 ( http://nmap.org )

nmap --version

Nmap version 7.92 ( https://nmap.org )
Platform: x86_64-redhat-linux-gnu
Compiled with: nmap-liblua-5.3.5 openssl-3.0.7 libz-1.2.11 libpcre-8.44 libpcap-1.10.0 nmap-libdnet-1.12 ipv6
Compiled without: libssh2
Available nsock engines: epoll poll select

NB: nmap-5.51 was built from source with './configure --without-openssl --without-zenmap' without which this old version would not build under Alma9.

  • Output of nmap --iflist
    NB: Other interfaces for other networks not included and IPs obfuscated for privacy.

nmap --iflist

Starting Nmap 7.92 ( https://nmap.org ) at 2024-10-25 19:27 BST
INTERFACES
DEV (SHORT) IP/MASK TYPE UP MTU MAC
lo (lo) 127.0.0.1/8 loopback up 65536
lo (lo) ::1/128 loopback up 65536
eth0 (eth0) 123.123.129.45/22 ethernet up 1500 52:54:00:00:00:00

ROUTES
DST/MASK DEV METRIC GATEWAY
123.123.128.0/22 eth0 100
0.0.0.0/0 eth0 100 123.123.128.4
::1/128 lo 0

Additional context
An explicit but IP/hostname obfuscated example command,

nmap -e eth0 -S 123.123.129.67 -Pn -p 80,443 www.ourdomain.ac.uk
Starting Nmap 7.92 ( https://nmap.org ) at 2024-10-25 19:44 BST
setup_target: failed to determine route to www.ourdomain.ac.uk(123.123.146.64)
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.09 seconds

Thanks
Tom Crane

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions