注册 登录
自由的生活_软路由 返回首页

msntop的个人空间 https://bbs.routerclub.com/?176481 [收藏] [复制] [分享] [RSS]

日志

用web代理做应用层拦截,实现类似电信push功能

已有 1698 次阅读2011-9-30 17:44

利用网页上弹出来的小广告,把它拦截并替换为我们做好的内容,图片,网页,flash都可以,我这里举几个例子,我这里只是对特定的目标才做代理,其它网站是不走代理的,由于很多网站不止一个IP,所以这里用防火墙把目标添加到一个地址列表,用来做代理的目标地址,配合radius计费系统,把即将到期的用户下发另外一个IP段,再只对这个源地址做代理,实现提醒即将到期用户续费的目的,如果用户量多的话,想在哪个知名网站做点小广告,嘿嘿,再收取点广告赞助,


/ip firewall filter
add action=add-dst-to-address-list address-list=web_proxy \
    address-list-timeout=0s chain=forward comment="" content=www.baidu.com \
    disabled=no
add action=add-dst-to-address-list address-list=web_proxy \
    address-list-timeout=0s chain=forward comment="" content=img.5251.net \
    disabled=no
add action=add-dst-to-address-list address-list=web_proxy \
    address-list-timeout=0s chain=forward comment="" content=\
    bbs.routerclub.com disabled=no
add action=add-dst-to-address-list address-list=web_proxy \
    address-list-timeout=0s chain=forward comment="" content=\
    minisite2009.qq.com disabled=no

/ip firewall nat
add action=redirect chain=dstnat comment="" disabled=no dst-address-list=\
    web_proxy dst-port=80 protocol=tcp to-ports=923


/ip proxy
set always-from-cache=no cache-administrator=td0923@yahoo.cn cache-hit-dscp=4 \
    cache-on-disk=no enabled=yes max-cache-size=none max-client-connections=\
    600 max-fresh-time=3d max-server-connections=600 parent-proxy=0.0.0.0 \
    parent-proxy-port=0 port=923 serialize-connections=no src-address=0.0.0.0
/ip proxy access
add action=deny comment="" disabled=no path=/othercity/all.htm redirect-to=\
    192.168.30.2/qqpush.html
add action=deny comment="" disabled=no path=/img/baidu_logo.gif redirect-to=\
    192.168.30.2/logo.gif
add action=deny comment="" disabled=no path=/images/ad_router_club.gif \
    redirect-to=192.168.30.2/routerclub.gif
add action=deny comment="" disabled=no path=\
    /upload/2008-09-11/108841759409.gif redirect-to=192.168.30.2/00.gif


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-22 20:39 , Processed in 0.035592 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

返回顶部