Post Pacific

Post Pacific (https://postpacific.mmorpg-game.online/index.php)
-   Lineage 2 Server Modifications ONLY! (https://postpacific.mmorpg-game.online/forumdisplay.php?f=28)
-   -   [SHARE] server crash new exploit fix *UPDATED* (https://postpacific.mmorpg-game.online/showthread.php?t=8001)

humordwarf 07.07.2007 20:36

[SHARE] server crash new exploit fix *UPDATED*
 
*UPDATED*

inside l2server.exe we have code (dont ask me how i got it):
Code:

Log->Add(2,L"[%s][%d] user[%s] failed to ride.  no collar[%d]",  CharName, CorallID);
so, as u see, here is mistake, first arg should be string, second - number, 3rd - string, 4th - number (4 parameters)
but in args there is TWO only, last two args Log->Add gets from stack garbage...

someone got the way how to invoke this error,
and server, when try to format this text crashes

Code:

IOThread [0][875] (ahehe):  void IOThread_common(void *arglist) -> CUserSocket::OnRead -> IconAction -> User::IconAction() -> void User::Ride(CPet* pStrider) -> CLog::Add -> CLog::AddV -> Log::AddV - vswprintf_s
how to fix:

in any hex editor find UNICODE text
"[%s][%d] user[%s] failed to ride. no collar[%d]"
and change to
"user[%s] failed to ride. no collar[%d]"
edit: and dont forget to put 0000 after text as zero char (null termitnated string rule)

thats all, folks

radio 07.07.2007 20:43

[rus]корейские программисты - конина блядская

зы. тоже чтоль расшарить чё-нить....

а для буржуинов пора делать кнопки "thanks" и "good job"
[/rus]

[eng] good job, man [/eng]

ZeniMax 07.07.2007 20:56

awesome share, big thanks humordwarf, cash for you! (Oh where is the cash system?? :/ )

Edit: Humordwarf we must fix that too?
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.d.]
to
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.s.]

humordwarf 07.07.2007 21:07

Quote:

Originally Posted by ZeniMax (Post 91052)
Edit: Humordwarf we must fix that too?
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.d.]
to
[.%.s.].[.%.d.]. .u.s.e.r.[.%.s.]. .f.a.i.l.e.d. .t.o. .u.n.r.i.d.e... . .n.o. .c.o.l.l.a.r.[.%.s.]

no
unride thing pass correct parameters to log
there is call: Log->Add(2,L"[%s][%d] user[%s] failed to unride. no collar[%d]",_T(__FILE__),__LINE__,CharName,CollarID);
all fine here

ZeniMax 07.07.2007 21:14

Ok thanks humordward.

Forcer 07.07.2007 21:32

Great, thanks.
[rus]
Хумор, малацца! :)
Меня иногда эта пиздень доставала.
По поводу корейцев - всеми руками согласен xD
[/rus]

Kenjiro 07.07.2007 21:36

Big thanks, hat from head _o_ :)

humordwarf 07.07.2007 21:47

*UPDATE*
sorry ppl, mistake
confused with params order (first %s, then %d)
new text should be "user[%s] failed to ride. no collar[%d]"
(updated 1st post)

HF 08.07.2007 07:48

Please, tell me,
1) what fix it? Same what do Amped "BlockRide=true" ?
2) maybe someone can do hex-text file for me?
and main question
This is only l2server error unicode message. Why fix it is a new message? So strange for me. Because so easy.

Ra1n0 08.07.2007 09:12

Quote:

This is only l2server error unicode message. Why fix it is a new message? So strange for me. Because so easy.
error got from function vswprintf_s because not enough parameters

humordwarf 08.07.2007 09:55

Quote:

Originally Posted by HF (Post 91123)
Please, tell me,
1) what fix it? Same what do Amped "BlockRide=true" ?
2) maybe someone can do hex-text file for me?
and main question
This is only l2server error unicode message. Why fix it is a new message? So strange for me. Because so easy.

1) see 1st message. BlockRide is not same
2) each ppl may have different exe's, why do not try urself? its not hard

main: if you know c++ even little... look on printf-like functions, printf("%s","text") gets from stack address of "text", then read from address, chars and output to console.... but if you try use printf("%s",123) - u'll get exception (crash). like access violation read from address 123 (printf tries read text from address 123)
so look again at first message, there is "%s%d%s%d", but on stack there only one string and only one number... second string address (3rd arg) undefined on stack

HF 08.07.2007 15:09

Quote:

Originally Posted by humordwarf (Post 91139)
main: if you know c++ even little... look on printf-like functions, printf("%s","text") gets from stack address of "text", then read from address, chars and output to console.... but if you try use printf("%s",123) - u'll get exception (crash). like access violation read from address 123 (printf tries read text from address 123)
so look again at first message, there is "%s%d%s%d", but on stack there only one string and only one number... second string address (3rd arg) undefined on stack

Ah! I understood! :) No more params for function calling!
Big thanks.

Question two.
What power for this bug? It's only server error? or maybe it server error on bug using? Bug cause server crash?
This is only for information.

humordwarf 08.07.2007 15:44

Quote:

Originally Posted by HF (Post 91171)
What power for this bug? It's only server error? or maybe it server error on bug using? Bug cause server crash?

oh... relax...
as soon as u get that crash log, u'll know what to do...

i repeat, someone got the way, special or not, cheater or not, not matter... matter - it happens.

FidoW 08.07.2007 15:46

Quote:

Originally Posted by humordwarf (Post 91176)
oh... relax...
as soon as u get that crash log, u'll know what to do...

i repeat, someone got the way, special or not, cheater or not, not matter... matter - it happens.

Fixed, thx HD. ;)

kanziguy 08.07.2007 22:51

fixed file upload please please

m4rk 08.07.2007 22:59

kanziguy use an hex editor to correct it...

Osito2Dancer 08.07.2007 23:07

Quote:

Originally Posted by FidoW (Post 91178)
Fixed, thx HD. ;)

Which editor can i use to fix this? I tried UltraEdit 32, but cant find the damned line.

Could you teach me how to?

m4rk 08.07.2007 23:23

You can use any editor, you just don't know how to search... Like Humordwarf said
Quote:

Originally Posted by Humordwarf
in any hex editor find UNICODE text

Code:

5b 00 25 00 73 00 5d 00 5b 00 25 00 64 00 5d 00 20 00 75 00 73 00 65 00 72 00 5b 00 25 00 73 00 5d 00 20 00 66 00 61 00 69 00 6c 00 65 00 64 00 20 00 74 00 6f 00 20 00 72 00 69 00 64 00 65 00 2e 00 20 00 20 00 6e 00 6f 00 20 00 63 00 6f 00 6c 00 6c 00 61 00 72 00 5b 00 25 00 64 00 5d

emanuel 08.07.2007 23:31

Nice... big thx.

petre1980 09.07.2007 03:35

Thx HD, i have made the corections but i don't know what you mean by that:
"edit: and dont forget to put 0000 after text as zero char (null termitnated string rule)"

Ra1n0 09.07.2007 04:36

Quote:

Thx HD, i have made the corections but i don't know what you mean by that:
"edit: and dont forget to put 0000 after text as zero char (null termitnated string rule)"
rtfm about unicode strings..

unicode strings look in hex like this
20 00 6e 00 6f 00 20 00 63 00 6f 00 6c 00 6c 00 61 00 72 00 5b 00 25 00 64 00 5d 00 00 00

after unicode string he must ended '\x00\x00", 00 00 its zero char

in ASCII strings 1 symbol =1 byte... ex. "a" in ASCII = 61
in UNICODE 1 symbol = 2 bytes.. ex. "a" in UNICODE = 61 00

HF 09.07.2007 04:46

So. Short fix - 4 byte. I do easy
"5b 00 25 00 73 00 5d" [%s]
->
"5b 00 20 00 20 00 5d" [ ]
:)
Line lenght without changes, bug fixed.

Ra1n0 09.07.2007 05:04

some corrections..this is 4 byte fix)
"5b 00 25 00 73 00 5d 00" [%s]
->
"5b 00 20 00 20 00 5d 00" [ ]
and
"5b 00 25 00 64 00 5d 00" [%d]
->
"5b 00 20 00 20 00 5d 00" [ ]

= "[ ][ ] user[%s] failed to ride. no collar[%d]"

:: Eru :: 02.08.2007 14:49

Thanks! Fixed.

Anyway, I'm still being attacked...I have to test everything again :(

GmZenBrasil 11.08.2007 06:21

:) thanks ^^


All times are GMT. The time now is 21:42.