Nmap Development mailing list archives

Re: Zenmap couldn't termate nmap.exe process when exiting


From: Shinnok <admin () shinnok com>
Date: Wed, 22 Jun 2011 20:03:45 +0300

On 6/22/2011 6:47 PM, David Fifield wrote:
This doesn't work for me; Python installed according to the instructions
in docs/win32-installer-zenmap-buildguide.txt doesn't have the win32api
module. If I remove the try...pass I get an exception when trying to
kill a scan.

Can you back out this change until we've had time to discuss it and
possible alternatives?

David Fifield
Reverted.

The problem was that win32api module is part of pywin32 which was available
in Active Python but not Python from Python.org, which figures as to be used in
win32-installer-zenmap-buildguide.txt.

However, I've since reverted to an exact environment as in the zenmap build guide and
I have the following two alternative approaches that work just fine:

#Use ctypes instead pywin32 which is a standard library in Python.org distribution
import ctypes
ctypes.windll.kernel32.TerminateProcess(int(self.command_process._handle), -1)

-or-

# :-P
os.popen('TASKKILL /PID '+str(self.command_process.pid)+' /F')

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: