Minor patch

This commit is contained in:
Miroslav Stampar
2019-01-08 12:58:27 +01:00
parent 02b78d2691
commit 49514adcd9
3 changed files with 16 additions and 5 deletions

View File

@@ -11,12 +11,17 @@ import httplib
import inspect
import os
import re
import socket
import ssl
import subprocess
import sys
import urllib2
sys.dont_write_bytecode = True
if hasattr(ssl, "_create_unverified_context"):
ssl._create_default_https_context = ssl._create_unverified_context
NAME, VERSION, AUTHOR = "WAF Detectify", "0.1", "sqlmap developers (@sqlmap)"
TIMEOUT = 10
HEADERS = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "identity", "Cache-Control": "max-age=0"}
@@ -101,14 +106,20 @@ def main():
print colorize("[i] checking '%s'..." % sys.argv[1])
hostname = sys.argv[1].split("//")[-1].split('/')[0]
try:
socket.getaddrinfo(hostname, None)
except socket.gaierror:
print colorize("[x] host '%s' does not exist" % hostname)
exit(1)
found = False
for function, product in WAF_FUNCTIONS:
if found and "unknown" in product.lower():
continue
if function(get_page):
print colorize("[!] WAF/IPS identified as '%s'" % product)
found = True
exit(colorize("[!] WAF/IPS identified as '%s'" % product))
if not found:
print colorize("[o] nothing found")