![]() |
[Share] server side html exploit fix, cloning char fix
[edit] be sure to look for updates later on in the thread [/edit]
Heres my solution for html exploits, I'll explain how it works. Each time a client requests a html the server will parse the requested html for valid commands, crc them, and store them in a vector referenced by this characters accountid. each call that handles a bypass or link cmd has been hooked, so every bypass or link cmd the client sends to the server, now gets, crcd and checked against the users table in the vector. If the cmd crc matches one that was previously stored for this user, the cmd is verified and the user is permitted to pass the cmd, when it fails to match the cmd and account are is logged to the l2server console and error log files as a possible exploit attempt. Every time a user successfully completes a cmd or enterworld is called (if they relog), their table is cleared. Link is handled the same way, only on failure it will retrieve the file linkerr.htm displaying it to the user, just put an access denied msg or whatever you please here. The vector size supports a default of 200,000 accounts, and a cmdlist of no more then 40 commands per html. At allocation time this uses ~30mb of memory, should you exceed 200,000 accounts it will double its size, until it can accomodate that high of account id(this will be buggy and cause problems in most cases cause of threading). So long as your html does not have more then 40cmds or a teleport list larger then 40 locations will work fine, and if you exceed that limit of 40, all cmds past the 40th will be ignored, and logged as an exploit. Now that said there are a few things to explain about the effects this can cause. First off, the method most versions of l2walker (maybe other bot clients also) handle htmls differs from ncsofts client, a side effect of this is that a majority of l2walker users will be logged as exploiters every time they access an npc, and denied access to use them. (not a bad side effect). If you see alot of failed teleport requests, warehouse withdraws, recipe crafting, from a certain account id, they are using a 3rd party client such as l2walker. Second, didn't feel the need to handle in-game BBS since i don't think anyone ever uses it because it causes a lot of stability problems. So all _bbs commands logged as html exploit can be ignored, its simply an unhandled call. Next, there appears to be a a few htmls for quests and such where the htmls include a link command that has extra spaces between "link nameof.htm", if you see alot of warnings for a html similar to something like name_q017_9823.htm, use grep or some other regexp program on all the html files in your html folder and locate the html that is calling link for this, and check it, it will have an extra space or something similar to this that is causing it to be reported incorrectly, and denying users access. (powergrep for windows is what i use). (the following have link followed by 2 spaces and need to be corrected) terry_q0213_22.htm terry_q0213_21.htm terry_q0213_18.htm terry_q0213_08.htm terry_q0213_06.htm blacksmith_pushkin_q0218_07.htm (the following have a space before the link cmd) charkeren_q0412_01.htm This patch should work for all, or most C1, C2, and C3 servers. I've tested it with c1 and c3 but not c2. Make a backup of your original l2server.exe, extract patch.exe and patch.dll into a folder with l2server.exe and run patch.exe once, after this you may discard patch.exe. l2server.exe will now force load of patch.dll opening a new console as you run it, displaying a list of calls that were hooked. Be sure that all of these are patched successfully, and if any fail then your l2server already has a modification at this address and wont be applied, most likely causing crashes and who knows what else. If you used my link+tp patch I posted on the forum awhile ago i suggest you use n l2server.exe without it, if you don't i believe link and teleport patches will fail but may still run fine. Also this patch fixes the issue with people using l2walker to clone chars (livid mentioned something about there was a duping method using this), instead of just closing the user socket this calls leaveworld also making this method not work any longer. I believe that covers about everything. I've attached the patch and some fixed htmls. |
Simply amazing.
|
O_O
|
Scan type: Realtime Protection Scan
Event: Virus Found! Virus name: W32.Small.gen File: C:\DOCUME~1\CaDuSiMs\CONFIG~1\Temp\Rar$EXxx.xx5\pa tch.exe Location: Quarantine Computer: CADU User: CaDuSiMs Action taken: Clean failed : Quarantine succeeded : Access denied Date found: Sun Oct 09 04:33:38 2005 |
Good Work Tontor, tnx
|
lol you got a virus XD
W32.Small.gen... detected by norton antivirus corp... so dont tell me im talking shit. its true. you should scan your pc for viruses ;) btw i dont say this happened on purpose but i wanted to warn everyone and especially you to scan your system for viruses. so its rather a good advice than criticism... edit: damn juiced was faster XD |
Quote:
Quote:
Code:
;Static DLL Injection for MASM by Aphex |
Nice post, tontor. :)
And second, you guys need to seriously get a better AV scanner. Norton sucks - plain and simple. The only good thing it has is the sandbox feature, and even with that, it can't scan anything for crap. I just scanned it with F-Prot, and nothing came back. No false positives, and no virus. It's clean like tontor said. So please, please get rid of anything Symantec/Norton related off your PCs. :P Worst piece of software, ever. Sorry for hijacking the thread, but I just can't stand Norton. And people do need to know that there's better alternatives out there that are less resource hungry and have better scanning engines. |
what about f-secure ^^ sucks too ?
|
well scanned with kaspersky and nothing found :lol:
|
except bbs all others are hack attempt ? or space error.
|
I think it's a great share if it acrually works. The problem is that it may leave other kind of "doors" open. or not...?
|
f-secure?! LOL... sorry but that isnt any better in my opinion...
btw im runnin on windows server 2k3 means i cant use just a virus prog... needs to be a corporate version since antivirus companies wanna earn money ;) so i ended up using noton corp. it works just fine and is secure :) |
yes demon it is,
tontor fukin nice u fixed it ^^ no more+20 cmd problem |
thx m8! this is a really great share :)
|
Quote:
|
tontor, i owe You one. I swear if i ever meet You, You will be drunk as hell :P Im buying :) (If You are really Japanese this may actually happen so beware :P)
Not only because You shared the fix, You shared a lot more, You showed us the way how to attach a external program to l2server. This way we can manage to archieve something we never thought about before. Macros, Reccomend, CP, Recipe Books. It's possible now ! We just need a bloody good coder :) |
hmm ? ;/
|
Fixed. ty.
|
thank you and congratulations!
|
Hmm... world announce disappeared and when i tried //gmspeed 5 server freezed.. any suggestion?
link and tp patch failed but i think it has nothing to do with that.. |
Quote:
|
Actualy I thought it was //gmspeed freezing, but it isnt.. someway the server is freezing and it doesnt crash, have to kill.. any idea?
|
good job and thanks for sharing
|
This is a very very nice tool !
Thanx a lot man ! |
Quote:
I'm not really from japan and i don't drink :). I don't mind sharing these parts of the things I've done, the primary goal was to provide others with a good solution for html exploit problem. If i hadn't added so many other fixes to the source code already i might of shared that as well, but there are some things i don't wish to make public :). Quote:
Quote:
10/09/2005 07:59:xx.xx3, WARNING: Possible exploit attempt ACCID:9175 CMD:[bypass -h menu_select?ask=333&reply=15]. |
would you be so kind to share urs? all i could find are patched..
about linkerr.htm, when is it called? is it supposed to show everytime client tries htm hacks? cause i tried and nothing displayed on client, but server warnings |
Quote:
|
Can you post changes needed, not patcher? My server is heavily modded, and it seem to conflict with your patcher <_<
Like, few dlls attatched, few sections resized, new added etc. And taking info from ur self-modyfiing attachement to clean server file is something I don't want to do. |
tontor - I'll pach my server, but first 2 lines - failed - is html fix working?:) i cant chek it :(
|
hehe
Quote:
|
What is it?
|
My l2server file gave an error too when i used the patcher,
but then i decided to start from the beginning and change the port, safe enchant etc. all over. I can tell you it's worth it, this is a great tool. I didn't test what happens without a protected ai.obj, does it still blocks the exploit ? I hope someone can tell me cos i'm really curious. Greetz |
Quote:
To others sorry ill reply later about offsets to change for reverting link+tp fixes and reply/comment to others. Quote:
|
Ive got a clean l2server, so that all patches went successfuly.. after 1 hour running (more stable than before), server freezed and last msgs was:
http://www.horyu.com.br/img/uploads/7f0ee0c182.jpg |
O.O nice tool !
Thanx a lot man ! O.o fuck.... norton.... |
Damn those sick mf's are still able to crash the server :(
|
tontor check pm
|
nice tool tontor!
btw, in todo list (if any?;) ): change packets about players, to hide HP/MP count, set it to 0? hide what armor on head (client not need this, but bots ...) |
Norton Antivirus - Big Sux. Use NOD32.
Very nice tool tontor! |
| All times are GMT. The time now is 22:47. |