Last active
November 24, 2019 02:31
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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