Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 11.04.2007, 09:13   #76
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

does char_logout fire on kick?
khelben is offline  
Old 11.04.2007, 09:31   #77
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

Quote:
Originally Posted by Reirus View Post
made same way as said Le][u$. Just edit char_login and char_logout+added new field+script in l2auth.

php was stupid, so solution is to use wget --spider to send kick packet
I wouldn't call the PHP solution stupid, it's the only solution that has been shared in a viable / implementable solution.

All the other posts have been vague references or theory.
Instead of tearing someone's idea down, why not just offer your solution as an alternative and site reasons why your way is better. I mean, if I'm going to go out of my way to share something with you and you just tear it down and say it's stupid, why would I share anything again?

You'll still need to launch wget much in the same way you'd launch the php compiler, and you'll still need the php with the kick code in it...

Thanks Le][u$ for contributing. Reirus, thanks for the alternative.
khelben is offline  
Old 11.04.2007, 12:14   #78
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

Those aren't really fixes. If the flag is on they can STILL inject ANY online account. That's NOT really a fix.
mcrabben7 is offline  
Old 11.04.2007, 12:40   #79
tpuNIsher
Архивный участник
 
Join Date: Mar 2006
Posts: 685
Default

Correct and agreed, that isn't a fix. That is only a way around that works half as good.

There is a dll being made, however, it is up to the creator if it will be shared. As much as i would like to see it be shared, if the creator decides for it to be close quarter and among "sec-soc" community only, so it will be. Don't ask what is sec-soc.

Anyways, for all those that have helped me, i'll be sure to repay the debt, thanks. I don't have anything useful for this topic anymore.
-eof-
tpuNIsher is offline  
Old 11.04.2007, 12:55   #80
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

Quote:
Originally Posted by mcrabben7 View Post
Those aren't really fixes. If the flag is on they can STILL inject ANY online account. That's NOT really a fix.
Right, I don't think anyone is arguing that fact.

But right now we're hemorrhaging, we're just trying to stop the bleeding. Not everyone can write code to attach to a process and inject itself. I wouldn't know where to start with that, but I've always shared everything I've made, it might not be much and it might not be great, but it's what I have.

If I could I'd rewrite the entire AuthD and add features that I feel should have been there from the start. But I'm not an experienced C programmer. I can hold my own in VB, which from what I hear is very similar to C#. But I'm digressing.

Anyway, true, these aren't fixes, but it's better than nothing atm. =/
khelben is offline  
Old 11.04.2007, 13:11   #81
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

Well I agree it's better than nothing. Not arguing here at all.
mcrabben7 is offline  
Old 11.04.2007, 13:43   #82
Le][u$
Архивный участник
 
Join Date: Aug 2006
Posts: 57
Default

Quote:
Originally Posted by mcrabben7 View Post
Those aren't really fixes. If the flag is on they can STILL inject ANY online account. That's NOT really a fix.
Yes, it's true, but if flag is on AND player in game - bug not work(bug with **-packet).
/rus
пох что могут зайти на акк и посмотреть че там есть, сделать-то ниче не смогут. а это главное, имхо. будем ждать когда появится полноценный фикс
/rus
Le][u$ is offline  
Old 11.04.2007, 16:46   #83
Forcer
Архивный участник
 
Join Date: Apr 2006
Posts: 554
Default

Alamar, а вот это я думаю смогут. Зайти в мир только не смогут
2All, When hacker enter account, they cannot enter game, but can delete characters? or not? i'm stuck :P
Forcer is offline  
Old 11.04.2007, 17:10   #84
Le][u$
Архивный участник
 
Join Date: Aug 2006
Posts: 57
Default

yes, thy can. but only chars with builder>0, chars with builder=0 must wait 7 days before deleted.
/rus: удалить могут, только опасно это для админских акков - т.к. удаляются сразу же, а у простого игрока - неделю сидеть будет еще на удаление... а можно попробывать проверку забубенить и в процедуру которая удаляет чара...
Le][u$ is offline  
Old 11.04.2007, 19:46   #85
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

Quote:
Originally Posted by Le][u$ View Post
3.
Code:
ALTER PROCEDURE [dbo].[lin_GetUnreadMailCount]

....

if (SELECT online FROM lin2db.dbo.user_account WHERE uid = (SELECT account_id FROM lin2world.dbo.user_data WHERE char_id = @char_id))<>1
begin
	set @path= @path +' C:\php\kick.php id=' +convert(varchar(5),@char_id)
	EXEC xp_cmdshell @path
	RETURN -1

end
else
	UPDATE user_account SET online = 0 WHERE uid =  (SELECT account_id FROM lin2world.dbo.user_data WHERE char_id = @char_id)
Turning the flag off after being checked increases the security.
khelben is offline  
Old 12.04.2007, 05:33   #86
TheTester
Архивный участник
 
Join Date: Oct 2006
Posts: 112
Default

Quote:
Originally Posted by khelben View Post
Turning the flag off after being checked increases the security.
And what about 'relogin'?
TheTester is offline  
Old 12.04.2007, 11:40   #87
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

Quote:
Originally Posted by TheTester View Post
And what about 'relogin'?
I'm not sure what you mean by relogin.

Relogin would not be affected because it's just setting the flag when you login.

Additionally you could add a date column to the flag and check it as well and make sure it isn't 'stale'

Again, this isn't a fix, it's just something temporary until we can get something better.

Hopefully one of these guys that knows how to dll inject will be kind enough to help us out. If I knew something, about it I'd gladly write it, but the most programming exp i have is in VB. And it's with relational databases, not anything where i had to attach to a process and inject anything.
khelben is offline  
Old 12.04.2007, 12:11   #88
tpuNIsher
Архивный участник
 
Join Date: Mar 2006
Posts: 685
Default

injecting dlls is easy as pie but coding in assembly isnt. 64 bit = even tougher . for me atleast.. anyways.. it will be fixed eventually. just dont pass the exploit around..to everyone that asks for how to do it..
tpuNIsher is offline  
Old 12.04.2007, 12:25   #89
-sky-
Архивный участник
 
Join Date: Apr 2005
Posts: 15
Default

2 .... (but in console Authd: "Fetch error -1" when login).

Replace (in authd.exe):
SELECT user_data FROM user_data WITH (nolock) WHERE uid = %d
=>
EXEC ap_Online %d

Code:
CREATE PROCEDURE [dbo].[ap_Online] 
@uid int
AS
SET NOCOUNT ON

UPDATE user_account SET online=1 WHERE uid=@uid

SET NOCOUNT OFF

SELECT user_data FROM user_data with (nolock) WHERE  uid=@uid 

GO
and check user_data table

3. ...thats all. if you can optimized it and/or can add some stuff for it, or you known how to do this better => plz post it there!

allow using xp_cmdshell is a big security hole, use mssql external proc
Code:
exec sp_l2kick @char_id
im to lazy to add extra params for this function its just connect to 127.0.0.1 2012 and kick char... no need xp_cmdshell and php script...

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
sp_l2kick.zip — 1782 байт
-sky- is offline  
Old 12.04.2007, 13:50   #90
testdude
Архивный участник
 
Join Date: Nov 2005
Posts: 504
Default

Quote:
Originally Posted by tpuNIsher View Post
injecting dlls is easy as pie but coding in assembly isnt. 64 bit = even tougher . for me atleast.. anyways.. it will be fixed eventually. just dont pass the exploit around..to everyone that asks for how to do it..
assembly is easyish... and 64bit is not that much different to 32bit once u get used to the stack ordering and that just about everything is 8bytes instead of 4... reguardless nearly all of the work can be done without assembly, as long as u can read and understand assembly it doesnt matter if u can code it or not because then you have everything you need for making a dll in C++


and as for the sql version of this fix.. there is no 100% secure way to make it work, the online thing is a cool concept but its all dependant on if it does write online = 0 when you log out, otherwise mr sploiter will still be able to access the acc... also you can still harrass gms/players with this exploit by kicking them off their acc, even though you cant login people will still be stupid enough to go and kick people off, send them ss' of their char select and say like "omg i hacked you, give me this or i will steal everything", and idiots will fall for it... imo best way to deal with this is to stop the injecting of the malformed packet...
testdude is offline  
Old 12.04.2007, 14:40   #91
ateh
Архивный участник
 
Join Date: Apr 2006
Posts: 118
Default

Set login=0 when any char of logged account enters the world, plus set job to set login=0 every xx minutes for all accounts. This way Restart function of client won't work... but well, can't have everything.
ateh is offline  
Old 12.04.2007, 14:55   #92
testdude
Архивный участник
 
Join Date: Nov 2005
Posts: 504
Default

thats retarded, how many people are gonna wanna play a server that u have to completely relog every time u wanna change chars? considering theres like 4 servers now that have actual fixes that dont suck me thinks ideas like this will make ur players go elsewhere.
testdude is offline  
Old 12.04.2007, 15:55   #93
elcapo
Архивный участник
 
Join Date: Mar 2005
Posts: 107
Default

you could use a "date" field instead of a integer.
update that field with NOW() when loggin correctly. (i dont remember the stored procedure that excecute when login).
check for time difference at the time to take characters.
if (field.time > 5 seconds) then, return char_id = -1
otherwise, give it the correct char_ids

This way, u dont want to bother for updating to 0. Time is always running.

What u think?

I would to the change in this procedure: lin_GetCharByAccountId
Why to give char_ids to someone who we dont know if is the owner? check first for that.
Check too, at the time to create a new char.
elcapo is offline  
Old 12.04.2007, 16:36   #94
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

Quote:
Originally Posted by elcapo View Post
you could use a "date" field instead of a integer.
update that field with NOW() when loggin correctly. (i dont remember the stored procedure that excecute when login).
check for time difference at the time to take characters.
if (field.time > 5 seconds) then, return char_id = -1
otherwise, give it the correct char_ids

This way, u dont want to bother for updating to 0. Time is always running.

What u think?

I would to the change in this procedure: lin_GetCharByAccountId
Why to give char_ids to someone who we dont know if is the owner? check first for that.
Check too, at the time to create a new char.
that's how i did it, i used auth_login as datetime instead of online and instead of checking online = 1 i checked datediff(ss, auth_login, getdate()) <= 30

also on char logout you can set the auth login flag again, that would allow another 30 seconds for them to choose a character, no restart required.


I'm going to package what i did here as soon as i can to make it easier on peeps, unless someone wants to share the dll fix..
khelben is offline  
Old 12.04.2007, 16:59   #95
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

Here's AuthD that calls ap_Online

you must have the following set in your config.txt:

UserData=True

http://www.2shared.com/file/1836692/...5/L2AuthD.html

http://rapidshare.com/files/25634619/L2AuthD.rar.html
khelben is offline  
Old 12.04.2007, 17:23   #96
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

can someone help me out with the sp_l2kick.dll?

I've never loaded Extended Proceedures into SQL before.

I tried the following:

sp_addextendedproc 'sp_l2kick', 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sp_l2kick.dll'

but when i try to run the command it pukes with this message:

Msg 17750, Level 16, State 0, Procedure sp_l2kick, Line 1
Could not load the DLL c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sp_l2kick.dll, or one of the DLLs it references. Reason: 193(%1 is not a valid Win32 application.).


Will this work in SQL Server 2K5?
khelben is offline  
Old 12.04.2007, 17:57   #97
elcapo
Архивный участник
 
Join Date: Mar 2005
Posts: 107
Default

Quote:
Originally Posted by khelben View Post
can someone help me out with the sp_l2kick.dll?

I've never loaded Extended Proceedures into SQL before.

I tried the following:

sp_addextendedproc 'sp_l2kick', 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sp_l2kick.dll'

but when i try to run the command it pukes with this message:

Msg 17750, Level 16, State 0, Procedure sp_l2kick, Line 1
Could not load the DLL c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sp_l2kick.dll, or one of the DLLs it references. Reason: 193(%1 is not a valid Win32 application.).


Will this work in SQL Server 2K5?
Just copy the .dll into "binn" folder in your mssql2005 folder, and then

sp_addextendedproc 'sp_l2kick', 'sp_l2kick.dll'
elcapo is offline  
Old 12.04.2007, 17:58   #98
elcapo
Архивный участник
 
Join Date: Mar 2005
Posts: 107
Default

Quote:
Originally Posted by khelben View Post
Here's AuthD that calls ap_Online

you must have the following set in your config.txt:

UserData=True

http://www.2shared.com/file/1836692/...5/L2AuthD.html

http://rapidshare.com/files/25634619/L2AuthD.rar.html
Whats that? i dont understand
elcapo is offline  
Old 12.04.2007, 18:05   #99
khelben
Архивный участник
 
Join Date: Mar 2006
Posts: 104
Default

Quote:
Originally Posted by elcapo View Post
Just copy the .dll into "binn" folder in your mssql2005 folder, and then

sp_addextendedproc 'sp_l2kick', 'sp_l2kick.dll'
That's basically what i did and when i call the function i get the error message i posted. I don't think it should matter if i run the sp_addextendedproc with or without the full path.



Quote:
Originally Posted by elcapo View Post
Whats that? i dont understand
It's just a modded AuthD that calls the function from page 9 instead of the original SQL.
You still need to actually create the function in the database.
khelben is offline  
Old 12.04.2007, 18:06   #100
Forcer
Архивный участник
 
Join Date: Apr 2006
Posts: 554
Default

-sky-, Good work, are you can share dll sources? Please
Forcer is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 22:48.