Ad-blocking with Pi-Hole

The days of needing browser plugins to block unwanted ad traffic on home networks are well and truly over and Pi-Hole just keeps delivering more and more stable innovation. There are numerous options when configuring the setup, Raspberry Pi, Docker image, virtual host or even an old physical device. Ultimately as long as you have a Linux flavour installed (see Prerequisites) it should function pretty nicely but for the sake of this guide, I will assume the Operating System (OS) has been cleanly installed on your platform of choice. Ensure you have a static IP assigned (easiest to assign this at build) and that ssh is configured to remote allow access to the host.

Log onto the host or ssh to get command line access, once complete type the below into the command line interface (CLI) and hit Enter. If it asks for your password you, it needs to be able to elevate privilege to install, once entered it will progress.

curl -sSL https://install.pi-hole.net | bash

If you prefer to see the code and subsequently run it then navigate to the folder you want to clone the repository to and run the following commands

git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole
cd "Pi-hole/automated install/"
sudo bash basic-install.sh

#Optional further options can be found here https://github.com/pi-hole/pi-hole/#one-step-automated-install

Confirmation that the installation is progressing will present like Screen 1 below, followed by a sequence of information screens. Subsequently you’ll be asked to choose your preferred DNS provider (Screen 3), in my case I chose cloudflare. The next page asks for confirmation of the third party block lists, any of which can be removed if you so wish.

Screen 1
Screen 3

Next choose whether the Pi-Hole will be responding to IPv4 and/or IPv6 traffic. Now you’ll be asked to confirm the hosts IP address and gateway, which can be changed if necessary, once complete the Pi-Hole warns that statically assigned IP’s used in conjunction with DHCP can cause conflicts. Would you like the web admin interface to be installed (well you can’t see the analytics without it) and whether you want to install the web server to support the admin interface (if you have a web server installed you don’t need this one). Do you want to log the queries, well I’d hope so to be able to see the analytics. Finally you can choose the level of logging, whether domains should be hidden etc, I choose to see everything.

If an error message pops up claiming that the Pi-Hole is not able to resolve dns, it is probably trying to lookup against itself so use the following command

sudo nano /etc/resolv.conf

Find the entry for “nameserver” and change the IP to your chosen provider, in my case 1.1.1.1 or 1.0.0.1. Save the changes and progress to the next stage.

Once the command finishes running the script, Pi-Hole is pretty much installed, running the following command allows you to set the password for the admin console;

sudo pihole -a -p

Enter a sensibly complex password and store it in a password manager, then navigate to the web console by typing the IP into your browser. You’ll notice it’s not really doing anything so don’t forget to set your router DNS to point at your Pi-Hole’s IP address, or just a laptop, PC, phone in order to test how things are working, then you should be able to see the traffic flowing in over time like this.

Well that is it for the basic configuration, enjoy the analytics and ad blocking.

OSSIM has limited or no connectivity: Make sure your network connection is active and try again

OSSIM has limited or no connectivity: Make sure your network connection is active and try again

In the event that you receive this message “Limited or no connectivity: Make sure your network connection is active and try again.” while trying to link OSSIM to the Open Threat Exchange (OTX) it may be that your DNS entries need adjusting. Simply SSH to the OSSIM environment and in the menu go to System Preferences, then Configure Network and Name Server (DNS) where you can change the entry to your required DNS settings.

Ensure you go back to the main menu and select Apply all Changes, this should then update the configuration file and solve the issue. You may however find that this does not help, in which case, go to  Jailbreak System and using the usual Linux navigation edit the file /etc/network/interfaces  check your details and if needed, change the DNS entry. Once complete, save and type exit, you will be returned to the main menu.

At this point you might wish to reboot the device.

Installing Ubuntu Server

Insert the bootable Media and ensure that the machine will read from it during boot. Select the Language you desire and then Install Ubuntu Server. Again you are prompted for language but this is the installation language rather than the page instructions, key up or down and then press Enter, select your country and then select Yes to detect the keyboard layout before following the instructions. Once you are happy that the correct keyboard layout has been generated, click Continue, give your server a name and click Continue. Enter the Name of the User you wish to create, followed by the Username and hit Continue for each. Enter a Password for the user and click Continue, then enter the Password again to confirm it and hit Continue, before selecting No for home directory encryption (this option is up to you). Next is the Time Zone setting, if you are happy with what is preset, select Yes, if not click no and correct it appropriately.

Next is the Partition configuration, press  Enter to continue with the default “Guided – use entire disk and set LVM”, select the partition you wish to use and press Enter. If you are happy to write the changes you have opted for, select Yes and then press Enter, confirm the amount of the disk you wish to use by pressing Enter. Confirm changes and write to disk by selecting Yes and pressing Enter. Enter your Proxy details if necessary or leave blank if you don’t need it and press Enter. Select how you want to keep your system up to date, in this guide I have opted for No automatic updates and press Enter.

Now the basic install is nearly over, you can select which elements you want to add to your Server but essentially you have a Server ready to install whatever you wish onto it. I personally like to add OpenSSH server so as to be able to work from a machine of my choice rather than from the device itself. Select all that you wish to by pressing spacebar and then pres Enter. Next choose Yes and press Enter to install the GRUB boot loader on the hard disk. Press Continue to finish and reboot the machine but make sure you remove the installation media before you do so.

Once booted, log in to the user you chose at the beginning of the installation and run sudo apt-get update, if you installed the most up to date distribution this should run without a hitch. For good measure, run sudo apt-get upgrade and the relevant software upgrades will now be installed. The server is now ready to be manipulated to whatever use you have planned for it, run ifconfig and note the IP address so that you can SSH into it from your desk.

Patching Shellshock – Mac

In the event that you discover your Mac is vulnerable to Shellshock, the following action should be taken.

To check whether you are vulnerable see Identifying Shellshock for full details on how to identify it.