Git Product home page Git Product logo

Comments (4)

Ullaakut avatar Ullaakut commented on August 15, 2024 1

Here is what you'd get from a run of nmap -sn -PE <ip> with this library (it would be marshalled into a go struct though)

───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: output.xml
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ <?xml version="1.0" encoding="UTF-8"?>
   2   │ <!DOCTYPE nmaprun>
   3   │ <?xml-stylesheet href="file:///usr/local/bin/../share/nmap/nmap.xsl" type="text/xsl"?>
   4   │ <!-- Nmap 7.80 scan initiated Mon Apr 27 08:51:02 2020 as: nmap -sn -PE -oX output.xml localhost -->
   5   │ <nmaprun scanner="nmap" args="nmap -sn -PE -oX output.xml localhost" start="1587970262" startstr="Mon Apr 27
       │ 08:51:02 2020" version="7.80" xmloutputversion="1.04">
   6   │ <verbose level="0"/>
   7   │ <debugging level="0"/>
   8   │ <host><status state="up" reason="localhost-response" reason_ttl="0"/>
   9   │ <address addr="127.0.0.1" addrtype="ipv4"/>
  10   │ <hostnames>
  11   │ <hostname name="localhost" type="user"/>
  12   │ <hostname name="localhost" type="PTR"/>
  13   │ </hostnames>
  14   │ </host>
  15   │ <runstats><finished time="1587970262" timestr="Mon Apr 27 08:51:02 2020" elapsed="0.02" summary="Nmap done at
       │  Mon Apr 27 08:51:02 2020; 1 IP address (1 host up) scanned in 0.02 seconds" exit="success"/><hosts up="1" do
       │ wn="0" total="1"/>
  16   │ </runstats>
  17   │ </nmaprun>

So yes, I can confirm that with this method you can validate whether a host responds to the ping. However, remember that you need to be root to use ICMP mode, otherwise it will revert to TCP.

from nmap.

Ullaakut avatar Ullaakut commented on August 15, 2024

Hi @hazcod!

Can you give some more details on what exactly you expect and what doesn't work as-is? The example code you wrote doesn't work for you?

Thanks :)

from nmap.

hazcod avatar hazcod commented on August 15, 2024

Hi @Ullaakut , I would want to know if a host responds to ICMP at all.
I'm not sure what results to interpret if it doesn't. Will it return no Hosts? No Ports?

from nmap.

Ullaakut avatar Ullaakut commented on August 15, 2024

I'm currently working so I can't check it right away, but if you want I'll give it a try this evening and let you know :) Also to see it by using the nmap command line, you can simply run nmap with -X to export it to XML, and the data that you will see in the XML output should be accessible from this library.

from nmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.