I'm not a professional, help to make a code pleaseee!!!
If net.Start ("opr_withdraw") is executed 100 times per second, then the sender net.Start ("opr_withdraw") will be kicked
What is the problem you're having?
Hackers run 1000 queries per second and on the server lags (Exploit)
I mean they could spam any net message, there must be something in the specific function that causes your server to lag.
I just need to set a timeout for this function, is this possible?
Look for the net.Receive function for opr_withdraw. Add this at the top of that function:
if (ply.next_opr_withdraw and ply.next_opr_withdraw > CurTime()) then
ply:Kick("Net spam")
return
end
ply.next_opr_withdraw = CurTime() + .01
You probably shouldn't kick players for this unless you know they're being malicious. The message should have a cooldown anyway if it runs expensive code. If you delete the line where the player is kicked it'll become a simple rate limiter.
.01 is the cooldown in seconds. Really something like .1 or even .25 would probably be a lot more appropriate if you aren't automatically kicking them.
Thank you!
Can you help me to make a limit on this function?
//Sell bitcoins
net.Receive("BM2.Command.SellBitcoins", function(len, ply)
local e = net.ReadEntity()
if e ~= nil then
ply:SellBitcoins(e)
end
end)
if e ~= nil then ply:SellBitcoins(e) endend)
Copy-paste the same snippet I put above, just change next_opr_withdraw to something like next_bitcoin_sell. What you call it doesn't really matter as long as it is a unique name.
I took note of this exploit recently, I propose to install SNTE to autoban all players who abuse the net ;)
(I will soon update to include even more net sensible)
https://steamcommunity.com/sharedfiles/filedetails/?id=1308262997
if you had more to say to explain to me the negative point of this code I would love to know them rather than read 5 poor word
There's nothing good about this addon, it does nothing. You're picking 4 net message id names out of a huge list and setting them up as honeypot. It won't help OP with his problem.
mhum..i am sorry but the code works very well so far: /
heaps of founders told me of ban list containing people who try to launch menu derived from odium (loki) who was also in my sourceban
no positive ban has been declared (all the better)
The loki exploit thing you're trying to detect checks for valid network strings before sending net messages.
function LOKI.ValidNetString( str )
local netstart = net.Start
if odium and odium.G and odium.G.net then
netstart = odium.G.net.Start
else
-- print( "scanning for exploit in insecure mode" )
end
local status, error = pcall( netstart, str )
return status
end
I understand that it might help some people, but it doesn't seem like a very good approach to exploit prevention.
to tell you it is really a backup solution to avoid that kids of 15 years abuse the StackGhost has 900,000 subscribers or else the steamid2 (spam error) ect ..
but thank you for the messages I expected to modify the source code to add some things, I will look at the dodge of false positive and more pointed analysis :)
Sorry, you need to Log In to post a reply to this thread.