fix for Feature #136

This commit is contained in:
Miroslav Stampar 2010-08-31 14:25:37 +00:00
parent e810fe7b0b
commit c4040ab297
3 changed files with 12 additions and 14 deletions

View File

@ -68,16 +68,6 @@ class Enumeration(GenericEnumeration):
return []
def getColumns(self, onlyColNames=False):
errMsg = "on SQLite it is not possible to enumerate database "
errMsg += "table columns"
if conf.dumpTable or conf.dumpAll:
errMsg += ", provide them with -C option"
raise sqlmapUnsupportedFeatureException, errMsg
logger.warn(errMsg)
def dumpAll(self):
errMsg = "on SQLite you must specify the table and columns to dump"
raise sqlmapUnsupportedFeatureException, errMsg

View File

@ -871,6 +871,8 @@ class Enumeration:
conf.db, conf.db,
conf.db, conf.tbl)
query += condQuery.replace("[DB]", conf.db)
elif kb.dbms == "SQLite":
query = rootQuery["inband"]["query"] % conf.tbl
value = inject.getValue(query, blind=False)
@ -878,6 +880,10 @@ class Enumeration:
table = {}
columns = {}
if kb.dbms == "SQLite":
for match in re.finditer(r"(\w+) ([A-Z]+)[,\r\n]", value):
columns[match.group(1)] = match.group(2)
else:
for column, colType in value:
columns[column] = colType

View File

@ -320,7 +320,9 @@
<inband query="SELECT tbl_name FROM sqlite_master WHERE type='table' ORDER BY 1"/>
<blind query="SELECT tbl_name FROM sqlite_master WHERE type='table' LIMIT %d, 1" count="SELECT COUNT(tbl_name) FROM sqlite_master WHERE type='table'"/>
</tables>
<columns/>
<columns>
<inband query="SELECT sql FROM sqlite_master WHERE tbl_name='%s'"/>
</columns>
<dump_table>
<inband query="SELECT %s FROM %s"/>
<blind query="SELECT %s FROM %s LIMIT %d, 1" count="SELECT COUNT(*) FROM %s"/>