Introduction

Note: This guide was tested using Ubuntu Server 14.04.4 LTS.

This is a HowTo for setting up Upside-Down-Ternet on Ubuntu. Basically, when a user browses the web, all the images are flipped upside-down. While it's not useful, it's quite a good April Fool's prank.

The process uses a transparent proxy, web server, and script to flip the images. Web traffic is routed to the proxy, instead of the default gateway, which is intercepted by the proxy which then downloads and modifies the images and then serves them back to the client browser.

Setting up the Proxy

The proxy used in this guide is Squid v3.3.8. The IP of this server is 192.168.113.253.

Setting up the Web Server

In this section, Nginx will be installed on your computer. You can install Apache if you'd like to.

Installation

sudo apt-get install nginx

Configuration

As the Squid runs with the user proxy. So Nginx should also run with the same user in order to serving the images. So we need to change the first line in the file located in /etc/nginx/nginx.conf.

user proxy

As Nginx is going to provide modified images, a directory where those images are stored needs to be created. Create a directory where the images are to be stored and set the correct directory permissions:

Setup the Route Running OpenWRT

This router is in the subnet 192.168.1.0/24, having an IP 192.168.113.x. What we need to do in this section is to redirect all HTTP traffic to the Squid server. So we need to setup iptables in this router.