Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 12:22
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Script to block tracking from omniture etc.
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count_1  
Author Message

Joined: 29 Jan 2008
Posts: 145
Location: Lancashire,U.K.

PostPosted: Mon 01 Mar 2010, 10:37    Post_subject:  Script to block tracking from omniture etc.
Sub_title: blocking ip's of scripts in webpages that track you

Hi all,
this script was posted by a colleague on the Badphorm Forum. It is his work and I am posting it here for wider use. Cut and paste this using your favourite editor.

#! /bin/sh -e
# Blocktracker
# update_iptables.sh
# ------------------
# Shell script to read a file of IP addresses (in CIDR notation),
# one per line and terminated with a last line of "eof" and to
# update iptables to REJECT (with reason icmp-admin-prohibited) any outbound traffic
# to these addresses. Will output a message to your syslog for each block.
# 1) You must have iptables installed (I think most distros will have it installed already).
# 2) You must run this script as root (I use crontab to run it once a day and on reboot)
# 3) Don't forget to make this script exexcutable!
# 4) You can make your blocklist file editable by a trusted non-root user if you wish.

# ***** EDIT LINE BELOW with location of your blocklist file *****
# *****------------------------------------------------------*****

# Clear existing iptables
/sbin/iptables --flush

# Configure iptables with addresses we block from going out
#echo "working"
while read line
/sbin/iptables -A OUTPUT -d $line -j LOG --log-prefix "BLOCKED TRACKING SITE: "
/sbin/iptables -A OUTPUT -d $line -j REJECT --reject-with icmp-admin-prohibited
done < $IPLIST

# Display new iptables
#/sbin/iptables --list
echo "finished"
# Exit
#end of blocktracker

save the above as blocktracker make it executable and put it in /usr/local/bin

the data file copy this list of ip numbers including the eof at the end and save as 'tracking_list_ip.data', put this in /

Thanks to Lardycake on Badphorm



Save the data file as "tracking_sites_ip.data" as it says in the script not tracking_list as I said. Sorry for the typo
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1862s ][ Queries: 11 (0.0056s) ][ GZIP on ]