harryhorton / node-nmap

NPM package for interfacing with local NMAP installation
MIT License
67 stars 26 forks source link

Include vendor in nmap result output #23

Closed tbwiss closed 7 years ago

tbwiss commented 7 years ago

Could you please include the following line of code in the index.js file:

tempHostList[hostLoopIter].vendor = xmlInput[hostLoopIter]["address"][addressLoopIter]["$"]["vendor"];

It adds the vendor to the result array of the nmap scan.

for (var addressLoopIter = 0; addressLoopIter < xmlInput[hostLoopIter]["address"].length; addressLoopIter++) {
                        //If IPv4, Mac, or unknown.  Get the type and add it or log the type found.
                        if (xmlInput[hostLoopIter]["address"][addressLoopIter]["$"]["addrtype"] === 'ipv4') {
                            tempHostList[hostLoopIter].ip = xmlInput[hostLoopIter]["address"][addressLoopIter]["$"]["addr"];
                        }
                        else if (xmlInput[hostLoopIter]["address"][addressLoopIter]["$"]["addrtype"] === 'mac') {
                            tempHostList[hostLoopIter].mac = xmlInput[hostLoopIter]["address"][addressLoopIter]["$"]["addr"];
                                   **NEW LINE OF CODE HERE**
                        }
                        else {
                        }

Thank you very much!

harryhorton commented 7 years ago

Absolutely. I'll take a look at this soon and merge in your request. Also, if you create a merge request, I'll approve it and publish the new version to NPM.

harryhorton commented 7 years ago

I've added the vendor to the output. Let me know how it works out for you.

tbwiss commented 7 years ago

Just tested it. Works like a charm. Thanks!

harryhorton commented 7 years ago

Great, let me know if you need anything else. Code for the project is pretty ugly as I build this module in 2015, but if I can muddle through it to add a feature, I'll be happy to.

harryhorton commented 7 years ago

Closing.