WSL: nmap not working

  • Windows Version Number: 10.0.15063
  • Bash Version: Ubuntu 16.04

-After installing nmap, when I try running sudo nmap -v -sn 192.168.0.0/16 to scan my network for devices I get the error: Couldn't open a raw socket. Error: Permission Denied (13)

-When running nmap -v -sn 192.168.0.0/16 without using sudo I get the error: Problem binding to interface , errno: 92 socket_bindtodevice : protocol not available

  • The output I should be receiving is (example): Initiating Ping Scan at 20:14 Scanning 4096 hosts [2 ports/host] Completed Ping Scan at 20:14, 33.00s elapsed (4096 total hosts) Initiating Parallel DNS resolution of 4096 hosts. at 20:14 Completed Parallel DNS resolution of 4096 hosts. at 20:14, 0.01s elapsed Nmap scan report for amazon-3c5740640.home (192.168.1.13) Host is up (0.095s latency).

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 205
  • Comments: 101 (16 by maintainers)

Most upvoted comments

Please don’t add +1* replies - they just dilute an issue’s signal to noise ratio. Use reactions on the original post to signal your votes: image

Thanks for reporting the issue. WSL currently has limited support for raw sockets. Please give us feedback on UserVoice so we can prioritize the work - https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo

For everyone upvoting here, thanks, we understand that this is an important ask. I would also recommend heading down to the user voice and upvoting there as well. We use that to prioritize.

#1349. User Voice is here.

more than one year passed without solution 😕

+1

+100

that has 1426 votes now ? how many votes need ?

You don’t understand. Our votes do not really count. The uservoice website is just a simulation so you think your opinion matters, but in fact it doesn’t.

They blatantly use the name Linux but in fact they don’t really want a full blown Linux distro, and instead they just needed a dev environment beucause they realized linux has everything and setting up a dev env on powershell is a painful experience.

Why ppl like Linux because Linux has fewer restrictions, people can do more what they want to do. Please don’t bring the limit from windows to the WSL.if only can do the windows can do,why we should be use WSL?

Soo,when could be the problem soloved?

https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/17817685-support-af-packet-address-family-tcpdump-wireshar

that has 1426 votes now ? how many votes need ?

upvote in uservoice instead

The uservoice links just report “Forbidden” and nothing else?

2 Years and still nothing

Please don’t +1 in comments - upvote in uservoice instead. +1’s are difficult for us to measure and dilute discussions on issue threads.

Closing since this is a dup of #1349

Mainly because nmap is a (one of many) precursor for many distributed systems which won’t run on WSL without proper network support. If we just wanted nmap, as you suggest, then wouldn’t bother running WSL 😃

On Wed, Aug 15, 2018 at 1:31 PM SecInfo007 notifications@github.com wrote:

Why not just download the nmap binary installer to windows, install it and run it in either Powershell or command prompt? Works fine… It’s obvious that Kali and other WSL apps will not work using nmap. Hoping for next updates will fix this issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/WSL/issues/2039#issuecomment-413183438, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIre57-wieuo7-2Y2IsMOG0ykti85xCks5uRBSZgaJpZM4NMvac .

I think even better way to use nmap on windows is to just launch docker container with nmap. You don’t even need to switch to linux containers if you use windows ones.

Advantages:

  1. No need to install and maintain nmap installation and all dependencies
  2. Fully reproducible scenario regardless of where you run it
  3. Always latest and up to date version of nmap
  4. Faster execution time then on WSL

Command is docker run --rm --platform=linux instrumentisto/nmap -p 3389 --script ssl-enum-ciphers 10.40.129.61

PS C:\Users\admin> docker run --rm --platform=linux instrumentisto/nmap -p 3389 --script ssl-enum-ciphers 10.40.129.61
Starting Nmap 7.70 ( https://nmap.org ) at 2018-08-15 10:49 UTC
Nmap scan report for 10.40.129.61
Host is up (0.051s latency).

PORT     STATE SERVICE
3389/tcp open  ms-wbt-server
| ssl-enum-ciphers:
|   TLSv1.0:
|     ciphers:
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (secp256r1) - A
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA (dh 1024) - A
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA (dh 1024) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
|     compressors:
|       NULL
|     cipher preference: server
|     warnings:
|       Broken cipher RC4 is deprecated by RFC 7465
|       Ciphersuite uses MD5 for message integrity
|       Key exchange (dh 1024) of lower strength than certificate key
|       Weak certificate signature: SHA1
|   TLSv1.1:
|     ciphers:
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (secp256r1) - A
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA (dh 1024) - A
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA (dh 1024) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
|     compressors:
|       NULL
|     cipher preference: server
|     warnings:
|       Broken cipher RC4 is deprecated by RFC 7465
|       Ciphersuite uses MD5 for message integrity
|       Key exchange (dh 1024) of lower strength than certificate key

+1

just tried on the latest windows 10 insider fast ring and wsl 2 and this now seems to work.

I hear ya. Please do give UV that feedback too: Ultimately though, they are likely blocking your campus network for a reason. Are you able to tunnel non-student traffic out via a separate static IP address?

FWIW, I have been pushing for Microsoft to offer a great community “forum” for a while. Let’s see if I can be annoying enough that someone eventually says “fine, do it”! 😉

Lucky you! Glad you’re unblocked. Thanks again for your help diagnosing this.

I understand the desire for nmap functionality, but the “+1” comments on are not helpful. Please use our User Voice to help us prioritize this work.

@moderators, please lock the comments. it’s annoying to receive notifications with “+1”, when everyone could instead subscribe.

So the problem hasn’t been solved yet?

Even though this issue is already closed I would like to hint other that you can use windows installed nmap from you wsl. Solution is presented here: https://medium.com/@the4rchangel/nmap-in-the-windows-bash-shell-64cadff1a689

In short: Install nmap on windows and add alias nmap='"/mnt/c/Program Files (x86)/Nmap/nmap.exe"' to you .bashrc.

让我认为nmap有一个bug

Was just about to ask if you could try again after “changing location” by VPNing into EU or USA. I’ve reported to UserVoice - will ping this thread when I hear back from them.

Thanks for reporting.