mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 20:51:31 +00:00
God help us all with this Python3 non-sense
This commit is contained in:
@@ -5,10 +5,8 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
import httplib
|
||||
import os
|
||||
import re
|
||||
import urlparse
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
@@ -34,6 +32,8 @@ from lib.parse.sitemap import parseSitemap
|
||||
from lib.request.connect import Connect as Request
|
||||
from thirdparty.beautifulsoup.beautifulsoup import BeautifulSoup
|
||||
from thirdparty.oset.pyoset import oset
|
||||
from thirdparty.six.moves import http_client as _http_client
|
||||
from thirdparty.six.moves import urllib as _urllib
|
||||
|
||||
def crawl(target):
|
||||
try:
|
||||
@@ -70,7 +70,7 @@ def crawl(target):
|
||||
except SqlmapSyntaxException:
|
||||
errMsg = "invalid URL detected. skipping '%s'" % current
|
||||
logger.critical(errMsg)
|
||||
except httplib.InvalidURL as ex:
|
||||
except _http_client.InvalidURL as ex:
|
||||
errMsg = "invalid URL detected ('%s'). skipping " % getSafeExString(ex)
|
||||
errMsg += "URL '%s'" % current
|
||||
logger.critical(errMsg)
|
||||
@@ -96,7 +96,7 @@ def crawl(target):
|
||||
if href:
|
||||
if threadData.lastRedirectURL and threadData.lastRedirectURL[0] == threadData.lastRequestUID:
|
||||
current = threadData.lastRedirectURL[1]
|
||||
url = urlparse.urljoin(current, href)
|
||||
url = _urllib.parse.urljoin(current, href)
|
||||
|
||||
# flag to know if we are dealing with the same target host
|
||||
_ = checkSameHost(url, target)
|
||||
@@ -135,7 +135,7 @@ def crawl(target):
|
||||
if readInput(message, default='N', boolean=True):
|
||||
found = True
|
||||
items = None
|
||||
url = urlparse.urljoin(target, "/sitemap.xml")
|
||||
url = _urllib.parse.urljoin(target, "/sitemap.xml")
|
||||
try:
|
||||
items = parseSitemap(url)
|
||||
except SqlmapConnectionException as ex:
|
||||
|
||||
Reference in New Issue
Block a user