Dnstop

From OnnoWiki
Revision as of 12:38, 24 June 2015 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

dnstop adalah sebuah aplikasi libpcap (seperti tcpdump) yang akan menayangkan berbagai tabel dari traffic DNS di jaringan kita. Saat ini, dnstop akan menampilkan tabel:

Source IP addresses
Destination IP addresses
Query types
Response codes
Opcodes
Top level domains
Second level domains
Third level domains
dll ..

dnstop mendukung IPv4 dan IPv6 address

Untuk memudahkan dalam mencari DNS query yang tidak di inginkan, dnstop memberikan beberapa filter. Filter akan memerintahkan dnstop untuk menayangkan hanya tipe query berikut:

For unknown/invalid TLDs A queries where the query name is already an IP address PTR queries for RFC1918 address space Responses with code REFUSED

dnstop can either read packets from the live capture device, or from a tcpdump savefile.

Install DNSTOP

sudo apt-get install dnstop

DNSTOP Syntax

Penggunaan

usage: dnstop [opts] netdevice|savefile
	-4	Count IPv4 packets
	-6	Count IPv6 packets
       -Q	Count queries
	-R	Count responses
	-a	Anonymize IP Addrs
	-b expr	BPF program code
	-i addr	Ignore this source IP address
	-n name	Count only messages in this domain
	-p	Don't put interface in promiscuous mode
	-P	Print "progress" messages in non-interactive mode
	-r	Redraw interval, in seconds
	-l N	Enable domain stats up to N components
	-X	Don't tabulate the "source + query name" stats
	-f	filter-name

Available filters:
	unknown-tlds
	A-for-A
	rfc1918-ptr
	refused
	qtype-any


Contoh, dengan -l 2, dnstop akan menyimpan dua tabel: satu dengan top-level domain name, dan satu lagi dengan second-level domain name. Menambahkan level akan memberikan data yang lebih detail, tapi juga membutuhkan memory & CPU.


-f -- input filter name

The "unknown-tlds" filter includes only queries for TLDs that are bogus.Useful for identifying hosts/servers that leak queries for things like "localhost" or "workgroup."

The "A-for-A" filter includes only A queries for names that are already IP addresses. Certain Microsoft Windows DNS servers have a known bug that forward these queries.

The "rfc1918-ptr" filter includes only PTR queries for addresses in RFC1918 space. These should never leak from inside an organi-zation.

The "refused" filter, when used with the -R option, tells dnstop to count only replies with rcode REFUSED.

The "qtype-any" filter tells dnstop to count only message of type ANY.

-n name -- Only count messages within the domain name

-P -- Print "progress" messages on stderr when in non-interactive mode.

-B buckets -- Use buckets hash table buckets.

-X -- Do not tabulate the sources + query name counters. This can significantly reduce memory usage on busy servers and large save files.

savefile -- a captured network trace in pcap format

device -- ethernet device (ie fxp0)

Contoh

dnstop eth0


Referensi