SnakeScan 1.7.4__tar.gz → 1.7.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.7.5/PKG-INFO +102 -0
- snakescan-1.7.5/README.md +88 -0
- {snakescan-1.7.4 → snakescan-1.7.5}/SnakeScan/CLI.py +6 -154
- {snakescan-1.7.4 → snakescan-1.7.5}/SnakeScan/Get_ssl.py +1 -1
- snakescan-1.7.5/SnakeScan/PoolExecutor.py +112 -0
- {snakescan-1.7.4 → snakescan-1.7.5}/SnakeScan/__init__.py +1 -1
- snakescan-1.7.4/PKG-INFO +0 -67
- snakescan-1.7.4/README.md +0 -54
- snakescan-1.7.4/SnakeScan/PoolExecutor.py +0 -260
- {snakescan-1.7.4 → snakescan-1.7.5}/LICENSE +0 -0
- {snakescan-1.7.4 → snakescan-1.7.5}/SnakeScan/Check_subnet.py +0 -0
- {snakescan-1.7.4 → snakescan-1.7.5}/pyproject.toml +0 -0
snakescan-1.7.5/PKG-INFO
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: SnakeScan
|
|
3
|
+
Version: 1.7.5
|
|
4
|
+
Summary: IPv4 address scanner for collecting address information.Scan or get the IPv4 address from the IPv6 host
|
|
5
|
+
Author: Den*Ram
|
|
6
|
+
Requires-Python: >=3.7
|
|
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
|
+
|
|
14
|
+
<!--
|
|
15
|
+
|
|
16
|
+
This documentation was created with the assistance of the GeekBot language model and Den*Ram
|
|
17
|
+
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
# 🐍 SnakeScan: Your Go-To Python Port Scanner
|
|
21
|
+
|
|
22
|
+
✨ A powerful and flexible Python library for all your port scanning needs. ✨
|
|
23
|
+
|
|
24
|
+
[](https://pypi.org/project/SnakeScan/)
|
|
25
|
+
|
|
26
|
+
[](https://opensource.org/licenses/MIT)
|
|
27
|
+
|
|
28
|
+
[](https://www.python.org/)
|
|
29
|
+
|
|
30
|
+
[](https://github.com/yourusername/SnakeScan/releases) <!-- Replace yourusername with yours -->
|
|
31
|
+
|
|
32
|
+
[](https://www.python.org/)
|
|
33
|
+
|
|
34
|
+
**SnakeScan** is designed to be both easy to use and incredibly versatile. Whether you're performing basic single port checks or diving into advanced subnet scans and real-time monitoring, SnakeScan has you covered.
|
|
35
|
+
|
|
36
|
+
## 🌟 Key Features:
|
|
37
|
+
|
|
38
|
+
* **Unmatched Flexibility:** Scan single ports, defined ranges, or pre-configured sets with ease.
|
|
39
|
+
|
|
40
|
+
* **Blazing Fast Multithreading:** Leverage multithreading for significantly faster scanning speeds.
|
|
41
|
+
|
|
42
|
+
* **Get the Details:** Retrieve valuable information about IP addresses (supports both IPv4 and IPv6).
|
|
43
|
+
|
|
44
|
+
* **Real-time Monitoring with Watcher:** Keep a constant eye on critical ports and their statuses.
|
|
45
|
+
|
|
46
|
+
* **Intuitive Design:** Clean and simple command-line parameters and API for effortless use.
|
|
47
|
+
|
|
48
|
+
## ⬇️ Installation:
|
|
49
|
+
|
|
50
|
+
Get started with SnakeScan in seconds!
|
|
51
|
+
|
|
52
|
+
bash
|
|
53
|
+
|
|
54
|
+
pip install SnakeScan
|
|
55
|
+
|
|
56
|
+
## ⚙️ Command Line Usage: Unleash the Power!
|
|
57
|
+
|
|
58
|
+
### 💡 Mastering Attribute Usage:
|
|
59
|
+
|
|
60
|
+
* **-p**: Specify ports to scan (single or ranges). **Important:** When specifying ranges, the beginning of the range is only included from the second time. For example, to scan from 80 to 443, use `79-443`. Examples: `snake -p 80,443` or `snake -p 80,3437,8080,20-30,79-443`
|
|
61
|
+
|
|
62
|
+
* **-h**: Display a complete list of available attributes and their descriptions. Example: `snake -h` or `snake -help`
|
|
63
|
+
|
|
64
|
+
* **-sp**: Use a predefined set of common ports for scanning with `ProcessPoolExecutor`. Example: `snake -sp`
|
|
65
|
+
|
|
66
|
+
* **-v**: Show the current version of the SnakeScan library. Example: `snake -v`
|
|
67
|
+
|
|
68
|
+
* **-gs**: Retrieve the SSL/TLS certificate from a specified website. Example: `snake www.google.com -gs` (Without specifying a host, you’ll encounter a connection error).
|
|
69
|
+
|
|
70
|
+
* **-t**: Enable multithreading to speed up your port scans. Example: `snake -t`
|
|
71
|
+
|
|
72
|
+
* **-ch**: Scan a subnet to discover other IP addresses on the network. Example: `snake -ch`
|
|
73
|
+
|
|
74
|
+
* **-l**: Display your public IP address (requires an active internet connection). Example: `snake -l`
|
|
75
|
+
|
|
76
|
+
* **-i**: Show detailed information about a specific IP address (supports both IPv4 and IPv6). Example: `snake www.google.com -i`
|
|
77
|
+
|
|
78
|
+
## 💻 Python Code Integration:
|
|
79
|
+
|
|
80
|
+
### ⏱️ Watcher: The Real-Time Port Sentinel!
|
|
81
|
+
|
|
82
|
+
`Watcher` allows you to continuously monitor the status of a designated port.
|
|
83
|
+
|
|
84
|
+
python
|
|
85
|
+
|
|
86
|
+
from SnakeScan import Watcher
|
|
87
|
+
|
|
88
|
+
watcher = Watcher("localhost", 53, 2) # Host, port, check interval (in seconds)
|
|
89
|
+
|
|
90
|
+
watcher.start() # Begin monitoring!
|
|
91
|
+
|
|
92
|
+
#### `Watcher` Command Set:
|
|
93
|
+
|
|
94
|
+
* `Watcher.start()` - Starts the port monitoring process.
|
|
95
|
+
|
|
96
|
+
* `Watcher.stop()` - Halts the port monitoring process.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
**Latest Update:** 1.7.5 (Enhanced port designations for even clearer understanding)
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
This documentation was created with the assistance of the GeekBot language model and Den*Ram
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
# 🐍 SnakeScan: Your Go-To Python Port Scanner
|
|
8
|
+
|
|
9
|
+
✨ A powerful and flexible Python library for all your port scanning needs. ✨
|
|
10
|
+
|
|
11
|
+
[](https://pypi.org/project/SnakeScan/)
|
|
12
|
+
|
|
13
|
+
[](https://opensource.org/licenses/MIT)
|
|
14
|
+
|
|
15
|
+
[](https://www.python.org/)
|
|
16
|
+
|
|
17
|
+
[](https://github.com/yourusername/SnakeScan/releases) <!-- Replace yourusername with yours -->
|
|
18
|
+
|
|
19
|
+
[](https://www.python.org/)
|
|
20
|
+
|
|
21
|
+
**SnakeScan** is designed to be both easy to use and incredibly versatile. Whether you're performing basic single port checks or diving into advanced subnet scans and real-time monitoring, SnakeScan has you covered.
|
|
22
|
+
|
|
23
|
+
## 🌟 Key Features:
|
|
24
|
+
|
|
25
|
+
* **Unmatched Flexibility:** Scan single ports, defined ranges, or pre-configured sets with ease.
|
|
26
|
+
|
|
27
|
+
* **Blazing Fast Multithreading:** Leverage multithreading for significantly faster scanning speeds.
|
|
28
|
+
|
|
29
|
+
* **Get the Details:** Retrieve valuable information about IP addresses (supports both IPv4 and IPv6).
|
|
30
|
+
|
|
31
|
+
* **Real-time Monitoring with Watcher:** Keep a constant eye on critical ports and their statuses.
|
|
32
|
+
|
|
33
|
+
* **Intuitive Design:** Clean and simple command-line parameters and API for effortless use.
|
|
34
|
+
|
|
35
|
+
## ⬇️ Installation:
|
|
36
|
+
|
|
37
|
+
Get started with SnakeScan in seconds!
|
|
38
|
+
|
|
39
|
+
bash
|
|
40
|
+
|
|
41
|
+
pip install SnakeScan
|
|
42
|
+
|
|
43
|
+
## ⚙️ Command Line Usage: Unleash the Power!
|
|
44
|
+
|
|
45
|
+
### 💡 Mastering Attribute Usage:
|
|
46
|
+
|
|
47
|
+
* **-p**: Specify ports to scan (single or ranges). **Important:** When specifying ranges, the beginning of the range is only included from the second time. For example, to scan from 80 to 443, use `79-443`. Examples: `snake -p 80,443` or `snake -p 80,3437,8080,20-30,79-443`
|
|
48
|
+
|
|
49
|
+
* **-h**: Display a complete list of available attributes and their descriptions. Example: `snake -h` or `snake -help`
|
|
50
|
+
|
|
51
|
+
* **-sp**: Use a predefined set of common ports for scanning with `ProcessPoolExecutor`. Example: `snake -sp`
|
|
52
|
+
|
|
53
|
+
* **-v**: Show the current version of the SnakeScan library. Example: `snake -v`
|
|
54
|
+
|
|
55
|
+
* **-gs**: Retrieve the SSL/TLS certificate from a specified website. Example: `snake www.google.com -gs` (Without specifying a host, you’ll encounter a connection error).
|
|
56
|
+
|
|
57
|
+
* **-t**: Enable multithreading to speed up your port scans. Example: `snake -t`
|
|
58
|
+
|
|
59
|
+
* **-ch**: Scan a subnet to discover other IP addresses on the network. Example: `snake -ch`
|
|
60
|
+
|
|
61
|
+
* **-l**: Display your public IP address (requires an active internet connection). Example: `snake -l`
|
|
62
|
+
|
|
63
|
+
* **-i**: Show detailed information about a specific IP address (supports both IPv4 and IPv6). Example: `snake www.google.com -i`
|
|
64
|
+
|
|
65
|
+
## 💻 Python Code Integration:
|
|
66
|
+
|
|
67
|
+
### ⏱️ Watcher: The Real-Time Port Sentinel!
|
|
68
|
+
|
|
69
|
+
`Watcher` allows you to continuously monitor the status of a designated port.
|
|
70
|
+
|
|
71
|
+
python
|
|
72
|
+
|
|
73
|
+
from SnakeScan import Watcher
|
|
74
|
+
|
|
75
|
+
watcher = Watcher("localhost", 53, 2) # Host, port, check interval (in seconds)
|
|
76
|
+
|
|
77
|
+
watcher.start() # Begin monitoring!
|
|
78
|
+
|
|
79
|
+
#### `Watcher` Command Set:
|
|
80
|
+
|
|
81
|
+
* `Watcher.start()` - Starts the port monitoring process.
|
|
82
|
+
|
|
83
|
+
* `Watcher.stop()` - Halts the port monitoring process.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
**Latest Update:** 1.7.5 (Enhanced port designations for even clearer understanding)
|
|
88
|
+
|
|
@@ -27,160 +27,49 @@ Bool = True
|
|
|
27
27
|
boolsd = True
|
|
28
28
|
boolean = 0
|
|
29
29
|
ports = {
|
|
30
|
-
1: "Tcpmux",
|
|
31
|
-
2: "Compressnet-Managment",
|
|
32
|
-
3: "Compressnet-Compression",
|
|
33
|
-
5: "RUE",
|
|
34
|
-
7: "Echo",
|
|
35
|
-
9: "Discard",
|
|
36
|
-
11: "Systat",
|
|
37
|
-
13: "Daytime",
|
|
38
|
-
17: "QOTD",
|
|
39
|
-
18: "MSP",
|
|
40
|
-
19: "Chargen",
|
|
41
30
|
20: "FTP-Data",
|
|
42
31
|
21: "FTP-Control",
|
|
43
32
|
22: "SSH",
|
|
44
33
|
23: "Telnet",
|
|
45
34
|
24: "Priv-mail",
|
|
46
35
|
25: "SMTP",
|
|
47
|
-
27: "NSW-FE",
|
|
48
36
|
29: "MSG-ICP",
|
|
49
37
|
31: "MSG-AUTH",
|
|
50
38
|
33: "DSP",
|
|
51
39
|
35: "Priv-print",
|
|
52
|
-
37: "Time",
|
|
53
|
-
38: "RAP",
|
|
54
|
-
39: "RLP",
|
|
55
40
|
41: "Graphics",
|
|
56
41
|
42: "WINS",
|
|
57
42
|
43: "Whois",
|
|
58
|
-
44: "MPM-FLAGS",
|
|
59
|
-
45: "MPM",
|
|
60
|
-
46: "MPM-SND",
|
|
61
|
-
47: "NI-FTP",
|
|
62
43
|
48: "AUDITD",
|
|
63
|
-
49: "TACACS",
|
|
64
|
-
50: "RE-MAIL-CK",
|
|
65
|
-
52: "XNS-TIME",
|
|
66
|
-
53: "DNS",
|
|
67
|
-
54: "XNS-CH",
|
|
68
|
-
55: "ISI-GL",
|
|
69
44
|
57: "Priv-term",
|
|
70
|
-
58: "XNS-MAIL",
|
|
71
45
|
59: "Priv-file",
|
|
72
|
-
61: "NI-MAIL",
|
|
73
|
-
62: "ACAS",
|
|
74
46
|
63: "WHOISPP",
|
|
75
|
-
64: "COVIA",
|
|
76
|
-
65: "TACACS-DS",
|
|
77
47
|
66: "SQL-NET",
|
|
78
|
-
67: "BOOTPS/DHCP server",
|
|
79
|
-
68: "BOOTPC/DHCP client",
|
|
80
|
-
69: "TFTP",
|
|
81
|
-
70: "Gopher",
|
|
82
48
|
75: "Priv-dial",
|
|
83
|
-
76: "DEOS",
|
|
84
|
-
77: "Priv-RUE",
|
|
85
|
-
78: "VETTCP",
|
|
86
|
-
79: "Finger",
|
|
87
49
|
80: "HTTP",
|
|
88
|
-
84: "CTF",
|
|
89
|
-
87: "Priv-term-L",
|
|
90
|
-
88: "Kerberos",
|
|
91
|
-
92: "NPP",
|
|
92
|
-
93: "DCP",
|
|
93
|
-
97: "SWIFT-RVF",
|
|
94
|
-
98: "TACNEWS",
|
|
95
|
-
99: "METAGRAM",
|
|
96
|
-
101: "HOSTNAMESERVER",
|
|
97
|
-
102: "ISO-TSAP",
|
|
98
|
-
103: "GPPITNP",
|
|
99
|
-
104: "ACR-NEMA",
|
|
100
|
-
105: "CSO,CSNET-NS",
|
|
101
|
-
106: "3COM-TSMUX",
|
|
102
|
-
107: "RTELNET",
|
|
103
|
-
108: "SNAGAS",
|
|
104
50
|
109: "POP2",
|
|
105
51
|
110: "POP3",
|
|
106
|
-
111: "RPCbind",
|
|
107
|
-
112: "MCIDAS",
|
|
108
52
|
113: "ident",
|
|
109
53
|
115: "SFTP",
|
|
110
|
-
116: "ANSANOTIFY",
|
|
111
|
-
117: "UUCP-PATH",
|
|
112
54
|
118: "SQLServ",
|
|
113
55
|
119: "NNTP",
|
|
114
|
-
120: "CFDPTKT",
|
|
115
|
-
121: "ERPC",
|
|
116
|
-
122: "SMAKYNET",
|
|
117
|
-
123: "NTP",
|
|
118
|
-
135: "MS-Locator",
|
|
119
|
-
137: "NetBIOS-NS",
|
|
120
|
-
138: "NetBIOS-DGM",
|
|
121
56
|
139: "NetBIOS-SSN",
|
|
122
57
|
143: "IMAP",
|
|
123
|
-
161: "SNMP",
|
|
124
|
-
162: "SNMP-trap",
|
|
125
58
|
179: "BGP",
|
|
126
59
|
194: "IRC",
|
|
127
60
|
199: "SMUX",
|
|
128
61
|
200: "SRC",
|
|
129
|
-
201: "AppleTalk routing maintenance",
|
|
130
62
|
220: "IMAP3",
|
|
131
63
|
311: "ASIP-WEBADMIN",
|
|
132
|
-
318: "PKIX-TIMESTAMP",
|
|
133
|
-
321: "PIP",
|
|
134
|
-
322: "RTSPS",
|
|
135
|
-
322: "RPKI-RTR",
|
|
136
|
-
324: "RPKI-RTR-TLS",
|
|
137
|
-
343: "TEXAR",
|
|
138
64
|
344: "PDAP",
|
|
139
65
|
345: "PAWSERV",
|
|
140
66
|
346: "ZSERV",
|
|
141
67
|
347: "FATSERV",
|
|
142
|
-
381: "HP-COLLECTOR",
|
|
143
|
-
382: "HP-MANAGED-NODE",
|
|
144
|
-
383: "HP-ALARM-MGR",
|
|
145
|
-
384: "ARNS",
|
|
146
|
-
385: "IBM-APP",
|
|
147
|
-
386: "ASA",
|
|
148
|
-
387: "AURP",
|
|
149
|
-
388: "UNIDATA-LDM",
|
|
150
|
-
389: "LDAP",
|
|
151
68
|
401: "UPS",
|
|
152
69
|
413: "SMSP",
|
|
153
70
|
427: "SVRLOC",
|
|
154
71
|
443: "HTTPS",
|
|
155
72
|
444: "SNPP",
|
|
156
|
-
445: "SMB/MICROSOFT-DS",
|
|
157
|
-
464: "KPASSWD",
|
|
158
|
-
465: "URD/IGMPV3LITE/SMTPS",
|
|
159
|
-
500: "ISAKMP",
|
|
160
|
-
512: "EXEC/COMSAT/BIFF",
|
|
161
|
-
513: "LOGIN/WHO",
|
|
162
|
-
514: "SHELL/SYSLOG",
|
|
163
|
-
515: "PRINTER",
|
|
164
|
-
520: "RIP",
|
|
165
|
-
524: "NCP",
|
|
166
|
-
530: "COURIER-RPC",
|
|
167
|
-
540: "UUCP",
|
|
168
|
-
541: "UUCP-RLOGIN",
|
|
169
|
-
543: "KLOGIN",
|
|
170
|
-
544: "KSHELL",
|
|
171
|
-
546: "DHCPv6 client",
|
|
172
|
-
547: "DHCPv6 server",
|
|
173
|
-
551: "CYBERCASH",
|
|
174
|
-
554: "RTSP",
|
|
175
|
-
556: "REMOTEFS",
|
|
176
|
-
587: "Submission",
|
|
177
|
-
593: "HTTP-RPC-EPMAP",
|
|
178
|
-
600: "IPCSERVER",
|
|
179
|
-
601: "SYSLOG-CONN",
|
|
180
|
-
602: "XMLRPV-BEEP",
|
|
181
|
-
603: "IDPX",
|
|
182
|
-
604: "TUNNEL",
|
|
183
|
-
605: "SOAP-BEEP",
|
|
184
73
|
606: "URM",
|
|
185
74
|
607: "NQS",
|
|
186
75
|
631: "IPP",
|
|
@@ -189,78 +78,41 @@ ports = {
|
|
|
189
78
|
646: "LDP",
|
|
190
79
|
647: "DHCP-FAILOVER",
|
|
191
80
|
648: "RRP",
|
|
192
|
-
654: "AODV",
|
|
193
|
-
674: "ACAP",
|
|
194
|
-
691: "MSEXCH-ROUTING",
|
|
195
|
-
698: "OLSR",
|
|
196
|
-
700: "EPP",
|
|
197
|
-
701: "LMP",
|
|
198
|
-
702: "IRIS-BEEP",
|
|
199
|
-
704: "ELCSD",
|
|
200
|
-
705: "AGENTX",
|
|
201
|
-
706: "SILC",
|
|
202
|
-
707: "BORLAND-DSJ",
|
|
203
|
-
709: "ENTRUST-KMSH",
|
|
204
|
-
710: "ENTRUST-ASH",
|
|
205
|
-
711: "CISCO-TDP",
|
|
206
|
-
712: "TBRPF",
|
|
207
|
-
713: "IRIS-XPC/IRIS-XPCS",
|
|
208
|
-
715: "IRIS-LWZ",
|
|
209
|
-
716: "PANA",
|
|
210
|
-
729: "NETVIEWDM1",
|
|
211
|
-
730: "NETVIEWDM2",
|
|
212
|
-
731: "NETVIEWDM3",
|
|
213
|
-
748: "KERBEROS-ADM/RIS-CM",
|
|
214
|
-
750: "KERBEROS-IV",
|
|
215
81
|
753: "RRH",
|
|
216
82
|
830: "NETCONF-SSH",
|
|
217
83
|
831: "NETCONF-BEEP",
|
|
218
84
|
832: "NETCONFSOAPHTTP",
|
|
219
85
|
833: "NETCONFSOAPBEEP",
|
|
220
|
-
847: "DHCP-FAILOVER2",
|
|
221
|
-
848: "GDOI",
|
|
222
|
-
860: "ISCSI",
|
|
223
86
|
861: "OWAMP-CONTROL",
|
|
224
87
|
862: "TWAPM-CONTROL",
|
|
225
88
|
873: "RSYNC",
|
|
226
89
|
989: "FTPS-DATA",
|
|
227
90
|
990: "FTPS",
|
|
228
|
-
991: "NAS",
|
|
229
|
-
992: "TELNETS",
|
|
230
|
-
993: "IMAPS",
|
|
231
91
|
995: "POP3S",
|
|
232
92
|
1038: "MTQP",
|
|
233
93
|
1080: "SOCKS",
|
|
234
94
|
1194: "OpenVPN",
|
|
235
|
-
1433: "
|
|
236
|
-
1521: "Oracle",
|
|
95
|
+
1433: "SQL server",
|
|
237
96
|
1723: "PPTP",
|
|
238
|
-
2049: "NFS",
|
|
239
97
|
2222: "SSH",
|
|
240
|
-
3050: "gds_db-Interbase/Firebird",
|
|
241
|
-
3074: "Xbox Live",
|
|
242
98
|
3128: "HTTP",
|
|
243
99
|
3268: "LDAP",
|
|
244
100
|
3306: "MySQL",
|
|
245
|
-
3386: "GTP 3GPP GSM/UMTS CDR logging protocol",
|
|
246
101
|
3389: "RDP",
|
|
247
102
|
3455: "RSVP",
|
|
248
103
|
3632: "Distributed compiler",
|
|
249
104
|
3689: "DAAP",
|
|
250
|
-
3702: "WS-Discovery",
|
|
251
|
-
5060: "SIP",
|
|
252
|
-
5353: "MDNS",
|
|
253
105
|
5432: "PostgreSQL",
|
|
254
106
|
5900: "VNC",
|
|
255
|
-
8000: "HTTP
|
|
256
|
-
8080: "HTTP
|
|
257
|
-
8443: "HTTPS
|
|
258
|
-
8888: "HTTP
|
|
107
|
+
8000: "HTTP",
|
|
108
|
+
8080: "HTTP",
|
|
109
|
+
8443: "HTTPS",
|
|
110
|
+
8888: "HTTP",
|
|
259
111
|
10000: "Webmin",
|
|
260
112
|
}
|
|
261
113
|
|
|
262
114
|
|
|
263
|
-
version = "1.7.
|
|
115
|
+
version = "1.7.5"
|
|
264
116
|
|
|
265
117
|
|
|
266
118
|
def is_port_open(host, port):
|
|
@@ -9,7 +9,7 @@ def Get_ssl(host, port=443, timeout=2, protocol="HTTP/1.0"):
|
|
|
9
9
|
context = ssl.create_default_context()
|
|
10
10
|
ssock = context.wrap_socket(sock, server_hostname=host)
|
|
11
11
|
ssock.sendall(f"GET / {protocol}\r\nHost:{host}\r\n\r\n".encode("utf-8"))
|
|
12
|
-
data = ssock.recv(
|
|
12
|
+
data = ssock.recv(4096)
|
|
13
13
|
print(data.decode(errors="replace"))
|
|
14
14
|
ssock.close()
|
|
15
15
|
except Exception as e:
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import socket
|
|
2
|
+
from termcolor import colored
|
|
3
|
+
from concurrent.futures import ProcessPoolExecutor
|
|
4
|
+
|
|
5
|
+
ports = {
|
|
6
|
+
20: "FTP-Data",
|
|
7
|
+
21: "FTP-Control",
|
|
8
|
+
22: "SSH",
|
|
9
|
+
23: "Telnet",
|
|
10
|
+
24: "Priv-mail",
|
|
11
|
+
25: "SMTP",
|
|
12
|
+
29: "MSG-ICP",
|
|
13
|
+
31: "MSG-AUTH",
|
|
14
|
+
33: "DSP",
|
|
15
|
+
35: "Priv-print",
|
|
16
|
+
41: "Graphics",
|
|
17
|
+
42: "WINS",
|
|
18
|
+
43: "Whois",
|
|
19
|
+
48: "AUDITD",
|
|
20
|
+
57: "Priv-term",
|
|
21
|
+
59: "Priv-file",
|
|
22
|
+
63: "WHOISPP",
|
|
23
|
+
66: "SQL-NET",
|
|
24
|
+
75: "Priv-dial",
|
|
25
|
+
80: "HTTP",
|
|
26
|
+
109: "POP2",
|
|
27
|
+
110: "POP3",
|
|
28
|
+
113: "ident",
|
|
29
|
+
115: "SFTP",
|
|
30
|
+
118: "SQLServ",
|
|
31
|
+
119: "NNTP",
|
|
32
|
+
139: "NetBIOS-SSN",
|
|
33
|
+
143: "IMAP",
|
|
34
|
+
179: "BGP",
|
|
35
|
+
194: "IRC",
|
|
36
|
+
199: "SMUX",
|
|
37
|
+
200: "SRC",
|
|
38
|
+
220: "IMAP3",
|
|
39
|
+
311: "ASIP-WEBADMIN",
|
|
40
|
+
344: "PDAP",
|
|
41
|
+
345: "PAWSERV",
|
|
42
|
+
346: "ZSERV",
|
|
43
|
+
347: "FATSERV",
|
|
44
|
+
401: "UPS",
|
|
45
|
+
413: "SMSP",
|
|
46
|
+
427: "SVRLOC",
|
|
47
|
+
443: "HTTPS",
|
|
48
|
+
444: "SNPP",
|
|
49
|
+
606: "URM",
|
|
50
|
+
607: "NQS",
|
|
51
|
+
631: "IPP",
|
|
52
|
+
636: "LDAPS",
|
|
53
|
+
639: "MSDP",
|
|
54
|
+
646: "LDP",
|
|
55
|
+
647: "DHCP-FAILOVER",
|
|
56
|
+
648: "RRP",
|
|
57
|
+
753: "RRH",
|
|
58
|
+
830: "NETCONF-SSH",
|
|
59
|
+
831: "NETCONF-BEEP",
|
|
60
|
+
832: "NETCONFSOAPHTTP",
|
|
61
|
+
833: "NETCONFSOAPBEEP",
|
|
62
|
+
861: "OWAMP-CONTROL",
|
|
63
|
+
862: "TWAPM-CONTROL",
|
|
64
|
+
873: "RSYNC",
|
|
65
|
+
989: "FTPS-DATA",
|
|
66
|
+
990: "FTPS",
|
|
67
|
+
995: "POP3S",
|
|
68
|
+
1038: "MTQP",
|
|
69
|
+
1080: "SOCKS",
|
|
70
|
+
1194: "OpenVPN",
|
|
71
|
+
1433: "SQL server",
|
|
72
|
+
1723: "PPTP",
|
|
73
|
+
2222: "SSH",
|
|
74
|
+
3128: "HTTP",
|
|
75
|
+
3268: "LDAP",
|
|
76
|
+
3306: "MySQL",
|
|
77
|
+
3389: "RDP",
|
|
78
|
+
3455: "RSVP",
|
|
79
|
+
3632: "Distributed compiler",
|
|
80
|
+
3689: "DAAP",
|
|
81
|
+
5432: "PostgreSQL",
|
|
82
|
+
5900: "VNC",
|
|
83
|
+
8000: "HTTP",
|
|
84
|
+
8080: "HTTP",
|
|
85
|
+
8443: "HTTPS",
|
|
86
|
+
8888: "HTTP",
|
|
87
|
+
10000: "Webmin",
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def is_port_open_threads(host, port):
|
|
92
|
+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
93
|
+
try:
|
|
94
|
+
s.settimeout(1)
|
|
95
|
+
s.connect((host, port))
|
|
96
|
+
except (OSError, socket.timeout):
|
|
97
|
+
try:
|
|
98
|
+
print(f"Closed{colored('|X|','red')}-->{ports.get(port)}|{port}|")
|
|
99
|
+
except:
|
|
100
|
+
print(f"Closed{colored('|X|','red')}-->|{port}|")
|
|
101
|
+
else:
|
|
102
|
+
print(f"Open{colored('|√|','green')}-->{ports.get(port)}|{port}|")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def PoolProcessExecutor(host):
|
|
106
|
+
with ProcessPoolExecutor(max_workers=None) as executor:
|
|
107
|
+
try:
|
|
108
|
+
for port in ports.keys():
|
|
109
|
+
future = executor.submit(is_port_open_threads, host, port)
|
|
110
|
+
|
|
111
|
+
except Exception as e:
|
|
112
|
+
print(e)
|
snakescan-1.7.4/PKG-INFO
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: SnakeScan
|
|
3
|
-
Version: 1.7.4
|
|
4
|
-
Summary: IPv4 address scanner for collecting address information.Scan or get the IPv4 address from the IPv6 host
|
|
5
|
-
Author: Den*Ram
|
|
6
|
-
Requires-Python: >=3.7
|
|
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
|
-
|
|
14
|
-
# SnakeScan
|
|
15
|
-

|
|
16
|
-

|
|
17
|
-

|
|
18
|
-

|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
## Help with using the library
|
|
22
|
-
- -l need internet to view public ip you device
|
|
23
|
-
- -t threading port search
|
|
24
|
-
- -s single search ports
|
|
25
|
-
- -i information about host
|
|
26
|
-
- -help in host /-help port in host
|
|
27
|
-
- -check [host] scan subnet in ip
|
|
28
|
-
- exit in host or port off script
|
|
29
|
-
|
|
30
|
-
### Watcher commands
|
|
31
|
-
```
|
|
32
|
-
Watcher.start() - Starts checking ports
|
|
33
|
-
Watcher.stop() - Stops port checking
|
|
34
|
-
```
|
|
35
|
-
### Watcher
|
|
36
|
-
```
|
|
37
|
-
from SnakeScan import Watcher
|
|
38
|
-
watcher = Watcher("localhost",53,2)
|
|
39
|
-
watcher.start()
|
|
40
|
-
```
|
|
41
|
-
### Help with attributes
|
|
42
|
-
```
|
|
43
|
-
-P:
|
|
44
|
-
snake -p 80,443 #Scanning specific ports
|
|
45
|
-
snake -p 80,3437,8080,20-30,79-443 #Scanning individual ports and ranges. If you use ranges, then one port from the beginning is not be taken into account. For example:80-443 then it will start with 81-443, so you need to enter it from 79-443, then it will be taken into account
|
|
46
|
-
snake -p 80,3437,10-0,20-10,443-79 #You can enter ranges the other way around: 80-443,443-80 but the first value will start one port higher
|
|
47
|
-
-H:
|
|
48
|
-
#Displays a list of attribute usages
|
|
49
|
-
snake -h
|
|
50
|
-
snake -help
|
|
51
|
-
-SP:
|
|
52
|
-
-sp:snake -sp #Uses selected pre-selected range and uses for scanning ProcessPoolExecutor
|
|
53
|
-
-V:
|
|
54
|
-
snake -v #Shows the library version
|
|
55
|
-
-GS:
|
|
56
|
-
snake www.google.com -gs #Get a certificate from the official website. If you don't enter the hostname, you'll get this error [Errno 111] Connection refused
|
|
57
|
-
-T:
|
|
58
|
-
snake -t #Uses threads for port scanning
|
|
59
|
-
-CH:
|
|
60
|
-
snake -ch #Scans the subnet for others IP
|
|
61
|
-
-L:
|
|
62
|
-
snake -l #Shows your public internet IP address. Internet connection required for use
|
|
63
|
-
-I:
|
|
64
|
-
snake www.google.com -i #Shows information about the IP address.Can receive information from IPV4 and IPV6
|
|
65
|
-
|
|
66
|
-
#Update in 1.7.4
|
|
67
|
-
- Added more standart ports to fast scan
|
snakescan-1.7.4/README.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# SnakeScan
|
|
2
|
-

|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
## Help with using the library
|
|
9
|
-
- -l need internet to view public ip you device
|
|
10
|
-
- -t threading port search
|
|
11
|
-
- -s single search ports
|
|
12
|
-
- -i information about host
|
|
13
|
-
- -help in host /-help port in host
|
|
14
|
-
- -check [host] scan subnet in ip
|
|
15
|
-
- exit in host or port off script
|
|
16
|
-
|
|
17
|
-
### Watcher commands
|
|
18
|
-
```
|
|
19
|
-
Watcher.start() - Starts checking ports
|
|
20
|
-
Watcher.stop() - Stops port checking
|
|
21
|
-
```
|
|
22
|
-
### Watcher
|
|
23
|
-
```
|
|
24
|
-
from SnakeScan import Watcher
|
|
25
|
-
watcher = Watcher("localhost",53,2)
|
|
26
|
-
watcher.start()
|
|
27
|
-
```
|
|
28
|
-
### Help with attributes
|
|
29
|
-
```
|
|
30
|
-
-P:
|
|
31
|
-
snake -p 80,443 #Scanning specific ports
|
|
32
|
-
snake -p 80,3437,8080,20-30,79-443 #Scanning individual ports and ranges. If you use ranges, then one port from the beginning is not be taken into account. For example:80-443 then it will start with 81-443, so you need to enter it from 79-443, then it will be taken into account
|
|
33
|
-
snake -p 80,3437,10-0,20-10,443-79 #You can enter ranges the other way around: 80-443,443-80 but the first value will start one port higher
|
|
34
|
-
-H:
|
|
35
|
-
#Displays a list of attribute usages
|
|
36
|
-
snake -h
|
|
37
|
-
snake -help
|
|
38
|
-
-SP:
|
|
39
|
-
-sp:snake -sp #Uses selected pre-selected range and uses for scanning ProcessPoolExecutor
|
|
40
|
-
-V:
|
|
41
|
-
snake -v #Shows the library version
|
|
42
|
-
-GS:
|
|
43
|
-
snake www.google.com -gs #Get a certificate from the official website. If you don't enter the hostname, you'll get this error [Errno 111] Connection refused
|
|
44
|
-
-T:
|
|
45
|
-
snake -t #Uses threads for port scanning
|
|
46
|
-
-CH:
|
|
47
|
-
snake -ch #Scans the subnet for others IP
|
|
48
|
-
-L:
|
|
49
|
-
snake -l #Shows your public internet IP address. Internet connection required for use
|
|
50
|
-
-I:
|
|
51
|
-
snake www.google.com -i #Shows information about the IP address.Can receive information from IPV4 and IPV6
|
|
52
|
-
|
|
53
|
-
#Update in 1.7.4
|
|
54
|
-
- Added more standart ports to fast scan
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import socket
|
|
2
|
-
from termcolor import colored
|
|
3
|
-
from concurrent.futures import ProcessPoolExecutor
|
|
4
|
-
|
|
5
|
-
ports = {
|
|
6
|
-
1: "Tcpmux",
|
|
7
|
-
2: "Compressnet-Managment",
|
|
8
|
-
3: "Compressnet-Compression",
|
|
9
|
-
5: "RUE",
|
|
10
|
-
7: "Echo",
|
|
11
|
-
9: "Discard",
|
|
12
|
-
11: "Systat",
|
|
13
|
-
13: "Daytime",
|
|
14
|
-
17: "QOTD",
|
|
15
|
-
18: "MSP",
|
|
16
|
-
19: "Chargen",
|
|
17
|
-
20: "FTP-Data",
|
|
18
|
-
21: "FTP-Control",
|
|
19
|
-
22: "SSH",
|
|
20
|
-
23: "Telnet",
|
|
21
|
-
24: "Priv-mail",
|
|
22
|
-
25: "SMTP",
|
|
23
|
-
27: "NSW-FE",
|
|
24
|
-
29: "MSG-ICP",
|
|
25
|
-
31: "MSG-AUTH",
|
|
26
|
-
33: "DSP",
|
|
27
|
-
35: "Priv-print",
|
|
28
|
-
37: "Time",
|
|
29
|
-
38: "RAP",
|
|
30
|
-
39: "RLP",
|
|
31
|
-
41: "Graphics",
|
|
32
|
-
42: "WINS",
|
|
33
|
-
43: "Whois",
|
|
34
|
-
44: "MPM-FLAGS",
|
|
35
|
-
45: "MPM",
|
|
36
|
-
46: "MPM-SND",
|
|
37
|
-
47: "NI-FTP",
|
|
38
|
-
48: "AUDITD",
|
|
39
|
-
49: "TACACS",
|
|
40
|
-
50: "RE-MAIL-CK",
|
|
41
|
-
52: "XNS-TIME",
|
|
42
|
-
53: "DNS",
|
|
43
|
-
54: "XNS-CH",
|
|
44
|
-
55: "ISI-GL",
|
|
45
|
-
57: "Priv-term",
|
|
46
|
-
58: "XNS-MAIL",
|
|
47
|
-
59: "Priv-file",
|
|
48
|
-
61: "NI-MAIL",
|
|
49
|
-
62: "ACAS",
|
|
50
|
-
63: "WHOISPP",
|
|
51
|
-
64: "COVIA",
|
|
52
|
-
65: "TACACS-DS",
|
|
53
|
-
66: "SQL-NET",
|
|
54
|
-
67: "BOOTPS/DHCP server",
|
|
55
|
-
68: "BOOTPC/DHCP client",
|
|
56
|
-
69: "TFTP",
|
|
57
|
-
70: "Gopher",
|
|
58
|
-
75: "Priv-dial",
|
|
59
|
-
76: "DEOS",
|
|
60
|
-
77: "Priv-RUE",
|
|
61
|
-
78: "VETTCP",
|
|
62
|
-
79: "Finger",
|
|
63
|
-
80: "HTTP",
|
|
64
|
-
84: "CTF",
|
|
65
|
-
87: "Priv-term-L",
|
|
66
|
-
88: "Kerberos",
|
|
67
|
-
92: "NPP",
|
|
68
|
-
93: "DCP",
|
|
69
|
-
97: "SWIFT-RVF",
|
|
70
|
-
98: "TACNEWS",
|
|
71
|
-
99: "METAGRAM",
|
|
72
|
-
101: "HOSTNAMESERVER",
|
|
73
|
-
102: "ISO-TSAP",
|
|
74
|
-
103: "GPPITNP",
|
|
75
|
-
104: "ACR-NEMA",
|
|
76
|
-
105: "CSO,CSNET-NS",
|
|
77
|
-
106: "3COM-TSMUX",
|
|
78
|
-
107: "RTELNET",
|
|
79
|
-
108: "SNAGAS",
|
|
80
|
-
109: "POP2",
|
|
81
|
-
110: "POP3",
|
|
82
|
-
111: "RPCbind",
|
|
83
|
-
112: "MCIDAS",
|
|
84
|
-
113: "ident",
|
|
85
|
-
115: "SFTP",
|
|
86
|
-
116: "ANSANOTIFY",
|
|
87
|
-
117: "UUCP-PATH",
|
|
88
|
-
118: "SQLServ",
|
|
89
|
-
119: "NNTP",
|
|
90
|
-
120: "CFDPTKT",
|
|
91
|
-
121: "ERPC",
|
|
92
|
-
122: "SMAKYNET",
|
|
93
|
-
123: "NTP",
|
|
94
|
-
135: "MS-Locator",
|
|
95
|
-
137: "NetBIOS-NS",
|
|
96
|
-
138: "NetBIOS-DGM",
|
|
97
|
-
139: "NetBIOS-SSN",
|
|
98
|
-
143: "IMAP",
|
|
99
|
-
161: "SNMP",
|
|
100
|
-
162: "SNMP-trap",
|
|
101
|
-
179: "BGP",
|
|
102
|
-
194: "IRC",
|
|
103
|
-
199: "SMUX",
|
|
104
|
-
200: "SRC",
|
|
105
|
-
201: "AppleTalk routing maintenance",
|
|
106
|
-
220: "IMAP3",
|
|
107
|
-
311: "ASIP-WEBADMIN",
|
|
108
|
-
318: "PKIX-TIMESTAMP",
|
|
109
|
-
321: "PIP",
|
|
110
|
-
322: "RTSPS",
|
|
111
|
-
322: "RPKI-RTR",
|
|
112
|
-
324: "RPKI-RTR-TLS",
|
|
113
|
-
343: "TEXAR",
|
|
114
|
-
344: "PDAP",
|
|
115
|
-
345: "PAWSERV",
|
|
116
|
-
346: "ZSERV",
|
|
117
|
-
347: "FATSERV",
|
|
118
|
-
381: "HP-COLLECTOR",
|
|
119
|
-
382: "HP-MANAGED-NODE",
|
|
120
|
-
383: "HP-ALARM-MGR",
|
|
121
|
-
384: "ARNS",
|
|
122
|
-
385: "IBM-APP",
|
|
123
|
-
386: "ASA",
|
|
124
|
-
387: "AURP",
|
|
125
|
-
388: "UNIDATA-LDM",
|
|
126
|
-
389: "LDAP",
|
|
127
|
-
401: "UPS",
|
|
128
|
-
413: "SMSP",
|
|
129
|
-
427: "SVRLOC",
|
|
130
|
-
443: "HTTPS",
|
|
131
|
-
444: "SNPP",
|
|
132
|
-
445: "SMB/MICROSOFT-DS",
|
|
133
|
-
464: "KPASSWD",
|
|
134
|
-
465: "URD/IGMPV3LITE/SMTPS",
|
|
135
|
-
500: "ISAKMP",
|
|
136
|
-
512: "EXEC/COMSAT/BIFF",
|
|
137
|
-
513: "LOGIN/WHO",
|
|
138
|
-
514: "SHELL/SYSLOG",
|
|
139
|
-
515: "PRINTER",
|
|
140
|
-
520: "RIP",
|
|
141
|
-
524: "NCP",
|
|
142
|
-
530: "COURIER-RPC",
|
|
143
|
-
540: "UUCP",
|
|
144
|
-
541: "UUCP-RLOGIN",
|
|
145
|
-
543: "KLOGIN",
|
|
146
|
-
544: "KSHELL",
|
|
147
|
-
546: "DHCPv6 client",
|
|
148
|
-
547: "DHCPv6 server",
|
|
149
|
-
551: "CYBERCASH",
|
|
150
|
-
554: "RTSP",
|
|
151
|
-
556: "REMOTEFS",
|
|
152
|
-
587: "Submission",
|
|
153
|
-
593: "HTTP-RPC-EPMAP",
|
|
154
|
-
600: "IPCSERVER",
|
|
155
|
-
601: "SYSLOG-CONN",
|
|
156
|
-
602: "XMLRPV-BEEP",
|
|
157
|
-
603: "IDPX",
|
|
158
|
-
604: "TUNNEL",
|
|
159
|
-
605: "SOAP-BEEP",
|
|
160
|
-
606: "URM",
|
|
161
|
-
607: "NQS",
|
|
162
|
-
631: "IPP",
|
|
163
|
-
636: "LDAPS",
|
|
164
|
-
639: "MSDP",
|
|
165
|
-
646: "LDP",
|
|
166
|
-
647: "DHCP-FAILOVER",
|
|
167
|
-
648: "RRP",
|
|
168
|
-
654: "AODV",
|
|
169
|
-
674: "ACAP",
|
|
170
|
-
691: "MSEXCH-ROUTING",
|
|
171
|
-
698: "OLSR",
|
|
172
|
-
700: "EPP",
|
|
173
|
-
701: "LMP",
|
|
174
|
-
702: "IRIS-BEEP",
|
|
175
|
-
704: "ELCSD",
|
|
176
|
-
705: "AGENTX",
|
|
177
|
-
706: "SILC",
|
|
178
|
-
707: "BORLAND-DSJ",
|
|
179
|
-
709: "ENTRUST-KMSH",
|
|
180
|
-
710: "ENTRUST-ASH",
|
|
181
|
-
711: "CISCO-TDP",
|
|
182
|
-
712: "TBRPF",
|
|
183
|
-
713: "IRIS-XPC/IRIS-XPCS",
|
|
184
|
-
715: "IRIS-LWZ",
|
|
185
|
-
716: "PANA",
|
|
186
|
-
729: "NETVIEWDM1",
|
|
187
|
-
730: "NETVIEWDM2",
|
|
188
|
-
731: "NETVIEWDM3",
|
|
189
|
-
748: "KERBEROS-ADM/RIS-CM",
|
|
190
|
-
750: "KERBEROS-IV",
|
|
191
|
-
753: "RRH",
|
|
192
|
-
830: "NETCONF-SSH",
|
|
193
|
-
831: "NETCONF-BEEP",
|
|
194
|
-
832: "NETCONFSOAPHTTP",
|
|
195
|
-
833: "NETCONFSOAPBEEP",
|
|
196
|
-
847: "DHCP-FAILOVER2",
|
|
197
|
-
848: "GDOI",
|
|
198
|
-
860: "ISCSI",
|
|
199
|
-
861: "OWAMP-CONTROL",
|
|
200
|
-
862: "TWAPM-CONTROL",
|
|
201
|
-
873: "RSYNC",
|
|
202
|
-
989: "FTPS-DATA",
|
|
203
|
-
990: "FTPS",
|
|
204
|
-
991: "NAS",
|
|
205
|
-
992: "TELNETS",
|
|
206
|
-
993: "IMAPS",
|
|
207
|
-
995: "POP3S",
|
|
208
|
-
1038: "MTQP",
|
|
209
|
-
1080: "SOCKS",
|
|
210
|
-
1194: "OpenVPN",
|
|
211
|
-
1433: "Microsoft SQL server",
|
|
212
|
-
1521: "Oracle",
|
|
213
|
-
1723: "PPTP",
|
|
214
|
-
2049: "NFS",
|
|
215
|
-
2222: "SSH",
|
|
216
|
-
3050: "gds_db-Interbase/Firebird",
|
|
217
|
-
3074: "Xbox Live",
|
|
218
|
-
3128: "HTTP",
|
|
219
|
-
3268: "LDAP",
|
|
220
|
-
3306: "MySQL",
|
|
221
|
-
3386: "GTP 3GPP GSM/UMTS CDR logging protocol",
|
|
222
|
-
3389: "RDP",
|
|
223
|
-
3455: "RSVP",
|
|
224
|
-
3632: "Distributed compiler",
|
|
225
|
-
3689: "DAAP",
|
|
226
|
-
3702: "WS-Discovery",
|
|
227
|
-
5060: "SIP",
|
|
228
|
-
5353: "MDNS",
|
|
229
|
-
5432: "PostgreSQL",
|
|
230
|
-
5900: "VNC",
|
|
231
|
-
8000: "HTTP alternate",
|
|
232
|
-
8080: "HTTP alternate",
|
|
233
|
-
8443: "HTTPS alternate",
|
|
234
|
-
8888: "HTTP alternate",
|
|
235
|
-
10000: "Webmin",
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
def is_port_open_threads(host, port):
|
|
240
|
-
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
241
|
-
try:
|
|
242
|
-
s.settimeout(1)
|
|
243
|
-
s.connect((host, port))
|
|
244
|
-
except (OSError, socket.timeout):
|
|
245
|
-
try:
|
|
246
|
-
print(f"Closed{colored('|X|','red')}-->{ports.get(port)}|{port}|")
|
|
247
|
-
except:
|
|
248
|
-
print(f"Closed{colored('|X|','red')}-->|{port}|")
|
|
249
|
-
else:
|
|
250
|
-
print(f"Open{colored('|√|','green')}-->{ports.get(port)}|{port}|")
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
def PoolProcessExecutor(host):
|
|
254
|
-
with ProcessPoolExecutor(max_workers=None) as executor:
|
|
255
|
-
try:
|
|
256
|
-
for port in ports.keys():
|
|
257
|
-
future = executor.submit(is_port_open_threads, host, port)
|
|
258
|
-
|
|
259
|
-
except Exception as e:
|
|
260
|
-
print(e)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|