Skip to content

Commit 74b19a0

Browse files
committed
minor update
1 parent 5b67af3 commit 74b19a0

4 files changed

Lines changed: 11 additions & 15 deletions

File tree

lib/core/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class HASHDB_KEYS:
139139
KB_CHARS = "KB_CHARS"
140140
KB_BRUTE_TABLES = "KB_BRUTE_TABLES"
141141
KB_BRUTE_COLUMNS = "KB_BRUTE_COLUMNS"
142+
CONF_TMP_PATH = "CONF_TMP_PATH"
142143

143144
class REDIRECTION:
144145
FOLLOW = "1"

lib/core/session.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,6 @@ def setOs():
150150
if condition:
151151
dataToSessionFile("[%s][%s][%s][OS][%s]\n" % (conf.url, kb.injection.place, safeFormatString(conf.parameters[kb.injection.place]), Backend.getOs()))
152152

153-
def setRemoteTempPath():
154-
condition = (
155-
not kb.resumedQueries or ( kb.resumedQueries.has_key(conf.url) and
156-
not kb.resumedQueries[conf.url].has_key("Remote temp path") )
157-
)
158-
159-
if condition:
160-
dataToSessionFile("[%s][%s][%s][Remote temp path][%s]\n" % (conf.url, kb.injection.place, safeFormatString(conf.parameters[kb.injection.place]), safeFormatString(conf.tmpPath)))
161-
162153
def setXpCmdshellAvailability(available):
163154
condition = (
164155
not kb.resumedQueries or ( kb.resumedQueries.has_key(conf.url) and

lib/core/target.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import time
1515

1616
from lib.core.common import dataToSessionFile
17+
from lib.core.common import hashDBRetrieve
1718
from lib.core.common import intersect
1819
from lib.core.common import paramToDict
1920
from lib.core.common import readInput
@@ -208,10 +209,12 @@ def __resumeHashDBValues():
208209
Resume stored data values from HashDB
209210
"""
210211

211-
kb.absFilePaths = conf.hashDB.retrieve(HASHDB_KEYS.KB_ABS_FILE_PATHS, True) or kb.absFilePaths
212-
kb.chars = conf.hashDB.retrieve(HASHDB_KEYS.KB_CHARS, True) or kb.chars
213-
kb.brute.tables = conf.hashDB.retrieve(HASHDB_KEYS.KB_BRUTE_TABLES, True) or kb.brute.tables
214-
kb.brute.columns = conf.hashDB.retrieve(HASHDB_KEYS.KB_BRUTE_COLUMNS, True) or kb.brute.columns
212+
kb.absFilePaths = hashDBRetrieve(HASHDB_KEYS.KB_ABS_FILE_PATHS, True) or kb.absFilePaths
213+
kb.chars = hashDBRetrieve(HASHDB_KEYS.KB_CHARS, True) or kb.chars
214+
kb.brute.tables = hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_TABLES, True) or kb.brute.tables
215+
kb.brute.columns = hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_COLUMNS, True) or kb.brute.columns
216+
217+
conf.tmpPath = conf.tmpPath or hashDBRetrieve(HASHDB_KEYS.CONF_TMP_PATH)
215218

216219
def __setOutputResume():
217220
"""

plugins/generic/misc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from lib.core.common import getCompiledRegex
1111
from lib.core.common import Backend
12+
from lib.core.common import hashDBWrite
1213
from lib.core.common import isTechniqueAvailable
1314
from lib.core.common import normalizePath
1415
from lib.core.common import ntToPosixSlashes
@@ -19,11 +20,11 @@
1920
from lib.core.data import logger
2021
from lib.core.data import queries
2122
from lib.core.enums import DBMS
23+
from lib.core.enums import HASHDB_KEYS
2224
from lib.core.enums import OS
2325
from lib.core.enums import PAYLOAD
2426
from lib.core.exception import sqlmapNoneDataException
2527
from lib.core.exception import sqlmapUnsupportedFeatureException
26-
from lib.core.session import setRemoteTempPath
2728
from lib.request import inject
2829

2930
class Miscellaneous:
@@ -57,7 +58,7 @@ def getRemoteTempPath(self):
5758
conf.tmpPath = normalizePath(conf.tmpPath)
5859
conf.tmpPath = ntToPosixSlashes(conf.tmpPath)
5960

60-
setRemoteTempPath()
61+
hashDBWrite(HASHDB_KEYS.CONF_TMP_PATH, conf.tmpPath)
6162

6263
def getVersionFromBanner(self):
6364
if "dbmsVersion" in kb.bannerFp:

0 commit comments

Comments
 (0)