2

I'm experimenting with nmap and i am trying to find my android phone on my local network from my laptop. I know the phones local IP is 192.168.2.2, and when i run

nmap -sn 192.168.2.2

it finds it

Nmap done: 1 IP address (1 host up)...

but when i just add sudo in front of it, it says

Nmap done: 1 IP address (0 hosts up)...

Why does it find my phone when i ping it as a regular user, but not when i ping it as root? And am i missing some crucial knowledge to understand this?

someoneb100
  • 141
  • 1
  • 13

1 Answers1

1

You need to run as sudo with elevated privileges in order to allow nmap to create raw sockets, otherwise nmap defaults to using default probing which is sending SYN packets to ports 80 and 443 using the connect system call:

Read more answers here:

Petrus K.
  • 840
  • 7
  • 27
  • 56