SnakeScan 1.5.8__tar.gz → 1.5.9__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.8 → snakescan-1.5.9}/PKG-INFO +10 -9
- {snakescan-1.5.8 → snakescan-1.5.9}/README.md +9 -8
- snakescan-1.5.8/SnakeScan/SnakeCLI.py → snakescan-1.5.9/SnakeScan/CLI.py +14 -5
- {snakescan-1.5.8 → snakescan-1.5.9}/SnakeScan/Check_subnet.py +1 -1
- snakescan-1.5.9/SnakeScan/PoolExecutor.py +65 -0
- {snakescan-1.5.8 → snakescan-1.5.9}/SnakeScan/__init__.py +1 -1
- {snakescan-1.5.8 → snakescan-1.5.9}/pyproject.toml +1 -1
- {snakescan-1.5.8 → snakescan-1.5.9}/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SnakeScan
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.9
|
|
4
4
|
Summary: Module SnakeScan
|
|
5
5
|
Author: Den*Ram
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -42,23 +42,24 @@ SnakeScan.run()
|
|
|
42
42
|
```
|
|
43
43
|
## Added CLI command line use
|
|
44
44
|
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
[host]
|
|
45
|
+
usage: Snake [-h] [-sp] [-v] [-i] [-p PORTS] [-s SINGLE]
|
|
46
|
+
[-t] [-ch] [-l]
|
|
47
|
+
[host]
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Snake - It's a command line module SnakeScan. Use him for
|
|
50
|
+
more fast starting
|
|
52
51
|
|
|
53
52
|
positional arguments:
|
|
54
53
|
host
|
|
55
54
|
|
|
56
55
|
options:
|
|
57
56
|
-h, --help show this help message and exit
|
|
58
|
-
-
|
|
57
|
+
-sp, --speed speed scan
|
|
58
|
+
-v, --version version
|
|
59
|
+
-i, --info ip info
|
|
59
60
|
-p, --ports PORTS ports
|
|
60
61
|
-s, --single SINGLE single scan
|
|
61
62
|
-t, --thread fast scan
|
|
62
63
|
-ch, --check scan subnet
|
|
63
|
-
-l, --local view you public
|
|
64
|
+
-l, --local view you public ip - need internet
|
|
64
65
|
```
|
|
@@ -28,23 +28,24 @@ SnakeScan.run()
|
|
|
28
28
|
```
|
|
29
29
|
## Added CLI command line use
|
|
30
30
|
```
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[host]
|
|
31
|
+
usage: Snake [-h] [-sp] [-v] [-i] [-p PORTS] [-s SINGLE]
|
|
32
|
+
[-t] [-ch] [-l]
|
|
33
|
+
[host]
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
Snake - It's a command line module SnakeScan. Use him for
|
|
36
|
+
more fast starting
|
|
38
37
|
|
|
39
38
|
positional arguments:
|
|
40
39
|
host
|
|
41
40
|
|
|
42
41
|
options:
|
|
43
42
|
-h, --help show this help message and exit
|
|
44
|
-
-
|
|
43
|
+
-sp, --speed speed scan
|
|
44
|
+
-v, --version version
|
|
45
|
+
-i, --info ip info
|
|
45
46
|
-p, --ports PORTS ports
|
|
46
47
|
-s, --single SINGLE single scan
|
|
47
48
|
-t, --thread fast scan
|
|
48
49
|
-ch, --check scan subnet
|
|
49
|
-
-l, --local view you public
|
|
50
|
+
-l, --local view you public ip - need internet
|
|
50
51
|
```
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import socket
|
|
3
3
|
import ipaddress
|
|
4
|
-
|
|
4
|
+
from concurrent.futures import ProcessPoolExecutor
|
|
5
5
|
from tqdm import tqdm
|
|
6
6
|
from termcolor import colored
|
|
7
7
|
from threading import Thread
|
|
8
8
|
from SnakeScan.Check_subnet import Check_network
|
|
9
|
-
|
|
9
|
+
from SnakeScan.PoolExecutor import PoolProcessExecutor
|
|
10
10
|
|
|
11
11
|
def main():
|
|
12
12
|
pass
|
|
@@ -63,6 +63,7 @@ ports = {
|
|
|
63
63
|
8080: "Tomcat",
|
|
64
64
|
10000: "Webmin",
|
|
65
65
|
}
|
|
66
|
+
__version__ = "1.5.9"
|
|
66
67
|
|
|
67
68
|
|
|
68
69
|
def is_port_open(host, port):
|
|
@@ -92,10 +93,12 @@ def is_port_open_threads(host, port):
|
|
|
92
93
|
|
|
93
94
|
def SnakeArgs():
|
|
94
95
|
parser = argparse.ArgumentParser(
|
|
95
|
-
description="
|
|
96
|
+
description="Snake - It's a command line module SnakeScan. Use him for more fast starting"
|
|
96
97
|
)
|
|
97
98
|
parser.add_argument("host", nargs="?", default="None")
|
|
98
|
-
parser.add_argument("-
|
|
99
|
+
parser.add_argument("-sp", "--speed", action="store_true", help="speed scan")
|
|
100
|
+
parser.add_argument("-v", "--version", action="store_true", help="version")
|
|
101
|
+
parser.add_argument("-i", "--info", action="store_true", help="ip info")
|
|
99
102
|
parser.add_argument("-p", "--ports", help="ports")
|
|
100
103
|
parser.add_argument("-s", "--single", help="single scan")
|
|
101
104
|
parser.add_argument("-t", "--thread", action="store_true", help="fast scan")
|
|
@@ -104,7 +107,7 @@ def SnakeArgs():
|
|
|
104
107
|
"-l",
|
|
105
108
|
"--local",
|
|
106
109
|
action="store_true",
|
|
107
|
-
help="view you public
|
|
110
|
+
help="view you public ip - need internet",
|
|
108
111
|
)
|
|
109
112
|
args = parser.parse_args()
|
|
110
113
|
return args
|
|
@@ -248,6 +251,7 @@ if SnakeArgs().info:
|
|
|
248
251
|
print("".center(60, "-"))
|
|
249
252
|
if SnakeArgs().thread:
|
|
250
253
|
print(f"Thread".center(60, "-"))
|
|
254
|
+
PoolProcessExecutor(host)
|
|
251
255
|
for port in ports.keys():
|
|
252
256
|
t = Thread(
|
|
253
257
|
target=is_port_open_threads,
|
|
@@ -257,3 +261,8 @@ if SnakeArgs().thread:
|
|
|
257
261
|
t.start()
|
|
258
262
|
for t in threads:
|
|
259
263
|
t.join()
|
|
264
|
+
if SnakeArgs().version:
|
|
265
|
+
print(f"Build_{__version__}")
|
|
266
|
+
if SnakeArgs().speed:
|
|
267
|
+
print(f"ProcessPoolExecutor".center(60, "-"))
|
|
268
|
+
PoolProcessExecutor(host)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import socket
|
|
2
|
+
from termcolor import colored
|
|
3
|
+
from concurrent.futures import ProcessPoolExecutor
|
|
4
|
+
ports = {
|
|
5
|
+
20: "FTP-DATA",
|
|
6
|
+
21: "FTP",
|
|
7
|
+
22: "SSH",
|
|
8
|
+
23: "Telnet",
|
|
9
|
+
25: "SMTP",
|
|
10
|
+
43: "WHOIS",
|
|
11
|
+
53: "DNS",
|
|
12
|
+
67: "DHCP",
|
|
13
|
+
68: "DHCP",
|
|
14
|
+
69: "TFTP",
|
|
15
|
+
80: "http",
|
|
16
|
+
110: "POP3",
|
|
17
|
+
115: "SFTP",
|
|
18
|
+
123: "NTP",
|
|
19
|
+
139: "NetBios",
|
|
20
|
+
143: "IMAP",
|
|
21
|
+
161: "SNMP",
|
|
22
|
+
179: "BGP",
|
|
23
|
+
443: "HTTPS",
|
|
24
|
+
445: "MICROSOFT-DS",
|
|
25
|
+
465: "SSL/TLS",
|
|
26
|
+
514: "SYSLOG",
|
|
27
|
+
515: "PRINTER",
|
|
28
|
+
554: "RTSP",
|
|
29
|
+
587: "TLS/STARTTLS",
|
|
30
|
+
993: "IMAPS",
|
|
31
|
+
995: "POP3S",
|
|
32
|
+
1080: "SOCKS",
|
|
33
|
+
1194: "OpenVPN",
|
|
34
|
+
1433: "SQL Server",
|
|
35
|
+
1723: "PPTP",
|
|
36
|
+
2222: "SSH",
|
|
37
|
+
3128: "HTTP",
|
|
38
|
+
3268: "LDAP",
|
|
39
|
+
3306: "MySQL",
|
|
40
|
+
3389: "RDP",
|
|
41
|
+
5432: "PostgreSQL",
|
|
42
|
+
5900: "VNC",
|
|
43
|
+
8080: "Tomcat",
|
|
44
|
+
10000: "Webmin",
|
|
45
|
+
}
|
|
46
|
+
def is_port_open_threads(host, port):
|
|
47
|
+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
48
|
+
try:
|
|
49
|
+
s.settimeout(1)
|
|
50
|
+
s.connect((host, port))
|
|
51
|
+
except (OSError, socket.timeout):
|
|
52
|
+
try:
|
|
53
|
+
print(f"Closed{colored('|X|','red')}-->{ports.get(port)}|{port}|")
|
|
54
|
+
except:
|
|
55
|
+
print(f"Closed{colored('|X|','red')}-->|{port}|")
|
|
56
|
+
else:
|
|
57
|
+
print(f"Open{colored('|√|','green')}-->{ports.get(port)}|{port}|")
|
|
58
|
+
def PoolProcessExecutor(host):
|
|
59
|
+
with ProcessPoolExecutor(max_workers=None) as executor:
|
|
60
|
+
try:
|
|
61
|
+
for port in ports.keys():
|
|
62
|
+
future = executor.submit(is_port_open_threads,host,port)
|
|
63
|
+
|
|
64
|
+
except Exception as e:
|
|
65
|
+
print(e)
|
|
File without changes
|