路由器修改html加广告,openwrt利用Privoxy实现js广告植入

本文介绍了如何使用OpenWrt路由器通过Privoxy修改HTTP响应,实现HTML中添加JS广告。步骤包括:编译OpenWrt固件并安装Privoxy,配置Privoxy的user.filter、user.action和config文件以注入广告脚本,以及设置iptables规则将流量重定向到Privoxy。完成设置后,路由器可以自动在访问的网页中插入广告。
摘要由CSDN通过智能技术生成

第一步:准备固件

编译OpenWrt固件-选择Privoxy

第二步:修改配置文件

配置user.filter, user.action, config文件。

config文件中需要指定监听都地址与端口号

[email protected]:/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</

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值