mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-31 18:39:46 +03:00
add code to handle the situation that only using js to redirect
This commit is contained in:
parent
20acf915c0
commit
b850641e85
|
@ -142,8 +142,16 @@ def _search(dork):
|
||||||
try:
|
try:
|
||||||
r = requests.get(baidu_link, timeout=10)
|
r = requests.get(baidu_link, timeout=10)
|
||||||
if r and r.status_code == 200:
|
if r and r.status_code == 200:
|
||||||
logger.info(r.url)
|
# baidu will just use Javascript to redirect the page rather than responding a 302 HTTP code.
|
||||||
retVal.append(r.url)
|
if r.history:
|
||||||
|
logger.info(r.url)
|
||||||
|
retVal.append(r.url)
|
||||||
|
else:
|
||||||
|
m = re.search('<script>window\.location\.replace\("(?P<url>.+?)"\)', r.content, re.I)
|
||||||
|
if m:
|
||||||
|
url = m.group('url')
|
||||||
|
logger.info(url)
|
||||||
|
retVal.append(url)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.debug(e.message)
|
logger.debug(e.message)
|
||||||
retVal = _remove_duplicate(retVal)
|
retVal = _remove_duplicate(retVal)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user