笔者通过在路由器上搭建Provioxy代理服务器来实现过滤通过其对网页,并植入相应对广告。
废话不多说直接上实验:
第一步:准备固件
编译OpenWrt固件-选择Privoxy
第二步:修改配置文件
配置user.filter, user.action, config文件。
config文件中需要指定监听都地址与端口号
root@YSWiFi:/etc/privoxy# cat config
confdir /etc/privoxy
logdir /var/log
filterfile default.filter
filterfile user.filter
#logfile privoxy
actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
actionsfile default.action # Main actions file
actionsfile user.action # User customizations
listen-address 10.1.1.1:8118
toggle 1
enable-remote-toggle 1
enable-remote-http-toggle 0
enable-edit-actions 1
enforce-blocks 0
buffer-limit 4096
forwarded-connect-retries 0
accept-intercepted-requests 1
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 300
socket-timeout 300
permit-access 10.1.1.0/24
debug 1 # show each GET/POST/CONNECT

本文介绍了如何在OpenWrt路由器上通过Provioxy设置代理服务器,实现网页过滤并植入广告。步骤包括:编译固件选择Privoxy,修改配置文件如user.filter和user.action来指定监听端口和注入广告脚本,最后通过user.filter添加过滤规则。实现实验后,每个打开的网页都会显示定制的广告。
最低0.47元/天 解锁文章
3259

被折叠的 条评论
为什么被折叠?



