Threat Level: green Handler on Duty: Jan Kopriva

SANS ISC: InfoSec Handlers Diary Blog InfoSec Handlers Diary Blog


Sign Up for Free!   Forgot Password?
Log In or Sign Up for Free!

How to stop javascript from websites infecting clients

Published: 2007-12-11
Last Updated: 2007-12-11 23:18:58 UTC
by Swa Frantzen (Version: 3)
0 comment(s)

Greg wrote in to ask how to protect users in his organization from getting infected with malware by visiting websites for business reasons that got hacked.

Knowing we like to recommend to disable javascript by using e.g. Firefox+NoScript, he asked for other solutions aside of disabling javascript as it's not an option in his environment.

So went looking for success stories with our audience and you came up with:
[note the product names are jus those mentioned by our readeres, nothing more needs to be sought in the mention]

  • Wendy writes her organization is successfully using a host based IDS/IPS system (Third Brigade's Deep Security Manager) that is loaded on each client and resets the connection when a malware site is encountered. She writes: "We have been able to identify sites that have not been previously noted as containing malicious code, including valid sites that have been compromised. This product works on roaming equipment, as it "calls home" once reconnected to the network, and reports in on possible compromises that we investigate, when alerted."  The ability to protect those laptops on the move seems to be a real plus of such a solution.
  • Ray writes in to tell us they block executables in the perimeter. They do allow IT to download executables though. Ray writes: "All HTTP is scanned by a virus scanner even for IT. By preventing staff from being able to download executable content you can very effectively prevent malware from infecting their computers. It's a political battle but worth fighting for."
  • Dan shared: "Our organization has deployed a product by Aladdin on their E-Safe appliance. They sell an add-on to the gateway called Applifilter.  It is very effective at preventing malicious scripts of all types including javascript.  It can be a little overzealous sometimes blocking legitimate scripts but has facilities for "whitelisting" specific sites."
  • Rick wrote: "After a couple years testing many combinations of products and settings, I've had good success with sandboxing IE as a last line of javascript defense. I also recommend the latest UTM (unified threat management) technology with a custom & tailored configuration to match your needs."
  • Blaze is along the same line using "a FortiGate product at our borders for IPS/IDS/AV protection.  The firewall is capable of border level IPS/IDS as well as content filtering for known Malware and Spyware sites".
  • Angus suggested: "Try running IE as a limited user using DropMyRights from  or CPAU from ... either should limit the ability of malware to do damage." Mark adds along the same lines: "What about running the browser in a sandbox, e.g. SandboxIE?".
  • Walter has an interesting approach in using "Proxomitron to filter web-traffic. But the problem with any filter is the ruleset. How can we filter something we do not know?And what about whitelists? Anyone tries to minimize CPU usage of filter software and uses whitelists. Do we need a plan how to verify our whitelists form time to time?". Interesting questions indeed as trusted websites can (and will) get compromised too.
  • An anonymous user writes: "Within limits, the privoxy proxy has some Javascript rewriting rules that reduce the dangers of Javascript.  You can also modify it to add more.  This does reduce the problems with allowing partial Javascript access.  I find that the default rules only break the more ambitious Javascript sites." Privoxy is often associated with Tor.
  • Mark suggests to consider "setting "Launching programs and files in an IFRAME" to Disable instead, since TTBOMK most of these site hacks involve malicious code in IFRAMEs?".
  • The obvious products of websense have been mentioned as well as the database of stopbadware.org
  • ...

Thanks to all writing in with suggestions.

--
Swa Frantzen -- Gorilla Security

Keywords:
0 comment(s)
Diary Archives