Tinybang_Studio

AutoHack

May 17th, 2020
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.66 KB | None | 0 0
  1. if params.len != 1 then exit("usage: auhax [ip]")
  2. ip = params[0]
  3.  
  4. metaxploit = include_lib("/lib/metaxploit.so")
  5.  
  6. HandleResult = function(result)
  7.     print("<color=red>"+typeof(result))
  8.  
  9.     if typeof(result) == "file" then
  10.         print(file.name)
  11.         files = result.get_files + result.get_folders
  12.         for file in files
  13.             print(file.name+" "+file.owner)
  14.         end for
  15.     end if
  16.  
  17.     if typeof(result) == "computer" then
  18.         if result.File("/etc/passwd") then print(result.File("/etc/passwd").content)
  19.     end if
  20.     if typeof(result) == "shell" then
  21.         connect = user_input("open shell (y/n) ")
  22.         if connect == "y" then result.start_terminal
  23.     end if
  24. end function
  25.  
  26. parse = function(result)
  27.     found = 0
  28.     List = []
  29.     line = result.split(" ")
  30.     line.reverse
  31.     for word in line
  32.         if found == 1 then
  33.             word = word.remove(".")
  34.             word = word.remove("<b>")
  35.             word = word.remove("</b>")
  36.             List.push(word)
  37.             found = 0
  38.         end if
  39.  
  40.         if found == 0 then
  41.             if word == "Buffer" then
  42.                 found = 1
  43.             end if     
  44.         end if
  45.     end for
  46.  
  47.     return List
  48. end function
  49.  
  50. router = get_router(ip)
  51. ports = router.used_ports
  52. for port in ports
  53.     print(port.get_lan_ip+" "+port.port_number)
  54. end for
  55. TargetPort = user_input("port: ").to_int
  56.  
  57. net = metaxploit.net_use(ip,TargetPort)
  58. if not net then exit("conection failed!")
  59. Lib = net.dump_lib
  60. print("Target lib: "+Lib.lib_name+" "+Lib.version)
  61.  
  62. Memories = metaxploit.scan(Lib)
  63. for memory in Memories
  64.     print("<color=red>Scanning mem: "+memory)
  65.     results = metaxploit.scan_address(Lib,memory)
  66.     for payload in parse(results)
  67.         print(memory+" "+payload)
  68.         result = Lib.overflow(memory,payload,"pass123")
  69.         if result then HandleResult(result)
  70.     end for
  71. end for
Add Comment
Please, Sign In to add comment