Register for your free account! | Forgot your password?

You last visited: Today at 14:34

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Security Fix - Auth Server

Discussion on Security Fix - Auth Server within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Security Fix - Auth Server

Notice this should be pretty common in the Conquer environment and especially at the auth state, but yet I've never seen anyone do it.

It's not much of a security problem, but it could be one.

Normally the client will disconnect after authentication, because there is only one packet to handle authentication, but what if the end-user is using a proxy and keeps spamming packets (dos?). That could be a problem and you would most likely want to avoid that.

After authentication you do not want to receive anymore packets.

There is two ways to get around this.

Never call your receive method after handling the first packet received (Unless co added more packets then after last packet.) at the auth server.

Or you can simply disconnect the client, but I am not sure if last one is allowed and will cause problem for the regular client. Never tested that.

Let's rely on the first one.

I assume most people uses a receive event like this: (Or something similar.)
Code:
public static BufferEvent OnReceive;
Where BufferEvent is a delegate. However in public sources I've noticed it's usually a delegate void. You want to change to that a bool.
Code:
public delegate bool BufferEvent(SocketClient sClient, DataPacket Packet);
Now in your receive's async callback you can do something like this:
Code:
							if (SocketEvents.OnReceive.Invoke(this, receiveData))
							{
								Receive(); // BeginReceive
							}
Now in your receive handler you can do something like this:
Code:
static bool SocketEvents_OnReceive(SocketClient sClient, DataPacket Packet)
		{
			// handle packets here
			return false; // return true if more packets should be received
		}
Notice that it returns a boolean. Whatever it returns also defines whether the server should still receive packets.

Not much of a security fix, but it should still be used.

This is all pseudo codes, so you have to use commonsense to actually implement something like this.
Super Aids is offline  
Thanks
4 Users
Old 12/14/2012, 17:44   #2
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by Super Aids View Post
Code:
public delegate bool BufferEvent(SocketClient sClient, DataPacket Packet);
Not to be too **** about naming conventions, but people still don't understand them?
nTL3fTy is offline  
Old 12/14/2012, 18:36   #3


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
You can safely disconnect the client after receiving the second packet on the auth server.
Korvacs is offline  
Thanks
1 User
Old 12/19/2012, 18:10   #4
 
elite*gold: 0
Join Date: Feb 2007
Posts: 340
Received Thanks: 38
Let's say we make a collection with all IPs that did not get through the game server authentication and if there are more than (x)...preferably 2 or 3 connections from that IP because the accept connections may be accessed 2 times for a single connection so we can make sure we don't disconnect the wrong client.

Instead of turning that void into a bool (to avoid calling the method once again when checking)
we can use the global collection to check if further data is to be sent or to disconnect the client.

Let me know if this way would work too.
ryuchetval is offline  
Old 12/20/2012, 14:32   #5
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Quote:
Originally Posted by ryuchetval View Post
Let's say we make a collection with all IPs that did not get through the game server authentication and if there are more than (x)...preferably 2 or 3 connections from that IP because the accept connections may be accessed 2 times for a single connection so we can make sure we don't disconnect the wrong client.

Instead of turning that void into a bool (to avoid calling the method once again when checking)
we can use the global collection to check if further data is to be sent or to disconnect the client.

Let me know if this way would work too.
It will never disconnect the wrong client. The problem does not lie in the acceptance of a connection, but in receiving data. The reason for this is to prevent endless packets being send to the auth-server.

It's only at the game-server that you want to actually keep receiving packets, because it does not handle authentication only, but the whole game processing.

Also the accept callback will only be called once per connection and if it gets called ore than once then there is something wrong with the way you've coded your sockets.

At last do not rely connections on their IPAddress Also only make a collection of the clients at the game server state when the client is actually logged in and authenticated (Packet-type 0x41c?), because then you can rely on the clients UID and the actual character name, rather than an IP. You do want to allow multiple connections per IP in most cases.
Super Aids is offline  
Reply


Similar Threads Similar Threads
Selling Runescape Both Auth Codes Only 5$ each for ANY auth regular price is 10$-30$
02/19/2011 - Runescape Trading - 5 Replies
Any auth code is 5$ send me a Pm or leave a post to tell me which ones you would like http://img260.imageshack.us/img260/2675/runescapea uths.png
hab in auth ordner usr/rain/auth den kompletten inhalt gelöscht
04/09/2010 - Metin2 Private Server - 2 Replies
hi ich hab in auth ordner also usr/rain/auth den kompletten inhalt gelöscht und eine datei erstellt mit #!/bin/sh ./auth sleep 60*5 ./auth.sh nochmal ne kurzfassung: ich hab versucht den login bug zu fixxen bin in /usr/rain/auth und hab dort alles gelöscht
Auth Pack: Auth Request
12/23/2009 - CO2 Private Server - 8 Replies
I know this pops up often, and I've searched everywhere for an answer, only to not get one. I've scanned over this site, as well as 4botters for an answer, and every one of them, didn't help. I'm trying to run a 4267 server with source, and so far, this is the biggest issue. I've spent several days of scanning google for this one issue for several hours at a time now. I've changed the IP from my server to everything from my Hamachi, my router, my default gateway, and my internal (I think...



All times are GMT +1. The time now is 14:34.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.