|
17 | 17 |
|
18 | 18 | def get_cli_args(): |
19 | 19 | parser = argparse.ArgumentParser(description="Script for running end to end tests for nxc") |
20 | | - parser.add_argument( |
21 | | - "--executable", |
22 | | - default="netexec" |
23 | | - ) |
24 | | - parser.add_argument( |
25 | | - "-t", |
26 | | - "--target", |
27 | | - required=True |
28 | | - ) |
29 | | - parser.add_argument( |
30 | | - "-u", |
31 | | - "--user", |
32 | | - "--username", |
33 | | - dest="username", |
34 | | - required=True |
35 | | - ) |
36 | | - parser.add_argument( |
37 | | - "-p", |
38 | | - "--pass", |
39 | | - "--password", |
40 | | - dest="password", |
41 | | - required=True |
42 | | - ) |
43 | | - parser.add_argument( |
44 | | - "-k", |
45 | | - "--kerberos", |
46 | | - action="store_true", |
47 | | - required=False, |
48 | | - help="Use kerberos authentication", |
49 | | - ) |
50 | | - parser.add_argument( |
51 | | - "-v", |
52 | | - "--verbose", |
53 | | - action="store_true", |
54 | | - required=False, |
55 | | - help="Display full command output", |
56 | | - ) |
57 | | - parser.add_argument( |
58 | | - "-e", |
59 | | - "--errors", |
60 | | - action="store_true", |
61 | | - required=False, |
62 | | - help="Display errors from commands", |
63 | | - ) |
64 | | - parser.add_argument( |
65 | | - "--not-tested", |
66 | | - action="store_true", |
67 | | - required=False, |
68 | | - help="Display commands that didn't get tested", |
69 | | - ) |
70 | | - parser.add_argument( |
71 | | - "--poetry", |
72 | | - action="store_true", |
73 | | - required=False, |
74 | | - help="Use poetry to run commands", |
75 | | - ) |
76 | | - parser.add_argument( |
77 | | - "--protocols", |
78 | | - nargs="+", |
79 | | - default=[], |
80 | | - required=False, |
81 | | - help="Protocols to test", |
82 | | - ) |
83 | | - parser.add_argument( |
84 | | - "--line-nums", |
85 | | - nargs="+", |
86 | | - type=parse_line_nums, |
87 | | - required=False, |
88 | | - help="Specify line numbers or ranges to run commands from", |
89 | | - ) |
90 | | - parser.add_argument( |
91 | | - "--test-user-file", |
92 | | - required=False, |
93 | | - default=normpath(join(script_dir, "data", "test_users.txt")), |
94 | | - help="Path to the file containing test usernames", |
95 | | - ) |
96 | | - parser.add_argument( |
97 | | - "--test-password-file", |
98 | | - required=False, |
99 | | - default=normpath(join(script_dir, "data", "test_passwords.txt")), |
100 | | - help="Path to the file containing test passwords", |
101 | | - ) |
102 | | - parser.add_argument( |
103 | | - "--amsi-bypass-file", |
104 | | - required=False, |
105 | | - default=normpath(join(script_dir, "data", "test_amsi_bypass.txt")), |
106 | | - help="Path to the file containing AMSI bypasses", |
107 | | - ) |
108 | | - parser.add_argument( |
109 | | - "--test-normal-file", |
110 | | - required=False, |
111 | | - default=normpath(join(script_dir, "data", "test_file.txt")), |
112 | | - help="Path to file to upload/download" |
113 | | - ) |
114 | | - parser.add_argument( |
115 | | - "--dns-server", |
116 | | - action="store", |
117 | | - required=False, |
118 | | - help="Specify DNS server", |
119 | | - ) |
| 20 | + parser.add_argument("--executable", default="netexec") |
| 21 | + parser.add_argument("-t", "--target", required=True) |
| 22 | + parser.add_argument("-u", "--user", "--username", dest="username", required=True) |
| 23 | + parser.add_argument("-p", "--pass", "--password", dest="password", required=True) |
| 24 | + parser.add_argument("-k", "--kerberos", action="store_true", required=False, help="Use kerberos authentication") |
| 25 | + parser.add_argument("-v", "--verbose", action="store_true", required=False, help="Display full command output") |
| 26 | + parser.add_argument("-e", "--errors", action="store_true", required=False, help="Display errors from commands") |
| 27 | + parser.add_argument("--not-tested", action="store_true", required=False, help="Display commands that didn't get tested") |
| 28 | + parser.add_argument("--poetry", action="store_true", required=False, help="Use poetry to run commands") |
| 29 | + parser.add_argument("--protocols", nargs="+", default=[], required=False, help="Protocols to test") |
| 30 | + parser.add_argument("--line-nums", nargs="+", type=parse_line_nums, required=False, help="Specify line numbers or ranges to run commands from") |
| 31 | + parser.add_argument("--test-user-file", required=False, default=normpath(join(script_dir, "data", "test_users.txt")), help="Path to the file containing test usernames") |
| 32 | + parser.add_argument("--test-password-file", required=False, default=normpath(join(script_dir, "data", "test_passwords.txt")), help="Path to the file containing test passwords") |
| 33 | + parser.add_argument("--amsi-bypass-file", required=False, default=normpath(join(script_dir, "data", "test_amsi_bypass.txt")), help="Path to the file containing AMSI bypasses") |
| 34 | + parser.add_argument("--test-normal-file", required=False, default=normpath(join(script_dir, "data", "test_file.txt")), help="Path to file to upload/download") |
| 35 | + parser.add_argument("--dns-server", action="store", required=False, help="Specify DNS server") |
120 | 36 | return parser.parse_args() |
121 | 37 |
|
122 | 38 |
|
|
0 commit comments