Is it possible to use nmap to ping like a url with an embedded port number? .

How would I ping this? http://openleadr.org:8911/OpenADR2/Simple/2.0b?

I think nmap -p 8911 openleadr.org would work but doesn't it leave off the remaining URL? /OpenADR2/Simple/2.0b

Would it also make a difference if the site was https?

  • nmap scans IP hosts, so the only part of the url it can work with is the hostname/IP. you can tell nmap to filter ports to test specific ones, but directories on the server path are scoped to the Application, not the host, and are not scan-able with nmap. application characteristics may be used for fingerprinting a service or OS, but their presence is all that nmap might notice. on https, once again, nmap doesn't care much about applications like an http server instance. its just scanning a host, that has ports opened by apps. – Frank Thomas Apr 19 at 21:53

I think you are mixing up a few things here. A ping test works using ICMP and will therefore only check network-layer connectivity.

nmap -p will simply check whether there is some process listening on that port. Therefore it checks transport-layer end-to-end connectivity.

What you seem to be trying to achieve is to check if there is a process responding with HTTP traffic, right? If that is all you want to do, then you could simply consider to create a HTTP (or HTTPS) request using curl. Depending on what you are trying to inspect about that HTTP endpoint you could parse specific information from the response. For example, although curl may return an HTTP response, this does not mean that the remote host considers the request successfull. To determine that, you would need to check the response code or body.

  • thanks so curl http://openleadr.org:8911/OpenADR2/Simple/2.0b ill give this a try... – HenryHub Apr 19 at 19:06
  • If you are unable to complete the request you can still use the tools to do a bottom-up analysis why you can't get an HTTP response. E.g. first, check network-layer connectivity using ping. Then, use nmap to "move up layer by layer". In your specific example however, there is no port listening on that port (at least when checking from my side). – jvda Apr 19 at 19:11
  • 1
    Nmap could speak HTTP – it comes with a wide variety of scripts for different application protocols (e.g. scanning TLS ciphers, probing SMB servers), and I'd be surprised if making HTTP requests wasn't one of them, though of course they're more aimed towards generic/automatic queries and not so much towards custom user input. – user1686 Apr 19 at 19:21
  • In a similar direction as @user1686 said, you can use the flags -sV to detect the service (and version). This will show you if there is actually HTTP/HTTPS even on a non-standardized port. – jvda Apr 19 at 19:38

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.