8

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?

1
  • 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). Jan 26, 2021 at 19:54

2 Answers 2

24

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.

1
  • Works like a charm :)
    – mdikici
    Nov 8, 2021 at 17:02
15

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

1
  • thanks that fixed my system Ubuntu 21.10
    – Mike Q
    Apr 26, 2022 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.