File tree 1 file changed +5
-5
lines changed
ethical-hacking/port_scanner
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 17
17
q = Queue ()
18
18
print_lock = Lock ()
19
19
20
- def port_scan (port ):
20
+ def port_scan (host , port ):
21
21
"""
22
22
Scan a port on the global variable `host`
23
23
"""
@@ -40,7 +40,7 @@ def scan_thread():
40
40
# get the port number from the queue
41
41
worker = q .get ()
42
42
# scan that port number
43
- port_scan (worker )
43
+ port_scan (* worker )
44
44
# tells the queue that the scanning for that port
45
45
# is done
46
46
q .task_done ()
@@ -56,10 +56,10 @@ def main(host, ports):
56
56
# start the daemon thread
57
57
t .start ()
58
58
59
- for worker in ports :
59
+ for port in ports :
60
60
# for each port, put that port into the queue
61
61
# to start scanning
62
- q .put (worker )
62
+ q .put (( host , port ) )
63
63
64
64
# wait the threads ( port scanners ) to finish
65
65
q .join ()
@@ -78,4 +78,4 @@ def main(host, ports):
78
78
79
79
ports = [ p for p in range (start_port , end_port )]
80
80
81
- main (host , ports )
81
+ main (host , ports )
You can’t perform that action at this time.
0 commit comments