_LINKI

GreyHack - BankGrabber by LINKI

Apr 21st, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. if not params or params.len != 1 then exit("<b>Example:</b> bankgrabber [IP/DNS]")
  2.  
  3. ip = params[0]
  4. if ip[0] == "w" then ip = nslookup(ip)
  5.  
  6. myComputer = get_shell.host_computer
  7. programPath = parent_path(program_path) + "/Banks"
  8. grabFileName = "Banks_" + ip + ".txt"
  9. grabFilePath = programPath + "/" + grabFileName
  10.  
  11. store = myComputer.File(grabFilePath)
  12. if store then
  13.     store.set_content("")
  14. else
  15.     myComputer.touch(programPath, grabFileName)
  16.     store = myComputer.File(grabFilePath)
  17. end if
  18.  
  19. grabFile = function(file)
  20.     if not file.content then return
  21.     store.set_content(store.content + file.content + "\n")
  22. end function
  23. hackUser = function(computer, userDir)
  24.     conf = computer.File(userDir.path + "/Config")
  25.     if not conf then return
  26.    
  27.     for file in conf.get_files
  28.         if file.name == "Bank.txt" then grabFile(file)
  29.     end for
  30. end function
  31. hackComputer = function(computer)
  32.     dir = computer.File("/home")
  33.     if not dir then return
  34.    
  35.     for userDir in dir.get_folders
  36.         hackUser(computer, userDir)
  37.     end for
  38. end function
  39.  
  40. router = get_router(ip)
  41. for computer in router.get_computers
  42.     hackComputer(computer)
  43. end for
  44.  
  45. store.set_content(store.content[:-1])
  46. print("[Grabbed " + store.content.split("\n").len + " accounts]")
Add Comment
Please, Sign In to add comment