Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not params or params.len < 2 or params.len > 4 then exit("<b>Example:</b> bankhacker [AccountsFile] [PasswordsFile] [MD5File] (OutFile)")
- myComputer = get_shell.host_computer
- getFile = function(filePath)
- file = myComputer.File(filePath)
- if not file then exit("<b>File <i>'" + filePath + "'</i> not found</b>")
- return file
- end function
- //Get AccountsFile&PasswordsFile//
- banksFile = getFile(params[0])
- passwordsFile = getFile(params[1])
- md5File = getFile(params[2])
- //Check OutFile//
- outFileDir = parent_path(banksFile.path)
- outFileName = "HackedBanks.txt"
- outFilePath = outFileDir + "/" + outFileName
- if params.len == 4 then
- // OK /sd/sd/file
- // OK /sd/sd/file/
- // OK sd/file
- // OK sd/file/
- // OK /
- // OK //
- // Tests passed
- outFilePath = params[3].replace("//", "/")
- if outFilePath == "/" or outFilePath[-1] == "/" then exit("<b>Could not create file - <i>'" + outFilePath + "'</i></b>")
- if outFilePath[0] == "/" then
- outFileDir = parent_path(outFilePath)
- else
- outFileDir = myComputer.current_path + "/" + parent_path(outFilePath)
- end if
- outFileName = outFilePath.split("/")[-1]
- end if
- //Get OutFile//
- outFile = myComputer.File(outFilePath)
- if not outFile then
- myComputer.touch(outFileDir, outFileName)
- outFile = myComputer.File(outFilePath)
- else
- outFile.set_content("")
- end if
- //===========OLD METHODS============//
- //bruteForceAtack = function(md5Hash)
- // i = md5Hashes.indexOf(md5Hash)
- // if not i then return false
- // return passwords[i/32]
- //end function
- //decipherAtack = function(account)
- // tempFile.set_content(account)
- // return crypto.decipher(tempFile.path)
- //end function
- //hackAccount = function(account)
- // password = bruteForceAtack(account.split(":")[1])
- // if password then return password
- // return decipherAtack(account)
- //end function
- //Decipher initialization//
- //crypto = include_lib("crypto")
- //if not crypto then exit("<b>Module <i>'crypto'</i> not found</b>")
- //tempFileDir = parent_path(program_path)
- //tempFileName = "temp"
- //myComputer.touch(tempFileDir, tempFileName)
- //tempFile = myComputer.File(tempFileDir + "/" + tempFileName)
- //HackFunction//
- bruteForceAtack = function(md5Hash)
- i = md5Hashes.indexOf(md5Hash)
- if not i then return false
- return passwords[i/32]
- end function
- //Main initialization//
- accounts = banksFile.content.split("\n")
- passwords = passwordsFile.content.split("\n")
- md5Hashes = md5File.content
- //Main//
- startTime = time()
- for account in accounts
- namePass = account.split(":")
- pass = bruteForceAtack(namePass[1])
- if pass then outFile.set_content(outFile.content + namePass[0] + ":" + pass + "\n")
- end for
- endTime = time()
- hackTime = endTime - startTime
- outFile.set_content(outFile.content[:-1])
- hacked = outFile.content.split("\n").len
- nothacked = accounts.len - hacked
- print("[Hacked " + hacked + " accounts]")
- if nothacked then print("[Not hacked " + nothacked + "]")
- print("[Total time: " + hackTime + "]")
Add Comment
Please, Sign In to add comment