justfortesthtmlshifoucunzai.html,如https://www.bihuoedu.com/vul/sqli/justfortesthtmlshifoucunzai.html,这个时候就跳转到了404页面我们的敏感目录也一样第二种情况:跳转到首页


if errorInject or newResStatusCode == 206 or ((newResStatusCode == 200) & abs(resLength - len(html404_content))<100):#如果别人定义的有404友好页面,也会跳转到友好页面,这时返回的状态码就是200,而我们要排除这种情况 # 获取请求的url print newResStatusCode print resLength print len(html404_content)def html_404_analyze():
url = "http://45.77.224.25:7001/wls-wsat/CoordinatorPortType/justfortesthtmlshifoucunzai.html"
#print url
try:
html_404 = requests.get(url)
print html_404.status_code
print html_404.content
except Exception as e:
print "sorry"
print e
if __name__ == "__main__":
#request_xxe()
html_404_analyze()


dir_black = ['.html', '.gif', '.js', '.css', '.woff', '.jpg', '.png', '.jpeg']#去除图片js css的地址 url = urlparse(url) if url.path.endswith not in dir_black: if url.path.endswith('/'): url = url.scheme + '://' + url.netloc + url.path else: url = url.scheme + '://' + url.netloc + url.path+'/'
url = url.scheme + '://' + url.netloc + "/".join(url.path.split('/')[0:-1])+"/"
if (ResStatusCode !=302 and ResStatusCode!=301):#如果本身就是一个跳转的页面,我们就不管了