蹭网不用死全家了
http://www.ex-parrot.com/pete/shot3.pngIPtables is Fun!
Suddenly everything is kittens! It's kitten net.
/sbin/iptables -A PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp -j DNAT --to-destination 64.111.96.38
For the uninitiated, this redirects all traffic to kittenwar.
For more fun, we set iptables to forward everything to a transparent squid proxy running on port 80 on the machine.
/sbin/iptables -A PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.0.1
That machine runs squid with a trivial redirector that downloads images, uses mogrify to turn them upside down and serves them out of its local webserver.
The redirection script
#!/usr/bin/perl
$|=1;
$count = 0;
$pid = $$;
while (<>) {
chomp $_;
if ($_ =~ /(.*\.jpg)/i) {
$url = $1;
system("/usr/bin/wget", "-q", "-O","/space/WebPages/images/$pid-$count.jpg", "$url");
system("/usr/bin/mogrify", "-flip","/space/WebPages/images/$pid-$count.jpg");
print "http://127.0.0.1/images/$pid-$count.jpg\n";
}
elsif ($_ =~ /(.*\.gif)/i) {
$url = $1;
system("/usr/bin/wget", "-q", "-O","/space/WebPages/images/$pid-$count.gif", "$url");
system("/usr/bin/mogrify", "-flip","/space/WebPages/images/$pid-$count.gif");
print "http://127.0.0.1/images/$pid-$count.gif\n";
}
else {
print "$_\n";;
}
$count++;
}
Then the internet looks like this!
太高端了 全s1只有我不是码农系列
----发送自 STAGE1 App for Android. 看到图了,不过现在的显卡不是都带画面旋转功能吗,设个快捷键反转过来看完了再转回去不就行了
----发送自 STAGE1 App for Android. 咋一看像C仔细一看不是。。。
这是啥?
----发送自 STAGE1 App for Android. 引用第4楼ramiel1于2013-04-24 18:28发表的:
人家蹭网只是下崽用的 images/back.gif
那就限制速度到5k flickr这界面有年头了吧 引用第5楼帕米克楠波特于2013-04-24 18:35发表的:
咋一看像C仔细一看不是。。。
这是啥?
----发送自 STAGE1 App for Android. images/back.gif
#!/usr/bin/perl 是不是要个高端路由才行? 用iptables的NAT转发,那岂不是要求这linux充当软路由? squid是个好东西 引用第11楼xinxinran于2013-04-25 09:29发表的:
用iptables的NAT转发,那岂不是要求这linux充当软路由? images/back.gif
很多能刷wrt固件的路由
页:
[1]