Block ads, trackers and malware with Raspberry Pi and Pi-hole - - PowerPoint PPT Presentation

block ads trackers and malware with raspberry pi and pi
SMART_READER_LITE
LIVE PREVIEW

Block ads, trackers and malware with Raspberry Pi and Pi-hole - - PowerPoint PPT Presentation

Block ads, trackers and malware with Raspberry Pi and Pi-hole https://cryptoaustralia.org.au Nick Kavadias nick@cryptoaustralia.org.au Self promotion! CryptoAUSTRALIA is a not-for-profit started by security and privacy enthusiast.


slide-1
SLIDE 1

Block ads, trackers and malware with Raspberry Pi and Pi-hole https://cryptoaustralia.org.au

Nick Kavadias nick@cryptoaustralia.org.au

slide-2
SLIDE 2

Self promotion!

  • CryptoAUSTRALIA is a not-for-profit started by security and privacy

enthusiast.

  • Finding practical ways of dealing with the modern privacy and security

challenge.

slide-3
SLIDE 3

We know how to internet..

@CryptoAustralia #cryptoaus http://chat.cryptoaustralia.org.au

slide-4
SLIDE 4
  • 1. I will tolerate some interruptions. So call out

questions.

  • 2. The night is split into two parts
  • 1. First preso ppt death (40 min?)
  • 2. Then the workshop (the rest)

NOTICES

slide-5
SLIDE 5

What we will be covering…

  • 1. Why block the internet?
  • 2. What is a DNS blackhole/sinkhole;
  • 3. Pi-hole hardware and software supported;
  • 4. My home Pi-hole install;
  • 5. Advanced topics on DNS, lists and VPNs
  • 6. Workshop with RPi / VM
slide-6
SLIDE 6

Instructions (for later)

  • Have RPi (or like) device use: https://cryptoa.us/centaurus
  • VirtualBox or VMWare Fusion use: https://cryptoa.us/fornax

Link to download VM in these instructions, we do have a local copies

  • n usb
slide-7
SLIDE 7

Can’t you just leave the internet alone?

No!

Flash ads which hijack pages; Pop-up and pop-under ads; Ads which stalk me on all my devices; Ad networks which track and profile me; Ads that tell me I’ve won stuff; and, Malvertising…

slide-8
SLIDE 8

Tech support scams! how do they work? Check out Jim Browning’s YouTube channel

slide-9
SLIDE 9
slide-10
SLIDE 10

Pi-hole, the solution to all your problems?

slide-11
SLIDE 11

No! No such thing as a silver bullet! But..

  • Good job blocking ads and trackers out of the box
  • Not YouTube video ads, but you can do with some tinkering
  • It is easy to setup and configure;
  • network based;
  • It is not a traffic filter.
  • Act as a second line of defence for malware/viruses
  • I still use browser extensions
  • … and antivirus
slide-12
SLIDE 12

How DNS works normally

https://go.gliffy.com/go/publish/12358860

slide-13
SLIDE 13

How DNS works with Pi-hole

https://go.gliffy.com/go/publish/12358867

slide-14
SLIDE 14

Pi-Hole, not just for blocking ads and tracking

  • Out of the ‘box’ ads/trackers & C&C blacklists ;
  • Many additional lists which are well maintained by security

community;

  • Upstream DNS services (power user!)
slide-15
SLIDE 15

What a blocked page site looks like

What about:

  • Images?
  • JavaScript?
  • Https?

V3.2 now lets you customise block page

slide-16
SLIDE 16

Do I need Raspberry Pi Hardware?

  • NOT Raspberry Pi exclusive
  • Well tested on Raspberry Pi SBCs
  • ARM, or Intel x86/x64
  • Will work with a Pi Zero and a ethernet dongle
  • Works on other SBCs, like Orange-Pi, see this

write-up.

  • Works on crappy old Intel desktops too
slide-17
SLIDE 17

What OS will Pi-hole run on?

  • Will work on any modern Linux OS. Officially supported Linux

distributions are:

slide-18
SLIDE 18

How did I set Pi- hole up at my place?

slide-19
SLIDE 19

Hardware I used:

  • Raspberry Pi 3 model B+ (overkill?)
  • 2 GB microSD card (smallest!)
  • microUSB cable for power into back of router
  • USB Y cables useful.
  • WARNING on underpowering: https://www.raspberrypi.org/help/faqs/#powerReqs
slide-20
SLIDE 20

Software I used

  • Software:
  • Windows 10 & Etcher.io for prepping card https://etcher.io/
  • Raspbian Lite https://www.raspberrypi.org/downloads/raspbian/
  • Pi-hole – installed by piping URL to bash!
slide-21
SLIDE 21

And you can too, with my easy 5 Step Plan..

slide-22
SLIDE 22

Step 1: Put image on SD Card

  • Format SD
  • Etcher.io
  • touch /boot/ssh

Windows will try reformat unknown card because ext4. IGNORE IT

slide-23
SLIDE 23

Step 2: Plug into network

  • Patch into home router
  • Power with microUSB
  • if you don’t have a USB slot close

by, an old 1 amp USB charger will do.

slide-24
SLIDE 24

Step 3: Figure out IP address of RPi?

This is the hardest part of the whole process! There are a few methods to try….

slide-25
SLIDE 25

Step 3: Method 0 - PING

If you’re feeling lucky, try PING ping raspberrypi

slide-26
SLIDE 26

Step 3: Method 1 - DHCP table on router?

slide-27
SLIDE 27

Step 3: Method 2 - Network Scanning

  • Good ol’ IP scanning. Pick one:
  • Nmap

sudo apt install nmap

  • Angry IP Scanner

http://angryip.org/download/

  • Masscan

https://github.com/robertdavidgraham/mass can

  • Arp-scan https://github.com/royhills/arp-

scan

  • Scan before, and after. See what’s new!
slide-28
SLIDE 28

AngryIP Scanner

slide-29
SLIDE 29

Step 3: Method 3

  • Plug RPi into a monitor and boot!
slide-30
SLIDE 30

Step 4: Run installer

  • ssh pi@raspberry
  • curl -sSL https://install.pi-

hole.net | bash Bad idea? Read why

slide-31
SLIDE 31

Pi-hole is up and running.. But not a for all devices… yet

  • Connect to web admin using http://pi.hole/admin
  • Pi-hole over-take DHCP, (disable on your your router) I’ve done this
  • n my setup because:
  • network printer
  • Get actual hostnames in your Pi-hole log
slide-32
SLIDE 32
slide-33
SLIDE 33

(Optional) Test it out?

  • Reconfigure a test computer to use the IP address of Pi-Hole for its

DNS.

slide-34
SLIDE 34

Step 5: Re-configure router DNS settings

  • Log into your router.
  • No idea how? Find your default gateway IP and try connecting with browser,

e.g. http://192.168.1.1

  • ipconfig or ifconfig
  • To get all devices on your network to use Pi-hole for DNS, you have

to make a choice…

slide-35
SLIDE 35

You have two choices for router config

Change IP for DNS Server Disable DHCP & have Pi- hole do it

Questions????

slide-36
SLIDE 36

Changing IP for DNS on my home router

slide-37
SLIDE 37

Or...Disable DHCP on router

slide-38
SLIDE 38

…and turn on DHCP Server on Pi-hole

slide-39
SLIDE 39
slide-40
SLIDE 40

Blocklists

  • Default blocklists in /etc/pihole/adlists.list
  • Blocklist collection here: https://wally3k.github.io/
  • Your Pi-hole has a cronjob which runs pihole updateGravity
  • nce a week.
  • Refer to our blog post CryptoAUSTRALIA's Favourite Block Lists
slide-41
SLIDE 41

Blocklists using the web admin interface

You can:

  • whitelist hosts
  • temporarily disable

all blocks with a timer/ manually You cannot:

  • Make exceptions

for local devices

slide-42
SLIDE 42

Setting up Pi-hole away from home

  • If you roll your own VPN on a VPS, you can setup Pi-hole on it. Then

you can run it anywhere!

  • https://github.com/pi-hole/pi-hole/wiki/Pi-hole---OpenVPN-server
slide-43
SLIDE 43

Are you a Pi-hole Power User?

  • Self-hosted DNS
  • Advanced Upstream DNS
  • Response Policy Zone (RPZ)
  • We have blog posts covering

these topics!

Note: You don’t need to necessarily use these with Pi- Hole

slide-44
SLIDE 44
  • 1. Your Own DNS Server
  • No DNS requests go to third-parties
  • Run your DNS server in the cloud
  • Pi-hole <--- DNSCRYPT ---> DNS server
  • More details in a blog post Build a Privacy-Respecting and Threat-

Blocking DNS Server

slide-45
SLIDE 45
  • 2. Advanced Upstream DNS
  • Third-party DNS servers
  • Complements Pi-Hole
  • Blocks malware and phishing
  • Admin panel
  • Block categories (adult, drugs, gambling, social media …)
  • DNS query logging and reporting
  • Manual blocking / whitelisting
  • Integration with real-time Threat Intelligence feeds ($$$ feature)
slide-46
SLIDE 46
  • 2. Advanced Upstream DNS
  • Strongarm https://strongarm.io
  • Comodo Dome Shield

https://cdome.comodo.com/shield

  • OpenDNS https://signup.opendns.com/homefree
  • Quad 9 https://www.quad9.net
slide-47
SLIDE 47

Which is the best threat blocking DNS provider?

More info? https://blog.cryptoaustralia.org.au/2017/12/23/ best-threat-blocking-dns-providers/

slide-48
SLIDE 48

Response Policy Zone (RPZ)

  • The previous two combined:
  • Use your own DNS server
  • Download RPZ-based block list
  • Register Strongarm business account (free)
  • Download BIND9.10+ config from

https://app.strongarm.io/settings/rpz/

slide-49
SLIDE 49

Done! Let Workshop it!

  • If you’ve brought along a RPi, use these

instructions: https://cryptoa.us/centaurus

  • If you’ve going to play along on the virtual

machine, use these instructions: https://cryptoa.us/fornax

  • Join us on #Slack

https://chat.cryptoaustralia.org.au/

slide-50
SLIDE 50

Where to get help after workshop

CryptoAUSTRALIA Slack channel #pi-hole-workshop-help https://chat.cryptoaustralia.org.au/ Pi-Hole website https://pi-hole.net/ Has links to Discourse(!) , sub- Reddit, YouTube channel https://blog.cryptoaustralia.org.au