_LINKI

GreyHack - BankHacker by LINKI

Apr 21st, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.93 KB | None | 0 0
  1. if not params or params.len < 2 or params.len > 4 then exit("<b>Example:</b> bankhacker [AccountsFile] [PasswordsFile] [MD5File] (OutFile)")
  2.  
  3. myComputer = get_shell.host_computer
  4. getFile = function(filePath)
  5.     file = myComputer.File(filePath)
  6.     if not file then exit("<b>File <i>'" + filePath + "'</i> not found</b>")
  7.     return file
  8. end function
  9.  
  10. //Get AccountsFile&PasswordsFile//
  11. banksFile = getFile(params[0])
  12. passwordsFile = getFile(params[1])
  13. md5File = getFile(params[2])
  14.  
  15. //Check OutFile//
  16. outFileDir = parent_path(banksFile.path)
  17. outFileName = "HackedBanks.txt"
  18. outFilePath = outFileDir + "/" + outFileName
  19. if params.len == 4 then
  20.     //  OK  /sd/sd/file
  21.     //  OK  /sd/sd/file/
  22.     //  OK  sd/file
  23.     //  OK  sd/file/
  24.     //  OK  /
  25.     //  OK  //
  26.     // Tests passed
  27.     outFilePath = params[3].replace("//", "/")
  28.     if outFilePath == "/" or outFilePath[-1] == "/" then exit("<b>Could not create file - <i>'" + outFilePath + "'</i></b>")
  29.     if outFilePath[0] == "/" then
  30.         outFileDir = parent_path(outFilePath)
  31.     else
  32.         outFileDir = myComputer.current_path + "/" + parent_path(outFilePath)
  33.     end if
  34.     outFileName = outFilePath.split("/")[-1]
  35. end if
  36.  
  37. //Get OutFile//
  38. outFile = myComputer.File(outFilePath)
  39. if not outFile then
  40.      myComputer.touch(outFileDir, outFileName)
  41.      outFile = myComputer.File(outFilePath)
  42. else
  43.     outFile.set_content("")
  44. end if
  45.  
  46. //===========OLD METHODS============//
  47. //bruteForceAtack = function(md5Hash)
  48. //  i = md5Hashes.indexOf(md5Hash)
  49. //  if not i then return false
  50. //  return passwords[i/32]
  51. //end function
  52. //decipherAtack = function(account)
  53. //  tempFile.set_content(account)
  54. //  return crypto.decipher(tempFile.path)
  55. //end function
  56. //hackAccount = function(account)
  57. //  password = bruteForceAtack(account.split(":")[1])
  58. //  if password then return password
  59. //  return decipherAtack(account)
  60. //end function
  61.  
  62. //Decipher initialization//
  63. //crypto = include_lib("crypto")
  64. //if not crypto then exit("<b>Module <i>'crypto'</i> not found</b>")
  65. //tempFileDir = parent_path(program_path)
  66. //tempFileName = "temp"
  67. //myComputer.touch(tempFileDir, tempFileName)
  68. //tempFile = myComputer.File(tempFileDir + "/" + tempFileName)
  69.  
  70. //HackFunction//
  71. bruteForceAtack = function(md5Hash)
  72.     i = md5Hashes.indexOf(md5Hash)
  73.     if not i then return false
  74.     return passwords[i/32]
  75. end function
  76.  
  77. //Main initialization//
  78. accounts = banksFile.content.split("\n")
  79. passwords = passwordsFile.content.split("\n")
  80. md5Hashes = md5File.content
  81.  
  82. //Main//
  83. startTime = time()
  84. for account in accounts
  85.     namePass = account.split(":")
  86.     pass = bruteForceAtack(namePass[1])
  87.     if pass then outFile.set_content(outFile.content + namePass[0] + ":" + pass + "\n")
  88. end for
  89. endTime = time()
  90. hackTime = endTime - startTime
  91. outFile.set_content(outFile.content[:-1])
  92.  
  93. hacked = outFile.content.split("\n").len
  94. nothacked = accounts.len - hacked
  95. print("[Hacked " + hacked + " accounts]")
  96. if nothacked then print("[Not hacked " + nothacked + "]")
  97. print("[Total time: " + hackTime + "]")
Add Comment
Please, Sign In to add comment