![]() |
|
|
|
|
#1 |
|
Архивный участник
Join Date: Aug 2006
Posts: 57
|
I can't bye some *.dll for my server to prevent this bug completly, and i do that:
1. Add custom field in lin2db (in my db it's "online") with INT value. 2. I use hAuthd by Hint and set online = 1 when user logged on (or you can use Authd with modded query Code:
"SELECT user_data FROM user_data WITH (nolock) WHERE uid = %d" Code:
"UPDATE user_account SET online = 1 WHERE uid = %d" 3. Code:
ALTER PROCEDURE [dbo].[lin_GetUnreadMailCount] ( @char_id int, @path varchar(64) = 'C:\php\php.exe' ) AS SET NOCOUNT ON SELECT COUNT(*) FROM user_mail_receiver(NOLOCK) WHERE receiver_id = @char_id AND mailbox_type = 0 AND read_status = 0; 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 Code:
<?
#$char_id=$_GET['id'];
//----Convert string to unicode---- >
function tounicode($string){
$rs="";
for($i=0;$i<strlen($string);$i++)
$rs.=$string[$i].chr(0);
return($rs.chr(0).chr(0));}
//<<<
function KickCharacterPacket($char_id){
include("config.php");$buf=pack("cV",5,$char_id).tounicode("admin");
$cachedsocket=@fsockopen($cached['host'],$cached['port'],$errno,$errstr,1) or die($notconnected);
fwrite($cachedsocket,pack("s",(strlen($buf)+2)).$buf);
$len=unpack("v",fread($cachedsocket,2));$rid=unpack("c",fread($cachedsocket,1));
for($i=0;$i<(($len[1]-4)/4);$i++){$read=unpack("i",fread($cachedsocket,4));$rs.=$read[1];}
fclose($cachedsocket);return GetError($rs);}
$a = KickCharacterPacket($char_id);
if(!$a){
echo 'some errors ocured!';
}else{
echo 'Successed!';
}
?>
|
|
|
|
|
#2 | |
|
Архивный участник
Join Date: Mar 2006
Posts: 104
|
Quote:
|
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Oct 2006
Posts: 112
|
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Mar 2006
Posts: 104
|
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. |
|
|
|
|
#5 |
|
Архивный участник
Join Date: Apr 2005
Posts: 15
|
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 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 its just connect to 127.0.0.1 2012 and kick char... no need xp_cmdshell and php script...Вложения из исходного сообщения (сами файлы в копии отсутствуют): sp_l2kick.zip — 1782 байт |
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|