LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Can I get better online security then what I have? (https://www.linuxquestions.org/questions/linux-security-4/can-i-get-better-online-security-then-what-i-have-848747/)

barriehie 12-08-2010 05:21 PM

The OP's post about having the HTTPS-Everywhere add on prompted me to write a perl script that would take my exported bookmarks.html file and generate the corresponding .xml files for the addon. It wasn't doing much so then I come to find out that the addon isn't supported in my version of FF. :( Anyhow, here's the script and I *think* it generates the files correctly. It's my first perl program that actually -does- something so keep that in mind please. :)

It's easy enough to run and I ran it with the bookmarks.html file in the same dir as the program. The .xml files are generated in the same location. You'll have to move them by whatever means you're comfortable with.

Code:

#!/usr/bin/perl -w
use strict;

#
# Script to parse FF/Iceweasel bookmarks.html
# file into xml file(s) for HTTPS-Everywhere
#

#
# Variables
#
my $line = '';
my $ruleset_name = '';
my $rule_from = '';
my $rule_to = '';
my $temp_name = '';
my $xml_fname = '';


if ( ! $ARGV[0] ) {
    print "Usage: httpsE.pl /path/bookmarks.html\n";
    exit 1;
    }

open FILE, "<", "$ARGV[0]" or die $!;
while ( $line = <FILE> ) {
    $line =~ s/^.*<DT><A HREF="//;
    $line =~ s/" ADD_DATE.*$//;
    if ( $line =~ /^http:.*$/ ) {
        $temp_name = $line;
        $temp_name =~ s/^http:\/\/www\.//;
        $temp_name =~ s/^http:\/\///;
        $temp_name =~ s/\/.*$//;
        $temp_name =~ s/\n//;
        $ruleset_name = "<ruleset name=\""."$temp_name"."\">";
        $rule_from = "<rule from=\"^".$line."\"";
        $rule_from =~ s/\n//;
        $rule_to =~ " to=\""."$line";
        $xml_fname = $temp_name.".xml";
        #
        # Create the xml file and write the data.
        #
        open(XML_FILE, ">$xml_fname");

        print "$xml_fname\n";
        print XML_FILE "$ruleset_name\n";
        $temp_name = $line;
        $temp_name =~ s/http/https/;
        $rule_to = " to=\""."$temp_name\"";
        $rule_to =~ s/\n//;
        $rule_from =~ s/\./\\./g;
        print XML_FILE "$rule_from "."$rule_to/>\n";
        print XML_FILE "</ruleset>\n";
        close(XML_FILE);
        }
    }

close FILE;
exit 0


Amdx2_x64 12-08-2010 07:26 PM

Well I decided to just keep Debian for now and install Arch later, when I have the time. So I checked WOT again and realized a mistake I had made immediately. When I had first searched for Web of Trust I had assumed that the first thing that would come up would be the actual add-on, I was half asleep and saw that it only worked with 3.6+. So that was that. It wouldn't work with my current version of Iceweasel. Well this time when I searched again I noticed that the one I saw before was in the category persona. So................

I installed the ACTUAL add-on this time with my current version of Iceweasel 3.5.15. I am checking it out now.

unSpawn 12-08-2010 07:46 PM

This thread being more about the privacy aspects of being on-line, rather than security, I hope you read the article at http://www.linuxquestions.org/questi...ffing-849111/?

Amdx2_x64 12-08-2010 08:00 PM

Quote:

Originally Posted by unSpawn (Post 4185361)
This thread being more about the privacy aspects of being on-line, rather than security, I hope you read the article at http://www.linuxquestions.org/questi...ffing-849111/?


Thank you. This is a great article.

I do have a big concern about ISP's doing the same thing/similar things for commercial profit, etc. The battle with Net Neutrality in the US is going in the ISP's direction. So if that happens Net Neutrality is dead and anything goes for them.


All times are GMT -5. The time now is 10:09 AM.