SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 23/03/2017, 04:20 PM   #1
Sjn
Huge Clucker
 
Join Date: Jul 2015
Location: Nepal
Posts: 349
Reputation: 50
Default Getting attacked, any help?

Hello there, everyone.

I had to forcibly create this topic cause I am out of idea now. The server randomly freezes and nothing is logged inside server_log. Crash detect does not log anything either. I had few array index out of bounds error before thought it's probably the reason for server freeze and I solved the error but it still keeps freezing. I finally found that there are some people out there constantly attacking the server and freezing it, range ban does not work either since they are possibly using VPN. However, the server does not log anything. I guess, I am not the only one facing this problem and I can see there are other servers too which are running fine so I guess there might be a way around to at least prevent the server from crashing whenever they attack. I tried as much possible ways as I could to prevent the runtime error in the script caused by those attacks but, I found this log today;

Code:
[11:27:33] [debug] Run time error 4: "Array index out of bounds"
[11:27:33] [debug]  Accessing element at negative index -1
[11:27:33] [debug] AMX backtrace:
[11:27:33] [debug] #0 00039ee8 in ?? (-1) from ***.amx
[11:27:33] [debug] #1 0003a738 in ?? (12, 0) from ***.amx
[11:27:33] [debug] #2 000212bc in public Iter_OnPlayerDisconnect (12, 2) from ***.amx
[11:27:33] [debug] #3 native CallLocalFunction () from samp03svr
[11:27:33] [debug] #4 0000dd94 in public ppb_OnPlayerDisconnect (12, 2) from ***.amx
[11:27:33] [debug] #5 0000c484 in public SSCANF_OnPlayerDisconnect (12, 2) from ***.amx
[11:27:33] [debug] #6 00000868 in public OnPlayerDisconnect (12, 2) from ***.amx
[11:27:33] [debug] #7 native BanEx () from samp03svr
[11:27:33] [debug] #8 000195cc in public OnPlayerFloodControl (12, 8, 7135) from ***.amx
[11:27:33] [debug] #9 native CallRemoteFunction () from samp03svr
[11:27:33] [debug] #10 0000fe48 in public Iter_OnPlayerConnect (12) from ***.amx
[11:27:33] [debug] #11 native CallLocalFunction () from samp03svr
[11:27:33] [debug] #12 0000d45c in public SSCANF_OnPlayerConnect (12) from ***.amx
[11:27:33] [debug] #13 00000828 in public OnPlayerConnect (12) from ***.amx
All of these plugins/includes are up to date. These error appeared after some random nicks were spamming connection. I was not in-game at that time so I have no idea what they might have done. I am also using anti flood protection include made by Ryder, but that's not really helpful either.

Any help will be appreciated, thanks.
Sjn is offline   Reply With Quote
Old 23/03/2017, 04:30 PM   #2
iKarim
Banned
 
Join Date: Oct 2015
Posts: 580
Reputation: 142
Default Re: Getting attacked, any help?

I don't really think it's an attack, the debug log clearly says that there's an array being accessed in negative index (-1), you should track the error from above to see which array exactly causes that.
iKarim is offline   Reply With Quote
Old 23/03/2017, 04:34 PM   #3
Sjn
Huge Clucker
 
Join Date: Jul 2015
Location: Nepal
Posts: 349
Reputation: 50
Default Re: Getting attacked, any help?

It is indeed an attack. I didn't post the entire log cause it contains lot of random nicks and IPs (probably bots). There are many connection spams before the script finally gave these errors in the log. Plus, you can see there are errors coming out from the foreach and sscanf includes. I don't think errors from those includes get triggered normally.
Sjn is offline   Reply With Quote
Old 23/03/2017, 04:37 PM   #4
iKarim
Banned
 
Join Date: Oct 2015
Posts: 580
Reputation: 142
Default Re: Getting attacked, any help?

They're coming from these places because usually these callbacks are hooked, so actual function is called by the hooked function (sscanf_*). I would say put debug messages everywhere on OnPlayerConnect & OnPlayerDisconnect to see what exactly causes this.

Last edited by iKarim; 23/03/2017 at 04:40 PM. Reason: Fuck mobile auto corection
iKarim is offline   Reply With Quote
Old 30/03/2017, 10:09 AM   #5
raydx
Huge Clucker
 
raydx's Avatar
 
Join Date: Feb 2017
Posts: 205
Reputation: 73
Default Re: Getting attacked, any help?

Quote:
Originally Posted by Sjn View Post
It is indeed an attack. I didn't post the entire log cause it contains lot of random nicks and IPs (probably bots). There are many connection spams before the script finally gave these errors in the log. Plus, you can see there are errors coming out from the foreach and sscanf includes. I don't think errors from those includes get triggered normally.
No, these errors aren't coming from foreach and sscanf. You didn't enabled debug mode (-d3 argument).
raydx is offline   Reply With Quote
Old 30/03/2017, 10:57 PM   #6
Sithis
Gangsta
 
Join Date: Mar 2013
Location: the Netherlands
Posts: 887
Reputation: 79
Default Re: Getting attacked, any help?

This is not an attack, this is a poorly coded script that accesses array indexes that are out of bounds.

Compile with debug flags (-d3) as stated above, then find out which function call the runtime error comes from.
__________________
Developer and owner of https://trinityrpg.com
Sithis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Someone attacked my server acchack1vn Server Support 10 07/02/2014 05:34 PM
servers getting attacked !! cvnr0 Server Support 7 07/01/2014 03:51 PM
Server attacked Gh0s7 Server Support 12 08/12/2013 07:41 PM
[HELP] server attacked ! Amine_Mejrhirrou Server Support 4 19/11/2012 07:15 PM
Who attacked Doman Help Archive 0 28/03/2010 09:43 PM


All times are GMT. The time now is 03:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.