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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SnakeScan
3
- Version: 1.5.8
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
- $ SnakeConsole -h
46
- usage: SnakeConsole [-h] [-i] [-p PORTS] [-s SINGLE] [-t]
47
- [-ch] [-l]
48
- [host]
45
+ usage: Snake [-h] [-sp] [-v] [-i] [-p PORTS] [-s SINGLE]
46
+ [-t] [-ch] [-l]
47
+ [host]
49
48
 
50
- SnakeCLI - It's a command line module SnakeScan. Use him
51
- for more fast starting
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
- -i, --info info about host
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 local ip:need internet
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
- $ SnakeConsole -h
32
- usage: SnakeConsole [-h] [-i] [-p PORTS] [-s SINGLE] [-t]
33
- [-ch] [-l]
34
- [host]
31
+ usage: Snake [-h] [-sp] [-v] [-i] [-p PORTS] [-s SINGLE]
32
+ [-t] [-ch] [-l]
33
+ [host]
35
34
 
36
- SnakeCLI - It's a command line module SnakeScan. Use him
37
- for more fast starting
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
- -i, --info info about host
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 local ip:need internet
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="SnakeCLI - It's a command line module SnakeScan. Use him for more fast starting"
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("-i", "--info", action="store_true", help="info about host")
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 local ip:need internet",
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)
@@ -55,4 +55,4 @@ def Check_network(host):
55
55
  for t in threads:
56
56
  t.join()
57
57
  except ValueError as e:
58
- print(f"Ошибка при создании объекта сети: {e}")
58
+ print(f"Error creating network object {e}")
@@ -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)
@@ -1,6 +1,6 @@
1
1
  """Module SnakeScan"""
2
2
 
3
- __version__ = "1.5.8"
3
+ __version__ = "1.5.9"
4
4
  import socket
5
5
  import ipaddress
6
6
  from art import tprint
@@ -20,4 +20,4 @@ Homepage = "https://github.com/Den-Ram/SnakeScan"
20
20
  Repository = "https://github.com/Den-Ram/SnakeScan"
21
21
  [project.scripts]
22
22
  SnakeScan = "SnakeScan:run"
23
- SnakeConsole = "SnakeScan.SnakeCLI:main"
23
+ Snake = "SnakeScan.CLI:main"
File without changes