Advertisement
Shiny_

Untitled

Oct 31st, 2014
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.29 KB | None | 0 0
  1. -- Początek kodu:
  2. local hostPassword = " "
  3. local enterPassword = false
  4. local hostIP = "000.000.000.000"
  5. local logged = false
  6. local host = nil
  7.  
  8. hosty = {
  9.     { host = "69.69.69.69", password = "12345", stop = false },
  10. }
  11.  
  12. function pobierzHosty()
  13.     return hosty end
  14.  
  15. -- Gdzieś tam dalej:
  16. addEventHandler("onClientGUIClick", GUIEditor.button[1], function()
  17.     if source == GUIEditor.button[1] then
  18.         local command = guiGetText(GUIEditor.edit[1])
  19.         if enterPassword == true and command ~= hostPassword and command ~= "//bruteforce" then
  20.             guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[" .. hostIP .. "] Access denied.")
  21.         elseif enterPassword == true and command == hostPassword and command ~= "//bruteforce" then
  22.             guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[" .. hostIP .. " ] Properly logged as 'root' account. ")
  23.             logged = true
  24.             enterPassword = false
  25.         elseif enterPassword == true and command == "//bruteforce" then
  26.             guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[Console] The attack may take up to a minute ")
  27.             guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[Console] Brute force attack step 0/6 ")
  28.             local step = 0
  29.             setTimer(function()
  30.                 step = step + 1
  31.                 guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[Console] Brute force attack step "..step.."/6 ")
  32.                 if step == 6 then
  33.                     guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[" .. hostIP .. " ] Properly logged as 'root' account. ")
  34.                     logged = true
  35.                     enterPassword = false
  36.                 end
  37.             end, 10000, 6)
  38.         end
  39.         if command == "exit" then
  40.             guiSetVisible(GUIEditor.window[1], false)
  41.         elseif string.sub(command, 1, 7) == "connect" then
  42.             local ip = string.gsub(string.sub(command, 8, string.len(command)), " ", "")
  43.             hostIP = ip -- ???
  44.                 guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[CONSOLE] Trying connect to " .. ip .. "")
  45.             for k,v in ipairs(hosty) do -- jak to zrobic? ;__; -- normalnie
  46.                 if v.host == ip then
  47.                     if v.stop == true then guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[" .. hostIP .. "] The device is disabled. Restart occurs within two minutes.") return end
  48.                     guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[CONSOLE] Connected to " .. ip .. "!")
  49.                     guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[" .. ip .. "] Enter password to 'root' account:")
  50.                     enterPassword = true
  51.                     hostPassword = v.password
  52.                     host = v
  53.                     guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[CONSOLE] Tip: Use the //bruteforce command to try a bruteforce attack.")
  54.                 else
  55.                     guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[CONSOLE] You can not connect to the " .. ip .. "")
  56.                 end
  57.             end
  58.         elseif command == "help" then
  59.             guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[Console] exit")
  60.             guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[Console] connect <host> - connect to the selected host")
  61.         elseif command == "off" and logged then
  62.             guiSetText(GUIEditor.memo[1], guiGetText(GUIEditor.memo[1]) .. "[" .. hostIP .. "] Disabled device. Restart occurs within two minutes.")
  63.             host.stop = true
  64.             setTimer(function() host.stop = false end, 120000, 1)
  65.         end
  66.     end
  67. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement