Discussion on [FIX][C++] SQL Injection in Messenger and Guild within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
U using a 40k game and no source? How is that even possible?
Hello, Aze.
I don't have source i have serverfiles on internet i find and i download that.
I don't know to using a source and i need diff 40k or fix.
Thanks
When i add the code to CGuildManager::CreateGuild which fixes sql injection players can create 2 guilds with the same name, are there any fix about it?
Ich habe da ein Problem mit der Funktion CreateGuild.
Wenn der User eine Gilde erstellt und einen bereits vorhanden namen verwendet erstellt er die Gilde und der User ist der Admin der alten breits vorhanden Gilde
Das ist die Funktion:
PHP Code:
DWORD CGuildManager::CreateGuild(TGuildCreateParameter& gcp)
{
if (!gcp.master)
return 0;
You don't have to implement the second fix in your source files because there is no potential SQL Injection for MakeGuild. The system is already checking the alpha characters 1 or 2 time(s).
The first one
Code:
if (strlen(cp.name) == 0 || !check_name(cp.name))
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("적합하지 않은 길드 이름 입니다."));
return;
}
The second one
Code:
if (!check_name(gcp.name))
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드 이름이 적합하지 않습니다."));
return 0;
}
You don't have to implement the second fix in your source files because there is no potential SQL Injection for MakeGuild. The system is already checking the alpha characters 1 or 2 time(s).
The first one
Code:
if (strlen(cp.name) == 0 || !check_name(cp.name))
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("적합하지 않은 길드 이름 입니다."));
return;
}
The second one
Code:
if (!check_name(gcp.name))
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드 이름이 적합하지 않습니다."));
return 0;
}
Kind Regards ~ Ken
That's it..
Wer als folgenden Bug hat und Gilden mit gleichen Namen erstellen kann:
Quote:
Originally Posted by DasSchwarzeT
Same here.. Werde ich wohl gleich mal fixen und dann hier updaten
einfach den 2. Fix hier im Startpost rausnehmen, ist nicht nötig.
DWORD CGuildManager::CreateGuild(TGuildCreateParameter& gcp)
{
if (!gcp.master)
return 0;
if (!check_name(gcp.name))
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드 이름이 적합하지 않습니다."));
return 0;
}
std::auto_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT COUNT(*) FROM guild%s WHERE name = '%s'",
get_table_postfix(), gcp.name));
if (pmsg->Get()->uiNumRows > 0)
{
MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);
if (!(row[0] && row[0][0] == '0'))
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 이미 같은 이름의 길드가 있습니다."));
return 0;
}
}
else
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드를 생성할 수 없습니다."));
return 0;
}
// new CGuild(gcp) queries guild tables and tell dbcache to notice other game servers.
// other game server calls CGuildManager::LoadGuild to load guild.
CGuild * pg = M2_NEW CGuild(gcp);
m_mapGuild.insert(std::make_pair(pg->GetID(), pg));
return pg->GetID();
}
DWORD CGuildManager::CreateGuild(TGuildCreateParameter& gcp)
{
if (!gcp.master)
return 0;
if (!check_name(gcp.name))
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드 이름이 적합하지 않습니다."));
return 0;
}
std::auto_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT COUNT(*) FROM guild%s WHERE name = '%s'",
get_table_postfix(), gcp.name));
if (pmsg->Get()->uiNumRows > 0)
{
MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);
if (!(row[0] && row[0][0] == '0'))
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 이미 같은 이름의 길드가 있습니다."));
return 0;
}
}
else
{
gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드를 생성할 수 없습니다."));
return 0;
}
// new CGuild(gcp) queries guild tables and tell dbcache to notice other game servers.
// other game server calls CGuildManager::LoadGuild to load guild.
CGuild * pg = M2_NEW CGuild(gcp);
m_mapGuild.insert(std::make_pair(pg->GetID(), pg));
return pg->GetID();
}
Small Help needed to fix the icons on messenger/guild 08/08/2015 - Flyff Private Server - 2 Replies Hello guys,
i just need a little help or guide on how do i fix the icons for each job in the friend list or messenger list. cause my messenger looks like this : Messenger Icons Error i need to correct the icons
same with the guild view Guild Icon Error wrong icons ...
Thanks in advance
[B) What´s App Messenger 12/14/2012 - elite*gold Trading - 20 Replies Hey Leute ich biete euch hiermit einen Code für den iTunes US Store an!
Dieser Code beinhaltet den Download von dem What´s App Messenger!
Sofortkauf 30 e*G!
Ich wiederhole, dieser Code funktioniert nur auf dem US iTunes Store!
Messenger Bug ? 07/19/2012 - Combat Arms - 2 Replies Leute bei Combat Arms geht der Messenger garnicht und mit dem Clan kann ich garnicht sprechen alle sind Offline ist das nur bei mir oder bei vielen ?
Und wie bekommt mann das wieder zurück ?
Tcp Messenger 06/21/2010 - AutoIt - 8 Replies Hi wieder mal ein Problem:rtfm:
Möchte nun Von meinem Tcp,Client was zu meinem Tcp,Server senden eine Nahricht möchte diese aber nicht immer im code ändern habe dazu eine Inputbox gemacht möchte nun das der text der in der inputbox ist gesendet wird mein code sieht bisher so aus
TCPStartup()
$verbindung = TCPConnect("127.0.0.1", 4322)
$message=Inputbox("Msg Transmitter","Bitte Gib deine Nahricht ein.")
If $verbindung = -1 Then
MsgBox(16, "Error", "Die Verbindung zum Server...