Fix erroneous 'noping' in various circumstances
nmap's raw IP facility is prone to mistakes in various environments. Disable the raw IP handling by telling nmap to run as if it didn't have privilege
This commit is contained in:
parent
56d468f669
commit
fb02c18853
@ -179,7 +179,7 @@ sub nmap_pping {
|
||||
my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions");
|
||||
my $more_options = $nmap_options[0];
|
||||
|
||||
open (FPING, "nmap -PE --system-dns --send-ip -sP $more_options ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
|
||||
open (FPING, "nmap -PE --unprivileged --system-dns --send-ip -sP $more_options ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
|
||||
my $node;
|
||||
while (<FPING>) {
|
||||
if (/Host (.*) \(.*\) appears to be up/) {
|
||||
|
@ -641,9 +641,9 @@ sub process_request_nmap {
|
||||
|
||||
foreach my $ip6 (0,1) { #first pass, ipv4, second pass ipv6
|
||||
if ($ip6 and scalar(@ip6s)) {
|
||||
open($fping,"nmap -6 -PS$ports,3001 -n --send-ip -p $ports,3001 $more_options ".join(' ',@ip6s). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
open($fping,"nmap --unprivileged -6 -PS$ports,3001 -n --send-ip -p $ports,3001 $more_options ".join(' ',@ip6s). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
} elsif (not $ip6 and scalar(@ips)) {
|
||||
open($fping,"nmap -PE -n --send-ip -p $ports,3001 $more_options ".join(' ',@ips). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
open($fping,"nmap --unprivileged -PE -n --send-ip -p $ports,3001 $more_options ".join(' ',@ips). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
} else { next; }
|
||||
while (<$fping>) {
|
||||
if (/Interesting ports on ([^ ]*)[: ]/ or /Nmap scan report for ([^ ]*)/) {
|
||||
|
Loading…
Reference in New Issue
Block a user