Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Security The Internet

Thwarting New JavaScript Malware Obfuscation 76

I Don't Believe in Imaginary Property writes "Malware writers have been obfuscating their JavaScript exploit code for a long time now and SANS is reporting that they've come up with some new tricks. While early obfuscations were easy enough to undo by changing eval() to alert(), they soon shifted to clever use of arguments.callee() in a simple cipher to block it. Worse, now they're using document.referrer, document.location, and location.href to make site-specific versions, too. But SANS managed to stop all that with an 8-line patch to SpiderMonkey that prints out any arguments to eval() before executing them. It seems that malware writers still haven't internalized the lesson of DRM — if my computer can access something in plaintext, I can too."
This discussion has been archived. No new comments can be posted.

Thwarting New JavaScript Malware Obfuscation

Comments Filter:
  • by spion666 ( 922711 ) on Tuesday July 15, 2008 @03:12PM (#24201229) Homepage

    It seems that malware writers still haven't internalized the lesson of DRM -- if my computer can access something in plaintext, I can too.

    In fact, thats the lesson from any digital copy protection scheme, some of which precede DRM (at least the term DRM)

  • Baby & Bathwater? (Score:5, Informative)

    by XanC ( 644172 ) on Tuesday July 15, 2008 @03:15PM (#24201275)

    There are certainly legitimate uses of eval, and legitimate reasons to "obfuscate". Like to compress the script that you send to each & every client. The savings in bandwidth for you (and for them, especially if they're on dialup) can add up. For example: http://www.javascriptcompressor.com [javascriptcompressor.com]

  • Re:document.referrer (Score:2, Informative)

    by ypctx ( 1324269 ) on Tuesday July 15, 2008 @03:20PM (#24201373)
    Many sites won't work without it, mainly to prevent "hotlinking".
  • by Anders ( 395 ) on Tuesday July 15, 2008 @03:22PM (#24201407)
    This is not a detection method. It is merely an aid in reverse engineering, once you have found some malware that you want to analyze.
  • Re:document.referrer (Score:2, Informative)

    by Anders ( 395 ) on Tuesday July 15, 2008 @03:26PM (#24201477)

    Many sites won't work without it, mainly to prevent "hotlinking".

    That is about as effective as User-Agent sniffing.

    This Firefox addon [mozilla.org] gives you arbitrary Referer headers on a per-site basis.

  • Re:document.referrer (Score:2, Informative)

    by ArcticFlood ( 863255 ) on Tuesday July 15, 2008 @03:34PM (#24201607)

    Most "hotlinking prevention" methods (either in a .htaccess or in PHP) that I've seen allow no referrer, since no referrer usually means it was a bookmark or a URL entered by hand. Since this also allows people to copy and paste links to site, these methods are generally pointless unless there is a real problem.

  • Its not obfuscation (Score:5, Informative)

    by Anonymous Coward on Tuesday July 15, 2008 @03:49PM (#24201879)

    Sure it may look like the attacker is cleverly trying to obfuscate their malware from prying eyes but usually they could care less about that. By the time you go reversing their code, they've already gotten the bulk of their victims anyway.

    Rather, they're most often using it to make the code easy to replicate elsewhere. A lot of places they'll host it will inadvertently hiccup on certain characters in the code and change them. Like < to &lt;, or + to space, or new line chars to end the string. Using an encoder that converts everything to alphanumeric is much easier to guarantee a successful propagation.

    Especially true for XSS worms

  • Re:document.referrer (Score:2, Informative)

    by ArcticFlood ( 863255 ) on Tuesday July 15, 2008 @04:43PM (#24202845)

    I was unclear. I meant an empty referrer, which occurs when you weren't referred by a URL (such as typing the URL manually or clicking a bookmark). If you prevent the use of an empty referrer, your page cannot be bookmarked or manually typed in the address bar, which is why it is allowed.

  • by patio11 ( 857072 ) on Wednesday July 16, 2008 @12:33AM (#24208273)

    It isn't an either/or choice, but programs with verbose variable names (which is typically one of the first targets of javascript compression: "replace timeSinceLastUpdate with r") compress disgustingly well. You may find that the gzip compression is effective enough that the obfuscation isn't worth the various attendant headaches (maintaining two versions of the code, etc).

The Tao is like a glob pattern: used but never used up. It is like the extern void: filled with infinite possibilities.

Working...