Skip to content

Commit d29758b

Browse files
committed
Prevent duplicate logging of nmap command line
1 parent 483132b commit d29758b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

analyze_hosts.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def do_portscan(host, options, logfile, stop_event):
484484
if len(scripts):
485485
arguments.append('--script=' + ','.join(scripts))
486486
logging.info('%s Starting nmap', host)
487-
logging.debug('nmap %s %s', ' '.join(arguments), host)
487+
logging.log(COMMAND, 'nmap %s %s', ' '.join(arguments), host)
488488
if options['dry_run']:
489489
return ALLPORTS
490490
try:
@@ -496,8 +496,6 @@ def do_portscan(host, options, logfile, stop_event):
496496
scanner[x].state() == 'up']:
497497
open_ports = [port for port in scanner[ip_address].all_tcp() if
498498
scanner[ip_address]['tcp'][port]['state'] == 'open']
499-
if (options['compact'] and len(open_ports)) or not options['compact']:
500-
append_logs(logfile, options, 'nmap ' + arguments)
501499
if options['no_portscan'] or len(open_ports):
502500
append_file(logfile, options, temp_file)
503501
if len(open_ports):

0 commit comments

Comments
 (0)