Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exception in thread Thread-1499:
- Traceback (most recent call last):
- File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
- File "/usr/lib/python3.7/threading.py", line 870, in run
- File "./puro.py", line 10, in portscan
- File "/usr/lib/python3.7/socket.py", line 151, in __init__
- OSError: [Errno 24] Too many open files
- #Questo errore avviene quando alzo il range di porte sopra il 999
- #!/usr/bin/python3
- import threading
- import socket
- target = input("Please enter the IP you want to scan: ")
- def portscan(port):
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.settimeout(0.5)#
- try:
- con = s.connect((target, port))
- print('Port :',port,"is open.")
- con.close()
- except:
- pass
- r = 1
- for x in range(1,999):
- t = threading.Thread(target=portscan,kwargs={'port':r})
- r += 1
- t.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement