Workstation1
------------
  OS: Archlinux (x86_64)
  Kernel: 3.15.7-1-ARCH 
  IP: 10.20.7.26
  Hostname: caprica
  MAC: 60:a4:4c:52:d6:e9

VM1
---
  Qemu KVM running on Workstation1
  OS: Ubuntu Server 14.04
  Kernel: 3.13.0-24-generic
  IP: 10.20.5.48 (connected to bridge on Workstation1)
  MAC: 52:54:00:12:34:56

VM2
---
  Qemu KVM running on Workstation1
  OS: Ubuntu Server 14.04
  Kernel: 3.13.0-24-generic
  IP: 10.20.6.245 (connected to bridge on Workstation1)
  MAC: 02:a2:3f:28:9b:c7


Network config
--------------

      VM1                VM2
bind DNS server     dnstunnel server
         \               /
          \             /
    (tap0) \           / (tap1)
            \         /
             \ (br0) /
            Worstation1
          dnstunnel client
        record traffic on br0


Trace capture procedure
-----------------------
1) Start workstation
2) Start Ubuntu VM
3) Check that Unbound is running on workstation1
4) Check that bind is running on VM1
5) Record traffic on Workstation1
    sudo tcpdump -s 0 -i br0 -w dnstunnel.dmp
6) Start dnstunnel server on VM2
    sudo ./dnstunneld -i 127.0.0.1 t1.tunnel
7) Check that server is working
    dig test123.t1.tunnel # must return 127.0.0.1
8) Create a tunnel socks proxy using ssh on Workstation1
    ssh -D 9050 -N -C -o ProxyCommand="./dnstunnelc sshdns.t1.tunnel" user01@localhost
        localhost is the localhost at the output of the DNS tunnel so user01 is a user on VM2
9) Surf web through DNS tunneled socks connection
    firefox -P
    create a profile with localhost:9050 as socks proxy


Notes
-----
Source: http://www.splitbrain.org/blog/2008-11/02-dns_tunneling_made_simple

Workstation1 uses Unbound as DNS proxy with this config:

server:
  ...
  module-config: "iterator"

forward-zone:
  name: "."
  forward-addr: 10.20.5.48
...


Edit dnstunneld on VM2 (line 32):

$opts{group}    = 'nogroup'


Config bind on VM1 using files in bind-config directory


Conclusion
----------
Perl script are buggy. Need to be restarted every few seconds => unlikely to be used in practice.
The covert channel plugin can successfully detect dnstunnel.
