MCPcopy Create free account
hub / github.com/fortra/impacket / parse_args

Function parse_args

examples/rbcd.py:263–302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

261 return False
262
263def parse_args():
264 parser = argparse.ArgumentParser(add_help=True,
265 description='Python (re)setter for property msDS-AllowedToActOnBehalfOfOtherIdentity for Kerberos RBCD attacks.')
266 parser.add_argument('identity', action='store', help='domain.local/username[:password]')
267 parser.add_argument("-delegate-to", type=str, required=True,
268 help="Target account the DACL is to be read/edited/etc.")
269 parser.add_argument("-delegate-from", type=str, required=False,
270 help="Attacker controlled account to write on the rbcd property of -delegate-to (only when using `-action write`)")
271 parser.add_argument('-action', choices=['read', 'write', 'remove', 'flush'], nargs='?', default='read',
272 help='Action to operate on msDS-AllowedToActOnBehalfOfOtherIdentity')
273
274 parser.add_argument('-use-ldaps', action='store_true', help='Use LDAPS instead of LDAP')
275
276 parser.add_argument('-ts', action='store_true', help='Adds timestamp to every logging output')
277 parser.add_argument('-debug', action='store_true', help='Turn DEBUG output ON')
278
279 group = parser.add_argument_group('authentication')
280 group.add_argument('-hashes', action="store", metavar="LMHASH:NTHASH", help='NTLM hashes, format is LMHASH:NTHASH')
281 group.add_argument('-no-pass', action="store_true", help='don\'t ask for password (useful for -k)')
282 group.add_argument('-k', action="store_true",
283 help='Use Kerberos authentication. Grabs credentials from ccache file '
284 '(KRB5CCNAME) based on target parameters. If valid credentials '
285 'cannot be found, it will use the ones specified in the command '
286 'line')
287 group.add_argument('-aesKey', action="store", metavar="hex key", help='AES key to use for Kerberos Authentication '
288 '(128 or 256 bits)')
289
290 group = parser.add_argument_group('connection')
291
292 group.add_argument('-dc-ip', action='store', metavar="ip address",
293 help='IP Address of the domain controller or KDC (Key Distribution Center) for Kerberos. If '
294 'omitted it will use the domain part (FQDN) specified in '
295 'the identity parameter')
296 group.add_argument('-dc-host', action='store', metavar="hostname", help='Hostname of the domain controller or KDC (Key Distribution Center) for Kerberos. If omitted, -dc-ip will be used')
297
298 if len(sys.argv) == 1:
299 parser.print_help()
300 sys.exit(1)
301
302 return parser.parse_args()
303
304
305def main():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…