mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-23 15:54:24 +03:00
Fix for an Issue #889
This commit is contained in:
parent
4e0e64d06b
commit
baf9ada28d
|
@ -5,11 +5,13 @@ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
|
|||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
import httplib
|
||||
import re
|
||||
|
||||
from lib.core.common import readInput
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from lib.request.connect import Connect as Request
|
||||
from thirdparty.oset.pyoset import oset
|
||||
|
||||
|
@ -26,8 +28,13 @@ def parseSitemap(url, retVal=None):
|
|||
abortedFlag = False
|
||||
retVal = oset()
|
||||
|
||||
content = Request.getPage(url=url, raise404=True)[0] if not abortedFlag else ""
|
||||
for match in re.finditer(r"<loc>\s*([^<]+)", content):
|
||||
try:
|
||||
content = Request.getPage(url=url, raise404=True)[0] if not abortedFlag else ""
|
||||
except httplib.InvalidURL:
|
||||
errMsg = "invalid URL given for sitemap ('%s')" % url
|
||||
raise SqlmapSyntaxException, errMsg
|
||||
|
||||
for match in re.finditer(r"<loc>\s*([^<]+)", content or ""):
|
||||
if abortedFlag:
|
||||
break
|
||||
url = match.group(1).strip()
|
||||
|
|
Loading…
Reference in New Issue
Block a user