Skip to content

Instantly share code, notes, and snippets.

@si9int
Created March 23, 2020 07:59
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save si9int/f20da59193e0a3d8c625e7fa3eabd0c6 to your computer and use it in GitHub Desktop.
Save si9int/f20da59193e0a3d8c625e7fa3eabd0c6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import requests, sys
requests.packages.urllib3.disable_warnings()
try:
target = sys.argv[1]
method = sys.argv[2]
except:
print('[!] Usage: python3 check_ip.py <domain/ip> <http/https>')
sys.exit()
x_headers = [
'X-Originating-IP',
'X-Forwarded-For',
'X-Remote-IP',
'X-Remote-Addr',
'X-Client-IP',
'X-Host',
'X-Forwared-Host',
]
for x in x_headers:
header = {
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Cache-Control' : 'no-cache',
'User-Agent' : 'Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0',
'Connection' : 'close',
x : target
}
res = requests.get('{}://{}'.format(method, target), headers=header, timeout=3, verify=False)
print('[-] {} | {}\t| response-size: {}'.format(res.status_code, x, len(res.text)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment