Showing posts with label anonymity. Show all posts
Showing posts with label anonymity. Show all posts

Thursday, May 3, 2012

Internet Track Blocker

I have started working on a script last week, but I have been busy so it took a while to finish it. Well not absolutely finish, but have it working properly.

The script is basically an "Internet track blocker" that can be used to block sites from collecting data on you. Sites like facebook for example.

Thanks to hak5.org and their awesome tips & tricks I became interested in this and took their initial idea one step further.


The command is in its simplest format looks like this:


sudo ngrep -q -d any 'facebook.com' -K 3

What is what?
  • -q -- tells ngrep to be quiet, though you will still see quite a lot of information floating around
  •  -d any -- ngrep should listen on all network interfaces
  • 'facebook.com' -- search for this term
  • -K 3 -- kill the data stream containing the word by sending 3 reset packets

The script 


Not being too creative, I have named my script "Block-d".
So basically what it does, it checks the data you send or receive and if it contains the given word (facebook in the above example), a reset segment will be sent, the connection reset and basically the data stream blocked.
So after freshening up my scripting knowledge and doing quite some research on the internet I have managed write a script that:
  • Is pre-set to block facebook and google (alone and together as well)
  • Allows to set what you want to block manually
  • Allows making a permanent blocklist with sites you want to block (useful if you have your specific sites you want to keep blocked, whatever you like)
  • You can set which interface you want to listen on (by default this is all=any
  • You can also tell how many reset segments you want to send (I've set it to 3, however 1 would do the job as well, its not bad to go for a little overkill)

What you will need to run this script

First of all you need ngrep. Now I don't remember if I installed it manually or it was pre-installed, but I think you will need to install it manually. Not hard at all,
sudo apt-get install ngrep

And of course you need the script as well that you can download from here:
Blockd.sh

Edit: Also available on Github at : https://github.com/Nargren/Blockd

After downloading the script, change the permissions to executable. You can simply right click/properties/permissions/Allow executing file as program. Or you can do it the terminal way
sudo chmox -x Blockd.sh

(I am about to set up a github account, but for now you can use the download link.)
I have tried to keep everything as simple as it is possible and I am open for any feedback. I have been running and testing it and seems to be working fine, although please contact me if you find any bugs or whatsoever. I'm also open for any ideas and suggestion how could it be made better.
(also, "use at own risk")

Please make sure you read the description at the start of the script, there is some important information there.

Screenshot

 

Saturday, April 28, 2012

Running Tor and Vidalia

Tor is free software and an open network that helps you defend against a form of network surveillance that threatens personal freedom and privacy[...]
Read more about the tor at https://www.torproject.org/

It is a very nice software that I have been using on windows and also wanted to use with linux. Luckily, there is a nice and easy to follow installation manual for Ubuntu, HERE. It is very easy to set it up and running, so I won't copy all the commands in here.

One thing to note though is that after installing, tor is ran on startup and when you want to start Vidalia (tor's UI for settings etc.) it will detect the running tor process and try to connect to it. This isn't working (or not for me at least) so before starting vidalia, make sure to kill off the running tor process

sudo killall tor

This command can be ran even on startup to make things easier and clear. After this vidalia can be started normally.

Edit

Its even easier to remove tor from your runlevel, preventing executing it at startup in the first place. If done this way, there is no need to kill tor at startup manually and vidalia will start it by itself fresh, guaranteeing that it runs as intended. Simply run
sudo update-rc.d -f tor remove


Others

One more thing, I remember having some trouble in the settings, but its like this at the moment:


I think once I had to set Authentication for "cookie" because it just wouldn't want to work with password, but apparently now it does, so I'm happy.

To use tor when browsing I'm using GProxy Toolbar for Firefox, a simple toolbar that lets me witch between proxies quickly without having to open the browser net configuration. Its set like this: