Skip to content

Instantly share code, notes, and snippets.

@Anirbansingha1
Last active August 24, 2019 16:11
Show Gist options
  • Select an option

  • Save Anirbansingha1/d5958b6e52ef9f896cb0124383f884d3 to your computer and use it in GitHub Desktop.

Select an option

Save Anirbansingha1/d5958b6e52ef9f896cb0124383f884d3 to your computer and use it in GitHub Desktop.
Multithreaded subdomain bruteforce tool
#python sub_brute.py example.com[domain] 10[thread]
#Coder:- Anirban Singha
import threading
import urllib2,sys
domain=sys.argv[1]
mythread=int(sys.argv[2])
def bruteforce_subdomain(domain,result,mylist):
for line in mylist:
try:
url='https://'+line+'.'+domain
r=urllib2.urlopen(url).getcode()
if r == 200:
print ('[+] '+url)
result.append(url)
except urllib2.URLError:
pass
except InvalidURL:
print ('[-] '+url+' -----> invalid url')
pass
print ('Starting Engline.....')
keyword = []
c=0
with open('vestige.txt') as l:
for line in l:
keyword.append(line)
c+=1
x=[]
k=0
wlc=c//mythread
print ('Warming Up Engine...')
for i in range(mythread):
x.append([])
for line in keyword:
x[i].append(line.strip())
k=k+1
if k == wlc:
k = 0
del keyword[:wlc]
break
result = []
print ('Finish making wordlist.')
for xy in range(mythread):
t=threading.Thread(target=bruteforce_subdomain,args=(domain,result,x[xy],))
t.start()
t.join()
z=open('bruteforce_subdomain.txt','w')
for line in result:
z.write(line.strip()+'\n')
z.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment