Login Register


Domain Scanner filter_list
Author
Message
Domain Scanner #1
This is a script to list all the alive hosts on a domain. It will not work if it can't find the DNS !!

Code:
#!/bin/bash echo echo ' ______ _______ _______ _______ _________ _ _______ _______ _______ _ _ _______ _______ ' echo '( __ \ ( ___ )( )( ___ )\__ __/( ( /|( ____ \( ____ \( ___ )( ( /|( ( /|( ____ \( ____ )' echo '| ( \ )| ( ) || () () || ( ) | ) ( | \ ( || ( \/| ( \/| ( ) || \ ( || \ ( || ( \/| ( )|' echo '| | ) || | | || || || || (___) | | | | \ | || (_____ | | | (___) || \ | || \ | || (__ | (____)|' echo '| | | || | | || |(_)| || ___ | | | | (\ \) |(_____ )| | | ___ || (\ \) || (\ \) || __) | __)' echo '| | ) || | | || | | || ( ) | | | | | \ | ) || | | ( ) || | \ || | \ || ( | (\ ( ' echo '| (__/ )| (___) || ) ( || ) ( |___) (___| ) \ |/\____) || (____/\| ) ( || ) \ || ) \ || (____/\| ) \ \__' echo '(______/ (_______)|/ \||/ \|\_______/|/ )_)\_______)(_______/|/ \||/ )_)|/ )_)(_______/|/ \__/' echo echo "By 9H4C7K3R2 - v1.0" echo "@ Script to list all alive hosts on a domain" echo # List sub domain and gives IP addresses echo -n "[+] Website URL (ex: www.google.com): " read url while [[ $url == "" ]] # Testing if a website has been entered do echo -n "[+] Website URL (ex: www.google.com): " read url done domaine=$(echo $url | sed -r 's/.*\.([^.]+\.[^.]+)$/\1/') # Picking domain echo "[+] Searching Domain" # Grabbing DNS dns=$(whois $domaine | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sed '1d') if [[ -z ${dns} ]] then echo "[+] Impossible to find DNS ip address or domain" echo "[+] Exiting" exit fi whois $domaine | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sed '1d' > .dns echo "[+] Grabbing DNS on domain $domaine" i=1 dnsnb=$(wc -l .dns | sed -e 's/\.dns//') # Counting DNS # Grabbing sub-domains while ((i<=dnsnb)) do dns=$(cat .dns | sed -n "$i"p"") host -l $domaine $dns >> .fetchdomain ((i++)) done echo "[+] Searching sub-domains" # Taking IP addresses and deleting doubles cat .fetchdomain | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' > .allipadd sort .allipadd | uniq > .ipdomain echo "[+] Grabbing IP addresses and cleaning list" j=1 ipnb=$(wc -l .ipdomain | sed -e 's/\.ipdomain//') # Counting number of found IP address # Ping Test and Printing results echo "[+] Checking alive hosts - $ipnb IPs" sleep 3 echo "[+] Result:" while ((j<=ipnb)) do ip=$(cat .ipdomain | sed -n "$j"p"") ping -c 1 -W 1 $ip > .testip result=$(cat .testip | grep -E -o '[0-9]{1,3}\% packet loss') if [[ $result == "0% packet loss" ]] then echo "IP address $ip answered and belongs to domain $url" else cat .testip 2>&1 >/dev/null fi ((j++)) done rm .dns rm .fetchdomain rm .allipadd rm .ipdomain rm .testip

Reply

RE: Domain Scanner #2
Good job with this one.

Reply

RE: Domain Scanner #3
Nice code.
Not accusing you of ripping it but is it yours originally?
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Domain Scanner #4
All my scripts are made by me, never ripped Smile

Reply

RE: Domain Scanner #5
Why the program is immediately closed? I can't read or make any other move.It happens almost for every batch file...

Reply

RE: Domain Scanner #6
(06-24-2014, 10:10 PM)BILL1991 Wrote: Why the program is immediately closed? I can't read or make any other move.It happens almost for every batch file...

Hmm.. not totally sure but you might want to add
Code:
pause <nul
after all of OP's code.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply

RE: Domain Scanner #7
Seems like your computer can't handle too many instructions O_o

Reply

RE: Domain Scanner #8
This is coded in Python right?
Nice script mate, this I'll definetly come in handy
[Image: 5R6Js8r.gif]

Reply

RE: Domain Scanner #9
Thanks. It's not python it's bash. I've been very busy these last times but now I should be back on the forum with some new scripts.

Reply







Users browsing this thread: