Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
RevoltSecurities authored Oct 10, 2024
1 parent fb3b0a2 commit 23c4c2a
Show file tree
Hide file tree
Showing 16 changed files with 479 additions and 0 deletions.
Empty file.
Binary file not shown.
Binary file not shown.
143 changes: 143 additions & 0 deletions subdominator/modules/enumerates/virustotal/virustotal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
from colorama import Fore, Style
import aiofiles
import random
import yaml
import aiohttp
import sys

bold = Style.BRIGHT
blue = Fore.BLUE
red = Fore.RED
white = Fore.WHITE
reset = Style.RESET_ALL

async def virustotal(domain, session, configs, username, args):
try:

virustotals = []

try:

async with aiofiles.open(configs, "r") as streamr:

data = yaml.safe_load(await streamr.read())

if "virustotal" not in data:

return

randvalue = data.get("virustotal", [])

if randvalue is None:

return

randomkey = random.choice(data.get("virustotal", []))

except yaml.YAMLError as e:

if args.show_key_info:

if not args.no_color:

print(f"[{bold}{red}INFO{reset}]: {bold}{white}Hey {username} Please check syntax of {configs}{reset}", file=sys.stderr)

else:

print(f"[INFO]: Hey {username} Please check syntax of {configs}", file=sys.stderr)

except TypeError as e:

pass

except KeyboardInterrupt as e:
quit()

except yaml.YAMLObject as e:

if args.show_key_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Hey {username} Please check syntax of {configs}{reset}", file=sys.stderr)
else:
print(f"[INFO]: Hey {username} Please check syntax of {configs}", file=sys.stderr)

except Exception as e:
if args.sec_deb:
print(f"[{bold}{red}WRN{reset}]: {bold}{white}Exception in virustotal reader block: {e}, {type(e)}{reset}", file=sys.stderr)

if randomkey is None:

return

try:

url = f"https://www.virustotal.com/vtapi/v2/domain/report?apikey={randomkey}&domain={domain}"
proxy = args.proxy if args.proxy else None

async with session.get(url, timeout=args.timeout, proxy=proxy, ssl=False) as response:
if response.status != 200:

if args.show_key_info:
if not args.no_color:
print(f"[{bold}{red}ALERT{reset}]: Virustotal blocking our request, {username} please check your api usage for this key: {randomkey}", file=sys.stderr)
else:
print(f"[ALERT]: Virustotal blocking our request, {username} please check your api usage for this key: {randomkey}", file=sys.stderr)
return []

data = await response.json()

if 'subdomains' in data:
subdomains = data['subdomains']
for subdomain in subdomains:
virustotals.append(subdomain)
return virustotals

except aiohttp.ServerConnectionError as e:

if args.show_timeout_info:

if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Virustotal API, due to Serverside Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for Virustotal API, due to Serverside Error", file=sys.stderr)

except aiohttp.ClientConnectionError as e:

if args.show_timeout_info:

if not args.no_color:

print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Virustotal API, due to ClientSide connection Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for Virustotal API, due to Clientside connection Error", file=sys.stderr)


except KeyboardInterrupt as e:
quit()

except TimeoutError as e:
if args.show_timeout_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Virustotal API, due to Timeout Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for Virustotal API, due to Timeout Error", file=sys.stderr)

except Exception as e:
if args.sec_deb:
print(f"[{bold}{red}WRN{reset}]: {bold}{white}Exception in virustotal request block: {e}, {type(e)}{reset}", file=sys.stderr)

except Exception as e:
if args.sec_deb:
print(f"[{bold}{red}WRN{reset}]: {bold}{white}Exception occured in api virustotal main block: {e}, due to: {type(e)}{reset}", file=sys.stderr)












Empty file.
Binary file not shown.
Binary file not shown.
56 changes: 56 additions & 0 deletions subdominator/modules/enumerates/waybackarchive/waybackarchive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from colorama import Fore, Style
import re
import httpx
import sys
from fake_useragent import UserAgent
from subdominator.modules.utils import compiler, extracts

bold = Style.BRIGHT
blue = Fore.BLUE
red = Fore.RED
white = Fore.WHITE
reset = Style.RESET_ALL
Waybackurls = set()

async def waybackarchive(domain, args):
try:
headers = {
"User-Agent": UserAgent().random
}
proxy = args.proxy if args.proxy else None
async with httpx.AsyncClient(verify=False, proxy=proxy) as request:
async with request.stream("GET", f"https://web.archive.org/cdx/search/cdx?url=*.{domain}&collapse=urlkey&fl=original", headers=headers, timeout=httpx.Timeout(read=300.0, connect=args.timeout, write=None, pool=None), follow_redirects=True) as response:
async for url in response.aiter_lines():
subdomains = await extracts(url, domain)
if subdomains:
for subdomain in subdomains:
subdomain = subdomain.lstrip("25").lstrip("2F").lstrip("40").lstrip(".").lstrip("B0")
if subdomain not in Waybackurls and not subdomain.startswith("%3D") and not subdomain.startswith("3D"):
Waybackurls.add(subdomain)
except KeyboardInterrupt as e:
quit()
except TimeoutError as e:
if args.show_timeout_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Webarchive, due to Timeout Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for Webarchive, due to Timeout Error", file=sys.stderr)
except httpx.ConnectTimeout:
if args.show_timeout_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Webarchive, due to Timeout Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for Webarchive, due to Timeout Error", file=sys.stderr)
except httpx.ConnectError:
if args.show_timeout_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Webarchive, due to Timeout Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for Webarchive, due to Timeout Error", file=sys.stderr)
except httpx.ReadTimeout:
pass
except Exception as e:
if args.sec_deb:
print(f"[{bold}{red}WRN{reset}]: {bold}{white}Exception in wayback request block: {e}, {type(e)}{reset}", file=sys.stderr)
finally:
return Waybackurls
Empty file.
Binary file not shown.
Binary file not shown.
125 changes: 125 additions & 0 deletions subdominator/modules/enumerates/whoisxml/whoisxml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
from colorama import Fore, Style
import aiofiles
import random
import yaml
import aiohttp
import sys
import asyncio

bold = Style.BRIGHT
blue = Fore.BLUE
red = Fore.RED
white = Fore.WHITE
reset = Style.RESET_ALL

async def whoisxml(domain, session, configs, username, args):

try:

try:
async with aiofiles.open(configs, "r") as streamr:
data = yaml.safe_load(await streamr.read())
if "whoisxmlapi" not in data:
return

randvalue = data.get("whoisxmlapi", [])

if randvalue is None:
return
randomkey = random.choice(data.get("whoisxmlapi", []))

except yaml.YAMLError as e:

if args.show_key_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Hey {username} Please check syntax of {configs}{reset}", file=sys.stderr)
else:
print(f"[INFO]: Hey {username} Please check syntax of {configs}", file=sys.stderr)

except TypeError as e:
pass

except yaml.YAMLObject as e:

if args.show_key_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Hey {username} Please check syntax of {configs}{reset}", file=sys.stderr)
else:
print(f"[INFO]: Hey {username} Please check syntax of {configs}", file=sys.stderr)

except Exception as e:
if args.sec_deb:
print(f"[{bold}{red}WRN{reset}]: {bold}{white}Exception in whoisxmlapi request block: {e}, {type(e)}{reset}", file=sys.stderr)

if randomkey is None:
return []

try:

whoisxmls = []

url = f"https://subdomains.whoisxmlapi.com/api/v1?apiKey={randomkey}&domainName={domain}"
proxy = args.proxy if args.proxy else None
async with session.get(url, timeout=args.timeout, proxy=proxy, ssl=False) as response:

data = await response.json()
if response.status != 200:
if args.show_key_info:
if not args.no_color:
print(f"[{bold}{red}ALERT{reset}]: Whoisxmlapi blocking our request, {username} please check your api usage for this key: {randomkey}", file=sys.stderr)

else:
print(f"[ALERT]: Whoisxmlapi blocking our request, {username} please check your api usage for this key: {randomkey}", file=sys.stderr)
return []

found_result = data.get('result', {}).get('records', [])

for subdomains in found_result:

subdomain = subdomains.get('domain')

if subdomain:

whoisxmls.append(subdomain)

return whoisxmls

except aiohttp.ServerConnectionError as e:

if args.show_timeout_info:

if not args.no_color:

print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Whoisxml API, due to Serverside Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for whoisxml API, due to Serverside Error", file=sys.stderr)

except aiohttp.ClientConnectionError as e:

if args.show_timeout_info:

if not args.no_color:

print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Whoisxml API, due to ClientSide connection Error", file=sys.stderr)

else:

print(f"[INFO]: Timeout reached for Whoisxml API, due to Clientside connection Error", file=sys.stderr)

except TimeoutError as e:
if args.show_timeout_info:
if not args.no_color:
print(f"[{bold}{red}INFO{reset}]: {bold}{white}Timeout reached for Whoisxml API, due to Timeout Error", file=sys.stderr)
else:
print(f"[INFO]: Timeout reached for Whoisxml API, due to Timeout Error", file=sys.stderr)

except KeyboardInterrupt as e:
quit()

except Exception as e:
if args.sec_deb:
print(f"[{bold}{red}WRN{reset}]: {bold}{white}Exception in whoisxmlapi request block: {e}, {type(e)}{reset}", file=sys.stderr)

except Exception as e:
if args.sec_deb:
print(f"[{bold}{red}WRN{reset}]: {bold}{white}Exception in whoisxmlapi main block: {e}, {type(e)}{reset}", file=sys.stderr)
Empty file.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 23c4c2a

Please sign in to comment.