Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- import sys
- def main():
- dictionary = sys.argv[1]
- with open(dictionary, "r") as dic:
- for line in dic:
- word = line.rstrip('\n')
- stdout = subprocess.call(
- 'ssh-keygen -c -C "user@server" -P "{0}" -f "./id_rsa"'.format(word),
- stderr=subprocess.DEVNULL,
- stdout=subprocess.DEVNULL,
- shell=True
- )
- if stdout == 0:
- print("Password found: " + word)
- return
- print("Password not found.")
- if __name__ == "__main__":
- if len(sys.argv) == 2:
- main()
- else:
- print("missing args")
Add Comment
Please, Sign In to add comment