Viewing and logging blocked items

General discussion about the NoScript extension for Firefox
jimoe
Posts: 18
Joined: Wed Aug 18, 2010 9:04 pm

Viewing and logging blocked items

Post by jimoe »

NoScript indicates that scripts or objects are blocked, and provides a count of each type.

How do I find out which scripts or objects are blocked?

Is it possible to log NoScript's activities?
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 SUSE/3.6.8-0.1.1 Firefox/3.6.8
Alan Baxter
Ambassador
Posts: 1586
Joined: Fri Mar 20, 2009 4:47 am
Location: Colorado, USA

Re: Viewing and logging blocked items

Post by Alan Baxter »

jimoe wrote:How do I find out which scripts or objects are blocked?
I use the NoScript menu's Blocked Objects flyout to see what objects are blocked. For scripts I use the JSView extension. It adds a Scripts pane to the Page Info window. Each of the scripts can be viewed from there with the right-click context menu.
Is it possible to log NoScript's activities?
I don't know. There may be a Firefox command line option which would turn it on. Giorgio would know.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
jimoe
Posts: 18
Joined: Wed Aug 18, 2010 9:04 pm

Re: Viewing and logging blocked items

Post by jimoe »

I use the NoScript menu's Blocked Objects flyout to see what objects are blocked.
Yes, I use that as well. My difficulty is this. I have the web server (apache) redirecting certain URL patterns to a neverland site. This has reduced a lot of unnecessary traffic and error logging.

I recently added a new application that triggers one (or more?) of those redirections. I can see the blockage of the redirected site but not the original URL that caused the redirection.
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 SUSE/3.6.8-0.1.1 Firefox/3.6.8
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Viewing and logging blocked items

Post by Giorgio Maone »

You can set the noscript.consoleDump about:config preference to true and start Firefox from a terminal with the -Console command line option.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
tim
Posts: 1
Joined: Sun Aug 22, 2010 9:07 pm

Re: Viewing and logging blocked items

Post by tim »

Alan Baxter wrote:I use the NoScript menu's Blocked Objects flyout to see what objects are blocked.
Where is it? The only flyouts I have are "Recently blocked sites" and "Untrusted". I see no place to view blocked objects...what am I missing here?
Alan Baxter wrote:For scripts I use the JSView extension.
Where is this? I too would like to see what scripts are being blocked.

Forgive my lack of understanding...I like to think I know what I'm doing but it's obvious I don't!

Tim
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Alan Baxter
Ambassador
Posts: 1586
Joined: Fri Mar 20, 2009 4:47 am
Location: Colorado, USA

Re: Viewing and logging blocked items

Post by Alan Baxter »

tim wrote:
Alan Baxter wrote:I use the NoScript menu's Blocked Objects flyout to see what objects are blocked.
Where is it? The only flyouts I have are "Recently blocked sites" and "Untrusted". I see no place to view blocked objects...what am I missing here?
The Blocked Objects selection is displayed only if some objects are blocked. Assuming that NoScript Options > Appearance > Blocked Objects is checked. It's checked by default.
Alan Baxter wrote:For scripts I use the JSView extension.
Where is this? I too would like to see what scripts are being blocked.
JSView :: Add-ons for Firefox
Download Philip Chee's improved version of JSView linked from http://forums.mozillazine.org/viewtopic ... &t=1704235 (http://downloads.mozdev.org/xsidebar/mo ... .5-mod.xpi).
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3369
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

Giorgio Maone wrote:You can set the noscript.consoleDump about:config preference to true and start Firefox from a terminal with the -Console command line option.
When you say set to true, the default value is 0, so true as in 1 or true as in "true" or either? Since the value is integer, you can only put 0 or 1, right? So true as in 1 right? like the old 0/1 false/true state?
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: Viewing and logging blocked items

Post by dhouwn »

GµårÐïåñ wrote:Since the value is integer, you can only put 0 or 1, right?
Nope, but probably any value other than 0 activates this (or maybe just every values above 0), it could be also the other way round though.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4) Gecko/20100818 Firefox/4.0b4
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3369
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

Well he might have put the default error trap of accepting any integer other than 0 as true, but in a formal programming condition, a true/false is represented as 1/0 respectively and I would be inclined to think that Giorgio would be sticking to the formal programming constraints, although for the sake of covering more error conditions, he might have a default catch for anything non-zero to signal true. But strictly speaking from a programming convention and common standard, it would only be a 1/0 combination, regardless of what additional error trapping leeway the programmer includes to prevent the widest possible range of possible human errors to not cause the program to crash or malfunction.
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Viewing and logging blocked items

Post by therube »

I saw no default value, so added the Preference as Boolean.
Not sure it's doing anything just yet though?

LOL: Nevermind. It will help once I install NoScript into the Profile!


Heh. That's better.

So not Boolean, but Integer.
Then I would suspect any value NOT 0.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: Viewing and logging blocked items

Post by dhouwn »

GµårÐïåñ wrote:But strictly speaking from a programming convention and common standard, it would only be a 1/0 combination,
Could be also 0 and -1 because these two values can be toggled with a simple bitwise NOT (for signed integers on common architectures). ;)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4) Gecko/20100818 Firefox/4.0b4
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3369
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

Actually when using boolean values IN THE PROGRAM, you can toggle true/false by doing NOT on 0/1 to achieve true/false (aka. 1/0) and yes by default many uninitiated variables will have -1 as their initially constructed value but often need to be given something valid to process since -1 (to the best of my knowledge) doesn't compute in a boolean evaluation of an integer. In fact, anything outside of 0/1 are defaulted to 0 when boolean evaluated from an integer form.
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Viewing and logging blocked items

Post by Giorgio Maone »

Sorry for the confusion, it was just a typo of mine.
noscript.consoleDump is a bitmask.
If you want to log content blocking, you need to set its rightmost bit.
In other words, you need to set it to 1, unless you're interested in other kinds of activities -- e.g., XSS filter activity gets logged by setting bit 4 (16) and optionally bit 5 (32) for deeper detail, so if you want to log content blocking + verbose XSS activity you need to set to 49.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3369
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: Viewing and logging blocked items

Post by GµårÐïåñ »

Gotcha, it has a multi mask/variable scope, got it. Thank you for the explanation. If we had the database with all the variables, when they were introduced or retired and what they do and what their possible values are and all that, it would make these kind of things easier and also less work for you to have to explain it. I started a similar project on my own a while back until we can integrate it and then my health tanked and it became for all intents and purposes abandoned. If you have an idea how and to what extent you want to do this, I would volunteer to do the grunt work or even the coding if you want and just give me a plan as to how you want it started and moved forward and I will be glad to do the work that needs to be done, no problem. Thanks.
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Viewing and logging blocked items

Post by Giorgio Maone »

Code: Select all

const LOG_CONTENT_BLOCK = 1;
const LOG_CONTENT_CALL = 2;
const LOG_CONTENT_INTERCEPT = 4;
const LOG_CHROME_WIN = 8;
const LOG_XSS_FILTER = 16;
const LOG_INJECTION_CHECK = 32;
const LOG_DOM = 64;
const LOG_JS = 128;
const LOG_LEAKS = 1024;
const LOG_SNIFF = 2048;
const LOG_CLEARCLICK = 4096;
const LOG_ABE = 8192;
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Post Reply