Skip to content

Instantly share code, notes, and snippets.

@si9int
Last active April 20, 2024 21:28
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save si9int/dce435633f49209150a780af4b3e768d to your computer and use it in GitHub Desktop.
Save si9int/dce435633f49209150a780af4b3e768d 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.3 | 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()
params['CSRF984348618797932'] = params['CSRF984348797932']
# Additional options
params['scan_subdomains'] = ''
params['domain'] = domain
params['privatequery'] = 'on'
data = requests.post('https://subdomainfinder.c99.nl/', data=params).text
print(data)
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)
@si9int
Copy link
Author

si9int commented Apr 5, 2020

Updated: v.0.2 - dynamically reading anti CSRF tokens

@si9int
Copy link
Author

si9int commented Apr 7, 2020

Updated: v.0.3 - tool works again

@gopinath6
Copy link

still broken.even though results are shown at end, at starting html codes are printed

D:\Dropbox\bug\Asus\Web\Tools\Subdomain\c99>python c99.sh example.com

<title>Subdomain Finder - C99.nl</title>
Brought to you by C99.nl <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script> 1204-desktop-amd64.example.com 29.example.com 35e9be169653.example.com 41309.example.com

@Zarcolio
Copy link

Zarcolio commented Apr 8, 2020

I keep getting:

Traceback (most recent call last):
  File "c99-nl.py", line 24, in <module>
    params['CSRF984348618797932'] = params['CSRF984348797932']
KeyError: 'CSRF984348797932'

@uBadRequest
Copy link

I keep getting:

Traceback (most recent call last):
  File "c99-nl.py", line 24, in <module>
    params['CSRF984348618797932'] = params['CSRF984348797932']
KeyError: 'CSRF984348797932'

Same here

@YashGoti
Copy link

Same Error:
Traceback (most recent call last):
File "c99-nl.py", line 24, in
params['CSRF984348618797932'] = params['CSRF984348797932']
KeyError: 'CSRF984348797932'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment