Skip to content

Instantly share code, notes, and snippets.

@ayoubfathi
Created April 13, 2019 07:01
Show Gist options
  • Save ayoubfathi/57c3fef7d4eada575a8b080cc3c4a562 to your computer and use it in GitHub Desktop.
Save ayoubfathi/57c3fef7d4eada575a8b080cc3c4a562 to your computer and use it in GitHub Desktop.
Using YouGetSignal API to get domains hosted on the same IP - Reverse IP
import requests
import json
import sys
import argparse
_strip = ['http://', 'https://', 'www']
G = '\033[92m'
Y = '\033[93m'
R = '\033[91m'
W = '\033[0m'
I = '\033[1;37;40m'
def args():
parser = argparse.ArgumentParser()
parser.add_argument('domain')
return parser.parse_args()
def banner():
print("""{}
_____ _____ _____
| __ \ |_ _| __ \
| |__) |_____ _| | | |__) |
| _ // _ \ \ / / | | ___/
| | \ \ __/\ V /| |_| |
|_| \_\___| \_/_____|_| {}
{} By @_ayoubfathi_{}
""".format(Y, W, R, W))
#Domain validation
def clean(domain):
for t in _strip:
if t in domain:
print("Usage: python revip.py domain.com")
sys.exit()
else:
pass
# retrieving reverseip domains
def rev(dom):
# YouGetSignal API Endpoint
_api = "https://domains.yougetsignal.com/domains.php"
# POST data
_data = {'remoteAddress': dom}
# Request Headers
_headers = {
'Host': "domains.yougetsignal.com",
'Connection': "keep-alive",
'Cache-Control': "no-cache",
'Origin': "http://www.yougetsignal.com",
'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36",
}
# Response
try:
response = requests.post(
_api,
headers=_headers,
data=_data,
timeout=7).content
_json = json.loads(response)
# parsing domains from response
# if _json['status'] == 'Fail':
#print("Daily reverse IP check limit reached")
# sys.exit(1)
content = _json['domainArray']
print(
"\033[33m\nTotal of domains found: {}\n---------------------------\033[0m\n".format(
_json['domainCount']))
for d, u in content:
print("{}{}{}".format(W, d, W))
except BaseException:
print(
"Usage: python revip.py domain.com\nThere is a problem with {}.".format(dom))
if __name__ == '__main__':
domain = args().domain
banner()
clean(domain)
rev(domain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment