[lua]
function GenerateRconPass()
local KEYS = {
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
"{",
"[",
"]",
"}",
"|",
":",
";",
"'",
"<",
">",
",",
".",
"/",
"?",
"!",
"@",
"#",
"$",
"%",
"^",
"&",
"*",
"(",
")",
"-",
"_",
"+",
"=",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"0"
}
local str = "";
for i = 1, 1024 do
str = str .. KEYS[math.random( 1, KEYS )];
end
game.ConsoleCommand( "rcon_password " .. str );
end
concommand.Add( "GenerateNewRcon", GenerateRconPass )
[/lua]
Would this work? Is this efficient?
[lua]local function GenerateString( len )
local str = ""
for i=1, len do
str = str .. string.char( math.random( 33, 125 ) )
end
-- Filtering any bad characters
return str:gsub( "[;]", "" )
end
concommand.Add( "rcon_generate", function()
local str = GenerateString( 128 )
game.ConsoleCommand( "rcon_password " .. str .. "\n" )
end )[/lua]
Why would you ever need a password 1024 chars long?
[url=http://wiki.garrysmod.com/?title=BlockedConvars]If i remember correctly you can't execute rcon_password from lua[/url]
Well he could use a module to bypass that or make an alias of rcon_password in his server.cfg
I don't see the point in changing rcon password tbh, when you can just not allow them not to use rcon.
[code]alias what rcon_password[/code]
[lua]function GenPass()
local password = ""
for i = 1 , 100 do
password = password..string.char(math.random(65 , 117))
end
MsgN(password)
return password
end
RunConsoleCommand("what" , GenPass())[/lua]
this may can be used for rcon bruteforce, right ?
[QUOTE=slay3r36;22285513]this may can be used for rcon bruteforce, right ?[/QUOTE]
don't you get auto-banned after 5 tries or so ?
also password will break if they contain this ";"
[QUOTE=ColdFusion;22288035]don't you get auto-banned after 5 tries or so ?[/QUOTE]
only if the server.cfg contain something like [CODE]sv_rcon_banpenalty 1440
sv_rcon_maxfailures 5
[/CODE]
Sorry, you need to Log In to post a reply to this thread.