SnakeScan 1.5.9__tar.gz → 1.6.0__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.5.9 → snakescan-1.6.0}/PKG-INFO +2 -2
- {snakescan-1.5.9 → snakescan-1.6.0}/README.md +1 -1
- {snakescan-1.5.9 → snakescan-1.6.0}/SnakeScan/CLI.py +31 -23
- {snakescan-1.5.9 → snakescan-1.6.0}/SnakeScan/PoolExecutor.py +6 -1
- {snakescan-1.5.9 → snakescan-1.6.0}/SnakeScan/__init__.py +8 -8
- {snakescan-1.5.9 → snakescan-1.6.0}/pyproject.toml +2 -1
- {snakescan-1.5.9 → snakescan-1.6.0}/LICENSE +0 -0
- {snakescan-1.5.9 → snakescan-1.6.0}/SnakeScan/Check_subnet.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SnakeScan
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
4
4
|
Summary: Module SnakeScan
|
|
5
5
|
Author: Den*Ram
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -40,7 +40,7 @@ SnakeScan.run()
|
|
|
40
40
|
for i in range(len(ports)):
|
|
41
41
|
Watcher("127.0.0.1",ports[i])
|
|
42
42
|
```
|
|
43
|
-
## Added CLI command line use
|
|
43
|
+
## Added CLI command line use snake or Snake
|
|
44
44
|
```
|
|
45
45
|
usage: Snake [-h] [-sp] [-v] [-i] [-p PORTS] [-s SINGLE]
|
|
46
46
|
[-t] [-ch] [-l]
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import sys
|
|
1
2
|
import argparse
|
|
2
3
|
import socket
|
|
3
4
|
import ipaddress
|
|
4
5
|
from concurrent.futures import ProcessPoolExecutor
|
|
5
|
-
from tqdm import tqdm
|
|
6
6
|
from termcolor import colored
|
|
7
7
|
from threading import Thread
|
|
8
|
+
from tqdm import tqdm
|
|
8
9
|
from SnakeScan.Check_subnet import Check_network
|
|
9
10
|
from SnakeScan.PoolExecutor import PoolProcessExecutor
|
|
10
11
|
|
|
12
|
+
|
|
11
13
|
def main():
|
|
12
14
|
pass
|
|
13
15
|
|
|
@@ -63,7 +65,7 @@ ports = {
|
|
|
63
65
|
8080: "Tomcat",
|
|
64
66
|
10000: "Webmin",
|
|
65
67
|
}
|
|
66
|
-
|
|
68
|
+
version = "1.6.0"
|
|
67
69
|
|
|
68
70
|
|
|
69
71
|
def is_port_open(host, port):
|
|
@@ -115,6 +117,24 @@ def SnakeArgs():
|
|
|
115
117
|
|
|
116
118
|
port_user = SnakeArgs().ports
|
|
117
119
|
host = SnakeArgs().host
|
|
120
|
+
if host.startswith("http://"):
|
|
121
|
+
host = host.strip()
|
|
122
|
+
host = host.split("http:")
|
|
123
|
+
host = host[1].strip("//")
|
|
124
|
+
host = host.split("/")
|
|
125
|
+
host = host[0]
|
|
126
|
+
for i in range(len(host)):
|
|
127
|
+
if host[i] == "/":
|
|
128
|
+
host = host[0:i]
|
|
129
|
+
if host.startswith("https://"):
|
|
130
|
+
host = host.strip()
|
|
131
|
+
host = host.split("https:")
|
|
132
|
+
host = host[1].strip("//")
|
|
133
|
+
host = host.split("/")
|
|
134
|
+
host = host[0]
|
|
135
|
+
for i in range(len(host)):
|
|
136
|
+
if host[i] == "/":
|
|
137
|
+
host = host[0:i]
|
|
118
138
|
if host == "None":
|
|
119
139
|
host = "localhost"
|
|
120
140
|
if SnakeArgs().ports:
|
|
@@ -157,22 +177,6 @@ if SnakeArgs().ports:
|
|
|
157
177
|
print(f"Open{colored('|√|','green')}:{portsopen}")
|
|
158
178
|
portsopen = 0
|
|
159
179
|
print("-" * 60)
|
|
160
|
-
if "http://" in host:
|
|
161
|
-
host = host.strip()
|
|
162
|
-
host = host.split("http:")
|
|
163
|
-
host = host.strip("//")
|
|
164
|
-
for i in range(len(host)):
|
|
165
|
-
if host[i] == "/":
|
|
166
|
-
host = host[0:i]
|
|
167
|
-
if "https://" in host:
|
|
168
|
-
host = host.strip()
|
|
169
|
-
host = host.strip("https:")
|
|
170
|
-
host = host.strip("//")
|
|
171
|
-
for i in range(len(host)):
|
|
172
|
-
if host[i] == "/":
|
|
173
|
-
host = host[0:i]
|
|
174
|
-
if host == "None":
|
|
175
|
-
host = "localhost"
|
|
176
180
|
if SnakeArgs().check:
|
|
177
181
|
Check_network(host)
|
|
178
182
|
if SnakeArgs().single:
|
|
@@ -230,7 +234,11 @@ if SnakeArgs().info:
|
|
|
230
234
|
network += "0"
|
|
231
235
|
network += "/24"
|
|
232
236
|
hosting = network
|
|
233
|
-
|
|
237
|
+
try:
|
|
238
|
+
ip_obj = ipaddress.ip_address(host)
|
|
239
|
+
except Exception as e:
|
|
240
|
+
print(e)
|
|
241
|
+
sys.exit()
|
|
234
242
|
print(f"Type IP: {type(ip_obj)}")
|
|
235
243
|
print(f"Version IP: {ip_obj.version}")
|
|
236
244
|
network_obj = ipaddress.ip_network(network)
|
|
@@ -251,7 +259,7 @@ if SnakeArgs().info:
|
|
|
251
259
|
print("".center(60, "-"))
|
|
252
260
|
if SnakeArgs().thread:
|
|
253
261
|
print(f"Thread".center(60, "-"))
|
|
254
|
-
|
|
262
|
+
|
|
255
263
|
for port in ports.keys():
|
|
256
264
|
t = Thread(
|
|
257
265
|
target=is_port_open_threads,
|
|
@@ -259,10 +267,10 @@ if SnakeArgs().thread:
|
|
|
259
267
|
)
|
|
260
268
|
threads.append(t)
|
|
261
269
|
t.start()
|
|
262
|
-
|
|
263
|
-
|
|
270
|
+
for t in threads:
|
|
271
|
+
t.join()
|
|
264
272
|
if SnakeArgs().version:
|
|
265
|
-
print(f"Build_{
|
|
273
|
+
print(f"Build_{version}")
|
|
266
274
|
if SnakeArgs().speed:
|
|
267
275
|
print(f"ProcessPoolExecutor".center(60, "-"))
|
|
268
276
|
PoolProcessExecutor(host)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import socket
|
|
2
2
|
from termcolor import colored
|
|
3
3
|
from concurrent.futures import ProcessPoolExecutor
|
|
4
|
+
|
|
4
5
|
ports = {
|
|
5
6
|
20: "FTP-DATA",
|
|
6
7
|
21: "FTP",
|
|
@@ -43,6 +44,8 @@ ports = {
|
|
|
43
44
|
8080: "Tomcat",
|
|
44
45
|
10000: "Webmin",
|
|
45
46
|
}
|
|
47
|
+
|
|
48
|
+
|
|
46
49
|
def is_port_open_threads(host, port):
|
|
47
50
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
48
51
|
try:
|
|
@@ -55,11 +58,13 @@ def is_port_open_threads(host, port):
|
|
|
55
58
|
print(f"Closed{colored('|X|','red')}-->|{port}|")
|
|
56
59
|
else:
|
|
57
60
|
print(f"Open{colored('|√|','green')}-->{ports.get(port)}|{port}|")
|
|
61
|
+
|
|
62
|
+
|
|
58
63
|
def PoolProcessExecutor(host):
|
|
59
64
|
with ProcessPoolExecutor(max_workers=None) as executor:
|
|
60
65
|
try:
|
|
61
66
|
for port in ports.keys():
|
|
62
|
-
future = executor.submit(is_port_open_threads,host,port)
|
|
67
|
+
future = executor.submit(is_port_open_threads, host, port)
|
|
63
68
|
|
|
64
69
|
except Exception as e:
|
|
65
70
|
print(e)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Module SnakeScan"""
|
|
2
2
|
|
|
3
|
-
__version__ = "1.
|
|
3
|
+
__version__ = "1.6.0"
|
|
4
4
|
import socket
|
|
5
5
|
import ipaddress
|
|
6
6
|
from art import tprint
|
|
@@ -170,17 +170,17 @@ def run():
|
|
|
170
170
|
finally:
|
|
171
171
|
print("".center(60, "-"))
|
|
172
172
|
continue
|
|
173
|
-
if "http://"
|
|
173
|
+
if host.startswith("http://"):
|
|
174
174
|
host = host.strip()
|
|
175
175
|
host = host.split("http:")
|
|
176
|
-
host = host.strip("//")
|
|
176
|
+
host = host[1].strip("//")
|
|
177
177
|
for i in range(len(host)):
|
|
178
178
|
if host[i] == "/":
|
|
179
179
|
host = host[0:i]
|
|
180
|
-
if "https://"
|
|
180
|
+
if host.startswith("https://"):
|
|
181
181
|
host = host.strip()
|
|
182
|
-
host = host.
|
|
183
|
-
host = host.strip("//")
|
|
182
|
+
host = host.split("https:")
|
|
183
|
+
host = host[1].strip("//")
|
|
184
184
|
for i in range(len(host)):
|
|
185
185
|
if host[i] == "/":
|
|
186
186
|
host = host[0:i]
|
|
@@ -227,8 +227,8 @@ def run():
|
|
|
227
227
|
)
|
|
228
228
|
threads.append(t)
|
|
229
229
|
t.start()
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
for t in threads:
|
|
231
|
+
t.join()
|
|
232
232
|
if "-s" in str(port_user):
|
|
233
233
|
port_user = port_single.strip("-s")
|
|
234
234
|
port_user = port_user.split()
|
|
File without changes
|
|
File without changes
|