[mod_python] threading and sockets

Ed Hotchkiss edhotchkiss at gmail.com
Sun Sep 18 22:06:54 EDT 2005


Anyone have an idea why my script does not thread the scans and finish 
quickly (it just does nothing, at all.)....
a color highlighted version is pasted here also: 
http://deadbeefbabe.org/paste/1671/0
 it should just scan a host, from the begin variable to the end, simple 
right? any ideas would be appreciated ...
----------------------------------------------------------------------------------------------------------------------------
 import threading
import socket
 class scanThread(threading.Thread):
def run(self):
try:
ss = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ss.connect((ip, port_counter))
print "%s | %d OPEN" % (ip, port_counter)
ss.close()
print "scanned: ",port_counter,"\n"
except: pass
# end class -------------------


def scan(ip, begin, end):
for port_counter in range(begin, end):
while threading < MAX_THREADS:
scanThread().start()
# end function -------------------
scan("someones ip goes here", 0, 10000)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050918/5896cdff/attachment.html


More information about the Mod_python mailing list