Skip to main content

DNStap and all the good stuff



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

Popular posts from this blog

Having fun analyzing nginx log to find malicious attacker in the net (ง'̀-'́)ง (day 37)

  What makes you sleepless at night? is it because of a ghost or scary stories? is it because you have an important meeting tomorrow? or is it because you have an exam? For me, what keeps me up all night is that I keep thinking about what happens to a website that I just created, is it safe from an attacker (certainly not) or did I missing some security adjustments that lead to vulnerability? well I'm not the best secure programmer in the world, I'm still learning and there is a big possibility that I can make a mistake but for me, a mistake can be a valuable investment to myself or yourself to be better so from this idea, I want to know more about what attackers casually do when attacking a website. Here in this post, I'm going to show you how I analyzed attack to the website that I have permission to design and also some interesting findings that I could get from the analysis Background: All of this analysis comes from the traffic that is targeted to th

Utilize Pwntools for crafting ROP chain :') (day 69)

who doesn't like pwntools? it is a very versatile tool and can be customized according to our need using the python script but did you need to know that pwntools itself can help us to automatically craft a rop chain for us? so in this post, I will show you how to make rop chain less painful and make pwntools do all the heavy lifting. To demonstrate this I will use the binary challenge callme 64 bit from ropemporium link: https://ropemporium.com/challenge/callme.html Crashing the app: Like any other exploitation process, we need to crash the program by generating a long string pattern to determine the offset. based on the information from the above figure we can see that we required to provide 40 bytes of offset Fun stuff: now this where the fun stuff began write the following python script: as in the guideline of the challenged said we need to chain the function call by first to call the callme_one function, callme_two function and then callme_three funct

WriteUp PWN tarzan ROP UNICTF ಠ_ಠ (day 61)

So in this post, I'm going to talk about how to solve the Tarzan pwn challenge from UNICTF 2019. Back in the day when the competition is still going I couldn't finish it and don't have any clue to solve this but this time I was able to finish it :) Also in this post, we will be going to be heavily focused on how to utilize pwntools to construct a ROP chain. If you kinda confused about my explanation in this post you can refer to this following youtube video, link: https://www.youtube.com/watch?v=gWU2yOu0COk I build the python script based on this video Ok, let's get started! In this challenge, you will get two binary first go with tarzan and libc-2.29.so by providing .so file it tell us what version library that the target machine is using this could help us to do ROP chain. first, we run the Tarzan binary to get the basic idea of the program work and as you can see it just show you some text, newline and when you try to input something it doesn't gi