2

Is there a way for me (non-expert in JavaScript) to detect JavaScript attacks from a website. I have done a lot of searching around and have not come up with a definitive answer. NoScript is a pain in the ass to use as more and more sites REQUIRE Java and scripting to be enabled (e.g. signing into this site). Every time I click on "allow site" I wonder what I'm "allowing." Also the advice, "Only allow sites you trust" is not really helpful as many sites have been hacked and don't even know it.

Also, I suspect a site running something to pick up my router IP as they seem to be able to identify me although I'm on TOR. I am not referring to a hidden site or one dealing in illegal content. I am talking about normal, known sites.

5
  • The best defenses against JavaScript exploits are NoScript and services like Chrome's "Safe Browsing" which check sites you visit against chrome's list of sites with exploits/malware (which they are actively scanning for). If the attacks were easier to detect, they wouldn't really be exploits ;)
    – George
    Commented Aug 22, 2013 at 13:23
  • 1
    You may want to move your question about sites seeing your IP behind tor to a separate quesiton, or at least provide more details.
    – George
    Commented Aug 22, 2013 at 13:23
  • Thanks for reply. Tor question is basically an example for main question. What more info should i provide?
    – bib bob
    Commented Aug 22, 2013 at 15:19
  • → bib bob: please separate the Javascript exploit protection question from the one about how your IP address might be visible on the Internet. If you keep such independant questions tightly together you risk to get answers poor on the 2 topics.
    – athena
    Commented Aug 22, 2013 at 17:48
  • Ok, I will re-post that as a separate question. I used it as an example for why I seek a deeper understanding of javascript. It was supposed to give the original question context.
    – bib bob
    Commented Aug 22, 2013 at 19:33

1 Answer 1

1

Code is neutral. There is no intrinsic difference between code which fulfils some functionality, and an active exploit, except that in the latter case you would prefer it not to happen. The difference is in your head, not in the code; computers cannot detect it automatically.

This is a fundamental property of IT security: there is no reliable test to know whether a given piece of code is benign or malicious. At best, we can:

  • Enforce benignity with heavy constraints, e.g. with NoScript: if the code cannot run, then it cannot harm.
  • Try to prune out malicious code by inspecting its source: allowing code to run only if it comes from a trustworthy source, and we have some reasonable assurance that what we got is indeed what that source sent (i.e., in a Web context: Javascript from a specific HTTPS Web site that we decided to trust).

I agree that this is unsatisfying. Unfortunately, the World has a tendency to be such.

1
  • As I already do what you suggested, the next step must be that I polish up my javascript and study suspect pages myself. As George P said, if it were easy to detect, there would be no problem.
    – bib bob
    Commented Aug 22, 2013 at 19:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .