Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nmap error: nmap: netutil.cc:3285: int route_dst_netlink(const sockaddr_storage*... #385

Closed
tokyoneon opened this issue Nov 6, 2018 · 16 comments

Comments

@tokyoneon
Copy link

@tokyoneon tokyoneon commented Nov 6, 2018

Describe the bug:

Using privileged scan types (-sU) with Nmap returns the following error:

nmap: netutil.cc:3285: int route_dst_netlink(const sockaddr_storage*, route_nfo*, const char*, const sockaddr_storage*): Assertion `p != NULL` failed.

To Reproduce:

  1. Create a Debian App.

  2. Add Kali repos:

     echo 'deb https://http.kali.org/kali kali-rolling main contrib non-free' >> /etc/apt/sources.list
    
  3. Add Kali signing key:

     wget -q -O - https://www.kali.org/archive-key.asc | apt-key add -
    
  4. Update and install Nmap:

     apt-get update && apt-get install nmap -y
    
  5. Perform Nmap scan as root:

     nmap -Pn -n -sU -A --top-ports 10 <target ip address>
    

Screenshot:

nmap_error

Device Information:

Device: Nexus 6P
Android Version: 8.1.0
UserLAnd Version 1.0.0

Some network/routing info:

# android/userland can see the router
$ ping 10.42.0.1

PING 10.42.0.1 (10.42.0.1) 56(84) bytes of data.
64 bytes from 10.42.0.1: icmp_seq=1 ttl=64 time=12.3 ms
64 bytes from 10.42.0.1: icmp_seq=2 ttl=64 time=14.0 ms
64 bytes from 10.42.0.1: icmp_seq=3 ttl=64 time=13.3 ms
64 bytes from 10.42.0.1: icmp_seq=4 ttl=64 time=3.62 ms
64 bytes from 10.42.0.1: icmp_seq=5 ttl=64 time=106 ms
64 bytes from 10.42.0.1: icmp_seq=6 ttl=64 time=67.10 ms
64 bytes from 10.42.0.1: icmp_seq=7 ttl=64 time=3.54 ms
64 bytes from 10.42.0.1: icmp_seq=8 ttl=64 time=8.27 ms

# normal routing table; only one gateway
$ route -n 

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.42.0.0       0.0.0.0         255.255.255.0   U     0      0        0 wlan0

# dns requests go over 10.42.0.1
$ cat /etc/resolv.conf 
nameserver 10.42.0.1

# access to internet without errors
$ curl 'https://wtfismyip.com/json'

 {
   "YourFuckingIPAddress": "185.220.100.252",
   "YourFuckingLocation": "Germany",
   "YourFuckingISP": "F3 Netze e.V.",
   "YourFuckingCountryCode": "DE"
}
@corbinlc
Copy link
Member

@corbinlc corbinlc commented Nov 13, 2018

Hmm... looks like it had trouble getting the name associated with the network interface. Can you enable proot logging (from settings enable it and turn the verbosity level to 9), then rerun the failing commands and then grab the PRoot_Debug_Log file from your (real or emulated) sdcard and send it to us one way or the other?

@tokyoneon
Copy link
Author

@tokyoneon tokyoneon commented Nov 13, 2018

Thanks! Here you go:

@corbinlc
Copy link
Member

@corbinlc corbinlc commented Nov 13, 2018

Sorry, can you provide the list of commands you ran when you were creating that debug log file. I am seeing a bit more than just the nmap call. If you don't remember exactly, can you delete the old debug log (from the settings) and repeat what you did and provide both the PRoot_Debug_Log and the copy and paste of what you ran in the term and what responses you got.

@corbinlc
Copy link
Member

@corbinlc corbinlc commented Nov 13, 2018

PRoot logs are very low level so I need to understand what is going on at a higher level to unravel it. If will probably ultimately be trying flow out myself, but if you could provide this one more piece of data for now, that would help.

@tokyoneon
Copy link
Author

@tokyoneon tokyoneon commented Nov 13, 2018

PRoot_Debug_Log.txt.zip
Sorry about that, I wasn't sure if the 50M came from older logs or generated after increasing verbosity. Attached is an updated log. Here's every command I ran:

  1. entered ssh password via ConnectBot
  2. $ su need root for nmap
  3. $ nmap -Pn -n -sTUV --reason -T4 -A --top-ports 15 -vv 10.42.0.1
  4. $ cd /sdcard
  5. $ python3 -m http.server 9999 created an http server to access the debug log from another device on the network

@tokyoneon
Copy link
Author

@tokyoneon tokyoneon commented Nov 17, 2018

@corbinlc is there anything I can do to help with this?

@corbinlc
Copy link
Member

@corbinlc corbinlc commented Nov 23, 2018

Not now. I am sorry. This specific issue is a little lower down in the priority list right now. That being said, I will update you as soon as I am looking at it and as soon as I need anything. Thanks!

@corbinlc
Copy link
Member

@corbinlc corbinlc commented Feb 1, 2019

@tokyoneon we still don't have a solution for this, but we saw your article. It is well written. Can we get your permission to use part of the step by step instructions in our README?

@BestPinguin
Copy link

@BestPinguin BestPinguin commented Apr 27, 2019

So how did you fix this issue? I have the same problem with UserLand on Debian and Kali. I didn't find any answer about it, help me please 😅
@tokyoneon

@tokyoneon
Copy link
Author

@tokyoneon tokyoneon commented Apr 27, 2019

@BestPinguin from what I understand, while it's possible to open a "root" terminal within the UserLAnd OS, you're not actually root in the Android OS. To run privileged Nmap scans (e.g., -sS and -sU) or switch the Wi-Fi interface to monitor mode for Wi-Fi hacking, actual root is required. You may want to have a look at this and this which came up in a quick Google search, but I haven't tried finding a workaround since opening this issue last year. Sorry!

@tokyoneon tokyoneon closed this Apr 27, 2019
@reksores
Copy link

@reksores reksores commented Apr 30, 2019

@tokyoneon same problem here...so i need root my telephone to solve this issue ... ooofffff :(

@ghost
Copy link

@ghost ghost commented May 2, 2019

Hi, i have the same problem and im root ( root checker basic say so). In termux nmap run without a problem

@kianoosh21
Copy link

@kianoosh21 kianoosh21 commented Nov 4, 2019

I'm having this issue and I've been searching for this for a while but there were no useful instructions I'm running kali linux nethunter on my phone and every time I try to use nmap I come across this error:

nmap: netutil.cc:3285: int route_dst_netlink(const sockaddr_storage*, route_nfo*, const char*, const sockaddr_storage*): Assertion p != NULL failed.

@captago
Copy link

@captago captago commented Jul 28, 2020

IMG_20200728_232012

@TheTangledMind
Copy link

@TheTangledMind TheTangledMind commented Mar 18, 2021

Screenshot:

nmap_error

I am having the same issue using Kali-nethunter. My device is rooted.

@TheTangledMind
Copy link

@TheTangledMind TheTangledMind commented Mar 18, 2021

Screenshot_20210319-091454_NetHunter Terminal.jpg

incase my screenshot provides any more info
********* Edit*********

I will note that nmap works fine if I use -sL
So it seems to only be a issue if I am trying to do a port scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants