godzillaqqq 发表于 2013-4-24 09:32

蹭网不用死全家了

http://www.ex-parrot.com/pete/shot3.png




IPtables 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!


太高端了

jun4rui 发表于 2013-4-24 09:50

aladeen 发表于 2013-4-24 10:31

全s1只有我不是码农系列

----发送自 STAGE1 App for Android.

aladeen 发表于 2013-4-24 10:33

看到图了,不过现在的显卡不是都带画面旋转功能吗,设个快捷键反转过来看完了再转回去不就行了

----发送自 STAGE1 App for Android.

ramiel1 发表于 2013-4-24 18:28

帕米克楠 发表于 2013-4-24 18:35

咋一看像C仔细一看不是。。。
这是啥?

----发送自 STAGE1 App for Android.

ov_efly 发表于 2013-4-24 19:20

引用第4楼ramiel1于2013-04-24 18:28发表的:
人家蹭网只是下崽用的 images/back.gif

那就限制速度到5k

ganeid 发表于 2013-4-24 19:42

flickr这界面有年头了吧

枝叶柚希 发表于 2013-4-24 20:04

引用第5楼帕米克楠波特于2013-04-24 18:35发表的:
咋一看像C仔细一看不是。。。
这是啥?

----发送自 STAGE1 App for Android. images/back.gif

#!/usr/bin/perl

keyz_haha 发表于 2013-4-24 20:35

zdian 发表于 2013-4-25 03:19

是不是要个高端路由才行?

xinxinran 发表于 2013-4-25 09:29

用iptables的NAT转发,那岂不是要求这linux充当软路由?

gsky916 发表于 2013-4-25 09:46

squid是个好东西

四点 发表于 2013-4-25 09:58

引用第11楼xinxinran于2013-04-25 09:29发表的:
用iptables的NAT转发,那岂不是要求这linux充当软路由? images/back.gif

很多能刷wrt固件的路由
页: [1]
查看完整版本: 蹭网不用死全家了