48 | | We need to generate traffic in our network and one of the easiest ways to do that is with HTTP traffic, so we need to set up a server and a web page. Connect to Server 1 and run [attachment:runme.apache this script] with the `sudo` command This will run a script with Apache 2 which sets up the server and web page and displays the users IP address on the Server 1 node. When prompted "Do you want to continue [Y/n]?" select `Y` Once the script is done running, the server is now set up and we can generate traffic! You can check this by typing `w3m http://localhost/cgi-bin/ip.cgi` which should display your IP address. |
| 48 | We need to generate traffic in our network and one of the easiest ways to do that is with HTTP traffic, so we need to set up a server and a web page. Connect to Server 1 and run [attachment:runme.apache this script] with the `sudo` command |
| 49 | {{{#! /bin/sh |
| 50 | |
| 51 | apt-get install apache2 |
| 52 | |
| 53 | echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn |
| 54 | |
| 55 | echo "#!/usr/bin/env python\nimport cgi\nimport os\n\nprint \"Content-type: text/html\" \nprint \"\" \n\nprint cgi.escape(os.environ[\"REMOTE_ADDR\"])" > /usr/lib/cgi-bin/ip.txt |
| 56 | |
| 57 | mv /usr/lib/cgi-bin/ip.txt /usr/lib/cgi-bin/ip.cgi |
| 58 | |
| 59 | chmod 755 /usr/lib/cgi-bin/ip.cgi |
| 60 | |
| 61 | }}}This will run a script with Apache 2 which sets up the server and web page and displays the users IP address on the Server 1 node. When prompted "Do you want to continue [Y/n]?" select `Y` Once the script is done running, the server is now set up and we can generate traffic! You can check this by typing `w3m http://localhost/cgi-bin/ip.cgi` which should display your IP address. |