Skip to content

Commit

Permalink
Initial commit. Buggy and Unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
iampritam97 committed Oct 19, 2023
1 parent 4cd2404 commit 28c66ee
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
Empty file added README.md
Empty file.
11 changes: 11 additions & 0 deletions mytest.py
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}.")
14 changes: 14 additions & 0 deletions pyproject.toml
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 added reconnaissance/__init__.py
Empty file.
26 changes: 26 additions & 0 deletions reconnaissance/subdomainenumeration.py
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 added tests/__init__.py
Empty file.

0 comments on commit 28c66ee

Please sign in to comment.