Skip to content

Instantly share code, notes, and snippets.

@mritunjay-k
Last active November 24, 2019 02:31
Show Gist options
  • Save mritunjay-k/ffda36a4c7e4212592fb50601a028566 to your computer and use it in GitHub Desktop.
Save mritunjay-k/ffda36a4c7e4212592fb50601a028566 to your computer and use it in GitHub Desktop.
Provide it a list of domains and it will show you which of them is 200 OK or 404 NOT FOUND (extremly helpful for web application bug hunting)
#!/usr/bin/env python
import requests
try:
read_file = open(input("Enter path of the file containing subdomains: "),'r')
for host in read_file:
domain = host.rstrip("\n")
try:
page = requests.get('http://'+ domain, timeout=20)
print ('Status Code: ',page.status_code,' for the Domain: ', domain)
except:
print ('Status Code: Not found for the Domain: ',domain ) #It means that the webpage can't be reached.
except:
print('File not found')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment