mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 06:01:29 +00:00
removing of unused imports together with some general code refactoring
This commit is contained in:
@@ -10,7 +10,6 @@ See the file 'doc/COPYING' for copying permission
|
||||
import codecs
|
||||
import gzip
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import StringIO
|
||||
import zlib
|
||||
@@ -19,8 +18,6 @@ from extra.chardet import detect
|
||||
from lib.core.common import extractErrorMessage
|
||||
from lib.core.common import extractRegexResult
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import isWindowsDriveLetterPath
|
||||
from lib.core.common import posixToNtSlashes
|
||||
from lib.core.common import readInput
|
||||
from lib.core.common import singleTimeLogMessage
|
||||
from lib.core.data import conf
|
||||
@@ -28,12 +25,10 @@ from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import HTTPHEADER
|
||||
from lib.core.enums import PLACE
|
||||
from lib.core.exception import sqlmapDataException
|
||||
from lib.core.settings import DEFAULT_COOKIE_DELIMITER
|
||||
from lib.core.settings import ML
|
||||
from lib.core.settings import META_CHARSET_REGEX
|
||||
from lib.core.settings import PARSE_HEADERS_LIMIT
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
from lib.parse.headers import headersParser
|
||||
from lib.parse.html import htmlParser
|
||||
|
||||
@@ -229,4 +224,4 @@ def processResponse(page, responseHeaders):
|
||||
msg = extractErrorMessage(page)
|
||||
|
||||
if msg:
|
||||
logger.info("parsed error message: '%s'" % msg)
|
||||
logger.info("parsed error message: '%s'" % msg)
|
||||
|
||||
@@ -20,18 +20,15 @@ from extra.multipart import multipartpost
|
||||
|
||||
from lib.core.agent import agent
|
||||
from lib.core.common import asciifyUrl
|
||||
from lib.core.common import average
|
||||
from lib.core.common import calculateDeltaSeconds
|
||||
from lib.core.common import clearConsoleLine
|
||||
from lib.core.common import cpuThrottle
|
||||
from lib.core.common import evaluateCode
|
||||
from lib.core.common import extractRegexResult
|
||||
from lib.core.common import getCurrentThreadData
|
||||
from lib.core.common import getFilteredPageContent
|
||||
from lib.core.common import getHostHeader
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import logHTTPTraffic
|
||||
from lib.core.common import parseTargetUrl
|
||||
from lib.core.common import randomizeParameterValue
|
||||
from lib.core.common import readInput
|
||||
from lib.core.common import removeReflectiveValues
|
||||
@@ -61,7 +58,6 @@ from lib.core.settings import MIN_TIME_RESPONSES
|
||||
from lib.core.settings import WARN_TIME_STDEV
|
||||
from lib.core.settings import UNENCODED_ORIGINAL_VALUE
|
||||
from lib.core.settings import URI_HTTP_HEADER
|
||||
from lib.core.threads import getCurrentThreadData
|
||||
from lib.request.basic import decodePage
|
||||
from lib.request.basic import forgeHeaders
|
||||
from lib.request.basic import processResponse
|
||||
@@ -171,7 +167,6 @@ class Connect:
|
||||
url = url.replace(" ", "%20")
|
||||
|
||||
page = None
|
||||
cookieStr = u""
|
||||
requestMsg = u"HTTP request [#%d]:\n%s " % (threadData.lastRequestUID, method or (HTTPMETHOD.POST if post else HTTPMETHOD.GET))
|
||||
requestMsg += "%s" % urlparse.urlsplit(url)[2] or "/"
|
||||
responseMsg = u"HTTP response "
|
||||
@@ -203,7 +198,7 @@ class Connect:
|
||||
requestMsg += "?%s" % params
|
||||
|
||||
elif multipart:
|
||||
# Needed in this form because of potential circle dependency
|
||||
# Needed in this form because of potential circle dependency
|
||||
# problem (option -> update -> connect -> option)
|
||||
from lib.core.option import proxyHandler
|
||||
|
||||
@@ -563,7 +558,7 @@ class Connect:
|
||||
|
||||
elif place:
|
||||
if place in (PLACE.GET, PLACE.POST, PLACE.URI):
|
||||
# payloads in GET and/or POST need to be urlencoded
|
||||
# payloads in GET and/or POST need to be urlencoded
|
||||
# throughly without safe chars (especially & and =)
|
||||
# addendum: as we support url encoding in tampering
|
||||
# functions therefore we need to use % as a safe char
|
||||
@@ -619,7 +614,6 @@ class Connect:
|
||||
for randomParameter in conf.rParam:
|
||||
for item in [PLACE.GET, PLACE.POST, PLACE.COOKIE]:
|
||||
if item in conf.parameters:
|
||||
origValue = conf.parameters[item]
|
||||
if item == PLACE.GET and get:
|
||||
get = _randomizeParameter(get, randomParameter)
|
||||
elif item == PLACE.POST and post:
|
||||
|
||||
@@ -10,14 +10,11 @@ See the file 'doc/COPYING' for copying permission
|
||||
import time
|
||||
|
||||
from lib.core.agent import agent
|
||||
from lib.core.common import dataToSessionFile
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import calculateDeltaSeconds
|
||||
from lib.core.common import getCurrentThreadData
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.convert import base64pickle
|
||||
from lib.core.convert import base64unpickle
|
||||
from lib.core.convert import utf8decode
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
|
||||
Reference in New Issue
Block a user