From e76995bd6a15acee16481d39585ddc3018a6d7af Mon Sep 17 00:00:00 2001 From: Maxim Karasev Date: Sat, 6 Aug 2022 20:44:51 +0300 Subject: [PATCH] reduce amount of third party dependencies --- lib/controller/checks.py | 4 ++-- lib/core/agent.py | 2 +- lib/core/common.py | 26 ++++++++++++------------- lib/core/convert.py | 6 +++--- lib/core/datatype.py | 4 ++-- lib/core/dump.py | 4 ++-- lib/core/gui.py | 10 +++++----- lib/core/option.py | 12 ++++++------ lib/core/patch.py | 8 ++++---- lib/core/settings.py | 4 ++-- lib/core/target.py | 6 +++--- lib/core/update.py | 2 +- lib/core/wordlist.py | 2 +- lib/parse/cmdline.py | 2 +- lib/parse/sitemap.py | 2 +- lib/request/basic.py | 10 +++++----- lib/request/basicauthhandler.py | 2 +- lib/request/chunkedhandler.py | 2 +- lib/request/comparison.py | 2 +- lib/request/connect.py | 10 +++++----- lib/request/httpshandler.py | 4 ++-- lib/request/inject.py | 2 +- lib/request/methodrequest.py | 2 +- lib/request/pkihandler.py | 4 ++-- lib/request/rangehandler.py | 2 +- lib/request/redirecthandler.py | 4 ++-- lib/takeover/abstraction.py | 2 +- lib/takeover/metasploit.py | 2 +- lib/takeover/web.py | 2 +- lib/techniques/error/use.py | 2 +- lib/techniques/union/use.py | 4 ++-- lib/utils/api.py | 24 +++++++++++------------ lib/utils/crawler.py | 8 ++++---- lib/utils/har.py | 4 ++-- lib/utils/hash.py | 10 +++++----- lib/utils/hashdb.py | 2 +- lib/utils/httpd.py | 10 +++++----- lib/utils/pivotdumptable.py | 2 +- lib/utils/purge.py | 2 +- lib/utils/search.py | 4 ++-- lib/utils/sqlalchemy.py | 2 +- plugins/dbms/maxdb/enumeration.py | 4 ++-- plugins/dbms/mssqlserver/enumeration.py | 2 +- plugins/dbms/sybase/enumeration.py | 4 ++-- plugins/generic/custom.py | 2 +- plugins/generic/databases.py | 2 +- plugins/generic/entries.py | 4 ++-- plugins/generic/search.py | 2 +- plugins/generic/users.py | 2 +- thirdparty/multipart/multipartpost.py | 2 +- 50 files changed, 121 insertions(+), 121 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index f80cdfd27..3f2acec2d 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -103,8 +103,8 @@ from lib.request.inject import checkBooleanExpression from lib.request.templates import getPageTemplate from lib.techniques.union.test import unionTest from lib.techniques.union.use import configUnion -from thirdparty import six -from thirdparty.six.moves import http_client as _http_client +import six +from six.moves import http_client as _http_client def checkSqlInjection(place, parameter, value): # Store here the details about boundaries and payload used to diff --git a/lib/core/agent.py b/lib/core/agent.py index 24c498e6d..8656d6fac 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -57,7 +57,7 @@ from lib.core.settings import SINGLE_QUOTE_MARKER from lib.core.settings import SLEEP_TIME_MARKER from lib.core.settings import UNICODE_ENCODING from lib.core.unescaper import unescaper -from thirdparty import six +import six class Agent(object): """ diff --git a/lib/core/common.py b/lib/core/common.py index 4ea6f7a46..ac1649711 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -187,21 +187,21 @@ from lib.core.settings import WEBSCARAB_SPLITTER from lib.core.threads import getCurrentThreadData from lib.utils.safe2bin import safecharencode from lib.utils.sqlalchemy import _sqlalchemy -from thirdparty import six +import six from thirdparty.clientform.clientform import ParseResponse from thirdparty.clientform.clientform import ParseError -from thirdparty.colorama.initialise import init as coloramainit -from thirdparty.magic import magic -from thirdparty.odict import OrderedDict -from thirdparty.six import unichr as _unichr -from thirdparty.six.moves import collections_abc as _collections -from thirdparty.six.moves import configparser as _configparser -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import input as _input -from thirdparty.six.moves import reload_module as _reload_module -from thirdparty.six.moves import urllib as _urllib -from thirdparty.six.moves import zip as _zip -from thirdparty.termcolor.termcolor import colored +from colorama.initialise import init as coloramainit +import magic +from collections import OrderedDict +from six import unichr as _unichr +from six.moves import collections_abc as _collections +from six.moves import configparser as _configparser +from six.moves import http_client as _http_client +from six.moves import input as _input +from six.moves import reload_module as _reload_module +from six.moves import urllib as _urllib +from six.moves import zip as _zip +from termcolor import colored class UnicodeRawConfigParser(_configparser.RawConfigParser): """ diff --git a/lib/core/convert.py b/lib/core/convert.py index 4e7d02b62..488f49760 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -28,9 +28,9 @@ from lib.core.settings import NULL from lib.core.settings import PICKLE_PROTOCOL from lib.core.settings import SAFE_HEX_MARKER from lib.core.settings import UNICODE_ENCODING -from thirdparty import six -from thirdparty.six import unichr as _unichr -from thirdparty.six.moves import collections_abc as _collections +import six +from six import unichr as _unichr +from six.moves import collections_abc as _collections try: from html import escape as htmlEscape diff --git a/lib/core/datatype.py b/lib/core/datatype.py index 66dd10314..9d3267935 100644 --- a/lib/core/datatype.py +++ b/lib/core/datatype.py @@ -8,8 +8,8 @@ See the file 'LICENSE' for copying permission import copy import types -from thirdparty.odict import OrderedDict -from thirdparty.six.moves import collections_abc as _collections +from collections import OrderedDict +from six.moves import collections_abc as _collections class AttribDict(dict): """ diff --git a/lib/core/dump.py b/lib/core/dump.py index d155ebae1..5a01c5a8b 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -56,8 +56,8 @@ from lib.core.settings import UNSAFE_DUMP_FILEPATH_REPLACEMENT from lib.core.settings import VERSION_STRING from lib.core.settings import WINDOWS_RESERVED_NAMES from lib.utils.safe2bin import safechardecode -from thirdparty import six -from thirdparty.magic import magic +import six +import magic class Dump(object): """ diff --git a/lib/core/gui.py b/lib/core/gui.py index 6b839eca3..204f838d9 100644 --- a/lib/core/gui.py +++ b/lib/core/gui.py @@ -28,7 +28,7 @@ from lib.core.settings import GIT_PAGE from lib.core.settings import SITE from lib.core.settings import VERSION_STRING from lib.core.settings import WIKI_PAGE -from thirdparty.six.moves import queue as _queue +from six.moves import queue as _queue alive = None line = "" @@ -37,10 +37,10 @@ queue = None def runGui(parser): try: - from thirdparty.six.moves import tkinter as _tkinter - from thirdparty.six.moves import tkinter_scrolledtext as _tkinter_scrolledtext - from thirdparty.six.moves import tkinter_ttk as _tkinter_ttk - from thirdparty.six.moves import tkinter_messagebox as _tkinter_messagebox + from six.moves import tkinter as _tkinter + from six.moves import tkinter_scrolledtext as _tkinter_scrolledtext + from six.moves import tkinter_ttk as _tkinter_ttk + from six.moves import tkinter_messagebox as _tkinter_messagebox except ImportError as ex: raise SqlmapMissingDependence("missing dependence ('%s')" % getSafeExString(ex)) diff --git a/lib/core/option.py b/lib/core/option.py index 93a0ce40e..9c8233dc6 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -151,13 +151,13 @@ from lib.utils.deps import checkDependencies from lib.utils.har import HTTPCollectorFactory from lib.utils.purge import purge from lib.utils.search import search -from thirdparty import six -from thirdparty.keepalive import keepalive +import six +import keepalive from thirdparty.multipart import multipartpost -from thirdparty.six.moves import collections_abc as _collections -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import http_cookiejar as _http_cookiejar -from thirdparty.six.moves import urllib as _urllib +from six.moves import collections_abc as _collections +from six.moves import http_client as _http_client +from six.moves import http_cookiejar as _http_cookiejar +from six.moves import urllib as _urllib from thirdparty.socks import socks from xml.etree.ElementTree import ElementTree diff --git a/lib/core/patch.py b/lib/core/patch.py index ca333bc96..fe9930910 100644 --- a/lib/core/patch.py +++ b/lib/core/patch.py @@ -20,7 +20,7 @@ import lib.request.connect import lib.utils.search import lib.utils.sqlalchemy import thirdparty.ansistrm.ansistrm -import thirdparty.chardet.universaldetector +import chardet.universaldetector from lib.core.common import filterNone from lib.core.common import getSafeExString @@ -37,8 +37,8 @@ from lib.core.option import _setHTTPHandlers from lib.core.option import setVerbosity from lib.core.settings import IS_WIN from lib.request.templates import getPageTemplate -from thirdparty import six -from thirdparty.six.moves import http_client as _http_client +import six +from six.moves import http_client as _http_client _rand = 0 @@ -78,7 +78,7 @@ def dirtyPatches(): _http_client.LineAndFileWrapper.readline = _ # to prevent too much "guessing" in case of binary data retrieval - thirdparty.chardet.universaldetector.MINIMUM_THRESHOLD = 0.90 + chardet.universaldetector.MINIMUM_THRESHOLD = 0.90 match = re.search(r" --method[= ](\w+)", " ".join(sys.argv)) if match and match.group(1).upper() != PLACE.POST: diff --git a/lib/core/settings.py b/lib/core/settings.py index 1f1f80a53..0a8c08c22 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -16,8 +16,8 @@ import time from lib.core.enums import DBMS from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS -from thirdparty import six -from thirdparty.six import unichr as _unichr +import six +from six import unichr as _unichr # sqlmap version (...) VERSION = "1.6.8.1" diff --git a/lib/core/target.py b/lib/core/target.py index c47b45130..12388c207 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -78,9 +78,9 @@ from lib.core.settings import USER_AGENT_ALIASES from lib.core.settings import XML_RECOGNITION_REGEX from lib.core.threads import getCurrentThreadData from lib.utils.hashdb import HashDB -from thirdparty import six -from thirdparty.odict import OrderedDict -from thirdparty.six.moves import urllib as _urllib +import six +from collections import OrderedDict +from six.moves import urllib as _urllib def _setRequestParams(): """ diff --git a/lib/core/update.py b/lib/core/update.py index d85a39f06..00dc4e657 100644 --- a/lib/core/update.py +++ b/lib/core/update.py @@ -30,7 +30,7 @@ from lib.core.settings import IS_WIN from lib.core.settings import VERSION from lib.core.settings import TYPE from lib.core.settings import ZIPBALL_PAGE -from thirdparty.six.moves import urllib as _urllib +from six.moves import urllib as _urllib def update(): if not conf.updateAll: diff --git a/lib/core/wordlist.py b/lib/core/wordlist.py index b634ed53f..c0ea750bb 100644 --- a/lib/core/wordlist.py +++ b/lib/core/wordlist.py @@ -11,7 +11,7 @@ from lib.core.common import getSafeExString from lib.core.common import isZipFile from lib.core.exception import SqlmapDataException from lib.core.exception import SqlmapInstallationException -from thirdparty import six +import six class Wordlist(six.Iterator): """ diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 6409fea28..b4f2ccac4 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -92,7 +92,7 @@ from lib.core.shell import autoCompletion from lib.core.shell import clearHistory from lib.core.shell import loadHistory from lib.core.shell import saveHistory -from thirdparty.six.moves import input as _input +from six.moves import input as _input def cmdLineParser(argv=None): """ diff --git a/lib/parse/sitemap.py b/lib/parse/sitemap.py index 452f894e8..6092aa6e1 100644 --- a/lib/parse/sitemap.py +++ b/lib/parse/sitemap.py @@ -13,7 +13,7 @@ from lib.core.data import logger from lib.core.datatype import OrderedSet from lib.core.exception import SqlmapSyntaxException from lib.request.connect import Connect as Request -from thirdparty.six.moves import http_client as _http_client +from six.moves import http_client as _http_client abortedFlag = None diff --git a/lib/request/basic.py b/lib/request/basic.py index 7d06009e9..531b5f142 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -54,12 +54,12 @@ from lib.core.settings import UNICODE_ENCODING from lib.core.settings import VIEWSTATE_REGEX from lib.parse.headers import headersParser from lib.parse.html import htmlParser -from thirdparty import six -from thirdparty.chardet import detect +import six +from chardet import detect from thirdparty.identywaf import identYwaf -from thirdparty.odict import OrderedDict -from thirdparty.six import unichr as _unichr -from thirdparty.six.moves import http_client as _http_client +from collections import OrderedDict +from six import unichr as _unichr +from six.moves import http_client as _http_client @lockedmethod def forgeHeaders(items=None, base=None): diff --git a/lib/request/basicauthhandler.py b/lib/request/basicauthhandler.py index 440e918df..929cf2044 100644 --- a/lib/request/basicauthhandler.py +++ b/lib/request/basicauthhandler.py @@ -5,7 +5,7 @@ Copyright (c) 2006-2022 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ -from thirdparty.six.moves import urllib as _urllib +from six.moves import urllib as _urllib class SmartHTTPBasicAuthHandler(_urllib.request.HTTPBasicAuthHandler): """ diff --git a/lib/request/chunkedhandler.py b/lib/request/chunkedhandler.py index 51f80aee4..9a5c92713 100644 --- a/lib/request/chunkedhandler.py +++ b/lib/request/chunkedhandler.py @@ -7,7 +7,7 @@ See the file 'LICENSE' for copying permission from lib.core.data import conf from lib.core.enums import HTTP_HEADER -from thirdparty.six.moves import urllib as _urllib +from six.moves import urllib as _urllib class ChunkedHandler(_urllib.request.HTTPHandler): """ diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 261aacf14..9debdd481 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -32,7 +32,7 @@ from lib.core.settings import REFLECTED_VALUE_MARKER from lib.core.settings import UPPER_RATIO_BOUND from lib.core.settings import URI_HTTP_HEADER from lib.core.threads import getCurrentThreadData -from thirdparty import six +import six def comparison(page, headers, code=None, getRatioValue=False, pageLength=None): _ = _adjust(_comparison(page, headers, code, getRatioValue, pageLength), getRatioValue) diff --git a/lib/request/connect.py b/lib/request/connect.py index 0e6eae9b5..73b72b719 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -136,11 +136,11 @@ from lib.request.comparison import comparison from lib.request.direct import direct from lib.request.methodrequest import MethodRequest from lib.utils.safe2bin import safecharencode -from thirdparty import six -from thirdparty.odict import OrderedDict -from thirdparty.six import unichr as _unichr -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import urllib as _urllib +import six +from collections import OrderedDict +from six import unichr as _unichr +from six.moves import http_client as _http_client +from six.moves import urllib as _urllib from thirdparty.socks.socks import ProxyError class Connect(object): diff --git a/lib/request/httpshandler.py b/lib/request/httpshandler.py index 8f01f74bd..8cccb7ace 100644 --- a/lib/request/httpshandler.py +++ b/lib/request/httpshandler.py @@ -17,8 +17,8 @@ from lib.core.data import kb from lib.core.data import logger from lib.core.exception import SqlmapConnectionException from lib.core.settings import PYVERSION -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import urllib as _urllib +from six.moves import http_client as _http_client +from six.moves import urllib as _urllib ssl = None try: diff --git a/lib/request/inject.py b/lib/request/inject.py index 7d584e8be..532169f4e 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -66,7 +66,7 @@ from lib.techniques.dns.test import dnsTest from lib.techniques.dns.use import dnsUse from lib.techniques.error.use import errorUse from lib.techniques.union.use import unionUse -from thirdparty import six +import six def _goDns(payload, expression): value = None diff --git a/lib/request/methodrequest.py b/lib/request/methodrequest.py index 92dacdb5d..380d736ac 100644 --- a/lib/request/methodrequest.py +++ b/lib/request/methodrequest.py @@ -6,7 +6,7 @@ See the file 'LICENSE' for copying permission """ from lib.core.convert import getText -from thirdparty.six.moves import urllib as _urllib +from six.moves import urllib as _urllib class MethodRequest(_urllib.request.Request): """ diff --git a/lib/request/pkihandler.py b/lib/request/pkihandler.py index dc7dca40a..61ce6c23a 100644 --- a/lib/request/pkihandler.py +++ b/lib/request/pkihandler.py @@ -8,8 +8,8 @@ See the file 'LICENSE' for copying permission from lib.core.data import conf from lib.core.common import getSafeExString from lib.core.exception import SqlmapConnectionException -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import urllib as _urllib +from six.moves import http_client as _http_client +from six.moves import urllib as _urllib class HTTPSPKIAuthHandler(_urllib.request.HTTPSHandler): def __init__(self, auth_file): diff --git a/lib/request/rangehandler.py b/lib/request/rangehandler.py index 458c32ec2..1096d2c2d 100644 --- a/lib/request/rangehandler.py +++ b/lib/request/rangehandler.py @@ -6,7 +6,7 @@ See the file 'LICENSE' for copying permission """ from lib.core.exception import SqlmapConnectionException -from thirdparty.six.moves import urllib as _urllib +from six.moves import urllib as _urllib class HTTPRangeHandler(_urllib.request.BaseHandler): """ diff --git a/lib/request/redirecthandler.py b/lib/request/redirecthandler.py index 2e3c393f3..6efc3bafb 100644 --- a/lib/request/redirecthandler.py +++ b/lib/request/redirecthandler.py @@ -31,8 +31,8 @@ from lib.core.settings import MAX_TOTAL_REDIRECTIONS from lib.core.threads import getCurrentThreadData from lib.request.basic import decodePage from lib.request.basic import parseResponse -from thirdparty import six -from thirdparty.six.moves import urllib as _urllib +import six +from six.moves import urllib as _urllib class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler): def _get_header_redirect(self, headers): diff --git a/lib/takeover/abstraction.py b/lib/takeover/abstraction.py index bb2faf01e..e41240213 100644 --- a/lib/takeover/abstraction.py +++ b/lib/takeover/abstraction.py @@ -29,7 +29,7 @@ from lib.takeover.udf import UDF from lib.takeover.web import Web from lib.takeover.xp_cmdshell import XP_cmdshell from lib.utils.safe2bin import safechardecode -from thirdparty.six.moves import input as _input +from six.moves import input as _input class Abstraction(Web, UDF, XP_cmdshell): """ diff --git a/lib/takeover/metasploit.py b/lib/takeover/metasploit.py index b322fc44c..e344cdf5c 100644 --- a/lib/takeover/metasploit.py +++ b/lib/takeover/metasploit.py @@ -49,7 +49,7 @@ from lib.core.subprocessng import blockingWriteToFD from lib.core.subprocessng import Popen as execute from lib.core.subprocessng import send_all from lib.core.subprocessng import recv_some -from thirdparty import six +import six if IS_WIN: import msvcrt diff --git a/lib/takeover/web.py b/lib/takeover/web.py index 93cb79f23..716285e98 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -57,7 +57,7 @@ from lib.core.settings import SHELL_RUNCMD_EXE_TAG from lib.core.settings import SHELL_WRITABLE_DIR_TAG from lib.core.settings import VIEWSTATE_REGEX from lib.request.connect import Connect as Request -from thirdparty.six.moves import urllib as _urllib +from six.moves import urllib as _urllib class Web(object): """ diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index 078c04b4e..920b6c08f 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -60,7 +60,7 @@ from lib.core.unescaper import unescaper from lib.request.connect import Connect as Request from lib.utils.progress import ProgressBar from lib.utils.safe2bin import safecharencode -from thirdparty import six +import six def _oneShotErrorUse(expression, field=None, chunkTest=False): offset = 1 diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index b77cc646d..40f75c691 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -59,8 +59,8 @@ from lib.core.unescaper import unescaper from lib.request.connect import Connect as Request from lib.utils.progress import ProgressBar from lib.utils.safe2bin import safecharencode -from thirdparty import six -from thirdparty.odict import OrderedDict +import six +from collections import OrderedDict def _oneShotUnionUse(expression, unpack=True, limited=False): retVal = hashDBRetrieve("%s%s" % (conf.hexConvert or False, expression), checkConf=True) # as UNION data is stored raw unconverted diff --git a/lib/utils/api.py b/lib/utils/api.py index 363b5bea2..4a70dd79d 100644 --- a/lib/utils/api.py +++ b/lib/utils/api.py @@ -55,18 +55,18 @@ from lib.core.settings import VERSION_STRING from lib.core.shell import autoCompletion from lib.core.subprocessng import Popen from lib.parse.cmdline import cmdLineParser -from thirdparty.bottle.bottle import error as return_error -from thirdparty.bottle.bottle import get -from thirdparty.bottle.bottle import hook -from thirdparty.bottle.bottle import post -from thirdparty.bottle.bottle import request -from thirdparty.bottle.bottle import response -from thirdparty.bottle.bottle import run -from thirdparty.bottle.bottle import server_names -from thirdparty import six -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import input as _input -from thirdparty.six.moves import urllib as _urllib +from bottle import error as return_error +from bottle import get +from bottle import hook +from bottle import post +from bottle import request +from bottle import response +from bottle import run +from bottle import server_names +import six +from six.moves import http_client as _http_client +from six.moves import input as _input +from six.moves import urllib as _urllib # Global data storage class DataStore(object): diff --git a/lib/utils/crawler.py b/lib/utils/crawler.py index 021514541..4354a2bcd 100644 --- a/lib/utils/crawler.py +++ b/lib/utils/crawler.py @@ -36,10 +36,10 @@ from lib.core.threads import getCurrentThreadData from lib.core.threads import runThreads from lib.parse.sitemap import parseSitemap from lib.request.connect import Connect as Request -from thirdparty import six -from thirdparty.beautifulsoup.beautifulsoup import BeautifulSoup -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import urllib as _urllib +import six +from bs4 import BeautifulSoup +from six.moves import http_client as _http_client +from six.moves import urllib as _urllib def crawl(target, post=None, cookie=None): if not target: diff --git a/lib/utils/har.py b/lib/utils/har.py index c7bbc6743..2bff6542a 100644 --- a/lib/utils/har.py +++ b/lib/utils/har.py @@ -15,8 +15,8 @@ from lib.core.bigarray import BigArray from lib.core.convert import getBytes from lib.core.convert import getText from lib.core.settings import VERSION -from thirdparty.six.moves import BaseHTTPServer as _BaseHTTPServer -from thirdparty.six.moves import http_client as _http_client +from six.moves import BaseHTTPServer as _BaseHTTPServer +from six.moves import http_client as _http_client # Reference: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html # http://www.softwareishard.com/har/viewer/ diff --git a/lib/utils/hash.py b/lib/utils/hash.py index b716a54fa..c831be03e 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -16,8 +16,8 @@ try: from Crypto.Cipher.DES import MODE_CBC as CBC from Crypto.Cipher.DES import new as des except: - from thirdparty.pydes.pyDes import CBC - from thirdparty.pydes.pyDes import des + from pyDes import CBC + from pyDes import des _multiprocessing = None @@ -85,9 +85,9 @@ from lib.core.settings import NULL from lib.core.settings import ROTATING_CHARS from lib.core.settings import UNICODE_ENCODING from lib.core.wordlist import Wordlist -from thirdparty import six -from thirdparty.colorama.initialise import init as coloramainit -from thirdparty.six.moves import queue as _queue +import six +from colorama.initialise import init as coloramainit +from six.moves import queue as _queue def mysql_passwd(password, uppercase=True): """ diff --git a/lib/utils/hashdb.py b/lib/utils/hashdb.py index 128720dd1..f1e70e09b 100644 --- a/lib/utils/hashdb.py +++ b/lib/utils/hashdb.py @@ -26,7 +26,7 @@ from lib.core.settings import HASHDB_FLUSH_THRESHOLD from lib.core.settings import HASHDB_RETRIEVE_RETRIES from lib.core.threads import getCurrentThreadData from lib.core.threads import getCurrentThreadName -from thirdparty import six +import six class HashDB(object): def __init__(self, filepath): diff --git a/lib/utils/httpd.py b/lib/utils/httpd.py index 546cca4de..e30bc63bb 100644 --- a/lib/utils/httpd.py +++ b/lib/utils/httpd.py @@ -21,11 +21,11 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ". from lib.core.enums import HTTP_HEADER from lib.core.settings import UNICODE_ENCODING from lib.core.settings import VERSION_STRING -from thirdparty import six -from thirdparty.six.moves import BaseHTTPServer as _BaseHTTPServer -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import socketserver as _socketserver -from thirdparty.six.moves import urllib as _urllib +import six +from six.moves import BaseHTTPServer as _BaseHTTPServer +from six.moves import http_client as _http_client +from six.moves import socketserver as _socketserver +from six.moves import urllib as _urllib HTTP_ADDRESS = "0.0.0.0" HTTP_PORT = 8951 diff --git a/lib/utils/pivotdumptable.py b/lib/utils/pivotdumptable.py index a36ab80e8..9f9fa83a5 100644 --- a/lib/utils/pivotdumptable.py +++ b/lib/utils/pivotdumptable.py @@ -34,7 +34,7 @@ from lib.core.settings import SINGLE_QUOTE_MARKER from lib.core.unescaper import unescaper from lib.request import inject from lib.utils.safe2bin import safechardecode -from thirdparty.six import unichr as _unichr +from six import unichr as _unichr def pivotDumpTable(table, colList, count=None, blind=True, alias=None): lengths = {} diff --git a/lib/utils/purge.py b/lib/utils/purge.py index 327261469..d81bf27ce 100644 --- a/lib/utils/purge.py +++ b/lib/utils/purge.py @@ -17,7 +17,7 @@ from lib.core.common import openFile from lib.core.compat import xrange from lib.core.convert import getUnicode from lib.core.data import logger -from thirdparty.six import unichr as _unichr +from six import unichr as _unichr def purge(directory): """ diff --git a/lib/utils/search.py b/lib/utils/search.py index 2b4a12b97..448de1749 100644 --- a/lib/utils/search.py +++ b/lib/utils/search.py @@ -33,8 +33,8 @@ from lib.core.settings import GOOGLE_REGEX from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE from lib.core.settings import UNICODE_ENCODING from lib.request.basic import decodePage -from thirdparty.six.moves import http_client as _http_client -from thirdparty.six.moves import urllib as _urllib +from six.moves import http_client as _http_client +from six.moves import urllib as _urllib from thirdparty.socks import socks def _search(dork): diff --git a/lib/utils/sqlalchemy.py b/lib/utils/sqlalchemy.py index be67316d8..a78fe2350 100644 --- a/lib/utils/sqlalchemy.py +++ b/lib/utils/sqlalchemy.py @@ -38,7 +38,7 @@ from lib.core.exception import SqlmapConnectionException from lib.core.exception import SqlmapFilePathException from lib.core.exception import SqlmapMissingDependence from plugins.generic.connector import Connector as GenericConnector -from thirdparty import six +import six def getSafeExString(ex, encoding=None): # Cross-referenced function raise NotImplementedError diff --git a/plugins/dbms/maxdb/enumeration.py b/plugins/dbms/maxdb/enumeration.py index f6dcf2042..3eb759b09 100644 --- a/plugins/dbms/maxdb/enumeration.py +++ b/plugins/dbms/maxdb/enumeration.py @@ -26,8 +26,8 @@ from lib.core.settings import CURRENT_DB from lib.utils.brute import columnExists from lib.utils.pivotdumptable import pivotDumpTable from plugins.generic.enumeration import Enumeration as GenericEnumeration -from thirdparty import six -from thirdparty.six.moves import zip as _zip +import six +from six.moves import zip as _zip class Enumeration(GenericEnumeration): def __init__(self): diff --git a/plugins/dbms/mssqlserver/enumeration.py b/plugins/dbms/mssqlserver/enumeration.py index 6654fe67b..ca2e1a92b 100644 --- a/plugins/dbms/mssqlserver/enumeration.py +++ b/plugins/dbms/mssqlserver/enumeration.py @@ -32,7 +32,7 @@ from lib.core.exception import SqlmapNoneDataException from lib.core.settings import CURRENT_DB from lib.request import inject from plugins.generic.enumeration import Enumeration as GenericEnumeration -from thirdparty import six +import six class Enumeration(GenericEnumeration): def getPrivileges(self, *args, **kwargs): diff --git a/plugins/dbms/sybase/enumeration.py b/plugins/dbms/sybase/enumeration.py index dda39514a..7ca3dc85d 100644 --- a/plugins/dbms/sybase/enumeration.py +++ b/plugins/dbms/sybase/enumeration.py @@ -29,8 +29,8 @@ from lib.core.settings import CURRENT_DB from lib.utils.brute import columnExists from lib.utils.pivotdumptable import pivotDumpTable from plugins.generic.enumeration import Enumeration as GenericEnumeration -from thirdparty import six -from thirdparty.six.moves import zip as _zip +import six +from six.moves import zip as _zip class Enumeration(GenericEnumeration): def getUsers(self): diff --git a/plugins/generic/custom.py b/plugins/generic/custom.py index 3002c0da1..fa945d24c 100644 --- a/plugins/generic/custom.py +++ b/plugins/generic/custom.py @@ -26,7 +26,7 @@ from lib.core.settings import NULL from lib.core.settings import PARAMETER_SPLITTING_REGEX from lib.core.shell import autoCompletion from lib.request import inject -from thirdparty.six.moves import input as _input +from six.moves import input as _input class Custom(object): """ diff --git a/plugins/generic/databases.py b/plugins/generic/databases.py index 32cfe28f0..8553779e5 100644 --- a/plugins/generic/databases.py +++ b/plugins/generic/databases.py @@ -55,7 +55,7 @@ from lib.core.settings import VERTICA_DEFAULT_SCHEMA from lib.request import inject from lib.utils.brute import columnExists from lib.utils.brute import tableExists -from thirdparty import six +import six class Databases(object): """ diff --git a/plugins/generic/entries.py b/plugins/generic/entries.py index 365fad204..53649da1a 100644 --- a/plugins/generic/entries.py +++ b/plugins/generic/entries.py @@ -49,8 +49,8 @@ from lib.core.settings import UPPER_CASE_DBMSES from lib.request import inject from lib.utils.hash import attackDumpedTable from lib.utils.pivotdumptable import pivotDumpTable -from thirdparty import six -from thirdparty.six.moves import zip as _zip +import six +from six.moves import zip as _zip class Entries(object): """ diff --git a/plugins/generic/search.py b/plugins/generic/search.py index 12195a161..2e84b8794 100644 --- a/plugins/generic/search.py +++ b/plugins/generic/search.py @@ -38,7 +38,7 @@ from lib.core.settings import UPPER_CASE_DBMSES from lib.request import inject from lib.utils.brute import columnExists from lib.utils.brute import tableExists -from thirdparty import six +import six class Search(object): """ diff --git a/plugins/generic/users.py b/plugins/generic/users.py index 0b658f2b0..13a4a4a6f 100644 --- a/plugins/generic/users.py +++ b/plugins/generic/users.py @@ -47,7 +47,7 @@ from lib.request import inject from lib.utils.hash import attackCachedUsersPasswords from lib.utils.hash import storeHashesToFile from lib.utils.pivotdumptable import pivotDumpTable -from thirdparty.six.moves import zip as _zip +from six.moves import zip as _zip class Users(object): """ diff --git a/thirdparty/multipart/multipartpost.py b/thirdparty/multipart/multipartpost.py index 5ea37ccf7..e47a8576f 100644 --- a/thirdparty/multipart/multipartpost.py +++ b/thirdparty/multipart/multipartpost.py @@ -30,7 +30,7 @@ import sys from lib.core.compat import choose_boundary from lib.core.convert import getBytes from lib.core.exception import SqlmapDataException -from thirdparty.six.moves import urllib as _urllib +from six.moves import urllib as _urllib # Controls how sequences are uncoded. If true, elements may be given # multiple values by assigning a sequence. -- 2.37.1