NMAP Specific Port?

I am trying to figure out if my Xbox 360 is on or off and it does not respond to pings. Any ideas? This is what I found out. If I run nmap there are two ports that show active: 2177 and 3391. So if I run:

nmap -Pn -p 3391 192.168.0.21

It will return up. Won’t work without -Pn. Problem is after I turn the Xbox 360 off, it still returns up. Any idea why and other thoughts how to do this?

What exactly are the outputs of the nmap command when the device is on and off?

Here’s what I get:

WHEN ON:
C:\temp\nmap\nmap-7.80>nmap -Pn -p 2177 192.168.0.21
WARNING: Could not import all necessary Npcap functions. You may need to upgrade to the latest version from https://npcap.org. Resorting to connect() mode -- Nmap may not function completely
Starting Nmap 7.80 ( https://nmap.org ) at 2020-02-29 08:48 Central Standard Time
Nmap scan report for fr-xbox…. (192.168.0.21)
Host is up (0.0020s latency).

PORT     STATE SERVICE
2177/tcp open  qwave

Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds


WHEN OFF:
C:\temp\nmap\nmap-7.80>nmap -Pn -p 2177 192.168.0.21
WARNING: Could not import all necessary Npcap functions. You may need to upgrade to the latest version from https://npcap.org. Resorting to connect() mode -- Nmap may not function completely
Starting Nmap 7.80 ( https://nmap.org ) at 2020-02-29 08:48 Central Standard Time
Nmap scan report for fr-xbox…. (192.168.0.21)
Host is up.

PORT     STATE    SERVICE
2177/tcp filtered qwave

Nmap done: 1 IP address (1 host up) scanned in 2.05 seconds

So major differences, when off says “filtered” for the state whatever that means and took longer to complete.

Same with port 3391 but service is savant instead of qwave.

Looks like the xbox360 isn’t really off when it is ‘off’. You can use those differences as a test though .

Is there any way thru the NMAP component in HA of running nmap and filtering the results? Assuming I can do so by calling the nmap command and doing an | awk command with it but not sure if that can be done scan_options?