Skip to content

Instantly share code, notes, and snippets.

@th3gundy
Forked from si9int/c99-nl.py
Created April 6, 2020 07:08
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save th3gundy/bc83580cbe04031e9164362b33600962 to your computer and use it in GitHub Desktop.
Save th3gundy/bc83580cbe04031e9164362b33600962 to your computer and use it in GitHub Desktop.
Automates https://subdomainfinder.c99.nl | Usage: python3 c99-nl.py <domain.com> | Requirements: pip3 install bs4
#!/usr/bin/env python3
# v.0.2 | twitter.com/si9int
import requests, sys
from bs4 import BeautifulSoup as bs
domain = sys.argv[1]
subdomains = []
def get_csrf_params():
csrf_params = {}
data = requests.get('https://subdomainfinder.c99.nl/').text
html = bs(data, 'html.parser').find('div', {'class' : 'input-group'})
for c in html.find_all('input'):
try:
csrf_params[c.get('name')] = c.get('value')
except:
pass
return csrf_params
params = get_csrf_params()
# Additional options
params['scan_subdomains'] = ''
params['domain'] = domain
params['privatequery'] = 'on'
data = requests.post('https://subdomainfinder.c99.nl/', data=params).text
html = bs(data, 'html.parser').find('table', {'id' : 'result_table'})
for tr in html.find_all('tr'):
try:
subdomains.append(tr.find('a').text)
except:
pass
for s in subdomains:
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment