def main():
""" main() -- entry point of program
Args:
None
Returns:
os.EX_OK on successful run
os_EX_USAGE on failed run
"""
signal.signal(signal.SIGINT, sigint_handler)
args = parse_cli()
if args.nocolor:
Color.disable()
# Need to configure terse first for proper output
Settings.set("terse", args.terse)
xprint("[+] sshady.py -- by Daniel Roberson @dmfroberson")
xprint("")
# Update setting for whether or not to attempt cracking of SSH keys
Settings.set("crack", args.nocrack)
# Make sure settings are sane
if not Settings.update_wordlist(args.wordlist) or \
not Settings.update_output_directory(args.outdir) or \
not Settings.update_user_file(args.users) or \
not Settings.update_host_file(args.hosts):
return os.EX_USAGE
# Search for users passwords.
# TODO don't do this if key directory is specified.
find_ssh_directories()
# If a hostfile is specified, loop through hosts and try to login with
# each of the harvested keys.
if Settings.config("hostfile"):
attempt_ssh_logins()
xprint("")
xprint("[+] You must defeat Sheng Long to stand a chance.")
xprint("[+] Done.")
return os.EX_OK
评论列表
文章目录