sshady.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:sshady 作者: droberson 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号