forked from JPaulMora/Pyrit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyrit_cli.py
More file actions
42 lines (32 loc) · 997 Bytes
/
pyrit_cli.py
File metadata and controls
42 lines (32 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
import sys
class PyritRuntimeError(Exception):
"""Custom exception for Pyrit CLI errors."""
pass
class Pyrit_CLI:
def __init__(self):
pass
def initFromArgv(self):
if len(sys.argv) <= 1 or sys.argv[1] in ("-h", "--help"):
self.print_help()
else:
print(f"Unrecognized option: {sys.argv[1]}")
raise PyritRuntimeError("Invalid argument")
def print_help(self):
print("""\
Pyrit 0.4.0 - WPA/WPA2-PSK attack tool
Usage: pyrit <command> [options]
Commands:
analyze Analyze captured data
batch Batch-process packets
benchmark Run CPU benchmarks
help Show this help message
For more help on a command, run: pyrit help <command>
""")
# Entry point for /usr/local/bin/pyrit
if __name__ == "__main__":
try:
Pyrit_CLI().initFromArgv()
except PyritRuntimeError as e:
print(f"Error: {e}")
sys.exit(1)