OpenWrt Forum Archive

Topic: ALL-U-NEED Ad Blocking by YAQUI - Does it work with OpenWRT

The content of this topic has been archived between 22 Apr 2018 and 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I searched the forums for specific terms such as "ALL-U-NEED" and "YAQUI" but didn't get any hits on any of the forums.

My question is whether or not the script below would work on OpenWRT? [My current build is Attitude Adjustment (r27096)]

I found the script here: http://www.linksysinfo.org/forums/showt … hp?t=65454 -- and it covers the sections of the script and what it does.

The script is below...

## ALL-U-NEED Ad Blocking v3.9d
## http://goo.gl/mhykQ
## Original script by YAQUI
## Updated by ~nephelim~, Syl, jochen, groosh, ng12345, ray123, mstombs
## base64 decoder by Danny Chouinard's

sleep 10

ADB="/tmp/ADBLOCK.sh"
{
cat <<'ENDF' >$ADB
#!/bin/sh

OPTIMISE="Y"
GETS="1 2 3 4"
TRIM_BEGIN=3
S1="http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml"  #44K
S2="http://mirror1.malwaredomains.com/files/justdomains"    #189K
S3="http://www.malwaredomainlist.com/hostslist/hosts.txt"   #97K
S4="http://www.mvps.org/winhelp2002/hosts.txt"              #620K
S5="http://hosts-file.net/hphosts-partial.asp"              #460K
S6="http://hostsfile.mine.nu/Hosts"                         #2641K
S7="http://support.it-mate.co.uk/downloads/hosts.txt"       #3851K

USEWHITELIST="Y" # N/Y/R for remote
WURL="http://example.com/whitelist.txt"
WHITE="intel.com"
BLACK=""

USEPIXELSERV="N"
PXL_IP=192.168.1.2
PXL_EXE="/tmp/pixelserv"
PXL_URL="http://example.com/pixelserv"

UPLOAD="N"
FTP_SERVER="example.com"
FTP_USER=""
FTP_PASS=""
FTP_PORT=21
FTP_PATH="/gen"

ADD_CONF="N"
USEHOSTS="N"
ROUTER="Y"

NIP="0.0.0.0"

ENDF
}

UPDATE="Y"
AUP() {
if [[ "$UPDATE" == "Y" ]] ; then
if [[ "$(cru l | grep AdUpd | cut -d '#' -f2)" != "AdUpd" ]] ; then
cru a AdUpd "0 4 * * * $ADB"
fi
fi
}

#### DO NOT EDIT BELOW ####

b64="openssl enc -base64 -d"
[[ "$(echo WQ==|$b64)" != "Y" ]] && b64="b64" 

b64(){
awk 'BEGIN{b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"}
{for(i=1;i<=length($0);i++){c=index(b64,substr($0,i,1));if(c--)
for(b=0;b<6;b++){o=o*2+int(c/32);c=(c*2)%64;if(++obc==8){if(o)
{printf"%c",o}else{system("echo -en \"\\0\"")}obc=o=0}}}}';}

{
cat <<'ENDF'| $b64 |gunzip >>$ADB
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
/QdjDEMl1Q8AAA==
ENDF
}

chmod 775 $ADB
$ADB
AUP

This would be really convenient as it does download new versions of the websites with a cron job and would really help out with my internet connection at home since I have multiple users on the network.

Thanks in advance.

Interesting. I hope you will get it working and perhaps write up some howto for posterity.

fyi:
For-your-information, to use any of the above requires extensive re-write of the scripts to run with openwtrt.  I know because I have done it.  Re-write needs to change from use of /jffs, change from use of nvram, change the alias network interface used, change the way file-age of file is determined (-mtime does not work with the find command in openwrt), change the way that the cron entry is created, change the iptables entry to work properly.  Encyclopedic references are somewhat helpful, but actually having accomplished something can impart real knowledge.

(Last edited by KingJL on 6 Jul 2011, 16:29)

KingJL wrote:

I know because I have done it.

KingJL -- could you share some of what you've used to accomplish this? I realized there was a great deal of commands within the script I posted that didn't (or wouldn't) work and I didn't want to drop this into my router's start-up just to see if it would work.

Any help you could provide would be greatly appreciated -- even if that help is just pointing me to a forum/wiki that acts like a Rosetta Stone to the commands in the script to function within OpenWRT.

Thanks in advance

What architecture are you using.  I can provide a zip file that works with the latest trunk for ar71xx w/ath9k architecture.  If you are not the trunk ar71xx ath9k, the network interface alias will need to be changed.  If you are not ar71xx, you will need to find a different pixelserv binary (i do have a binary for broadcom).  If you want the zip file, PM me with your email address.

KingKL, I am interested in your mods. I have a router based on an AR71XX platform. If it is easy to modify to use on a BRCM47XX platform, that will be cool too.

mazilo wrote:

KingKL, I am interested in your mods. I have a router based on an AR71XX platform. If it is easy to modify to use on a BRCM47XX platform, that will be cool too.

PM with a valid email address (forum email does not provide for attachments).

PM sent -- thanks KingJL smile

Thanks again for the PM KingJL.

I've gotten the files over to the router and attempted to get it running. I've followed your instructions within your e-mail and created the necessary directory on the router and copied the files over to that path. I've also made sure to modify the files so that they were executable. The only file I've place into startup is the script to disable the advertisements since the pixelserv process is called within that shell script. I've also made sure that all the calls on interfaces within the script match what is actually used by my firmware on the router.

When I reboot the router though -- the shell script isn't being executed or it isn't staying up as a process because it isn't showing as an active process.

root@OpenWrt:/etc/dns# ps | grep -v grep | grep /etc/dns/disable_adds.sh 
root@OpenWrt:/etc/dns#

I'm not sure what I may have done incorrectly -- but here is a listing of the files in their respective path on the router.

root@OpenWrt:/etc/dns# pwd
/etc/dns
root@OpenWrt:/etc/dns# ls -l
-rwxr-xr-x    1 root     root          5099 Jun 28 21:47 disable_adds.sh
-rwxr-xr-x    1 root     root          7596 Jun 28 21:48 pixelserv

This is my "Local Startup" within the Luci console.

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

mkdir /var/log/openvpn &
/etc/openvpn/openvpnbridge &
openvpn /etc/openvpn/vpn.conf &
/etc/dns/disable_adds.sh &


exit 0

Any help would be greatly appreciated -- and more than likely is something missed incidentally.

KingJL wrote:
mazilo wrote:

KingKL, I am interested in your mods. I have a router based on an AR71XX platform. If it is easy to modify to use on a BRCM47XX platform, that will be cool too.

PM with a valid email address (forum email does not provide for attachments).

I PMed you my e-mail address a few days ago and have not received your codes, yet. If you didn't receive my PM, you can send your code as an attachment to me on KingJL@slickdeals.endjunk.com e-mail address. Once I have received your e-mail, I will inform you here and disable this e-mail address.

mazilo wrote:
KingJL wrote:
mazilo wrote:

KingKL, I am interested in your mods. I have a router based on an AR71XX platform. If it is easy to modify to use on a BRCM47XX platform, that will be cool too.

PM with a valid email address (forum email does not provide for attachments).

I PMed you my e-mail address a few days ago and have not received your codes, yet. If you didn't receive my PM, you can send your code as an attachment to me on KingJL@slickdeals.endjunk.com e-mail address. Once I have received your e-mail, I will inform you here and disable this e-mail address.

PM'd you mazilo

rgranados80 wrote:
mazilo wrote:
KingJL wrote:

PM with a valid email address (forum email does not provide for attachments).

I PMed you my e-mail address a few days ago and have not received your codes, yet. If you didn't receive my PM, you can send your code as an attachment to me on KingJL@slickdeals.endjunk.com e-mail address. Once I have received your e-mail, I will inform you here and disable this e-mail address.

PM'd you mazilo

I sent this out to you and rgranados80 (email was address to both of you) yesterday to the email address in your original PM!  Just resent to that email and the temp email address in previous post.  Did rgranados80 get it?

KingJL wrote:

Did rgranados80 get it?

Yep -- just posted above the problems I'm experiencing above. PM sent too.

rgranados80 wrote:

Thanks again for the PM KingJL.

I've gotten the files over to the router and attempted to get it running. I've followed your instructions within your e-mail and created the necessary directory on the router and copied the files over to that path. I've also made sure to modify the files so that they were executable. The only file I've place into startup is the script to disable the advertisements since the pixelserv process is called within that shell script. I've also made sure that all the calls on interfaces within the script match what is actually used by my firmware on the router.

When I reboot the router though -- the shell script isn't being executed or it isn't staying up as a process because it isn't showing as an active process.

root@OpenWrt:/etc/dns# ps | grep -v grep | grep /etc/dns/disable_adds.sh 
root@OpenWrt:/etc/dns#

I'm not sure what I may have done incorrectly -- but here is a listing of the files in their respective path on the router.

root@OpenWrt:/etc/dns# pwd
/etc/dns
root@OpenWrt:/etc/dns# ls -l
-rwxr-xr-x    1 root     root          5099 Jun 28 21:47 disable_adds.sh
-rwxr-xr-x    1 root     root          7596 Jun 28 21:48 pixelserv

This is my "Local Startup" within the Luci console.

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

mkdir /var/log/openvpn &
/etc/openvpn/openvpnbridge &
openvpn /etc/openvpn/vpn.conf &
/etc/dns/disable_adds.sh &


exit 0

Any help would be greatly appreciated -- and more than likely is something missed incidentally.

Directories, disable_adds.sh, and pixelserv appear ok.

Take your disable_adds.sh command out of startup temporarily until you see why the script is not running.

reboot, then ssh into the router and run the disable_adds.sh script manually.  See if any errors.
Also in LuCi take a look at the system log,  there are entries "local0.notice" "ad_blocker_script" that indicate progress.
When the shell script successfully completes ther will be 4 additional files in the /etc/dns directory.

The package, as sent, is set up for ar71xx, trunk build (not backfire), and the interface alias of the br-lan interface (creates br-lan:1).  Check if you have br-lan with ifconfig.

(Last edited by KingJL on 7 Jul 2011, 20:21)

I've gone ahead and removed the script from the start up to be on the safe side.

When I tried to run the script manually -- I'm getting the messages below?

root@OpenWrt:~# cd /etc/dns
root@OpenWrt:/etc/dns# ls
disable_adds.sh  pixelserv
root@OpenWrt:/etc/dns# ./disable_adds.sh 
-ash: ./disable_adds.sh: not found
root@OpenWrt:/etc/dns# ./etc/dns/disable_adds.sh
-ash: ./etc/dns/disable_adds.sh: not found

I was curious of where I could find the logs for the router in general -- and I'm not familiar with what I'd be looking for within them yet. I'm also uncertain of the four files that would be located in the /etc/dns path -- but I knew there would be two; "dlhosts" and "adblock.conf" (I've only gotten that far in the script. None of those files have been created since the script hasn't been able to be run on my router it seems.

The build that my router is running is a Trunk build and is based on the ar71xx architecture. Truly stumped at  the moment. :T

rgranados80 wrote:

I've gone ahead and removed the script from the start up to be on the safe side.

When I tried to run the script manually -- I'm getting the messages below?

root@OpenWrt:~# cd /etc/dns
root@OpenWrt:/etc/dns# ls
disable_adds.sh  pixelserv
root@OpenWrt:/etc/dns# ./disable_adds.sh 
-ash: ./disable_adds.sh: not found
root@OpenWrt:/etc/dns# ./etc/dns/disable_adds.sh
-ash: ./etc/dns/disable_adds.sh: not found

I was curious of where I could find the logs for the router in general -- and I'm not familiar with what I'd be looking for within them yet. I'm also uncertain of the four files that would be located in the /etc/dns path -- but I knew there would be two; "dlhosts" and "adblock.conf" (I've only gotten that far in the script. None of those files have been created since the script hasn't been able to be run on my router it seems.

The build that my router is running is a Trunk build and is based on the ar71xx architecture. Truly stumped at  the moment. :T

For right now, you've got me stumped!  For the last command above change it from

./etc/dns/disable_adds.sh

to

/etc/dns/disable_adds.sh

For some reason the sh doesn't see disable_adds as ann executable scrript.  Once you discover why, things can progress.

When the scrip successfully finishes the /etc/dns directory will look as follows

root@OpenWrt:/etc/dns# ls
adblock.conf            dlhosts                 pixelserv
disable_adds.sh         personal-ads-list.conf  whitelist

Alright -- I've made some progress with a google search. This is the first time I've ever had to do this since I started meddling around within *nix type systems.

root@OpenWrt:/etc/dns# sh disable_adds.sh 
: not founds.sh: line 10: {
ad_blocker_script: 
: not founds.sh: line 12: }
: not founds.sh: line 13: 
: not founds.sh: line 15: 
: not founds.sh: line 16: 
: not founds.sh: line 17: 
disable_adds.sh: line 105: syntax error: unexpected end of file (expecting "done")

I had to pre-fix the script with "sh" -- and then it gave me the output you see above. Do I need to make more modifications to the file permissions?

root@OpenWrt:/etc/dns# ls -l
-rwxr-xr-x    1 root     root          5099 Jun 28 21:47 disable_adds.sh
-rwxr-xr-x    1 root     root          7596 Jun 28 21:48 pixelserv

At least I was able to make it attempt to run within the shell.

KingJL wrote:
rgranados80 wrote:
mazilo wrote:

I PMed you my e-mail address a few days ago and have not received your codes, yet. If you didn't receive my PM, you can send your code as an attachment to me on KingJL@slickdeals.endjunk.com e-mail address. Once I have received your e-mail, I will inform you here and disable this e-mail address.

PM'd you mazilo

I sent this out to you and rgranados80 (email was address to both of you) yesterday to the email address in your original PM!  Just resent to that email and the temp email address in previous post.  Did rgranados80 get it?

Thanks. I received your e-mail with an attachment.

The errors reported do not make sense.  There is something wierd about your shell environment.  Busybox with it's built in shell is not functioning as mine (Bleeding Edge r27170) does.  I wonder if it is some busybox features that are not enabled or some needed packages missing in your configuration.  I am at a loss!

inspect the disable_ads.sh script.  It may be corrupted! Here is the script below:

#!/bin/sh
########Debug commands for terminal############
#echo "alias mem='cat /proc/meminfo'" >>/tmp/root/.profile
#echo "alias ll='ls -lash --color=auto'" >>/tmp/root/.profile
#echo "alias ls='ls --color=auto'" >>/tmp/root/.profile
#echo "alias tlog='tail -f /var/log/messages'" >>/tmp/root/.profile
#echo "alias clog='cat /var/log/messages | grep local0.notice'" >>/tmp/root/.profile
########Functions setup#########################
logger_ads()
{
logger -s -p local0.notice -t ad_blocker_script $1
}
 
##################################################

logger_ads "###########Ads blocker ed###########"

if [[ -z "$1" ]]; then
    logger_ads "Sleeping for 30 secs to give time for router boot"
    sleep 30
else
    logger_ads "override switch given"
    [[ $1 = "-h" || $1 = "/?" ]] && echo "use -m to override the 30 seconds delay and -f to force a list refresh" && exit 0    
    [ $1 = "-f" ] && rm /etc/dns/adblock.conf && rm /etc/dns/dlhosts
fi

# while ! ping www.google.com -c 1 > /dev/null ; do
# use wget for thos instances where the host network prevents pings
while ! wget http://www.google.com -O /dev/null 2>/dev/null ; do
    logger_ads "waiting for the internet connection to come up"
    sleep 5
done
 
logger_ads "New IP and ports setup"
pixel="`ifconfig br-lan | grep inet | awk '{ print $3 }' | awk -F ":" '{ print $2 }' | cut -d . -f 1,2,3`.254"
/sbin/ifconfig br-lan:1 $pixel
#/sbin/ifconfig br-lan:1 $pixel netmask "`ifconfig br-lan | grep inet | awk '{ print $4 }' | awk -F ":" '{ print $2 }'`" broadcast "`ifconfig br-lan | grep inet | awk '{ print $3 }' | awk -F ":" '{ print $2 }'`" up
 
logger_ads "Adding a refresh cycle by puting the script in cron if it isnt there yet"
if [[ -z "`cat /etc/crontabs/root | grep "/etc/dns/disable_adds.sh"`" ]] ; then
    echo '0 0 * * * root /etc/dns/disable_adds.sh -m' >> /etc/crontabs/root
    /etc/init.d/cron restart && logger_ads "restarted the cron service"
else
    logger_ads "The script is already in cron"
fi

logger_ads "Redirect setup & Appending to the FW script"
[[ -z "`iptables -L -n -t nat | grep ${pixel} | grep 88`" ]] && logger_ads "did NOT find an active redirect rule with the iptable command, injecting it now." && /usr/sbin/iptables -t nat -I PREROUTING 1 -d ${pixel} -p tcp --dport 80 -j DNAT --to ${pixel}:88

 
logger_ads "Starting or ReSpawning pixelsrv"
if [[ -n "`ps | grep -v grep | grep /etc/dns/pixelserv`" ]]
then
logger_ads "the pixelserv is already up"
else
logger_ads "it seems that the pixelserv isnt up. starting it now"
/etc/dns/pixelserv $pixel -p 88
fi

logger_ads "Get the online lists"
tnow=`date +%s`
tdlh=`date +%s -r /etc/dns/dlhosts`
tadblk=`date +%s -r /etc/dns/adblock.conf`
tdlh=`expr $tdlh + 86400`
tadblk=`expr $tadblk + 86400`

[ ! -e /etc/dns/whitelist ] && echo google-analytics > /etc/dns/whitelist && echo googleadservices >> /etc/dns/whitelist
if [[ $tnow -ge $tdlh || $tnow -ge $tadblk || ! -e /etc/dns/dlhosts || ! -e /etc/dns/adblock.conf ]]; then
    logger_ads "The lists are NOT setup at all yet, or more then 3 days old. will now retrieve them from the web"
    logger_ads "Retrieving the MVPS hosts list"
    wget -q -O - http://www.mvps.org/winhelp2002/hosts.txt | grep "^127.0.0.1" | grep -v localhost | tr -d '\015' >/tmp/dlhosts.tmp
    logger_ads "adjusting the MVPS hosts list for our use"
    cat /etc/dns/whitelist | while read line; do sed -i /${line}/d /tmp/dlhosts.tmp ; done
    sed -i s/127.0.0.1/$pixel/g /tmp/dlhosts.tmp
    logger_ads "done adjusting the MVPS hosts list use"
    logger_ads "retrieving the Yoyo domain list"
    wget -q "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq&showintro=0&mimetype=plaintext" -O /tmp/adblock.tmp
    logger_ads "adjusting the Yoyo domain list for our use"
    cat /etc/dns/whitelist | while read line; do sed -i /${line}/d /tmp/adblock.tmp ; done
    sed -i s/127.0.0.1/$pixel/g /tmp/adblock.tmp
    logger_ads "Moving the Yoyo list to etc"
    mv /tmp/adblock.tmp /etc/dns/adblock.conf
    logger_ads "Moving the MVPS hosts list to etc"
    mv /tmp/dlhosts.tmp /etc/dns/dlhosts

else
    logger_ads "The lists are less then 3 days old, saving on flash erosion and NOT refreshing them"
fi
 
logger_ads "Removing whitelist from the personal file"
[ ! -e /etc/dns/personal-ads-list.conf ] && touch /etc/dns/personal-ads-list.conf
cat /etc/dns/whitelist | while read line; do sed -i /${line}/d /etc/dns/personal-ads-list.conf ; done

# Replace the adblock stuff in the "dnsmasq.conf" file.
sed  -i "/^#BEGIN--adblock-custom/,/^#END--adblock-custom/d" /etc/dnsmasq.conf
echo "#BEGIN--adblock-custom" >>/etc/dnsmasq.conf
echo "conf-file=/etc/dns/adblock.conf" >>/etc/dnsmasq.conf
echo "addn-hosts=/etc/dns/dlhosts" >>/etc/dnsmasq.conf
echo "conf-file=/etc/dns/personal-ads-list.conf" >> /etc/dnsmasq.conf
echo "#END--adblock-custom" >>/etc/dnsmasq.conf

logger_ads "Refreshing DNS settings"
/etc/init.d/dnsmasq restart && logger_ads "restarted the dnsmasq service"

logger_ads "##########The Ads blocker script has finished its run and you should up and running##########"

(Last edited by KingJL on 7 Jul 2011, 21:21)

After reviewing the location the shell responded as being "wrong" I was also stumped. It's stopping on the brackets for some reason...

BusyBox v1.18.4 (2011-06-03 02:18:49 CEST) multi-call binary.

These are the modules I have loaded.

Module
aes_generic
arc4
ath
ath9k
ath9k_common
ath9k_hw
button_hotplug
cfg80211
compat
crc_ccitt
crypto_algapi
ehci_hcd
gpio_keys_polled
input_core
input_polldev
ip_tables
ipt_LOG
ipt_MASQUERADE
ipt_REJECT
iptable_filter
iptable_mangle
iptable_nat
iptable_raw
leds_gpio
leds_wndr3700_usb
ledtrig_usbdev
mac80211
nf_conntrack
nf_conntrack_ftp
nf_conntrack_ipv4
nf_conntrack_irc
nf_defrag_ipv4
nf_nat
nf_nat_ftp
nf_nat_irc
nls_base
ohci_hcd
ppp_async
ppp_generic
pppoe
pppox
slhc
tun
usbcore
x_tables
xt_comment
xt_conntrack
xt_limit
xt_mac
xt_multiport
xt_NOTRACK
xt_state
xt_TCPMSS
xt_tcpudp

I can't think of anything else I could provide to explain what is running -- unless you can think of any.

rgranados80:
In LuCi go to System->Software
What version of busybox is listed?
My version is: 1.18.4-1

busybox    1.18.4-1

Maybe a dev can give a hint to where to look!

rgranados80:
What are the permissions on the /etc/dns directory?