Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 401905b

Browse files
committed
Minor improvement to UNION file write
1 parent 64b45f2 commit 401905b

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

lib/core/agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def payload(self, place=None, parameter=None, value=None, newValue=None, where=N
7979

8080
retVal = ""
8181

82-
if where is None and isTechniqueAvailable(kb.technique):
82+
if kb.forceWhere:
83+
where = kb.forceWhere
84+
elif where is None and isTechniqueAvailable(kb.technique):
8385
where = kb.injection.data[kb.technique].where
8486

8587
if kb.injection.place is not None:

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
17951795
kb.followSitemapRecursion = None
17961796
kb.forcedDbms = None
17971797
kb.forcePartialUnion = False
1798+
kb.forceWhere = None
17981799
kb.futileUnion = None
17991800
kb.headersFp = {}
18001801
kb.heuristicDbms = None

plugins/dbms/mysql/filesystem.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
from lib.core.common import isNumPosStrValue
99
from lib.core.common import isTechniqueAvailable
10+
from lib.core.common import popValue
11+
from lib.core.common import pushValue
1012
from lib.core.common import randomStr
1113
from lib.core.common import singleTimeWarnMessage
1214
from lib.core.data import conf
@@ -97,8 +99,11 @@ def unionWriteFile(self, wFile, dFile, fileType, forceCheck=False):
9799
debugMsg = "exporting the %s file content to file '%s'" % (fileType, dFile)
98100
logger.debug(debugMsg)
99101

102+
pushValue(kb.forceWhere)
103+
kb.forceWhere = PAYLOAD.WHERE.NEGATIVE
100104
sqlQuery = "%s INTO DUMPFILE '%s'" % (fcEncodedStr, dFile)
101105
unionUse(sqlQuery, unpack=False)
106+
kb.forceWhere = popValue()
102107

103108
warnMsg = "expect junk characters inside the "
104109
warnMsg += "file as a leftover from UNION query"

0 commit comments

Comments
 (0)