-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4cd2404
commit 28c66ee
Showing
6 changed files
with
51 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from reconnaissance.subdomainenumeration import enumerate_subdomains | ||
|
||
domain = "bing.com" | ||
subdomains = enumerate_subdomains(domain) | ||
|
||
if subdomains: | ||
print(f"Subdomains for {domain}:") | ||
for subdomain in subdomains: | ||
print(subdomain) | ||
else: | ||
print(f"No subdomains found for {domain}.") |
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,14 @@ | ||
[tool.poetry] | ||
name = "reconnaissance" | ||
version = "0.0.1" | ||
description = "" | ||
authors = ["Pritam Dash <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
Empty file.
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,26 @@ | ||
import requests | ||
import json | ||
|
||
|
||
def enumerate_subdomains(domain): | ||
try: | ||
# Send a request to the CRT.sh API | ||
url = f"https://crt.sh/?q=%.{domain}&output=json" | ||
response = requests.get(url) | ||
|
||
if response.status_code == 200: | ||
# Parse the JSON response | ||
data = json.loads(response.text) | ||
|
||
# Extract and format subdomains | ||
subdomains = set() | ||
for entry in data: | ||
subdomains.add(entry['name_value'].strip()) | ||
|
||
return subdomains | ||
else: | ||
print(f"Failed to fetch subdomains for {domain}.") | ||
return set() | ||
except Exception as e: | ||
print(f"An error occurred: {str(e)}") | ||
return set() |
Empty file.