Zone Transfer (AXFR) Enumeration

axfr.sh è un supplemento a knock

#!/bin/bash

## Zone Transfer (AXFR) enumeration
## axfr.sh is a supplement to knock
## http://knock.gianniamato.it

## by Gianni ‘guelfoweb’ Amato

usage(){
echo “usage: $0 [ domain ] [ fileoutput ]”
}

if [ $# -lt 1 ]; then
usage
exit -1
fi

DOMAIN=$1

fileverify(){
if [ -f $OUTPUT ]; then
echo “error: file exists: ‘$OUTPUT’”
usage
exit 1
fi
}

if [ -z $2 ]; then
OUTPUT=”output”
fileverify
else
OUTPUT=$2
fileverify
fi

QUERY=`dig $DOMAIN NS +short | sed ‘s/[.t]*$//’`
NS=($QUERY)

for((i=0;i<${#NS[@]};i++)); do
echo “Trying Zone Transfer on -> ${NS[$i]}” >> $OUTPUT
echo >> $OUTPUT
dig @${NS[$i]} $DOMAIN axfr | grep -v “^;” | grep -v “^$” >> $OUTPUT
done

if [ -f $OUTPUT ]; then
cat $OUTPUT
echo “Output saved in ‘$OUTPUT’ file.”
exit 1
else
echo “error: ‘$DOMAIN’ is not a valid domain name.”
fi

usage: bash axfr.sh [ domain ] [ fileoutput ]

in alternativa utilizzando i seguenti permessi chmod a+x axfr.sh

./axfr.sh example.com

l’output verra mostrato a video e scritto di default nel file ‘output’.

Se si vuole specificare il file output di destinazione:

./axfr.sh example.com filename.txt

Lo script bash è scaricabile direttamente da qui o dalla pagina di download.

code , . URL.

One Response to Zone Transfer (AXFR) Enumeration

  1. anonymous says:

    e tutto sto casino per chi non sa usare nslookup o dig?

Lascia un Commento

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *

*

È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>