martes, 23 de octubre de 2007

Manual Dig

Dig es una herramienta principalmente de linux, utilizada para el envio de ordenes DNS, esta herramienta es muy util hablando de defacing, y de detectar que webs estan en un server (utilizado para mass defacement), sin mas que decir comenzemos:

El primer comando que es de los que mas destaca de los que utilizaremos es el siguiente:
Quote
BT ~ # dig ns

Este comando nos devolvera una lista de super DNS, que podremos utilizar para trabajar:

Quote
; <<>> DiG 9.3.2 <<>> ns
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 4874
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13

;; QUESTION SECTION:
;. IN NS

;; ANSWER SECTION:
. 234977 IN NS L.ROOT-SERVERS.NET.
. 234977 IN NS M.ROOT-SERVERS.NET.
. 234977 IN NS A.ROOT-SERVERS.NET.
. 234977 IN NS B.ROOT-SERVERS.NET.
. 234977 IN NS C.ROOT-SERVERS.NET.
. 234977 IN NS D.ROOT-SERVERS.NET.
. 234977 IN NS E.ROOT-SERVERS.NET.
. 234977 IN NS F.ROOT-SERVERS.NET.
. 234977 IN NS G.ROOT-SERVERS.NET.
. 234977 IN NS H.ROOT-SERVERS.NET.
. 234977 IN NS I.ROOT-SERVERS.NET.
. 234977 IN NS J.ROOT-SERVERS.NET.
. 234977 IN NS K.ROOT-SERVERS.NET.

;; ADDITIONAL SECTION:
M.ROOT-SERVERS.NET. 30938 IN A 202.12.27.33
A.ROOT-SERVERS.NET. 591011 IN A 198.41.0.4
B.ROOT-SERVERS.NET. 30938 IN A 192.228.79.201
C.ROOT-SERVERS.NET. 39988 IN A 192.33.4.12
D.ROOT-SERVERS.NET. 53749 IN A 128.8.10.90
E.ROOT-SERVERS.NET. 30938 IN A 192.203.230.10
F.ROOT-SERVERS.NET. 591011 IN A 192.5.5.241
G.ROOT-SERVERS.NET. 53680 IN A 192.112.36.4
H.ROOT-SERVERS.NET. 30939 IN A 128.63.2.53
I.ROOT-SERVERS.NET. 40043 IN A 192.36.148.17
J.ROOT-SERVERS.NET. 591011 IN A 192.58.128.30
K.ROOT-SERVERS.NET. 591011 IN A 193.0.14.129
L.ROOT-SERVERS.NET. 30938 IN A 198.32.64.12

;; Query time: 383 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:09:15 2007
;; MSG SIZE rcvd: 436


Algunas funciones de dig:

Tracer:
Quote
BT ~ # dig web.com +trace
Bueno creo que es logico lo que hace.....

Resolver DNS de una web:
Quote
BT ~ # dig web.com NS

Esto nos devuelve la lista de los servidores DNS de determinada web.

Ejemplo:
Quote
BT ~ # dig google.com NS

; <<>> DiG 9.3.2 <<>> google.com NS
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 27071
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN NS

;; ANSWER SECTION:
google.com. 64768 IN NS ns1.google.com.
google.com. 64768 IN NS ns2.google.com.
google.com. 64768 IN NS ns3.google.com.
google.com. 64768 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345450 IN A 216.239.34.10
ns3.google.com. 345450 IN A 216.239.36.10
ns4.google.com. 345450 IN A 216.239.38.10
ns1.google.com. 345450 IN A 216.239.32.10

;; Query time: 276 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:26:59 2007
;; MSG SIZE rcvd: 164

Listar Servidores de Correo de determinado dominio:

Quote
BT ~ # dig google.com MX

; <<>> DiG 9.3.2 <<>> google.com MX
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 35446
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN MX

;; ANSWER SECTION:
google.com. 4237 IN MX 10 smtp1.google.com.
google.com. 4237 IN MX 10 smtp2.google.com.
google.com. 4237 IN MX 10 smtp3.google.com.
google.com. 4237 IN MX 10 smtp4.google.com.

;; ADDITIONAL SECTION:
smtp2.google.com. 1054 IN A 64.233.167.25
smtp3.google.com. 1060 IN A 64.233.183.25
smtp4.google.com. 1066 IN A 72.14.215.25
smtp1.google.com. 3329 IN A 72.14.203.25

;; Query time: 583 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:28:39 2007
;; MSG SIZE rcvd: 180

Consultar datos de un Dominio en determinado servidor DNS:

Quote
BT ~ # dig google.com @ns1.google.com

; <<>> DiG 9.3.2 <<>> google.com @ns1.google.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 34414
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 300 IN A 64.233.167.99
google.com. 300 IN A 72.14.207.99
google.com. 300 IN A 64.233.187.99

;; AUTHORITY SECTION:
google.com. 345600 IN NS ns1.google.com.
google.com. 345600 IN NS ns2.google.com.
google.com. 345600 IN NS ns3.google.com.
google.com. 345600 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns1.google.com. 345600 IN A 216.239.32.10
ns2.google.com. 345600 IN A 216.239.34.10
ns3.google.com. 345600 IN A 216.239.36.10
ns4.google.com. 345600 IN A 216.239.38.10

;; Query time: 1124 msec
;; SERVER: 216.239.32.10#53(216.239.32.10)
;; WHEN: Tue Sep 25 20:30:38 2007
;; MSG SIZE rcvd: 212

DNS Inverso:

Quote
BT ~ # dig -x google.com

; <<>> DiG 9.3.2 <<>> -x google.com
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: FORMERR, id: 36927
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;com.google.in-addr.arpa. IN PTR

;; Query time: 3 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:35:52 2007
;; MSG SIZE rcvd: 41

Numero IP en IPv6:

Quote
BT ~ #dig google.com AAAA

; <<>> DiG 9.3.2 <<>> google.com AAAA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 21031
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN AAAA

;; AUTHORITY SECTION:
google.com. 39 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 1084 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:41:20 2007
;; MSG SIZE rcvd: 78
[/b]

otra funcion que tambien les recomiendo es la de ANY, la cual nos devuelve los servidores de correo, DNS, y varios datos mas:

Quote
BT ~ # dig google.com ANY

; <<>> DiG 9.3.2 <<>> google.com ANY
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 65404
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 8

;; QUESTION SECTION:
;google.com. IN ANY

;; ANSWER SECTION:
google.com. 181 IN A 64.233.167.99
google.com. 181 IN A 72.14.207.99
google.com. 181 IN A 64.233.187.99
google.com. 63936 IN NS ns1.google.com.
google.com. 63936 IN NS ns2.google.com.
google.com. 63936 IN NS ns3.google.com.
google.com. 63936 IN NS ns4.google.com.
google.com. 3505 IN MX 10 smtp2.google.com.
google.com. 3505 IN MX 10 smtp3.google.com.
google.com. 3505 IN MX 10 smtp4.google.com.
google.com. 3505 IN MX 10 smtp1.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345481 IN A 216.239.34.10
ns3.google.com. 345481 IN A 216.239.36.10
ns4.google.com. 345481 IN A 216.239.38.10
ns1.google.com. 345481 IN A 216.239.32.10
smtp3.google.com. 328 IN A 64.233.183.25
smtp4.google.com. 334 IN A 72.14.215.25
smtp1.google.com. 3332 IN A 72.14.203.25
smtp2.google.com. 322 IN A 64.233.167.25

;; Query time: 1243 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:40:52 2007
;; MSG SIZE rcvd: 364

Mail del responsable y otros datos del DNS:
Quote
BT ~ # dig google.com SOA

; <<>> DiG 9.3.2 <<>> google.com SOA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 52736
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN SOA

;; ANSWER SECTION:
google.com. 86400 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 2563 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:51:14 2007
;; MSG SIZE rcvd: 78

aqui el correo seria: dns-admin@google.com (cambiando el "." por @), el DNS primario seria: ns1.google.com, y su ultima actualizacion fue: 2007/09/17, el TTL (Time to a live) es de 300, el tiempo de espera para actualizacion de los DNS's secundarios (con respecto al primario) es de: 7200, el tiempo de reintento (cuando hay error al conectar con DNS primario) es de: 1800, y el tiempo de caducidad (el tiempo que el servidor mantendra en cache los datos sin actualizar en caso de error de actualizacion) es de: 1209600 (si no me equivoco estos datos estan en milisegundos).

otras funciones utiles:
+nocmd
+nocomments
+noquestion
+noanswer
+noauthority
+noadditional
+nostats
+noall

Su funcion es logica, y son utiles cuando queremos resumir las respuestas....Dig es una herramienta principalmente de linux, utilizada para el envio de ordenes DNS, esta herramienta es muy util hablando de defacing, y de detectar que webs estan en un server (utilizado para mass defacement), sin mas que decir comenzemos:

El primer comando que es de los que mas destaca de los que utilizaremos es el siguiente:
Quote
BT ~ # dig ns

Este comando nos devolvera una lista de super DNS, que podremos utilizar para trabajar:

Quote
; <<>> DiG 9.3.2 <<>> ns
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 4874
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13

;; QUESTION SECTION:
;. IN NS

;; ANSWER SECTION:
. 234977 IN NS L.ROOT-SERVERS.NET.
. 234977 IN NS M.ROOT-SERVERS.NET.
. 234977 IN NS A.ROOT-SERVERS.NET.
. 234977 IN NS B.ROOT-SERVERS.NET.
. 234977 IN NS C.ROOT-SERVERS.NET.
. 234977 IN NS D.ROOT-SERVERS.NET.
. 234977 IN NS E.ROOT-SERVERS.NET.
. 234977 IN NS F.ROOT-SERVERS.NET.
. 234977 IN NS G.ROOT-SERVERS.NET.
. 234977 IN NS H.ROOT-SERVERS.NET.
. 234977 IN NS I.ROOT-SERVERS.NET.
. 234977 IN NS J.ROOT-SERVERS.NET.
. 234977 IN NS K.ROOT-SERVERS.NET.

;; ADDITIONAL SECTION:
M.ROOT-SERVERS.NET. 30938 IN A 202.12.27.33
A.ROOT-SERVERS.NET. 591011 IN A 198.41.0.4
B.ROOT-SERVERS.NET. 30938 IN A 192.228.79.201
C.ROOT-SERVERS.NET. 39988 IN A 192.33.4.12
D.ROOT-SERVERS.NET. 53749 IN A 128.8.10.90
E.ROOT-SERVERS.NET. 30938 IN A 192.203.230.10
F.ROOT-SERVERS.NET. 591011 IN A 192.5.5.241
G.ROOT-SERVERS.NET. 53680 IN A 192.112.36.4
H.ROOT-SERVERS.NET. 30939 IN A 128.63.2.53
I.ROOT-SERVERS.NET. 40043 IN A 192.36.148.17
J.ROOT-SERVERS.NET. 591011 IN A 192.58.128.30
K.ROOT-SERVERS.NET. 591011 IN A 193.0.14.129
L.ROOT-SERVERS.NET. 30938 IN A 198.32.64.12

;; Query time: 383 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:09:15 2007
;; MSG SIZE rcvd: 436


Algunas funciones de dig:

Tracer:
Quote
BT ~ # dig web.com +trace
Bueno creo que es logico lo que hace.....

Resolver DNS de una web:
Quote
BT ~ # dig web.com NS

Esto nos devuelve la lista de los servidores DNS de determinada web.

Ejemplo:
Quote
BT ~ # dig google.com NS

; <<>> DiG 9.3.2 <<>> google.com NS
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 27071
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN NS

;; ANSWER SECTION:
google.com. 64768 IN NS ns1.google.com.
google.com. 64768 IN NS ns2.google.com.
google.com. 64768 IN NS ns3.google.com.
google.com. 64768 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345450 IN A 216.239.34.10
ns3.google.com. 345450 IN A 216.239.36.10
ns4.google.com. 345450 IN A 216.239.38.10
ns1.google.com. 345450 IN A 216.239.32.10

;; Query time: 276 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:26:59 2007
;; MSG SIZE rcvd: 164

Listar Servidores de Correo de determinado dominio:

Quote
BT ~ # dig google.com MX

; <<>> DiG 9.3.2 <<>> google.com MX
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 35446
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN MX

;; ANSWER SECTION:
google.com. 4237 IN MX 10 smtp1.google.com.
google.com. 4237 IN MX 10 smtp2.google.com.
google.com. 4237 IN MX 10 smtp3.google.com.
google.com. 4237 IN MX 10 smtp4.google.com.

;; ADDITIONAL SECTION:
smtp2.google.com. 1054 IN A 64.233.167.25
smtp3.google.com. 1060 IN A 64.233.183.25
smtp4.google.com. 1066 IN A 72.14.215.25
smtp1.google.com. 3329 IN A 72.14.203.25

;; Query time: 583 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:28:39 2007
;; MSG SIZE rcvd: 180

Consultar datos de un Dominio en determinado servidor DNS:

Quote
BT ~ # dig google.com @ns1.google.com

; <<>> DiG 9.3.2 <<>> google.com @ns1.google.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 34414
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 300 IN A 64.233.167.99
google.com. 300 IN A 72.14.207.99
google.com. 300 IN A 64.233.187.99

;; AUTHORITY SECTION:
google.com. 345600 IN NS ns1.google.com.
google.com. 345600 IN NS ns2.google.com.
google.com. 345600 IN NS ns3.google.com.
google.com. 345600 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns1.google.com. 345600 IN A 216.239.32.10
ns2.google.com. 345600 IN A 216.239.34.10
ns3.google.com. 345600 IN A 216.239.36.10
ns4.google.com. 345600 IN A 216.239.38.10

;; Query time: 1124 msec
;; SERVER: 216.239.32.10#53(216.239.32.10)
;; WHEN: Tue Sep 25 20:30:38 2007
;; MSG SIZE rcvd: 212

DNS Inverso:

Quote
BT ~ # dig -x google.com

; <<>> DiG 9.3.2 <<>> -x google.com
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: FORMERR, id: 36927
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;com.google.in-addr.arpa. IN PTR

;; Query time: 3 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:35:52 2007
;; MSG SIZE rcvd: 41

Numero IP en IPv6:

Quote
BT ~ #dig google.com AAAA

; <<>> DiG 9.3.2 <<>> google.com AAAA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 21031
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN AAAA

;; AUTHORITY SECTION:
google.com. 39 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 1084 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:41:20 2007
;; MSG SIZE rcvd: 78
[/b]

otra funcion que tambien les recomiendo es la de ANY, la cual nos devuelve los servidores de correo, DNS, y varios datos mas:

Quote
BT ~ # dig google.com ANY

; <<>> DiG 9.3.2 <<>> google.com ANY
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 65404
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 8

;; QUESTION SECTION:
;google.com. IN ANY

;; ANSWER SECTION:
google.com. 181 IN A 64.233.167.99
google.com. 181 IN A 72.14.207.99
google.com. 181 IN A 64.233.187.99
google.com. 63936 IN NS ns1.google.com.
google.com. 63936 IN NS ns2.google.com.
google.com. 63936 IN NS ns3.google.com.
google.com. 63936 IN NS ns4.google.com.
google.com. 3505 IN MX 10 smtp2.google.com.
google.com. 3505 IN MX 10 smtp3.google.com.
google.com. 3505 IN MX 10 smtp4.google.com.
google.com. 3505 IN MX 10 smtp1.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345481 IN A 216.239.34.10
ns3.google.com. 345481 IN A 216.239.36.10
ns4.google.com. 345481 IN A 216.239.38.10
ns1.google.com. 345481 IN A 216.239.32.10
smtp3.google.com. 328 IN A 64.233.183.25
smtp4.google.com. 334 IN A 72.14.215.25
smtp1.google.com. 3332 IN A 72.14.203.25
smtp2.google.com. 322 IN A 64.233.167.25

;; Query time: 1243 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:40:52 2007
;; MSG SIZE rcvd: 364

Mail del responsable y otros datos del DNS:
Quote
BT ~ # dig google.com SOA

; <<>> DiG 9.3.2 <<>> google.com SOA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 52736
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN SOA

;; ANSWER SECTION:
google.com. 86400 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 2563 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:51:14 2007
;; MSG SIZE rcvd: 78

aqui el correo seria: dns-admin@google.com (cambiando el "." por @), el DNS primario seria: ns1.google.com, y su ultima actualizacion fue: 2007/09/17, el TTL (Time to a live) es de 300, el tiempo de espera para actualizacion de los DNS's secundarios (con respecto al primario) es de: 7200, el tiempo de reintento (cuando hay error al conectar con DNS primario) es de: 1800, y el tiempo de caducidad (el tiempo que el servidor mantendra en cache los datos sin actualizar en caso de error de actualizacion) es de: 1209600 (si no me equivoco estos datos estan en milisegundos).

otras funciones utiles:
+nocmd
+nocomments
+noquestion
+noanswer
+noauthority
+noadditional
+nostats
+noall

Su funcion es logica, y son utiles cuando queremos resumir las respuestas....Dig es una herramienta principalmente de linux, utilizada para el envio de ordenes DNS, esta herramienta es muy util hablando de defacing, y de detectar que webs estan en un server (utilizado para mass defacement), sin mas que decir comenzemos:

El primer comando que es de los que mas destaca de los que utilizaremos es el siguiente:
Quote
BT ~ # dig ns

Este comando nos devolvera una lista de super DNS, que podremos utilizar para trabajar:

Quote
; <<>> DiG 9.3.2 <<>> ns
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 4874
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13

;; QUESTION SECTION:
;. IN NS

;; ANSWER SECTION:
. 234977 IN NS L.ROOT-SERVERS.NET.
. 234977 IN NS M.ROOT-SERVERS.NET.
. 234977 IN NS A.ROOT-SERVERS.NET.
. 234977 IN NS B.ROOT-SERVERS.NET.
. 234977 IN NS C.ROOT-SERVERS.NET.
. 234977 IN NS D.ROOT-SERVERS.NET.
. 234977 IN NS E.ROOT-SERVERS.NET.
. 234977 IN NS F.ROOT-SERVERS.NET.
. 234977 IN NS G.ROOT-SERVERS.NET.
. 234977 IN NS H.ROOT-SERVERS.NET.
. 234977 IN NS I.ROOT-SERVERS.NET.
. 234977 IN NS J.ROOT-SERVERS.NET.
. 234977 IN NS K.ROOT-SERVERS.NET.

;; ADDITIONAL SECTION:
M.ROOT-SERVERS.NET. 30938 IN A 202.12.27.33
A.ROOT-SERVERS.NET. 591011 IN A 198.41.0.4
B.ROOT-SERVERS.NET. 30938 IN A 192.228.79.201
C.ROOT-SERVERS.NET. 39988 IN A 192.33.4.12
D.ROOT-SERVERS.NET. 53749 IN A 128.8.10.90
E.ROOT-SERVERS.NET. 30938 IN A 192.203.230.10
F.ROOT-SERVERS.NET. 591011 IN A 192.5.5.241
G.ROOT-SERVERS.NET. 53680 IN A 192.112.36.4
H.ROOT-SERVERS.NET. 30939 IN A 128.63.2.53
I.ROOT-SERVERS.NET. 40043 IN A 192.36.148.17
J.ROOT-SERVERS.NET. 591011 IN A 192.58.128.30
K.ROOT-SERVERS.NET. 591011 IN A 193.0.14.129
L.ROOT-SERVERS.NET. 30938 IN A 198.32.64.12

;; Query time: 383 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:09:15 2007
;; MSG SIZE rcvd: 436


Algunas funciones de dig:

Tracer:
Quote
BT ~ # dig web.com +trace
Bueno creo que es logico lo que hace.....

Resolver DNS de una web:
Quote
BT ~ # dig web.com NS

Esto nos devuelve la lista de los servidores DNS de determinada web.

Ejemplo:
Quote
BT ~ # dig google.com NS

; <<>> DiG 9.3.2 <<>> google.com NS
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 27071
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN NS

;; ANSWER SECTION:
google.com. 64768 IN NS ns1.google.com.
google.com. 64768 IN NS ns2.google.com.
google.com. 64768 IN NS ns3.google.com.
google.com. 64768 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345450 IN A 216.239.34.10
ns3.google.com. 345450 IN A 216.239.36.10
ns4.google.com. 345450 IN A 216.239.38.10
ns1.google.com. 345450 IN A 216.239.32.10

;; Query time: 276 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:26:59 2007
;; MSG SIZE rcvd: 164

Listar Servidores de Correo de determinado dominio:

Quote
BT ~ # dig google.com MX

; <<>> DiG 9.3.2 <<>> google.com MX
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 35446
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN MX

;; ANSWER SECTION:
google.com. 4237 IN MX 10 smtp1.google.com.
google.com. 4237 IN MX 10 smtp2.google.com.
google.com. 4237 IN MX 10 smtp3.google.com.
google.com. 4237 IN MX 10 smtp4.google.com.

;; ADDITIONAL SECTION:
smtp2.google.com. 1054 IN A 64.233.167.25
smtp3.google.com. 1060 IN A 64.233.183.25
smtp4.google.com. 1066 IN A 72.14.215.25
smtp1.google.com. 3329 IN A 72.14.203.25

;; Query time: 583 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:28:39 2007
;; MSG SIZE rcvd: 180

Consultar datos de un Dominio en determinado servidor DNS:

Quote
BT ~ # dig google.com @ns1.google.com

; <<>> DiG 9.3.2 <<>> google.com @ns1.google.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 34414
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 300 IN A 64.233.167.99
google.com. 300 IN A 72.14.207.99
google.com. 300 IN A 64.233.187.99

;; AUTHORITY SECTION:
google.com. 345600 IN NS ns1.google.com.
google.com. 345600 IN NS ns2.google.com.
google.com. 345600 IN NS ns3.google.com.
google.com. 345600 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns1.google.com. 345600 IN A 216.239.32.10
ns2.google.com. 345600 IN A 216.239.34.10
ns3.google.com. 345600 IN A 216.239.36.10
ns4.google.com. 345600 IN A 216.239.38.10

;; Query time: 1124 msec
;; SERVER: 216.239.32.10#53(216.239.32.10)
;; WHEN: Tue Sep 25 20:30:38 2007
;; MSG SIZE rcvd: 212

DNS Inverso:

Quote
BT ~ # dig -x google.com

; <<>> DiG 9.3.2 <<>> -x google.com
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: FORMERR, id: 36927
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;com.google.in-addr.arpa. IN PTR

;; Query time: 3 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:35:52 2007
;; MSG SIZE rcvd: 41

Numero IP en IPv6:

Quote
BT ~ #dig google.com AAAA

; <<>> DiG 9.3.2 <<>> google.com AAAA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 21031
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN AAAA

;; AUTHORITY SECTION:
google.com. 39 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 1084 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:41:20 2007
;; MSG SIZE rcvd: 78
[/b]

otra funcion que tambien les recomiendo es la de ANY, la cual nos devuelve los servidores de correo, DNS, y varios datos mas:

Quote
BT ~ # dig google.com ANY

; <<>> DiG 9.3.2 <<>> google.com ANY
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 65404
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 8

;; QUESTION SECTION:
;google.com. IN ANY

;; ANSWER SECTION:
google.com. 181 IN A 64.233.167.99
google.com. 181 IN A 72.14.207.99
google.com. 181 IN A 64.233.187.99
google.com. 63936 IN NS ns1.google.com.
google.com. 63936 IN NS ns2.google.com.
google.com. 63936 IN NS ns3.google.com.
google.com. 63936 IN NS ns4.google.com.
google.com. 3505 IN MX 10 smtp2.google.com.
google.com. 3505 IN MX 10 smtp3.google.com.
google.com. 3505 IN MX 10 smtp4.google.com.
google.com. 3505 IN MX 10 smtp1.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345481 IN A 216.239.34.10
ns3.google.com. 345481 IN A 216.239.36.10
ns4.google.com. 345481 IN A 216.239.38.10
ns1.google.com. 345481 IN A 216.239.32.10
smtp3.google.com. 328 IN A 64.233.183.25
smtp4.google.com. 334 IN A 72.14.215.25
smtp1.google.com. 3332 IN A 72.14.203.25
smtp2.google.com. 322 IN A 64.233.167.25

;; Query time: 1243 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:40:52 2007
;; MSG SIZE rcvd: 364

Mail del responsable y otros datos del DNS:
Quote
BT ~ # dig google.com SOA

; <<>> DiG 9.3.2 <<>> google.com SOA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 52736
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN SOA

;; ANSWER SECTION:
google.com. 86400 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 2563 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:51:14 2007
;; MSG SIZE rcvd: 78

aqui el correo seria: dns-admin@google.com (cambiando el "." por @), el DNS primario seria: ns1.google.com, y su ultima actualizacion fue: 2007/09/17, el TTL (Time to a live) es de 300, el tiempo de espera para actualizacion de los DNS's secundarios (con respecto al primario) es de: 7200, el tiempo de reintento (cuando hay error al conectar con DNS primario) es de: 1800, y el tiempo de caducidad (el tiempo que el servidor mantendra en cache los datos sin actualizar en caso de error de actualizacion) es de: 1209600 (si no me equivoco estos datos estan en milisegundos).

otras funciones utiles:
+nocmd
+nocomments
+noquestion
+noanswer
+noauthority
+noadditional
+nostats
+noall

Su funcion es logica, y son utiles cuando queremos resumir las respuestas....Dig es una herramienta principalmente de linux, utilizada para el envio de ordenes DNS, esta herramienta es muy util hablando de defacing, y de detectar que webs estan en un server (utilizado para mass defacement), sin mas que decir comenzemos:

El primer comando que es de los que mas destaca de los que utilizaremos es el siguiente:
Quote
BT ~ # dig ns

Este comando nos devolvera una lista de super DNS, que podremos utilizar para trabajar:

Quote
; <<>> DiG 9.3.2 <<>> ns
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 4874
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13

;; QUESTION SECTION:
;. IN NS

;; ANSWER SECTION:
. 234977 IN NS L.ROOT-SERVERS.NET.
. 234977 IN NS M.ROOT-SERVERS.NET.
. 234977 IN NS A.ROOT-SERVERS.NET.
. 234977 IN NS B.ROOT-SERVERS.NET.
. 234977 IN NS C.ROOT-SERVERS.NET.
. 234977 IN NS D.ROOT-SERVERS.NET.
. 234977 IN NS E.ROOT-SERVERS.NET.
. 234977 IN NS F.ROOT-SERVERS.NET.
. 234977 IN NS G.ROOT-SERVERS.NET.
. 234977 IN NS H.ROOT-SERVERS.NET.
. 234977 IN NS I.ROOT-SERVERS.NET.
. 234977 IN NS J.ROOT-SERVERS.NET.
. 234977 IN NS K.ROOT-SERVERS.NET.

;; ADDITIONAL SECTION:
M.ROOT-SERVERS.NET. 30938 IN A 202.12.27.33
A.ROOT-SERVERS.NET. 591011 IN A 198.41.0.4
B.ROOT-SERVERS.NET. 30938 IN A 192.228.79.201
C.ROOT-SERVERS.NET. 39988 IN A 192.33.4.12
D.ROOT-SERVERS.NET. 53749 IN A 128.8.10.90
E.ROOT-SERVERS.NET. 30938 IN A 192.203.230.10
F.ROOT-SERVERS.NET. 591011 IN A 192.5.5.241
G.ROOT-SERVERS.NET. 53680 IN A 192.112.36.4
H.ROOT-SERVERS.NET. 30939 IN A 128.63.2.53
I.ROOT-SERVERS.NET. 40043 IN A 192.36.148.17
J.ROOT-SERVERS.NET. 591011 IN A 192.58.128.30
K.ROOT-SERVERS.NET. 591011 IN A 193.0.14.129
L.ROOT-SERVERS.NET. 30938 IN A 198.32.64.12

;; Query time: 383 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:09:15 2007
;; MSG SIZE rcvd: 436


Algunas funciones de dig:

Tracer:
Quote
BT ~ # dig web.com +trace
Bueno creo que es logico lo que hace.....

Resolver DNS de una web:
Quote
BT ~ # dig web.com NS

Esto nos devuelve la lista de los servidores DNS de determinada web.

Ejemplo:
Quote
BT ~ # dig google.com NS

; <<>> DiG 9.3.2 <<>> google.com NS
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 27071
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN NS

;; ANSWER SECTION:
google.com. 64768 IN NS ns1.google.com.
google.com. 64768 IN NS ns2.google.com.
google.com. 64768 IN NS ns3.google.com.
google.com. 64768 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345450 IN A 216.239.34.10
ns3.google.com. 345450 IN A 216.239.36.10
ns4.google.com. 345450 IN A 216.239.38.10
ns1.google.com. 345450 IN A 216.239.32.10

;; Query time: 276 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:26:59 2007
;; MSG SIZE rcvd: 164

Listar Servidores de Correo de determinado dominio:

Quote
BT ~ # dig google.com MX

; <<>> DiG 9.3.2 <<>> google.com MX
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 35446
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN MX

;; ANSWER SECTION:
google.com. 4237 IN MX 10 smtp1.google.com.
google.com. 4237 IN MX 10 smtp2.google.com.
google.com. 4237 IN MX 10 smtp3.google.com.
google.com. 4237 IN MX 10 smtp4.google.com.

;; ADDITIONAL SECTION:
smtp2.google.com. 1054 IN A 64.233.167.25
smtp3.google.com. 1060 IN A 64.233.183.25
smtp4.google.com. 1066 IN A 72.14.215.25
smtp1.google.com. 3329 IN A 72.14.203.25

;; Query time: 583 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:28:39 2007
;; MSG SIZE rcvd: 180

Consultar datos de un Dominio en determinado servidor DNS:

Quote
BT ~ # dig google.com @ns1.google.com

; <<>> DiG 9.3.2 <<>> google.com @ns1.google.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 34414
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 300 IN A 64.233.167.99
google.com. 300 IN A 72.14.207.99
google.com. 300 IN A 64.233.187.99

;; AUTHORITY SECTION:
google.com. 345600 IN NS ns1.google.com.
google.com. 345600 IN NS ns2.google.com.
google.com. 345600 IN NS ns3.google.com.
google.com. 345600 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
ns1.google.com. 345600 IN A 216.239.32.10
ns2.google.com. 345600 IN A 216.239.34.10
ns3.google.com. 345600 IN A 216.239.36.10
ns4.google.com. 345600 IN A 216.239.38.10

;; Query time: 1124 msec
;; SERVER: 216.239.32.10#53(216.239.32.10)
;; WHEN: Tue Sep 25 20:30:38 2007
;; MSG SIZE rcvd: 212

DNS Inverso:

Quote
BT ~ # dig -x google.com

; <<>> DiG 9.3.2 <<>> -x google.com
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: FORMERR, id: 36927
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;com.google.in-addr.arpa. IN PTR

;; Query time: 3 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:35:52 2007
;; MSG SIZE rcvd: 41

Numero IP en IPv6:

Quote
BT ~ #dig google.com AAAA

; <<>> DiG 9.3.2 <<>> google.com AAAA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 21031
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN AAAA

;; AUTHORITY SECTION:
google.com. 39 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 1084 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:41:20 2007
;; MSG SIZE rcvd: 78
[/b]

otra funcion que tambien les recomiendo es la de ANY, la cual nos devuelve los servidores de correo, DNS, y varios datos mas:

Quote
BT ~ # dig google.com ANY

; <<>> DiG 9.3.2 <<>> google.com ANY
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 65404
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 8

;; QUESTION SECTION:
;google.com. IN ANY

;; ANSWER SECTION:
google.com. 181 IN A 64.233.167.99
google.com. 181 IN A 72.14.207.99
google.com. 181 IN A 64.233.187.99
google.com. 63936 IN NS ns1.google.com.
google.com. 63936 IN NS ns2.google.com.
google.com. 63936 IN NS ns3.google.com.
google.com. 63936 IN NS ns4.google.com.
google.com. 3505 IN MX 10 smtp2.google.com.
google.com. 3505 IN MX 10 smtp3.google.com.
google.com. 3505 IN MX 10 smtp4.google.com.
google.com. 3505 IN MX 10 smtp1.google.com.

;; ADDITIONAL SECTION:
ns2.google.com. 345481 IN A 216.239.34.10
ns3.google.com. 345481 IN A 216.239.36.10
ns4.google.com. 345481 IN A 216.239.38.10
ns1.google.com. 345481 IN A 216.239.32.10
smtp3.google.com. 328 IN A 64.233.183.25
smtp4.google.com. 334 IN A 72.14.215.25
smtp1.google.com. 3332 IN A 72.14.203.25
smtp2.google.com. 322 IN A 64.233.167.25

;; Query time: 1243 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:40:52 2007
;; MSG SIZE rcvd: 364

Mail del responsable y otros datos del DNS:
Quote
BT ~ # dig google.com SOA

; <<>> DiG 9.3.2 <<>> google.com SOA
;; global options: printcmd
;; Got answer:
;; Flecha>HEADER<<- opcode: QUERY, status: NOERROR, id: 52736
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN SOA

;; ANSWER SECTION:
google.com. 86400 IN SOA ns1.google.com. dns-admin.google.com. 2007091701 7200 1800 1209600 300

;; Query time: 2563 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Tue Sep 25 20:51:14 2007
;; MSG SIZE rcvd: 78

aqui el correo seria: dns-admin@google.com (cambiando el "." por @), el DNS primario seria: ns1.google.com, y su ultima actualizacion fue: 2007/09/17, el TTL (Time to a live) es de 300, el tiempo de espera para actualizacion de los DNS's secundarios (con respecto al primario) es de: 7200, el tiempo de reintento (cuando hay error al conectar con DNS primario) es de: 1800, y el tiempo de caducidad (el tiempo que el servidor mantendra en cache los datos sin actualizar en caso de error de actualizacion) es de: 1209600 (si no me equivoco estos datos estan en milisegundos).

otras funciones utiles:
+nocmd
+nocomments
+noquestion
+noanswer
+noauthority
+noadditional
+nostats
+noall

Su funcion es logica, y son utiles cuando queremos resumir las respuestas....


Autor: Thera Hack