File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -391,8 +391,8 @@ def __process_event(self, eventdata):
391391 xt = xmlnode .attributes
392392 taskname = xt ['task' ].value
393393 starttime = xt ['time' ].value
394- xinfo = ''
395- if xt . has_key ( 'extrainfo' ):
394+ xinfo = ''
395+ if 'extrainfo' in xt . keys ( ):
396396 xinfo = xt ['extrainfo' ].value
397397 newtask = NmapTask (taskname , starttime , xinfo )
398398 self .__nmap_tasks [newtask .name ] = newtask
@@ -404,7 +404,7 @@ def __process_event(self, eventdata):
404404 tname = xt ['task' ].value
405405 xinfo = ''
406406 self .__nmap_tasks [tname ].endtime = xt ['time' ].value
407- if xt . has_key ( 'extrainfo' ):
407+ if 'extrainfo' in xt . keys ( ):
408408 xinfo = xt ['extrainfo' ].value
409409 self .__nmap_tasks [tname ].extrainfo = xinfo
410410 self .__nmap_tasks [tname ].status = "ended"
Original file line number Diff line number Diff line change 77nmap_proc = NmapProcess (targets = "scanme.nmap.org" , options = "-sT" )
88nmap_proc .run_background ()
99while nmap_proc .is_alive ():
10- print "Nmap Scan running: ETC: {0} DONE: {1}%" .format (nmap_proc .etc ,
11- nmap_proc .progress )
12- sleep (2 )
10+ nmaptask = nmap_proc .current_task
11+ if nmaptask :
12+ print "Task {0} ({1}): ETC: {2} DONE: {3}%" .format (nmaptask .name ,
13+ nmaptask .status ,
14+ nmaptask .etc ,
15+ nmaptask .progress )
16+ sleep (0.5 )
1317
1418print "rc: {0} output: {1}" .format (nmap_proc .rc , nmap_proc .summary )
1519print nmap_proc .stdout
You can’t perform that action at this time.
0 commit comments