mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-02 20:54:13 +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
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import httplib
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from lib.core.common import readInput
|
from lib.core.common import readInput
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
|
from lib.core.exception import SqlmapSyntaxException
|
||||||
from lib.request.connect import Connect as Request
|
from lib.request.connect import Connect as Request
|
||||||
from thirdparty.oset.pyoset import oset
|
from thirdparty.oset.pyoset import oset
|
||||||
|
|
||||||
|
@ -26,8 +28,13 @@ def parseSitemap(url, retVal=None):
|
||||||
abortedFlag = False
|
abortedFlag = False
|
||||||
retVal = oset()
|
retVal = oset()
|
||||||
|
|
||||||
content = Request.getPage(url=url, raise404=True)[0] if not abortedFlag else ""
|
try:
|
||||||
for match in re.finditer(r"<loc>\s*([^<]+)", content):
|
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:
|
if abortedFlag:
|
||||||
break
|
break
|
||||||
url = match.group(1).strip()
|
url = match.group(1).strip()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user