harryhorton / node-nmap

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

Use spoof source IP #28

Open qq351844 opened 7 years ago

qq351844 commented 7 years ago

Hi,

I want to use spoof source IP to do the detection destination IP and port. What should I do to change the source IP?

Thanks!!

harryhorton commented 7 years ago

From the README:


//    Accepts array or comma separarted string for custom nmap commands in the second argument.
var nmapscan = new nmap.NmapScan('127.0.0.1 google.com', '-sn');

nmapscan.on('complete',function(data){
  console.log(data);
});
nmapscan.on('error', function(error){
  console.log(error);
});

nmapscan.startScan();

You can replace -sn in the second paramter with whatever argument string you'd normally pass to nmap (other than the destinations).