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

Skip to content

Commit 3f0a443

Browse files
committed
some updates
1 parent c8fe2fa commit 3f0a443

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

lib/core/agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ def nullAndCastField(self, field):
227227
nulledCastedField = field
228228
else:
229229
nulledCastedField = queries[kb.dbms].cast.query % field
230-
nulledCastedField = queries[kb.dbms].isnull.query % nulledCastedField
230+
if kb.dbms == DBMS.ACCESS:
231+
nulledCastedField = queries[kb.dbms].isnull.query % (nulledCastedField, nulledCastedField)
232+
else:
233+
nulledCastedField = queries[kb.dbms].isnull.query % nulledCastedField
231234

232235
return nulledCastedField
233236

lib/techniques/blind/inference.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is N
138138
continuousOrder means that distance between each two neighbour's
139139
numerical values is exactly 1
140140
"""
141-
141+
142142
result = tryHint(idx)
143143

144144
if result:
@@ -167,7 +167,7 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is N
167167
position = (len(charTbl) >> 1)
168168
posValue = charTbl[position]
169169

170-
if kb.dbms in (DBMS.SQLITE, DBMS.ACCESS, DBMS.MAXDB):
170+
if kb.dbms in (DBMS.SQLITE, DBMS.MAXDB):
171171
pushValue(posValue)
172172
posValue = chr(posValue) if posValue < 128 else unichr(posValue)
173173

@@ -176,7 +176,7 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is N
176176
queriesCount[0] += 1
177177
result = Request.queryPage(forgedPayload)
178178

179-
if kb.dbms in (DBMS.SQLITE, DBMS.ACCESS, DBMS.MAXDB):
179+
if kb.dbms in (DBMS.SQLITE, DBMS.MAXDB):
180180
posValue = popValue()
181181

182182
if result:

plugins/dbms/access/fingerprint.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,6 @@ def checkDbms(self):
189189
logger.warn(warnMsg)
190190

191191
return False
192+
193+
def forceDbmsEnum(self):
194+
conf.db = "Access"

xml/queries.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
<dbms value="Microsoft Access">
342342
<cast query="CVAR(%s)"/>
343343
<length query="LEN(%s)"/>
344-
<isnull query="ISNULL(%s)"/>
344+
<isnull query="IIF(ISNULL(%s), ' ', %s)"/>
345345
<delimiter query=","/>
346346
<limit query="TOP %d"/>
347347
<limitregexp query="\s+TOP\s+([\d]+)"/>
@@ -354,7 +354,6 @@
354354
<timedelay/>
355355
<substring query="MID((%s), %d, %d)"/>
356356
<case query="IIF(%s,1,0)"/>
357-
<inference query="AND MID((%s), %d, 1) > '%s'"/>
358357
<banner/>
359358
<current_user query="SELECT CURRENTUSER()"/>
360359
<current_db/>
@@ -363,6 +362,7 @@
363362
<dbs/>
364363
<tables>
365364
<inband query="SELECT Name FROM MSysObjects WHERE (Left([Name],1) &lt;&gt; '~') AND (Left([Name],4) &lt;&gt; 'MSys') AND ([Type] In (1, 4, 6))"/>
365+
<blind query="SELECT MIN(Name) FROM MSysObjects WHERE Type = 1 AND name > '%s'" count="SELECT COUNT(*) FROM MSysObjects WHERE Type = 1"/>
366366
</tables>
367367
</dbms>
368368

0 commit comments

Comments
 (0)