-
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
alienvault and urlscan added in subdomain enum
- Loading branch information
1 parent
93073dc
commit 7cf105d
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from json import loads | ||
import modules.subdom as parent | ||
from modules.write_log import log_writer | ||
|
||
R = '\033[31m' # red | ||
G = '\033[32m' # green | ||
C = '\033[36m' # cyan | ||
W = '\033[0m' # white | ||
Y = '\033[33m' # yellow | ||
|
||
|
||
async def alienvault(hostname, session): | ||
print(f'{Y}[!] {C}Requesting {G}AlienVault{W}') | ||
url = f'https://otx.alienvault.com/api/v1/indicators/domain/{hostname}/passive_dns' | ||
try: | ||
async with session.get(url) as resp: | ||
status = resp.status | ||
if status == 200: | ||
output = await resp.text() | ||
json_data = loads(output)['passive_dns'] | ||
subdomains = [] | ||
for entry in json_data: | ||
subdomains.append(entry['hostname']) | ||
parent.found.extend(subdomains) | ||
print(f'{G}[+] {Y}AlienVault {W}found {C}{len(subdomains)} {W}subdomains!') | ||
else: | ||
print(await resp.text()) | ||
print(f'{R}[-] {C}AlienVault Status : {W}{status}') | ||
log_writer(f'[alienvault_subs] Status = {status}, expected 200') | ||
except Exception as exc: | ||
print(f'{R}[-] {C}AlienVault Exception : {W}{exc}') | ||
log_writer('[alienvault_subs] Completed') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from json import loads | ||
import modules.subdom as parent | ||
from modules.write_log import log_writer | ||
|
||
R = '\033[31m' # red | ||
G = '\033[32m' # green | ||
C = '\033[36m' # cyan | ||
W = '\033[0m' # white | ||
Y = '\033[33m' # yellow | ||
|
||
|
||
async def urlscan(hostname, session): | ||
print(f'{Y}[!] {C}Requesting {G}UrlScan{W}') | ||
url = f'https://urlscan.io/api/v1/search/?q=domain:{hostname}' | ||
try: | ||
async with session.get(url) as resp: | ||
status = resp.status | ||
if status == 200: | ||
output = await resp.text() | ||
json_data = loads(output)['results'] | ||
subdomains = [] | ||
for entry in json_data: | ||
subdomains.append(entry['task']['domain']) | ||
parent.found.extend(subdomains) | ||
print(f'{G}[+] {Y}UrlScan {W}found {C}{len(subdomains)} {W}subdomains!') | ||
else: | ||
print(await resp.text()) | ||
print(f'{R}[-] {C}UrlScan Status : {W}{status}') | ||
log_writer(f'[urlscan_subs] Status = {status}, expected 200') | ||
except Exception as exc: | ||
print(f'{R}[-] {C}UrlScan Exception : {W}{exc}') | ||
log_writer('[urlscan_subs] Completed') |