SnakeScan 1.9.8__tar.gz → 1.9.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.9.8
3
+ Version: 1.9.9
4
4
  Summary: Unlock the potential of your network with this powerful IPv4 address scanner. Easily scan IP address ranges, identify active hosts, and even extract IPv4 addresses from IPv6 environments. Enhance your network monitoring, troubleshooting, and security analysis!
5
5
  Author: Den*Ram
6
6
  Requires-Python: >=3.7
@@ -11,7 +11,7 @@ Requires-Dist: tqdm
11
11
  Requires-Dist: termcolor
12
12
 
13
13
  <!--
14
- This documentation was created with GeekBot Language Model and Den*Ram
14
+ This documentation was created using the Language Model Geekbot and DEN-RAM. All code provided in the Python package is created exclusively by the author.
15
15
 
16
16
  -->
17
17
 
@@ -70,21 +70,23 @@ flit install
70
70
 
71
71
  ## ⌨️ Command Line Usage:
72
72
 
73
- * * Commands for individual actions (Updating 1.9.8): scan{save}, info, dict.
73
+ * Commands for individual actions (Updating 1.9.8): scan{save}, info, dict.
74
74
 
75
- * * Commands cannot be used in one line: Snake scan -t info -i dict -d ~ cause an error due to incorrect command input.
75
+ * Commands cannot be used in one line: Snake scan -t info -i dict -d ~ cause an error due to incorrect command input.
76
76
 
77
- * * The optional "save" command was added to the "scan" command.
77
+ * The optional "save" command was added to the "scan" command.
78
78
 
79
- * * "save" ~ Attributes -
79
+ * "save" ~ Attributes -
80
80
  "-s", "--save", help= Gives permission to save the file.
81
81
  "-n", "--name", help= The name of the file to be saved.
82
82
  "-p", "--path", help= Specify your own file save path.
83
83
  "-a", "--append", help= Add an existing file with data. **WARNING: By default, the file is overwritten every time you save it using this argument, the file will be supplemented without overwriting the content.
84
84
 
85
85
  ### 💡 Attribute Reference:
86
-
87
- * **-hs --host**: Provides the ability to enter a host. **WARNING: If the value is not specified, the default value will be used. **Default value: localhost.`
86
+
87
+ * **-hf --hostfile**: Allows you to use a file with pre-known hosts. **Example: snake -hf myPath/hosts.json,myPath/home/hosts_to_scan.json. **Format: JSON. **WARNING: Can take multiple host file paths or one as an argument value. If this argument is applied, the -hs[host] argument will not be applied.`
88
+
89
+ * **-hs --host**: Provides the ability to enter a host. **WARNING: If value and argument are not specified, the default value will be used. **Default value: localhost.`
88
90
 
89
91
  * **-time**: Sets a timeout for each port. Examples: `snake scan -time 4`
90
92
 
@@ -154,5 +156,5 @@ watcher.start() # Start monitoring!
154
156
 
155
157
  ---
156
158
 
157
- **Last Updated:** 1.9.8 (Bug fix)
159
+ **Last Updated:** 1.9.9 (Fix bugs, added the -hf argument, --hostfile.)
158
160
 
@@ -1,5 +1,5 @@
1
1
  <!--
2
- This documentation was created with GeekBot Language Model and Den*Ram
2
+ This documentation was created using the Language Model Geekbot and DEN-RAM. All code provided in the Python package is created exclusively by the author.
3
3
 
4
4
  -->
5
5
 
@@ -58,21 +58,23 @@ flit install
58
58
 
59
59
  ## ⌨️ Command Line Usage:
60
60
 
61
- * * Commands for individual actions (Updating 1.9.8): scan{save}, info, dict.
61
+ * Commands for individual actions (Updating 1.9.8): scan{save}, info, dict.
62
62
 
63
- * * Commands cannot be used in one line: Snake scan -t info -i dict -d ~ cause an error due to incorrect command input.
63
+ * Commands cannot be used in one line: Snake scan -t info -i dict -d ~ cause an error due to incorrect command input.
64
64
 
65
- * * The optional "save" command was added to the "scan" command.
65
+ * The optional "save" command was added to the "scan" command.
66
66
 
67
- * * "save" ~ Attributes -
67
+ * "save" ~ Attributes -
68
68
  "-s", "--save", help= Gives permission to save the file.
69
69
  "-n", "--name", help= The name of the file to be saved.
70
70
  "-p", "--path", help= Specify your own file save path.
71
71
  "-a", "--append", help= Add an existing file with data. **WARNING: By default, the file is overwritten every time you save it using this argument, the file will be supplemented without overwriting the content.
72
72
 
73
73
  ### 💡 Attribute Reference:
74
-
75
- * **-hs --host**: Provides the ability to enter a host. **WARNING: If the value is not specified, the default value will be used. **Default value: localhost.`
74
+
75
+ * **-hf --hostfile**: Allows you to use a file with pre-known hosts. **Example: snake -hf myPath/hosts.json,myPath/home/hosts_to_scan.json. **Format: JSON. **WARNING: Can take multiple host file paths or one as an argument value. If this argument is applied, the -hs[host] argument will not be applied.`
76
+
77
+ * **-hs --host**: Provides the ability to enter a host. **WARNING: If value and argument are not specified, the default value will be used. **Default value: localhost.`
76
78
 
77
79
  * **-time**: Sets a timeout for each port. Examples: `snake scan -time 4`
78
80
 
@@ -142,4 +144,4 @@ watcher.start() # Start monitoring!
142
144
 
143
145
  ---
144
146
 
145
- **Last Updated:** 1.9.8 (Bug fix)
147
+ **Last Updated:** 1.9.9 (Fix bugs, added the -hf argument, --hostfile.)
@@ -296,7 +296,7 @@ else:
296
296
  if __name__ == "__main__":
297
297
  main()
298
298
 
299
- version = "1.9.8"
299
+ version = "1.9.9"
300
300
 
301
301
 
302
302
  def is_port_open(host, port, argument=None, protocol=socket.SOCK_STREAM, timeout=1):
@@ -436,6 +436,13 @@ def SnakeArgs():
436
436
  default="None",
437
437
  help="Provides the ability to enter a host. **WARNING: If the value is not specified, the default value will be used. **Default value: localhost.",
438
438
  )
439
+ parser.add_argument(
440
+ "-hf",
441
+ "--hostfile",
442
+ nargs="?",
443
+ default=False,
444
+ help="Allows you to use a file with pre-known hosts. **Example: snake -hf myPath/hosts.json,myPath/home/hosts_to_scan.json. **Format: JSON. **WARNING: Can take multiple host file paths or one as an argument value. If this argument is applied, the -hs[host] argument will not be applied.",
445
+ )
439
446
  command = parser.add_subparsers(dest="command", help="List of commands")
440
447
  scan = command.add_parser(name="scan", help="Allows you to use scanning.")
441
448
  scan.add_argument(
@@ -565,6 +572,26 @@ for n in range(len(host)):
565
572
  if host[0] == "None":
566
573
  host[0] = "localhost"
567
574
 
575
+ if SnakeArgs().hostfile:
576
+ host = []
577
+ hosting = []
578
+ hostfiles = SnakeArgs().hostfile.split(",")
579
+ for h in hostfiles:
580
+ try:
581
+ host.append(load_json_config(h))
582
+ except Exception as e:
583
+ print(f"[!] WARNING: Error - {e}")
584
+ continue
585
+ try:
586
+ for n in host:
587
+ for i in n.values():
588
+ hosting.append(i)
589
+ host = hosting
590
+ except Exception as e:
591
+ print(
592
+ f"[!] Warning: Error - syntax error has been made when entering the file path to the file(s)."
593
+ )
594
+
568
595
  if SnakeArgs().command == "scan":
569
596
  scan_protocol = socket.SOCK_DGRAM if SnakeArgs().udp else socket.SOCK_STREAM
570
597
 
@@ -679,6 +706,7 @@ if SnakeArgs().command == "scan":
679
706
  excepthost = []
680
707
  for n in range(len(host)):
681
708
  OpenPorts = []
709
+ print(f"|{host[n]}|".center(60, "—"))
682
710
  for port in range(len(port_user)):
683
711
  if is_port_open(host[n], port_user[port], None, scan_protocol, timeout):
684
712
  print(
@@ -698,6 +726,7 @@ if SnakeArgs().command == "scan":
698
726
  print(
699
727
  f"{colored(f'{port_user[port]}','red')}-->{colored(f'|X|','red')}"
700
728
  )
729
+ print("".center(60, "—"))
701
730
  try:
702
731
  first = rangeports[::2]
703
732
  second = rangeports[1::2]
@@ -845,7 +874,7 @@ if SnakeArgs().command == "scan":
845
874
  )
846
875
  future.result()
847
876
  except Exception as e:
848
- print("".center(60, "—"))
877
+ print(f"|{host[n]}|".center(60, "—"))
849
878
  print(e)
850
879
  print("".center(60, "—"))
851
880
 
@@ -1,6 +1,6 @@
1
1
  """Unlock the potential of your network with this powerful IPv4 address scanner. Easily scan IP address ranges, identify active hosts, and even extract IPv4 addresses from IPv6 environments. Enhance your network monitoring, troubleshooting, and security analysis!"""
2
2
 
3
- __version__ = "1.9.8"
3
+ __version__ = "1.9.9"
4
4
  import socket
5
5
  from time import sleep
6
6
  from termcolor import colored
File without changes
File without changes