Skip to content

Commit

Permalink
added amass and subfinder && update web interface
Browse files Browse the repository at this point in the history
  • Loading branch information
RJP committed Jun 4, 2018
1 parent 846f91c commit 9a4e395
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions database/additional_tools/domains_db.py
Expand Up @@ -18,6 +18,15 @@
#Add new subdomain scanners here. Make sure to let them save the output to /tmp/ICU/{domain}/doains-all.txt
os.system(os.path.dirname(os.path.abspath(__file__)) + "/../../tools/dependencies/sublister/sublist3r.py -o /tmp/ICU/"+domain+"/domains-all.txt -d "+domain)
time.sleep(2)

#Subfinder
os.system("subfinder -d " + domain + " -v -o /tmp/ICU/"+domain+"/domains-subfinder.txt --timeout 6")
time.sleep(2)

#Amass
os.system("amass -o /tmp/ICU/"+domain+"/domains-amass.txt -d " + domain)
time.sleep(2)

#Retrieve all info from a top domain and its subdomains, so we can use this data instead of opening new db connections later on
cursor.execute("select Domain, TopDomainID, Active, Program, DomainID, scan_Id from domains where TopDomainID = (select DomainID from domains where Domain = %s) or Domain = %s", (domain, domain))
database_data = cursor.fetchall()
Expand All @@ -29,6 +38,16 @@

#All the domains from the subdomain scanners
domains_all = open("/tmp/ICU/"+domain+"/domains-all.txt",'r').read().split('\n')

#Domains from subfinder
domains_subfinder = open("/tmp/ICU/"+domain+"/domains-subfinder.txt",'r').read().split('\n')

#Domains from amass
domains_subfinder = open("/tmp/ICU/"+domain+"/domains-amass.txt",'r').read().split('\n')

#Add all the subfinder subdomain to it
domains_all.extend(x for x in domains_subfinder if x not in domains_all)

#Add all the database subdomain to it
domains_all.extend(x for x in database_domains if x not in domains_all)
#Make it unique
Expand Down
6 changes: 5 additions & 1 deletion web/setup.sh
Expand Up @@ -64,7 +64,11 @@ if (\$result->num_rows > 0) {
<ul class=\"submenu\">';
\$domain[1] = array_reverse(\$domain[1], true);
foreach (\$domain[1] as \$d) {
echo '<li class=\"subdomain\" added=\"'.\$d[\"LastModified\"].'\" active=\"'.\$d[\"Active\"].'\" inscope=\"'.\$d[\"InScope\"].'\" program=\"'.\$d[\"Program\"].'\"><a href=\"#\">'.\$d[\"Domain\"].'</a></li>';
if((string)\$d[\"Active\"] == \"0\"){
echo '<li class=\"subdomain\" added=\"'.\$d[\"LastModified\"].'\" active=\"'.\$d[\"Active\"].'\" inscope=\"'.\$d[\"InScope\"].'\" program=\"'.\$d[\"Program\"].'\"><del><a href=\"#\">'.\$d[\"Domain\"].'</a></del></li>';
} else {
echo '<li class=\"subdomain\" added=\"'.\$d[\"LastModified\"].'\" active=\"'.\$d[\"Active\"].'\" inscope=\"'.\$d[\"InScope\"].'\" program=\"'.\$d[\"Program\"].'\"><a href=\"#\">'.\$d[\"Domain\"].'</a></li>';
}
}
echo '</ul></li>';
}
Expand Down

0 comments on commit 9a4e395

Please sign in to comment.