Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 12:26

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

Advertisement



crash packet logger

Discussion on crash packet logger within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
crash packet logger

Hello, I currently have a problem, someone is using a packet loggerto crash the server. I know he's using a flaw with the new packet login
but I do not know exactly what I have to do.

here is the code:


/// <summary>
/// login packet
/// </summary>
/// <param name="loginPacket"></param>
public void VerifyLogin(LoginPacket loginPacket)
{
if (loginPacket == null)
{
return;
}

UserDTO user = new UserDTO
{
Name = loginPacket.Name,
Password = ConfigurationManager.AppSettings["UseOldCrypto"] == "true"
? CryptographyBase.Sha512(LoginCryptography.GetPassw ord(loginPacket.Password)).ToUpper()
: loginPacket.Password
};
AccountDTO loadedAccount = DAOFactory.AccountDAO.LoadByName(user.Name);
if (loadedAccount?.Password.ToUpper().Equals(user.Pas sword) == true)
{
string ipAddress = _session.IpAddress;
DAOFactory.AccountDAO.WriteGeneralLog(loadedAccoun t.AccountId, ipAddress, null,
GeneralLogType.Connection, "LoginServer");

//check if the account is connected
if (!CommunicationServiceClient.Instance.IsAccountCon nected(loadedAccount.AccountId))
{
AuthorityType type = loadedAccount.Authority;
PenaltyLogDTO penalty = DAOFactory.PenaltyLogDAO.LoadByAccount(loadedAccou nt.AccountId)
.FirstOrDefault(s => s.DateEnd > DateTime.Now && s.Penalty == PenaltyType.Banned);
if (penalty != null)
{
_session.SendPacket(
$"fail {string.Format(Language.Instance.GetMessageFromKey ("BANNED"), penalty.Reason, penalty.DateEnd.ToString("yyyy-MM-dd-HH:mm"))}");
}
else
{
switch (type)
{
case AuthorityType.Unconfirmed:
{
_session.SendPacket($"fail {Language.Instance.GetMessageFromKey("NOTVALIDATE" )}");
}
break;

case AuthorityType.Banned:
{
_session.SendPacket(
$"fail {string.Format(Language.Instance.GetMessageFromKey ("BANNED"), "Unknown", "Unknown")}");
}
break;

case AuthorityType.Closed:
{
_session.SendPacket($"fail {Language.Instance.GetMessageFromKey("IDERROR")}") ;
}
break;

default:
{
if (loadedAccount.Authority == AuthorityType.User
|| loadedAccount.Authority == AuthorityType.BitchNiggerFaggot)
{
MaintenanceLogDTO maintenanceLog = DAOFactory.MaintenanceLogDAO.LoadFirst();
if (maintenanceLog != null && maintenanceLog.DateStart < DateTime.Now)
{
_session.SendPacket(
$"fail {string.Format(Language.Instance.GetMessageFromKey ("MAINTENANCE"), maintenanceLog.DateEnd, maintenanceLog.Reason)}");
return;
}
}

int newSessionId = SessionFactory.Instance.GenerateSessionId();
Logger.Debug(string.Format(Language.Instance.GetMe ssageFromKey("CONNECTION"), user.Name,
newSessionId));
try
{
ipAddress = ipAddress.Substring(6, ipAddress.LastIndexOf(':') - 6);
CommunicationServiceClient.Instance.RegisterAccoun tLogin(loadedAccount.AccountId,
newSessionId, ipAddress);
}
catch (Exception ex)
{
Logger.Error("General Error SessionId: " + newSessionId, ex);
}

string[] clientData = loginPacket.ClientData.Split('.');

if (clientData.Length < 2)
{
clientData = loginPacket.ClientDataOld.Split('.');
}

bool ignoreUserName = short.TryParse(clientData[3], out short clientVersion)
&& (clientVersion < 3075
|| ConfigurationManager.AppSettings["UseOldCrypto"] == "true");
_session.SendPacket(BuildServersPacket(user.Name, newSessionId, ignoreUserName));
}
break;
}
}
}
else
{
_session.SendPacket($"fail {Language.Instance.GetMessageFromKey("ALREADY_CONN ECTED")}");
}
}
else
{
_session.SendPacket($"fail {Language.Instance.GetMessageFromKey("IDERROR")}") ;
}
}

#endregion
}
}
redbull2905 is offline  
Old 10/01/2018, 13:53   #2
 
erixor's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 408
Received Thanks: 1,067
Maybe providing a screenshot of the actual crash could be helpful, so people don't have to read this ugly not indented brick of code
erixor is offline  
Thanks
2 Users
Old 10/01/2018, 18:49   #3
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
redbull2905 is offline  
Old 10/01/2018, 19:54   #4
 
erixor's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 408
Received Thanks: 1,067
Well, that's not in the loginPacket, but in the MatePacketHandler, line 51.

Quickfix: Replace the "First" with a "FirstOrDefault" and check for null value.
erixor is offline  
Old 10/01/2018, 21:11   #5
 
0Lucifer0's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,005
Received Thanks: 1,018
Common the red error say exactly where the error is... and this is not in login ><
0Lucifer0 is offline  
Old 10/02/2018, 00:33   #6
 
@LRevolution's Avatar
 
elite*gold: 0
Join Date: May 2014
Posts: 227
Received Thanks: 117
Quote:
Originally Posted by 0Lucifer0 View Post
Common the red error say exactly where the error is... and this is not in login ><
I believe most people think it's impossible to fix something by themselves, much less read what the error actually is, ie the HUGE RED TEXT explaining what the error is and where it happened in the code.
@LRevolution is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Crash, crash, and more crash trying to log in
07/28/2010 - SRO Private Server - 3 Replies
When i try to log in i always put something heavy pressing the enter key but i get a crash after 10-15 min of trying to log in
Crash Crash Crash
07/27/2010 - SRO Private Server - 3 Replies
When i try to log in with bot, after i log in, instant CRASH. It is because of the traffic on ZSZC ? What should i do ?
Crash. Crash. Crash. Help?
10/30/2009 - Dekaron - 10 Replies
Okay EPVPr's, I have a question for you. Is anyone else having the 2moons/dekaron client crash on them as much as it is for me? I'll explain my full situation unlike alot of people on here(I'm sure most of you guy's know what i'm referring to :p) Situation: I start 2Moons, login. Usually on char select i'll open CE 5.5 from my "Up To Date" .CT file. Other times it will be "in map" depends on the situation as you all know. With as little as only one script activated(or even all) which most...



All times are GMT +1. The time now is 12:28.


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.