|
40 | 40 | from lib.core.data import temp |
41 | 41 | from lib.core.exception import sqlmapFilePathException |
42 | 42 | from lib.core.data import paths |
| 43 | +from lib.core.settings import SQL_STATEMENTS |
43 | 44 | from lib.core.settings import VERSION_STRING |
44 | 45 |
|
45 | 46 |
|
@@ -493,39 +494,11 @@ def parsePasswordHash(password): |
493 | 494 |
|
494 | 495 |
|
495 | 496 | def cleanQuery(query): |
496 | | - # SQL SELECT statement |
497 | | - upperQuery = query.replace("select ", "SELECT ") |
498 | | - upperQuery = upperQuery.replace(" from ", " FROM ") |
499 | | - upperQuery = upperQuery.replace(" where ", " WHERE ") |
500 | | - upperQuery = upperQuery.replace(" group by ", " GROUP BY ") |
501 | | - upperQuery = upperQuery.replace(" order by ", " ORDER BY ") |
502 | | - upperQuery = upperQuery.replace(" having ", " HAVING ") |
503 | | - upperQuery = upperQuery.replace(" limit ", " LIMIT ") |
504 | | - upperQuery = upperQuery.replace(" offset ", " OFFSET ") |
505 | | - upperQuery = upperQuery.replace(" union all ", " UNION ALL ") |
506 | | - upperQuery = upperQuery.replace(" rownum ", " ROWNUM ") |
507 | | - |
508 | | - # SQL data definition |
509 | | - upperQuery = upperQuery.replace(" create ", " CREATE ") |
510 | | - upperQuery = upperQuery.replace(" drop ", " DROP ") |
511 | | - upperQuery = upperQuery.replace(" truncate ", " TRUNCATE ") |
512 | | - upperQuery = upperQuery.replace(" alter ", " ALTER ") |
513 | | - |
514 | | - # SQL data manipulation |
515 | | - upperQuery = upperQuery.replace(" insert ", " INSERT ") |
516 | | - upperQuery = upperQuery.replace(" update ", " UPDATE ") |
517 | | - upperQuery = upperQuery.replace(" delete ", " DELETE ") |
518 | | - upperQuery = upperQuery.replace(" merge ", " MERGE ") |
519 | | - |
520 | | - # SQL data control |
521 | | - upperQuery = upperQuery.replace(" grant ", " GRANT ") |
522 | | - |
523 | | - # SQL transaction control |
524 | | - upperQuery = upperQuery.replace(" start transaction ", " START TRANSACTION ") |
525 | | - upperQuery = upperQuery.replace(" begin work ", " BEGIN WORK ") |
526 | | - upperQuery = upperQuery.replace(" begin transaction ", " BEGIN TRANSACTION ") |
527 | | - upperQuery = upperQuery.replace(" commit ", " COMMIT ") |
528 | | - upperQuery = upperQuery.replace(" rollback ", " ROLLBACK ") |
| 497 | + upperQuery = query |
| 498 | + |
| 499 | + for sqlStatements in SQL_STATEMENTS.values(): |
| 500 | + for sqlStatement in sqlStatements: |
| 501 | + upperQuery = upperQuery.replace(sqlStatement, sqlStatement.upper()) |
529 | 502 |
|
530 | 503 | return upperQuery |
531 | 504 |
|
|
0 commit comments