Good afternoon, is approaching April 1, and I really would not want this day to be the same as the others, so I propose a special, IT joke. This is a translation of an article accidentally found on the Internet, in fact, translated it to a11aud , but he lacks karma for the post, so I write (a11aud himself will be very grateful for the karma :))
1) Introduction
My neighbors are stealing my wireless internet. Yes, I could begin to encrypt, but you can get a lot of pleasure from the contemplation of bewilderment on their faces!
2) Separate the network!
I started by dividing the network into two parts: trusted and untrusted. Trusted had its share of the network, untrusted - its own. We use a DHCP server to identify the MAC addresses to be divided into appropriate groups.
/etc/dhcpd.conf')
ddns-updates off;
ddns-update-style interim;
authoritative;
shared-network local {
subnet *.*.*.* netmask 255.255.255.0 {
range *.*.*.* *.*.*.*;
option routers *.*.*.*;
option subnet-mask 255.255.255.0;
option domain-name "XXXXX" ;
option domain-name-servers *.*.*.*;
deny unknown-clients;
host trusted1 {
hardware ethernet *:*:*:*:*:*;
fixed-address *.*.*.*;
}
}
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.10;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.0.1;
allow unknown-clients;
}
}
* This source code was highlighted with Source Code Highlighter .
3) IPtables are fun!
Suddenly everything became cats! Koshkanet.
/ 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 on
kittenwarPS As a Russian-language alternative, I suggest
http://www.koshkimira.ru/To heighten the fun, you can configure iptables for forwarding everything to transparent
squid proxy running on port 80.
/ 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
On this car, squid is spinning with a banal redirect that downloads pictures, uses a modifier to flip them upside down and sends them outside the local web server.
Actually, the script itself:
#!/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++;
}
* This source code was highlighted with Source Code Highlighter .
4) And the Internet began to look like this!


And if you try the effect of vagueness "-blur 4", then you get "vague"!
Original