SnakeScan 1.4.4__tar.gz → 1.4.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {snakescan-1.4.4 → snakescan-1.4.5}/PKG-INFO +8 -3
- snakescan-1.4.5/README.md +18 -0
- snakescan-1.4.5/SnakeScan/__init__.py +306 -0
- snakescan-1.4.4/README.md +0 -13
- snakescan-1.4.4/SnakeScan/__init__.py +0 -287
- {snakescan-1.4.4 → snakescan-1.4.5}/LICENSE +0 -0
- {snakescan-1.4.4 → snakescan-1.4.5}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SnakeScan
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.5
|
|
4
4
|
Summary: Module SnakeScan using to scan port or ports in you device or other devices
|
|
5
5
|
Author: Den*Ram
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -16,12 +16,17 @@ import SnakeScan
|
|
|
16
16
|
|
|
17
17
|
and use module to scan port
|
|
18
18
|
|
|
19
|
-
For full compatibility, I recommend using python 3.x.x
|
|
20
|
-
|
|
21
19
|
--l need internet connection
|
|
22
20
|
--h help
|
|
23
21
|
--t threading port search
|
|
24
22
|
--d dos
|
|
25
23
|
--s single port search
|
|
26
24
|
--i information about host
|
|
25
|
+
Port or Host:--h to watch help
|
|
26
|
+
Added class Watcher:
|
|
27
|
+
for SnakeScan import Watcher
|
|
28
|
+
Watcher(host:str,port:int)
|
|
29
|
+
SnakeScan now run for command and import SnakeScan not run him
|
|
30
|
+
import SnakeScan
|
|
31
|
+
SnakeScan.run()
|
|
27
32
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import SnakeScan
|
|
2
|
+
|
|
3
|
+
and use module to scan port
|
|
4
|
+
|
|
5
|
+
--l need internet connection
|
|
6
|
+
--h help
|
|
7
|
+
--t threading port search
|
|
8
|
+
--d dos
|
|
9
|
+
--s single port search
|
|
10
|
+
--i information about host
|
|
11
|
+
Port or Host:--h to watch help
|
|
12
|
+
Added class Watcher:
|
|
13
|
+
for SnakeScan import Watcher
|
|
14
|
+
Watcher(host:str,port:int)
|
|
15
|
+
SnakeScan now run for command and import SnakeScan not run him
|
|
16
|
+
import SnakeScan
|
|
17
|
+
SnakeScan.run()
|
|
18
|
+
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"""Module SnakeScan using to scan port or ports in you device or other devices"""
|
|
2
|
+
__version__="1.4.5"
|
|
3
|
+
import socket
|
|
4
|
+
from art import tprint
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from tqdm import tqdm
|
|
7
|
+
from termcolor import colored
|
|
8
|
+
from threading import Thread, Timer
|
|
9
|
+
|
|
10
|
+
next = None
|
|
11
|
+
|
|
12
|
+
class Watcher():
|
|
13
|
+
def __init__(self,host,port_user,sleep=0.5):
|
|
14
|
+
self.host=host
|
|
15
|
+
self.port_user=port_user
|
|
16
|
+
self.sleep=sleep
|
|
17
|
+
global next
|
|
18
|
+
Timer(sleep, Watcher,kwargs={"host":host,"port_user":port_user}).start()
|
|
19
|
+
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
20
|
+
connection = sock.connect_ex((host,port_user))
|
|
21
|
+
if next != connection:
|
|
22
|
+
if connection == 0:
|
|
23
|
+
print (f"Service is up {host}-->|{port_user}|")
|
|
24
|
+
else:
|
|
25
|
+
print (f"Service is down {host}-->|{port_user}|")
|
|
26
|
+
next = connection
|
|
27
|
+
def run():
|
|
28
|
+
portsopen=0
|
|
29
|
+
portsclosed=0
|
|
30
|
+
Run_now=True
|
|
31
|
+
Bool=True
|
|
32
|
+
boolsd=True
|
|
33
|
+
global num
|
|
34
|
+
num=0
|
|
35
|
+
boolean=0
|
|
36
|
+
OpenPorts=[]
|
|
37
|
+
ports = {
|
|
38
|
+
20: "FTP-DATA", 21: "FTP", 22: "SSH", 23: "Telnet",
|
|
39
|
+
25: "SMTP", 43: "WHOIS", 53: "DNS", 67:"DHCP", 68:"DHCP", 69:"TFTP", 80: "http", 110:"POP3",
|
|
40
|
+
115: "SFTP", 123: "NTP", 139:"NetBios", 143: "IMAP", 161: "SNMP",
|
|
41
|
+
179: "BGP", 443: "HTTPS", 445: "MICROSOFT-DS", 465:"SSL/TLS",
|
|
42
|
+
514: "SYSLOG", 515: "PRINTER", 554:"RTSP", 587:"TLS/STARTTLS", 993: "IMAPS",
|
|
43
|
+
995: "POP3S", 1080: "SOCKS", 1194: "OpenVPN",
|
|
44
|
+
1433: "SQL Server", 1723: "PPTP", 2222:"SSH", 3128: "HTTP",
|
|
45
|
+
3268: "LDAP", 3306: "MySQL", 3389: "RDP",
|
|
46
|
+
5432: "PostgreSQL", 5900: "VNC", 8080: "Tomcat", 10000: "Webmin" }
|
|
47
|
+
def is_port_open(host,port):
|
|
48
|
+
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
49
|
+
try:
|
|
50
|
+
#Connecting...
|
|
51
|
+
s.connect((host,port))
|
|
52
|
+
#Port//(Closed<--or-->Open)
|
|
53
|
+
except:
|
|
54
|
+
s.close()
|
|
55
|
+
return False
|
|
56
|
+
else:
|
|
57
|
+
s.close()
|
|
58
|
+
return True
|
|
59
|
+
def dos_threads(host,port,fake_ip):
|
|
60
|
+
host=host.strip("--d")
|
|
61
|
+
host=host.strip()
|
|
62
|
+
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
63
|
+
try:
|
|
64
|
+
s.connect((host,port))
|
|
65
|
+
s.sendto(("GET /"+host+"HTTP/1.1\r\n").encode("ascii"),(host,port))
|
|
66
|
+
s.sendto(("Host: "+fake_ip+"\r\n\r\n").encode("ascii"),(host,port))
|
|
67
|
+
s.close()
|
|
68
|
+
return True
|
|
69
|
+
except:
|
|
70
|
+
s.close()
|
|
71
|
+
return False
|
|
72
|
+
def is_port_open_threads(host,port):
|
|
73
|
+
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
74
|
+
try:
|
|
75
|
+
#Connecting...
|
|
76
|
+
s.connect((host,port))
|
|
77
|
+
#Port//(Closed<--or-->Open)
|
|
78
|
+
except:
|
|
79
|
+
s.close()
|
|
80
|
+
try:
|
|
81
|
+
print(f"Closed{colored('|X|','red')}-->{ports[all]}|{all}|")
|
|
82
|
+
except:
|
|
83
|
+
print(f"Closed{colored('|X|','red')}-->|{all}|")
|
|
84
|
+
finally:
|
|
85
|
+
s.close()
|
|
86
|
+
else:
|
|
87
|
+
print(f"Open{colored('|√|','green')}-->{ports[all]}|{all}|")
|
|
88
|
+
print("–"*60)
|
|
89
|
+
tprint("SnakeScan")
|
|
90
|
+
print("–"*60)
|
|
91
|
+
while Run_now:
|
|
92
|
+
host=input(f"{colored('[$]','green')}Host-->")
|
|
93
|
+
if "--v" in host:
|
|
94
|
+
print(f"Build_{__version__}")
|
|
95
|
+
continue
|
|
96
|
+
if "--h" in host:
|
|
97
|
+
print("Host:|--l,host --i,host --d|")
|
|
98
|
+
continue
|
|
99
|
+
if "--i" in host:
|
|
100
|
+
host=host.strip("--i").strip()
|
|
101
|
+
print("".center(60,"-"))
|
|
102
|
+
try:
|
|
103
|
+
hostname=socket.gethostbyaddr(host)
|
|
104
|
+
print(f"Host:{hostname[0]}")
|
|
105
|
+
except:
|
|
106
|
+
hostname="Undefined"
|
|
107
|
+
print(f"Host:{hostname}")
|
|
108
|
+
try:
|
|
109
|
+
print(f"IP:{socket.gethostbyname(host)}")
|
|
110
|
+
except Exception as e:
|
|
111
|
+
print(f"IP:{e}")
|
|
112
|
+
continue
|
|
113
|
+
finally:
|
|
114
|
+
print("".center(60,"-"))
|
|
115
|
+
continue
|
|
116
|
+
if "http://" in host and "--d" in host:
|
|
117
|
+
host=host.strip().strip("--d")
|
|
118
|
+
host=host.split("http:")
|
|
119
|
+
host=host.strip("//")
|
|
120
|
+
host=host+""+"--d"
|
|
121
|
+
for i in range(len(host)):
|
|
122
|
+
if host[i] == "/":
|
|
123
|
+
host=host[0:i]
|
|
124
|
+
if "https://" in host and "--d" in host:
|
|
125
|
+
host=host.strip().strip("--d")
|
|
126
|
+
host=host.strip("https:")
|
|
127
|
+
host=host.strip("//")
|
|
128
|
+
host=host+""+"--d"
|
|
129
|
+
for i in range(len(host)):
|
|
130
|
+
if host[i] == "/":
|
|
131
|
+
host=host[0:i]
|
|
132
|
+
if "http://" in host:
|
|
133
|
+
host=host.strip()
|
|
134
|
+
host=host.split("http:")
|
|
135
|
+
host=host.strip("//")
|
|
136
|
+
for i in range(len(host)):
|
|
137
|
+
if host[i] == "/":
|
|
138
|
+
host=host[0:i]
|
|
139
|
+
if "https://" in host:
|
|
140
|
+
host=host.strip()
|
|
141
|
+
host=host.strip("https:")
|
|
142
|
+
host=host.strip("//")
|
|
143
|
+
for i in range(len(host)):
|
|
144
|
+
if host[i] == "/":
|
|
145
|
+
host=host[0:i]
|
|
146
|
+
if "--d" in host:
|
|
147
|
+
try:
|
|
148
|
+
host=host.strip("--d")
|
|
149
|
+
host=host.strip()
|
|
150
|
+
host=socket.gethostbyname(host)
|
|
151
|
+
host=host+""+"--d"
|
|
152
|
+
except:
|
|
153
|
+
print(f"{host} is not avaible")
|
|
154
|
+
continue
|
|
155
|
+
if "--d" in host:
|
|
156
|
+
try:
|
|
157
|
+
threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
|
|
158
|
+
dos_port=int(input(f"{colored('[$]','green')}Port-->"))
|
|
159
|
+
fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
|
|
160
|
+
except:
|
|
161
|
+
while True:
|
|
162
|
+
print(f"{colored('|Threads|Port|','green')}{colored('[X]:Invalid value','red')}")
|
|
163
|
+
|
|
164
|
+
try:
|
|
165
|
+
threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
|
|
166
|
+
dos_port=int(input(f"{colored('[$]','green')}Port-->"))
|
|
167
|
+
fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
|
|
168
|
+
|
|
169
|
+
except Exception as error:
|
|
170
|
+
print(f"Error:{error}")
|
|
171
|
+
continue
|
|
172
|
+
if threadsnum:
|
|
173
|
+
break
|
|
174
|
+
for dos in range(0,threadsnum):
|
|
175
|
+
num+=1
|
|
176
|
+
t=Thread(target=dos_threads,kwargs={"host":host,"port":dos_port,"fake_ip":fake_ip})
|
|
177
|
+
t.start()
|
|
178
|
+
t.join()
|
|
179
|
+
if dos_threads(host,dos_port,fake_ip):
|
|
180
|
+
print("Dos-Information".center(60,"-"))
|
|
181
|
+
print(f"{colored('[$]','green')}Threads--> {num} GET/HTTP/1.1")
|
|
182
|
+
|
|
183
|
+
else:
|
|
184
|
+
try:
|
|
185
|
+
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
186
|
+
host=host.strip("--d")
|
|
187
|
+
host=socket.gethostbyname(host)
|
|
188
|
+
s.connect((host,dos_port))
|
|
189
|
+
except Exception as error:
|
|
190
|
+
print(f"Error:{error}")
|
|
191
|
+
continue
|
|
192
|
+
if host == "Exit" or host == "exit":
|
|
193
|
+
break
|
|
194
|
+
if host == "":
|
|
195
|
+
while True:
|
|
196
|
+
print(f"{colored('Host','green')}{colored('[X]:Empty value','red')}")
|
|
197
|
+
host=input(f"{colored('[$]','green')}Host-->")
|
|
198
|
+
if host:
|
|
199
|
+
break
|
|
200
|
+
if "--l" in host:
|
|
201
|
+
local=""
|
|
202
|
+
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
203
|
+
try:
|
|
204
|
+
s.connect(('10.255.255.255',1))
|
|
205
|
+
local=s.getsockname()[0]
|
|
206
|
+
except Exception as e:
|
|
207
|
+
local=f"127.0.0.1:{e}"
|
|
208
|
+
finally:
|
|
209
|
+
s.close()
|
|
210
|
+
print(local)
|
|
211
|
+
continue
|
|
212
|
+
port_user=input(f"{colored('[$]','green')}Port-->")
|
|
213
|
+
if "--v" in port_user:
|
|
214
|
+
print(f"Build_{__version__}")
|
|
215
|
+
continue
|
|
216
|
+
if "--h" in port_user:
|
|
217
|
+
print("Port:|--s port,--t|")
|
|
218
|
+
continue
|
|
219
|
+
if port_user == "":
|
|
220
|
+
while True:
|
|
221
|
+
print(f"{colored('Port','green')}{colored('[X]:Empty value','red')}")
|
|
222
|
+
port_user=input(f"{colored('[$]','green')}Port-->")
|
|
223
|
+
if port_user:
|
|
224
|
+
break
|
|
225
|
+
port_single=port_user
|
|
226
|
+
if port_user == "Exit" or port_user == "Exit":
|
|
227
|
+
break
|
|
228
|
+
if port_user:
|
|
229
|
+
try:
|
|
230
|
+
length=int(port_user)
|
|
231
|
+
except:
|
|
232
|
+
if "--t" in str(port_user):
|
|
233
|
+
print(f"Thread".center(60,"-"))
|
|
234
|
+
for all in ports.keys():
|
|
235
|
+
t=Thread(target=is_port_open_threads,kwargs={"host":host,"port":all})
|
|
236
|
+
t.start()
|
|
237
|
+
t.join()
|
|
238
|
+
if "--s" in str(port_user):
|
|
239
|
+
port_user=port_single.strip("--s")
|
|
240
|
+
port_user=port_user.split()
|
|
241
|
+
port_list=port_user
|
|
242
|
+
port_user=[]
|
|
243
|
+
for i in range(len(port_list)):
|
|
244
|
+
try:
|
|
245
|
+
port_user.append(int(port_list[i]))
|
|
246
|
+
except:
|
|
247
|
+
print(f"{port_list[i]}-->Invalid value")
|
|
248
|
+
break
|
|
249
|
+
for port in range(len(port_user)):
|
|
250
|
+
if is_port_open(host,port_user[port]):
|
|
251
|
+
print(f"Open{colored('|√|','green')}{host}-->{ports[port_user[port]]}|{port_user[port]}|")
|
|
252
|
+
else:
|
|
253
|
+
try:
|
|
254
|
+
print(f"Closed{colored('|X|','red')}{host}-->{ports[port_user[port]]}|{port_user[port]}|")
|
|
255
|
+
except:
|
|
256
|
+
print(f"Closed{colored('|X|','red')}{host}-->|{port_user[port]}|")
|
|
257
|
+
|
|
258
|
+
continue
|
|
259
|
+
|
|
260
|
+
else:
|
|
261
|
+
if "--t" in port_user:
|
|
262
|
+
t.join()
|
|
263
|
+
continue
|
|
264
|
+
port_user="100"
|
|
265
|
+
print(f"{colored('[!]','red')}Port:invalid value")
|
|
266
|
+
for i in range(0,len(port_user)):
|
|
267
|
+
if port_user[i] == " ":
|
|
268
|
+
port_user=100
|
|
269
|
+
break
|
|
270
|
+
port_user=int(port_user)
|
|
271
|
+
length=port_user
|
|
272
|
+
else:
|
|
273
|
+
print(f"{colored('|*|','blue')}100")
|
|
274
|
+
port_user=100
|
|
275
|
+
length=port_user
|
|
276
|
+
print(f"{colored('|!|','red')}Listening {host} please wait...")
|
|
277
|
+
#|-----------------Starting---------------------|
|
|
278
|
+
length=int(length)+1
|
|
279
|
+
for port in tqdm(range(1,length)):
|
|
280
|
+
if is_port_open(host,port):
|
|
281
|
+
for name in ports:
|
|
282
|
+
if port == name:
|
|
283
|
+
OpenPorts=[port]
|
|
284
|
+
portsopen+=1
|
|
285
|
+
else:
|
|
286
|
+
portsclosed+=1
|
|
287
|
+
if port_user != "":
|
|
288
|
+
if int(port_user) == port:
|
|
289
|
+
if port_user == "":
|
|
290
|
+
pass
|
|
291
|
+
elif int(port_user) == port:
|
|
292
|
+
if is_port_open(host,port):
|
|
293
|
+
Bool=True
|
|
294
|
+
boolean+=1
|
|
295
|
+
else:
|
|
296
|
+
Bool=False
|
|
297
|
+
if boolean == 1:
|
|
298
|
+
pass
|
|
299
|
+
for i in OpenPorts:
|
|
300
|
+
print(f"Open{colored('|√|','green')}-->{ports[i]}|{i}|")
|
|
301
|
+
print(f"{host}".center(60,"-"))
|
|
302
|
+
print(f"Closed{colored('|X|','red')}:{portsclosed}")
|
|
303
|
+
portsclosed=0
|
|
304
|
+
print(f"Open{colored('|√|','green')}:{portsopen}")
|
|
305
|
+
portsopen=0
|
|
306
|
+
print("-"*60)
|
snakescan-1.4.4/README.md
DELETED
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"""Module SnakeScan using to scan port or ports in you device or other devices"""
|
|
2
|
-
__version__="1.4.4"
|
|
3
|
-
import socket
|
|
4
|
-
from art import tprint
|
|
5
|
-
from datetime import datetime
|
|
6
|
-
from tqdm import tqdm
|
|
7
|
-
from termcolor import colored
|
|
8
|
-
from threading import Thread
|
|
9
|
-
portsopen=0
|
|
10
|
-
portsclosed=0
|
|
11
|
-
Run_now=True
|
|
12
|
-
Bool=True
|
|
13
|
-
boolsd=True
|
|
14
|
-
global num
|
|
15
|
-
num=0
|
|
16
|
-
boolean=0
|
|
17
|
-
OpenPorts=[]
|
|
18
|
-
ports = {
|
|
19
|
-
20: "FTP-DATA", 21: "FTP", 22: "SSH", 23: "Telnet",
|
|
20
|
-
25: "SMTP", 43: "WHOIS", 53: "DNS", 67:"DHCP", 68:"DHCP", 69:"TFTP", 80: "http", 110:"POP3",
|
|
21
|
-
115: "SFTP", 123: "NTP", 139:"NetBios", 143: "IMAP", 161: "SNMP",
|
|
22
|
-
179: "BGP", 443: "HTTPS", 445: "MICROSOFT-DS", 465:"SSL/TLS",
|
|
23
|
-
514: "SYSLOG", 515: "PRINTER", 554:"RTSP", 587:"TLS/STARTTLS", 993: "IMAPS",
|
|
24
|
-
995: "POP3S", 1080: "SOCKS", 1194: "OpenVPN",
|
|
25
|
-
1433: "SQL Server", 1723: "PPTP", 2222:"SSH", 3128: "HTTP",
|
|
26
|
-
3268: "LDAP", 3306: "MySQL", 3389: "RDP",
|
|
27
|
-
5432: "PostgreSQL", 5900: "VNC", 8080: "Tomcat", 10000: "Webmin" }
|
|
28
|
-
def is_port_open(host,port):
|
|
29
|
-
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
30
|
-
try:
|
|
31
|
-
#Connecting...
|
|
32
|
-
s.connect((host,port))
|
|
33
|
-
#Port//(Closed<--or-->Open)
|
|
34
|
-
except:
|
|
35
|
-
s.close()
|
|
36
|
-
return False
|
|
37
|
-
else:
|
|
38
|
-
s.close()
|
|
39
|
-
return True
|
|
40
|
-
def dos_threads(host,port,fake_ip):
|
|
41
|
-
host=host.strip("--d")
|
|
42
|
-
host=host.strip()
|
|
43
|
-
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
44
|
-
try:
|
|
45
|
-
s.connect((host,port))
|
|
46
|
-
s.sendto(("GET /"+host+"HTTP/1.1\r\n").encode("ascii"),(host,port))
|
|
47
|
-
s.sendto(("Host: "+fake_ip+"\r\n\r\n").encode("ascii"),(host,port))
|
|
48
|
-
s.close()
|
|
49
|
-
return True
|
|
50
|
-
except:
|
|
51
|
-
s.close()
|
|
52
|
-
return False
|
|
53
|
-
def is_port_open_threads(host,port):
|
|
54
|
-
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
55
|
-
try:
|
|
56
|
-
#Connecting...
|
|
57
|
-
s.connect((host,port))
|
|
58
|
-
#Port//(Closed<--or-->Open)
|
|
59
|
-
except:
|
|
60
|
-
s.close()
|
|
61
|
-
try:
|
|
62
|
-
print(f"Closed{colored('|X|','red')}-->{ports[all]}|{all}|")
|
|
63
|
-
except:
|
|
64
|
-
print(f"Closed{colored('|X|','red')}-->|{all}|")
|
|
65
|
-
finally:
|
|
66
|
-
s.close()
|
|
67
|
-
else:
|
|
68
|
-
print(f"Open{colored('|√|','green')}-->{ports[all]}|{all}|")
|
|
69
|
-
print("–"*60)
|
|
70
|
-
tprint("SnakeScan")
|
|
71
|
-
print("–"*60)
|
|
72
|
-
while Run_now:
|
|
73
|
-
host=input(f"{colored('[$]','green')}Host-->")
|
|
74
|
-
if "--v" in host:
|
|
75
|
-
print(f"Build_{__version__}")
|
|
76
|
-
continue
|
|
77
|
-
if "--h" in host:
|
|
78
|
-
print("Host:|--l,host --i,host --d|")
|
|
79
|
-
continue
|
|
80
|
-
if "--i" in host:
|
|
81
|
-
host=host.strip("--i").strip()
|
|
82
|
-
print("".center(60,"-"))
|
|
83
|
-
try:
|
|
84
|
-
hostname=socket.gethostbyaddr(host)
|
|
85
|
-
print(f"Host:{hostname[0]}")
|
|
86
|
-
except:
|
|
87
|
-
hostname="Undefined"
|
|
88
|
-
print(f"Host:{hostname}")
|
|
89
|
-
try:
|
|
90
|
-
print(f"IP:{socket.gethostbyname(host)}")
|
|
91
|
-
except Exception as e:
|
|
92
|
-
print(f"IP:{e}")
|
|
93
|
-
continue
|
|
94
|
-
finally:
|
|
95
|
-
print("".center(60,"-"))
|
|
96
|
-
continue
|
|
97
|
-
if "http://" in host and "--d" in host:
|
|
98
|
-
host=host.strip().strip("--d")
|
|
99
|
-
host=host.split("http:")
|
|
100
|
-
host=host.strip("//")
|
|
101
|
-
host=host+""+"--d"
|
|
102
|
-
for i in range(len(host)):
|
|
103
|
-
if host[i] == "/":
|
|
104
|
-
host=host[0:i]
|
|
105
|
-
if "https://" in host and "--d" in host:
|
|
106
|
-
host=host.strip().strip("--d")
|
|
107
|
-
host=host.strip("https:")
|
|
108
|
-
host=host.strip("//")
|
|
109
|
-
host=host+""+"--d"
|
|
110
|
-
for i in range(len(host)):
|
|
111
|
-
if host[i] == "/":
|
|
112
|
-
host=host[0:i]
|
|
113
|
-
if "http://" in host:
|
|
114
|
-
host=host.strip()
|
|
115
|
-
host=host.split("http:")
|
|
116
|
-
host=host.strip("//")
|
|
117
|
-
for i in range(len(host)):
|
|
118
|
-
if host[i] == "/":
|
|
119
|
-
host=host[0:i]
|
|
120
|
-
if "https://" in host:
|
|
121
|
-
host=host.strip()
|
|
122
|
-
host=host.strip("https:")
|
|
123
|
-
host=host.strip("//")
|
|
124
|
-
for i in range(len(host)):
|
|
125
|
-
if host[i] == "/":
|
|
126
|
-
host=host[0:i]
|
|
127
|
-
if "--d" in host:
|
|
128
|
-
try:
|
|
129
|
-
host=host.strip("--d")
|
|
130
|
-
host=host.strip()
|
|
131
|
-
host=socket.gethostbyname(host)
|
|
132
|
-
host=host+""+"--d"
|
|
133
|
-
except:
|
|
134
|
-
print(f"{host} is not avaible")
|
|
135
|
-
continue
|
|
136
|
-
if "--d" in host:
|
|
137
|
-
try:
|
|
138
|
-
threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
|
|
139
|
-
dos_port=int(input(f"{colored('[$]','green')}Port-->"))
|
|
140
|
-
fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
|
|
141
|
-
except:
|
|
142
|
-
while True:
|
|
143
|
-
print(f"{colored('|Threads|Port|','green')}{colored('[X]:Invalid value','red')}")
|
|
144
|
-
|
|
145
|
-
try:
|
|
146
|
-
threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
|
|
147
|
-
dos_port=int(input(f"{colored('[$]','green')}Port-->"))
|
|
148
|
-
fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
|
|
149
|
-
|
|
150
|
-
except Exception as error:
|
|
151
|
-
print(f"Error:{error}")
|
|
152
|
-
continue
|
|
153
|
-
if threadsnum:
|
|
154
|
-
break
|
|
155
|
-
for dos in range(0,threadsnum):
|
|
156
|
-
num+=1
|
|
157
|
-
t=Thread(target=dos_threads,kwargs={"host":host,"port":dos_port,"fake_ip":fake_ip})
|
|
158
|
-
t.start()
|
|
159
|
-
t.join()
|
|
160
|
-
if dos_threads(host,dos_port,fake_ip):
|
|
161
|
-
print("Dos-Information".center(60,"-"))
|
|
162
|
-
print(f"{colored('[$]','green')}Threads--> {num} GET/HTTP/1.1")
|
|
163
|
-
|
|
164
|
-
else:
|
|
165
|
-
try:
|
|
166
|
-
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
167
|
-
host=host.strip("--d")
|
|
168
|
-
host=socket.gethostbyname(host)
|
|
169
|
-
s.connect((host,dos_port))
|
|
170
|
-
except Exception as error:
|
|
171
|
-
print(f"Error:{error}")
|
|
172
|
-
continue
|
|
173
|
-
if host == "Exit" or host == "exit":
|
|
174
|
-
break
|
|
175
|
-
if host == "":
|
|
176
|
-
while True:
|
|
177
|
-
print(f"{colored('Host','green')}{colored('[X]:Empty value','red')}")
|
|
178
|
-
host=input(f"{colored('[$]','green')}Host-->")
|
|
179
|
-
if host:
|
|
180
|
-
break
|
|
181
|
-
if "--l" in host:
|
|
182
|
-
local=""
|
|
183
|
-
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
184
|
-
try:
|
|
185
|
-
s.connect(('10.255.255.255',1))
|
|
186
|
-
local=s.getsockname()[0]
|
|
187
|
-
except Exception as e:
|
|
188
|
-
local=f"127.0.0.1:{e}"
|
|
189
|
-
finally:
|
|
190
|
-
s.close()
|
|
191
|
-
print(local)
|
|
192
|
-
continue
|
|
193
|
-
port_user=input(f"{colored('[$]','green')}Port-->")
|
|
194
|
-
if "--v" in port_user:
|
|
195
|
-
print(f"Build_{__version__}")
|
|
196
|
-
continue
|
|
197
|
-
if "--h" in port_user:
|
|
198
|
-
print("Port:|--s port,--t|")
|
|
199
|
-
continue
|
|
200
|
-
if port_user == "":
|
|
201
|
-
while True:
|
|
202
|
-
print(f"{colored('Port','green')}{colored('[X]:Empty value','red')}")
|
|
203
|
-
port_user=input(f"{colored('[$]','green')}Port-->")
|
|
204
|
-
if port_user:
|
|
205
|
-
break
|
|
206
|
-
port_single=port_user
|
|
207
|
-
if port_user == "Exit" or port_user == "Exit":
|
|
208
|
-
break
|
|
209
|
-
if port_user:
|
|
210
|
-
try:
|
|
211
|
-
length=int(port_user)
|
|
212
|
-
except:
|
|
213
|
-
if "--t" in str(port_user):
|
|
214
|
-
print(f"Thread".center(60,"-"))
|
|
215
|
-
for all in ports.keys():
|
|
216
|
-
t=Thread(target=is_port_open_threads,kwargs={"host":host,"port":all})
|
|
217
|
-
t.start()
|
|
218
|
-
t.join()
|
|
219
|
-
if "--s" in str(port_user):
|
|
220
|
-
port_user=port_single.strip("--s")
|
|
221
|
-
port_user=port_user.split()
|
|
222
|
-
port_list=port_user
|
|
223
|
-
port_user=[]
|
|
224
|
-
for i in range(len(port_list)):
|
|
225
|
-
try:
|
|
226
|
-
port_user.append(int(port_list[i]))
|
|
227
|
-
except:
|
|
228
|
-
print(f"{port_list[i]}-->Invalid value")
|
|
229
|
-
break
|
|
230
|
-
for port in range(len(port_user)):
|
|
231
|
-
if is_port_open(host,port_user[port]):
|
|
232
|
-
print(f"Open{colored('|√|','green')}{host}-->{ports[port_user[port]]}|{port_user[port]}|")
|
|
233
|
-
else:
|
|
234
|
-
try:
|
|
235
|
-
print(f"Closed{colored('|X|','red')}{host}-->{ports[port_user[port]]}|{port_user[port]}|")
|
|
236
|
-
except:
|
|
237
|
-
print(f"Closed{colored('|X|','red')}{host}-->|{port_user[port]}|")
|
|
238
|
-
|
|
239
|
-
continue
|
|
240
|
-
|
|
241
|
-
else:
|
|
242
|
-
if "--t" in port_user:
|
|
243
|
-
t.join()
|
|
244
|
-
continue
|
|
245
|
-
port_user="100"
|
|
246
|
-
print(f"{colored('[!]','red')}Port:invalid value")
|
|
247
|
-
for i in range(0,len(port_user)):
|
|
248
|
-
if port_user[i] == " ":
|
|
249
|
-
port_user=100
|
|
250
|
-
break
|
|
251
|
-
port_user=int(port_user)
|
|
252
|
-
length=port_user
|
|
253
|
-
else:
|
|
254
|
-
print(f"{colored('|*|','blue')}100")
|
|
255
|
-
port_user=100
|
|
256
|
-
length=port_user
|
|
257
|
-
print(f"{colored('|!|','red')}Listening {host} please wait...")
|
|
258
|
-
#|-----------------Starting---------------------|
|
|
259
|
-
length=int(length)+1
|
|
260
|
-
for port in tqdm(range(1,length)):
|
|
261
|
-
if is_port_open(host,port):
|
|
262
|
-
for name in ports:
|
|
263
|
-
if port == name:
|
|
264
|
-
OpenPorts=[port]
|
|
265
|
-
portsopen+=1
|
|
266
|
-
else:
|
|
267
|
-
portsclosed+=1
|
|
268
|
-
if port_user != "":
|
|
269
|
-
if int(port_user) == port:
|
|
270
|
-
if port_user == "":
|
|
271
|
-
pass
|
|
272
|
-
elif int(port_user) == port:
|
|
273
|
-
if is_port_open(host,port):
|
|
274
|
-
Bool=True
|
|
275
|
-
boolean+=1
|
|
276
|
-
else:
|
|
277
|
-
Bool=False
|
|
278
|
-
if boolean == 1:
|
|
279
|
-
pass
|
|
280
|
-
for i in OpenPorts:
|
|
281
|
-
print(f"Open{colored('|√|','green')}-->{ports[i]}|{i}|")
|
|
282
|
-
print(f"{host}".center(60,"-"))
|
|
283
|
-
print(f"Closed{colored('|X|','red')}:{portsclosed}")
|
|
284
|
-
portsclosed=0
|
|
285
|
-
print(f"Open{colored('|√|','green')}:{portsopen}")
|
|
286
|
-
portsopen=0
|
|
287
|
-
print("-"*60)
|
|
File without changes
|
|
File without changes
|