Parses user flags passed to TorBot
()
| 109 | |
| 110 | |
| 111 | def set_arguments() -> argparse.ArgumentParser: |
| 112 | """ |
| 113 | Parses user flags passed to TorBot |
| 114 | """ |
| 115 | parser = argparse.ArgumentParser(prog="TorBot", usage="Gather and analayze data from Tor sites.") |
| 116 | parser.add_argument("-u", "--url", type=str, required=True, help="Specifiy a website link to crawl") |
| 117 | parser.add_argument("--depth", type=int, help="Specifiy max depth of crawler (default 1)", default=1) |
| 118 | parser.add_argument("--save", type=str, choices=['tree', 'json'], help="Save results in a file") |
| 119 | parser.add_argument("--visualize", type=str, choices=['table', 'tree', 'json'], help="Visualizes data collection.") |
| 120 | parser.add_argument("-q", "--quiet", action="store_true") |
| 121 | parser.add_argument("--version", action="store_true", help="Show current version of TorBot.") |
| 122 | parser.add_argument("--update", action="store_true", help="Update TorBot to the latest stable version") |
| 123 | parser.add_argument("--info", action="store_true", |
| 124 | help="Info displays basic info of the scanned site. Only supports a single URL at a time.") |
| 125 | parser.add_argument("-v", action="store_true", help="verbose logging") |
| 126 | parser.add_argument("--disable-socks5", action="store_true", |
| 127 | help="Executes HTTP requests without using SOCKS5 proxy") |
| 128 | |
| 129 | return parser |
| 130 | |
| 131 | |
| 132 | if __name__ == '__main__': |