Is there anyway to bypass/exploit this code?

Posts 1–3 of 3 · Page 1 of 1
Is there anyway to bypass/exploit this code?
Code:
local APIKey = "<insert api key here>" -- See 

local function HandleSharedPlayer(ply, lenderSteamID)
    print(string.format("FamilySharing: %s | %s has been lent Garry's Mod by %s", 
            ply:Nick(),
            ply:SteamID(),
            lenderSteamID
    ))

    if not (ULib and ULib.bans) then return end

    if ULib.bans[lenderSteamID] then
        ply:Kick("The account that lent you Garry's Mod is banned on this server")
    end
end

local function CheckFamilySharing(ply)
    http.Fetch(
        string.format("url of api",
            APIKey,
            ply:SteamID64()
        ),
        
        function(body)
            body = util.JSONToTable(body)

            if not body or not body.response or not body.response.lender_steamid then
                error(string.format("FamilySharing: Invalid Steam API response for %s | %s\n", ply:Nick(), ply:SteamID()))
            end

            local lender = body.response.lender_steamid
            if lender ~= "0" then
                HandleSharedPlayer(ply, util.SteamIDFrom64(lender))
            end
        end,
        
        function(code)
            error(string.format("FamilySharing: Failed API call for %s | %s (Error: %s)\n", ply:Nick(), ply:SteamID(), code))
        end
    )
end

hook.Add("PlayerAuthed", "CheckFamilySharing", CheckFamilySharing)
Yes there is create a new account.
Quote Originally Posted by netanelbb1 View Post
Code:
local APIKey = "<insert api key here>" -- See 

local function HandleSharedPlayer(ply, lenderSteamID)
    print(string.format("FamilySharing: %s | %s has been lent Garry's Mod by %s", 
            ply:Nick(),
            ply:SteamID(),
            lenderSteamID
    ))

    if not (ULib and ULib.bans) then return end

    if ULib.bans[lenderSteamID] then
        ply:Kick("The account that lent you Garry's Mod is banned on this server")
    end
end

local function CheckFamilySharing(ply)
    http.Fetch(
        string.format("url of api",
            APIKey,
            ply:SteamID64()
        ),
        
        function(body)
            body = util.JSONToTable(body)

            if not body or not body.response or not body.response.lender_steamid then
                error(string.format("FamilySharing: Invalid Steam API response for %s | %s\n", ply:Nick(), ply:SteamID()))
            end

            local lender = body.response.lender_steamid
            if lender ~= "0" then
                HandleSharedPlayer(ply, util.SteamIDFrom64(lender))
            end
        end,
        
        function(code)
            error(string.format("FamilySharing: Failed API call for %s | %s (Error: %s)\n", ply:Nick(), ply:SteamID(), code))
        end
    )
end

hook.Add("PlayerAuthed", "CheckFamilySharing", CheckFamilySharing)
Just DDoS http://api.steampowered.com and you're fine?
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us