9

I am trying to get familiar with hacking and networking by doing HackTheBox challenges. At starting point Oopsie I am supposed to use command nmap -sS -A 10.10.10.28. However, after running it in Ubuntu 20.04 I got following error: Starting Nmap 7.91 ( https://nmap.org ) at 2021-01-25 20:07 CET Couldn't open a raw socket. Error: Permission denied (13). At https://github.com/microsoft/WSL/issues/2039 I read, that this feature is not implemented in nmap. Is there any way to open a raw socket in my operating system with this tool?

Marek Mudron
  • 93
  • 1
  • 1
  • 3
  • 1
    You link to a WSL issue - Are you running WSL (Windows Subsystem for Linux? If so, this is critical information to someone trying to answer your question, and you should mention it and tag it as windows-subsystem-for-linux. Note that the issue you linked to says that support for raw sockets is limited in *WSL*, not in *nmap* (which is what you said in your question). – NotTheDr01ds Jan 26 '21 at 19:54

2 Answers2

28

Did you install nmap using:
$ sudo snap install nmap
or
$ sudo apt install nmap
I had this same issue, I installed using snap and was getting the same error as you. If that is the case remove the snap install and use apt:
$ sudo snap remove nmap
$ sudo apt install nmap

run a command with nmap, if you get the error:
bash: /snap/bin/nmap: No such file or directory
use the following command to let go of the cached link:
hash -r
run nmap again,this worked for me.

How I got my answer.

soul
  • 296
  • 3
  • 3
20

You have to grant network access to nmap with: snap connect nmap:network-control

Melardev
  • 301
  • 2
  • 4