()
| 15 | |
| 16 | |
| 17 | def gen_cli_args(): |
| 18 | setup_debug_logging() |
| 19 | |
| 20 | try: |
| 21 | VERSION, COMMIT = importlib.metadata.version("netexec").split("+") |
| 22 | DISTANCE, COMMIT = COMMIT.split(".") |
| 23 | except ValueError: |
| 24 | VERSION = importlib.metadata.version("netexec") |
| 25 | COMMIT = "" |
| 26 | DISTANCE = "" |
| 27 | CODENAME = "Yippie-Ki-Yay" |
| 28 | |
| 29 | generic_parser = argparse.ArgumentParser(add_help=False, formatter_class=DisplayDefaultsNotNone) |
| 30 | generic_group = generic_parser.add_argument_group("Generic Options") |
| 31 | generic_group.add_argument("--version", action="store_true", help="Display nxc version") |
| 32 | generic_group.add_argument("-t", "--threads", type=int, dest="threads", default=256, help="set how many concurrent threads to use") |
| 33 | generic_group.add_argument("--timeout", default=None, type=int, help="max timeout in seconds of each thread") |
| 34 | generic_group.add_argument("--jitter", metavar="INTERVAL", type=str, help="sets a random delay between each authentication") |
| 35 | |
| 36 | output_parser = argparse.ArgumentParser(add_help=False, formatter_class=DisplayDefaultsNotNone) |
| 37 | output_group = output_parser.add_argument_group("Output Options") |
| 38 | output_group.add_argument("--no-progress", action="store_true", help="do not displaying progress bar during scan") |
| 39 | output_group.add_argument("--log", metavar="LOG", help="export result into a custom file") |
| 40 | log_level = output_group.add_mutually_exclusive_group() |
| 41 | log_level.add_argument("--verbose", action="store_true", help="enable verbose output") |
| 42 | log_level.add_argument("--debug", action="store_true", help="enable debug level information") |
| 43 | |
| 44 | dns_parser = argparse.ArgumentParser(add_help=False, formatter_class=DisplayDefaultsNotNone) |
| 45 | dns_group = dns_parser.add_argument_group("DNS") |
| 46 | dns_group.add_argument("-6", dest="force_ipv6", action="store_true", help="Enable force IPv6") |
| 47 | dns_group.add_argument("--dns-server", action="store", help="Specify DNS server (default: Use hosts file & System DNS)") |
| 48 | dns_group.add_argument("--dns-tcp", action="store_true", help="Use TCP instead of UDP for DNS queries") |
| 49 | dns_group.add_argument("--dns-timeout", action="store", type=int, default=3, help="DNS query timeout in seconds") |
| 50 | |
| 51 | parser = argparse.ArgumentParser( |
| 52 | description=rf""" |
| 53 | . . |
| 54 | .| |. _ _ _ _____ |
| 55 | || || | \ | | ___ | |_ | ____| __ __ ___ ___ |
| 56 | \\( )// | \| | / _ \ | __| | _| \ \/ / / _ \ / __| |
| 57 | .=[ ]=. | |\ | | __/ | |_ | |___ > < | __/ | (__ |
| 58 | / /˙-˙\ \ |_| \_| \___| \__| |_____| /_/\_\ \___| \___| |
| 59 | ˙ \ / ˙ |
| 60 | ˙ ˙ |
| 61 | |
| 62 | The network execution tool |
| 63 | Maintained as an open source project by @NeffIsBack, @MJHallenbeck, @_zblurx |
| 64 | |
| 65 | For documentation and usage examples, visit: https://www.netexec.wiki/ |
| 66 | |
| 67 | {highlight('Version', 'red')} : {highlight(VERSION)} |
| 68 | {highlight('Codename', 'red')}: {highlight(CODENAME)} |
| 69 | {highlight('Commit', 'red')} : {highlight(COMMIT)} |
| 70 | """, |
| 71 | formatter_class=RawTextHelpFormatter, |
| 72 | parents=[generic_parser, output_parser, dns_parser] |
| 73 | ) |
| 74 |
no test coverage detected