Closed bheru27 closed 7 years ago
There isn't a way in the current version to get the version of NMAP.
To add this as a feature, I would need to add a new function that runs nmap -v
and uses regex to grab the version and return it as a string. Would that work for you?
no no, i mean, when yo do an nmap scan, you get somethng like PORT STATE SERVICE VERSION 25/tcp filtered smtp 80/tcp open http nginx 1.6.2 110/tcp open pop3 Dovecot pop3d 143/tcp open imap Dovecot imapd 443/tcp open ssl/http nginx 465/tcp open ssl/smtp Postfix smtpd 587/tcp open smtp Postfix smtpd 993/tcp open ssl/imap Dovecot imapd 995/tcp open ssl/pop3 Dovecot pop3d
but the library only shows 'http', 'pop3'... would we cool if we could get also the "dovecot", "nginx" ... part :)
Thanks for the quick reply!
If the information is output by NMAP, then I should be able to grab it an include it in the output. I'll try to find some time to look into this within the next week.
Just to give you an update, I'm working on this. However, I'm doing a full Typescript to ES6 conversion first since my old code for this module isn't very maintainable.
@Johnhhorton any news?
@cojack Finished converting to ES6 from TypeScript on a separate branch tonight. I still need to add this requested feature and update the documentation.
@bheru27 Checking out the JSON I'm getting from NMAP with OsAndPortScan, I get this kind of data:
"$": {
"protocol": "tcp",
"portid": "10001"
},
"state": [
{
"$": {
"state": "open",
"reason": "syn-ack",
"reason_ttl": "64"
}
}
],
"service": [
{
"$": {
"name": "scp-config",
"method": "table",
"conf": "3"
}
}
]
}
What NMAP flags are you using for your scans in NMAP to get the additional output? I need to be able to reproduce your scan to get the desired keys to make available in the final output. If I can reproduce the data, I can have the new version out that night.
There will be breaking changes in this at the require level. I was using pretty poor practices before, so you'll just need to change how you're requiring it (I'll include the changes in the documentation). The code base still isn't great, but it's much more manageable for adding new features.
Thanks for being patient guys, work and home live have been busy this past month.
Got it: -sV
I'll have the new version up soon.
Since -sV will probe for ports and attempt to gather additional information. use
const nmap = require('./index');
let scan = new nmap.NmapScan("google.com", "-sV");
node-nmap will attempt to gather additional options returned from the port/service if they exist.
"port": 443,
"protocol": "tcp",
"service": "http",
"tunnel": "ssl",
"method": "probed",
"product": "ssl"
}
the key product
will contain the information you're looking for. Note: if a value isn't returned, the key will not be set.
New version has been published. @cojack @bheru27
@Johnhhorton thanks :)
Hi, I was wondering if you could include the option to get the version of the services running, I dont know if it would be much trouble, but this is what the library needs, would be really awesome to include that since im working in a big project where we are using it.
Or if it is already there and im not seeing it, please guide me, thanks.