-
Notifications
You must be signed in to change notification settings - Fork 0
/
sprayport.py
109 lines (85 loc) · 2.47 KB
/
sprayport.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#sprayport.py
# Purpose: Just another Port Scanner in Python
# Developed by: Suetena Loia aka SweetrushCoder
# Version: 0.9
import socket
import threading
from queue import Queue
print_lock = threading.Lock()
# Defining Server List
serverAddress = [
"10.3.3.1",
"10.5.5.1",
"10.6.6.1",
"10.7.7.1",
"10.8.8.1"
]
# Iniation of Server Loop Address Holder
# Due ServerAddress List Injection for Threading
activeServertoScan = ""
#Defining Port List
portToScan = [
80, # HTTP Standard
443, # HTTPS
8080, # HTTP Custom
4100, # HTTP Custom
22, # SSH Standard
21, # FTP Standard
23, # Telnet Standard
]
# Define the Number of Theads to Use.
# threadWorkers = (len(portToScan))
threadWorkers = (1000)
def initPrompt():
print(
"\n\n\n",
"SprayPort Scanner [verion 0.9] \n",
"Developed by: Suetena Loia aka [SweetrushCoder]\n"
"License: GNUv1\n"
)
def EndingPrompt():
print("\n\n\n",
"+=================================================+\n",
"Scan Completed Successfull \n",
"Number of IP Scannned: (", (len(serverAddress)), ") \n",
"Number of Ports Scanned: (", (len(portToScan)), ") \n",
"+=================================================+\n"
)
# scan fucation
def portscan(setPort):
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
conto = sck.connect((activeServertoScan, setPort))
with print_lock:
print('\tPort \t', setPort, "\tReturned ### OPEN ###")
conto.close()
except:
pass
# Running Threading for Speed
def threader():
while True:
worker = q.get()
portscan(worker)
q.task_done()
# Main loop for the Program or Main Calling Area
# Start Here
initPrompt()
# Iniatioing Loops for Scanning Address List
for x in range(len(serverAddress)):
activeServertoScan = serverAddress[x]
print(
"\n---------------------------------------------------",
"\nScan Result ", activeServertoScan,
"\n---------------------------------------------------\n"
)
q= Queue()
for gg in range(threadWorkers):
t = threading.Thread(target=threader)
t.daemon = True
t.start()
for y in range(len(portToScan)):
worker = portToScan[y]
q.put(worker)
q.join()
# End of Running Code
EndingPrompt()