Here we go
One of the hottest trend that i heard in passive dns analysis is DNStap, use for logging the dns traffic that happen in the server.
dnstap,messages are generated from within DNS implementations, via instrumentation:
–No UDP fragment or TCP stream reassembly
–No guessing the transaction bailiwick
–No matching of on wire queries with responses
–No imputing stub vs. cache miss query
but although all of the improvement that has been made,Often so many times that i try to install dnstap in my vmware or a server i end up in with so many failure that i could not understand. I try to read the documentation many times but it ends up in same mistake again, but i try to come out with a different approach and after spending 2 night of restless sleep <i'm kidding> i finally found a way and i will explained to you how to install the dnstap in your machine.
1. install all of the necessary utility, in my opinion installing this utility at first will save me a lot of time
sudo apt-get install git dh-autoreconf pkg-config libevent-dev libssl-dev libexpat1-dev libprotobuf-dev
2. clone the repository of all the dnstap component, to save up more time i just create bash script to automated the process of cloning
#!/bin/bash
git clone https://github.com/google/protobuf
git clone https://github.com/protobuf-c/protobuf-c
git clone https://github.com/farsightsec/fstrm
save this into your machine and run it with "bash" command
3. ok, so now you will have 3 directory with all of the necessary component. run to install the 3 component with the following command to each directory.
~#autoreconf -i
~#./configure
~#sudo make; sudo make install
(if any error happen, run"sudo ldconfig" to load the dynamic link)
4. install unbound-1.0.5 with supported dnstap:
~# wget www.unbound.net/downloads/unbound-1.5.0.tar.gz
~# tar -xvf unbound-1.5.0.tar.gz
~# ./configure –enable-dnstap && sudo make && sudo make install
5. Download the example unbound.conf file. This config file runs unbound on localhost, port 53053, and enables dnstap output to the socket /tmp/dnstap.sock.
~#wget -O /tmp/unbound.conf https://dl.farsightsecurity.com/dist/presentations/nanog60/unbound.conf
Run the unbound server with the example unbound.conf file. Note that the server won't detach from the terminal and daemonize. Make sure you are using the patched Unbound that was built in the previous step.
~#sudo unbound -c /tmp/unbound.conf
6. move to another terminal and capture the traffic. Capture the traffic with fstrm capture
~#fstrm_capture -t protobuf:dnstap.Dnstap -u /tmp/dnstap.sock -w /tmp/dnstap.out
7. now in order to read the log file you need to install the dnstap-read utility built with golang:
7.1. install golang packet, because dnstap-read utility is using go programming language:
~$ sudo curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz (download the package)
~$ sudo tar -xvf go1.6.linux-amd64.tar.gz (untar the package)
~$ mkdir /home/godoc (create a directory for golang)
~$ sudo mv go /home/godoc/
7.2. set the go paths:
~$ sudo nano ~/.profile
~$ export PATH=$PATH:/home/godoc/go/bin (At the end of the file, add this line)
~$ source ~/.profile (refresh the profile)
7.3. install go components:
go get -u -v github.com/dnstap/golang-dnstap/dnstap
source:
http://dnstap.info/
https://github.com/dnstap
https://github.com/dnstap/golang-dnstap
https://www.isc.org/wp-content/uploads/2016/05/dnstap-webinar.pdf
Comments
Post a Comment