OpenResolver.py, open DNS crawler
Sun 23 November 2014Week-end felice: ho trovato voglia e tempo per scrivere un po di (orribile) python!
Dato che la tecnica del DNS Amplification Attack è didatticamente molto interessante, ho deciso di fare un po di esercizi di scripting e creare un piccolo programma in python che potesse ricercare i famosi Open Resolver in giro per la rete.
Si chiama Openresolver.py (che classe :P) ed è hostato sul mio github: https://github.com/j0lly/openresolvers.
Per ora è solo un'accozzaglia di righe di codice, ma il suo sporco lavoro lo fa:
basta passare un ip o un range di ip in formato CIDR e lui comincerà a testare tutti i target per trovare quelli che risolvono query DNS arbitrarie.
Esempio:
[root@newsun][~/openresolvers]
16:42:43 # git com./openresolver.py -t 91.98.29.244/24 -c 120 -o resolvers.txt
resolving with 91.98.29.0
resolving with 91.98.29.1
resolving with 91.98.29.2
[..]
resolving with 91.98.29.118
resolving with 91.98.29.119
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.26 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.22 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.86 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.66 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.68 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.69 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.67 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.10 to the list
fd-fp3.wg1.b.yahoo.com.
adding 91.98.29.70 to the list
resolving with 91.98.29.120
[..]
I found 14 resolvers!
dumped list to resolvers.txt
Al momento è molto verboso e non fornisce molte opzioni, ma cercherò di migliorarne il contenuto se avrò tempo; ovviamente se qualcuno volesse contribuire, sarei felicissimo di accettare qualche commit!
Spero che qualcuno trovi lo script interessante, o per lo meno curioso :P
Stay tuned!
J0lly