Created
November 11, 2020 18:51
-
-
Save c0d3x27/c98c5ae6d6985706cacb11f3d892a1f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests,re | |
from urllib.parse import unquote | |
import checkdomains | |
domains = open("Domains-to-test.txt","r") | |
for domain in domains.readlines(): | |
subdomains = open(domain.rstrip("\n")+"_subdomains.txt","r") | |
for subdomain in subdomains.readlines(): | |
buckets = [] | |
urls = checkdomains.isdomainlive(subdomain.rstrip("\n")) | |
if urls: | |
for url in urls: | |
print("checking - "+url) | |
try: | |
html=requests.get(url=url,timeout=20,verify=False).content | |
try: | |
html=unquote(str(html)) | |
except Exception as e: | |
print(e) | |
regjs=r"(?<=src=['\"])[a-zA-Z0-9_\.\-\:\/]+\.js" | |
regs3=r"[\w\-\.]+\.s3\.?(?:[\w\-\.]+)?\.amazonaws\.com|(?<!\.)s3\.?(?:[\w\-\.]+)?\.amazonaws\.com\\?\/[\w\-\.]+" | |
js=re.findall(regjs,html) | |
s3=re.findall(regs3,html) | |
buckets=buckets+s3 | |
if len(js)>0: | |
for i in js: | |
if i.startswith('//'): | |
jsurl=i.replace('//','http://') | |
elif i.startswith('http'): | |
jsurl=i | |
else: | |
jsurl=url+'/'+i | |
try: | |
jsfile=requests.get(jsurl,timeout=20).content | |
s3=re.findall(regs3,jsfile) | |
except Exception as y: | |
pass | |
if s3: | |
buckets=buckets+s3 | |
except Exception as x: | |
pass | |
for bucket in buckets: | |
print(bucket) |
Hi, how do i fix "ModuleNotFoundError: No module named 'checkdomains'"
I'm sorry for the delayed response. that module doesn't exist because that is the file you make from where the script will take the URLs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm sorry for the delayed response. that module doesn't exist because that is the file you make from where the script will take the URLs