Skip to content

Commit

Permalink
feat: multi-threading
Browse files Browse the repository at this point in the history
  • Loading branch information
0xk4b1r authored Oct 14, 2024
2 parents 4d4a033 + 8e91a5e commit 9b0e261
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 45 deletions.
42 changes: 0 additions & 42 deletions subdomain-finder.py

This file was deleted.

33 changes: 30 additions & 3 deletions subdomains-list.txt → subdomains-wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
blogs
blog
www
3d
a
acceptatie
access
Expand All @@ -9,24 +7,29 @@ accounts
ad
adm
admin
admin1
administration
administrator
ads
adserver
affiliate
affiliate1
affiliates
agenda
alpha
alumni
analytics
ann
api
api1
apollo
app
apps
ar
archive
art
assets
assets1
atlas
auth
auto
Expand All @@ -43,6 +46,7 @@ barracuda
bb
bbs
beta
beta1
biblioteca
billing
blackboard
Expand Down Expand Up @@ -183,6 +187,8 @@ event
events
ex
example
example1
example2
examples
exchange
external
Expand Down Expand Up @@ -244,6 +250,7 @@ heracles
hercules
hermes
home
home1
homer
host
host2
Expand Down Expand Up @@ -337,6 +344,7 @@ localhost
log
loghost
login
logins
logon
logs
london
Expand Down Expand Up @@ -367,6 +375,7 @@ mailman
mailserver
main
manage
management
manager
mantis
map
Expand Down Expand Up @@ -421,6 +430,7 @@ mx1
mx2
mx3
my
myaccount
mysql
mysql2
n
Expand Down Expand Up @@ -480,6 +490,7 @@ operations
ops
ora
oracle
orders
origin
orion
os
Expand All @@ -496,6 +507,7 @@ partner
partners
pay
payment
payment1
payments
pbx
pcanywhere
Expand Down Expand Up @@ -532,7 +544,9 @@ preview
private
pro
prod
product
production
products
project
projects
promo
Expand Down Expand Up @@ -561,6 +575,7 @@ report
reports
repos
research
research1
resources
restricted
reviews
Expand All @@ -578,6 +593,7 @@ s3
s4
sa
sales
sales1
sample
samples
sandbox
Expand All @@ -596,6 +612,7 @@ share
sharepoint
shell
shop
shop1
shopping
signup
sip
Expand Down Expand Up @@ -631,6 +648,7 @@ st
staff
stage
staging
staging1
start
stat
static
Expand All @@ -645,6 +663,7 @@ streaming
student
sun
support
support1
survey
sv
svn
Expand All @@ -659,6 +678,7 @@ test1
test2
test3
testing
testing1
testsite
testweb
tfs
Expand Down Expand Up @@ -687,6 +707,7 @@ unix
up
update
upload
upload1
uploads
us
user
Expand Down Expand Up @@ -729,17 +750,20 @@ web3
web4
web5
webadmin
webapp
webcam
webconf
webct
webdb
webdisk
webinar
weblog
webmail
webmail2
webmaster
webmin
webservices
website
webstats
webstore
whm
Expand All @@ -750,6 +774,7 @@ win32
windows
wordpress
work
workshop
wp
ws
wsus
Expand Down Expand Up @@ -779,6 +804,8 @@ wwwold
wwww
x
xml
z1
z2
zabbix
zeus
zimbra
44 changes: 44 additions & 0 deletions subscout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import requests
from pyfiglet import Figlet
from concurrent.futures import ThreadPoolExecutor
import argparse


def search_subdomain(sub):
"""Check if the subdomain is active and print it if it is."""
sub_domain = f"http://{sub}.{domain_name}"

try:
response = requests.get(sub_domain, timeout=5)
if response.status_code == 200:
print(sub_domain)
except requests.ConnectionError:
pass
except requests.Timeout:
print(f"Timeout while trying to access {sub_domain}")
except requests.RequestException as e:
print(f"Error occurred: {e}")


def search(domain_name: str):
"""Main function to read subdomains and initiate searching."""
f = Figlet(font="small")
header = f.renderText("SubScout")
print(header)

# Read subdomains from the file
with open("subdomains-wordlist.txt", "r") as file:
subs = file.read().splitlines()

# Use ThreadPoolExecutor for efficient thread management
max_workers = 100 # Adjust the number of workers as needed
with ThreadPoolExecutor(max_workers=max_workers) as executor:
executor.map(search_subdomain, subs)


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Subdomain Finder")
parser.add_argument("domain", help="Domain name to search subdomains for")
args = parser.parse_args()
domain_name = args.domain
search(domain_name)

0 comments on commit 9b0e261

Please sign in to comment.