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

Skip to content

Commit 4badb54

Browse files
committed
Couple of small patches
1 parent 29aaec8 commit 4badb54

6 files changed

Lines changed: 512 additions & 37 deletions

File tree

lib/core/dicts.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
See the file 'LICENSE' for copying permission
66
"""
77

8+
from lib.core.enums import CONTENT_TYPE
89
from lib.core.enums import DBMS
910
from lib.core.enums import OS
1011
from lib.core.enums import POST_HINT
@@ -294,3 +295,31 @@
294295
OS.WINDOWS: ("C:/xampp/htdocs/", "C:/wamp/www/", "C:/Inetpub/wwwroot/"),
295296
OS.LINUX: ("/var/www/", "/var/www/html", "/usr/local/apache2/htdocs", "/var/www/nginx-default", "/srv/www") # Reference: https://wiki.apache.org/httpd/DistrosDefaultLayout
296297
}
298+
299+
PART_RUN_CONTENT_TYPES = {
300+
"checkDbms": CONTENT_TYPE.TECHNIQUES,
301+
"getFingerprint": CONTENT_TYPE.DBMS_FINGERPRINT,
302+
"getBanner": CONTENT_TYPE.BANNER,
303+
"getCurrentUser": CONTENT_TYPE.CURRENT_USER,
304+
"getCurrentDb": CONTENT_TYPE.CURRENT_DB,
305+
"getHostname": CONTENT_TYPE.HOSTNAME,
306+
"isDba": CONTENT_TYPE.IS_DBA,
307+
"getUsers": CONTENT_TYPE.USERS,
308+
"getPasswordHashes": CONTENT_TYPE.PASSWORDS,
309+
"getPrivileges": CONTENT_TYPE.PRIVILEGES,
310+
"getRoles": CONTENT_TYPE.ROLES,
311+
"getDbs": CONTENT_TYPE.DBS,
312+
"getTables": CONTENT_TYPE.TABLES,
313+
"getColumns": CONTENT_TYPE.COLUMNS,
314+
"getSchema": CONTENT_TYPE.SCHEMA,
315+
"getCount": CONTENT_TYPE.COUNT,
316+
"dumpTable": CONTENT_TYPE.DUMP_TABLE,
317+
"search": CONTENT_TYPE.SEARCH,
318+
"sqlQuery": CONTENT_TYPE.SQL_QUERY,
319+
"tableExists": CONTENT_TYPE.COMMON_TABLES,
320+
"columnExists": CONTENT_TYPE.COMMON_COLUMNS,
321+
"readFile": CONTENT_TYPE.FILE_READ,
322+
"writeFile": CONTENT_TYPE.FILE_WRITE,
323+
"osCmd": CONTENT_TYPE.OS_CMD,
324+
"regRead": CONTENT_TYPE.REG_READ
325+
}

lib/core/enums.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -340,34 +340,6 @@ class CONTENT_TYPE:
340340
OS_CMD = 24
341341
REG_READ = 25
342342

343-
PART_RUN_CONTENT_TYPES = {
344-
"checkDbms": CONTENT_TYPE.TECHNIQUES,
345-
"getFingerprint": CONTENT_TYPE.DBMS_FINGERPRINT,
346-
"getBanner": CONTENT_TYPE.BANNER,
347-
"getCurrentUser": CONTENT_TYPE.CURRENT_USER,
348-
"getCurrentDb": CONTENT_TYPE.CURRENT_DB,
349-
"getHostname": CONTENT_TYPE.HOSTNAME,
350-
"isDba": CONTENT_TYPE.IS_DBA,
351-
"getUsers": CONTENT_TYPE.USERS,
352-
"getPasswordHashes": CONTENT_TYPE.PASSWORDS,
353-
"getPrivileges": CONTENT_TYPE.PRIVILEGES,
354-
"getRoles": CONTENT_TYPE.ROLES,
355-
"getDbs": CONTENT_TYPE.DBS,
356-
"getTables": CONTENT_TYPE.TABLES,
357-
"getColumns": CONTENT_TYPE.COLUMNS,
358-
"getSchema": CONTENT_TYPE.SCHEMA,
359-
"getCount": CONTENT_TYPE.COUNT,
360-
"dumpTable": CONTENT_TYPE.DUMP_TABLE,
361-
"search": CONTENT_TYPE.SEARCH,
362-
"sqlQuery": CONTENT_TYPE.SQL_QUERY,
363-
"tableExists": CONTENT_TYPE.COMMON_TABLES,
364-
"columnExists": CONTENT_TYPE.COMMON_COLUMNS,
365-
"readFile": CONTENT_TYPE.FILE_READ,
366-
"writeFile": CONTENT_TYPE.FILE_WRITE,
367-
"osCmd": CONTENT_TYPE.OS_CMD,
368-
"regRead": CONTENT_TYPE.REG_READ
369-
}
370-
371343
class CONTENT_STATUS:
372344
IN_PROGRESS = 0
373345
COMPLETE = 1

lib/core/option.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@
3535
from lib.core.common import dataToStdout
3636
from lib.core.common import getPublicTypeMembers
3737
from lib.core.common import getSafeExString
38-
from lib.core.common import extractRegexResult
39-
from lib.core.common import filterStringValue
4038
from lib.core.common import findLocalPort
4139
from lib.core.common import findPageForms
4240
from lib.core.common import getConsoleWidth
4341
from lib.core.common import getFileItems
4442
from lib.core.common import getFileType
45-
from lib.core.common import getUnicode
4643
from lib.core.common import normalizePath
4744
from lib.core.common import ntToPosixSlashes
4845
from lib.core.common import openFile
@@ -307,7 +304,7 @@ def _setRequestFromFile():
307304
conf.secondReq = safeExpandUser(conf.secondReq)
308305

309306
if not os.path.isfile(conf.secondReq):
310-
errMsg = "specified second-order HTTP request file '%s' " % onf.secondReq
307+
errMsg = "specified second-order HTTP request file '%s' " % conf.secondReq
311308
errMsg += "does not exist"
312309
raise SqlmapFilePathException(errMsg)
313310

@@ -1624,6 +1621,9 @@ def _cleanupOptions():
16241621
if any((conf.proxy, conf.proxyFile, conf.tor)):
16251622
conf.disablePrecon = True
16261623

1624+
if conf.dummy:
1625+
conf.batch = True
1626+
16271627
threadData = getCurrentThreadData()
16281628
threadData.reset()
16291629

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.6.33"
22+
VERSION = "1.2.6.35"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/utils/api.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
from lib.core.data import logger
3434
from lib.core.datatype import AttribDict
3535
from lib.core.defaults import _defaults
36+
from lib.core.dicts import PART_RUN_CONTENT_TYPES
3637
from lib.core.enums import AUTOCOMPLETE_TYPE
3738
from lib.core.enums import CONTENT_STATUS
3839
from lib.core.enums import MKSTEMP_PREFIX
39-
from lib.core.enums import PART_RUN_CONTENT_TYPES
4040
from lib.core.exception import SqlmapConnectionException
4141
from lib.core.log import LOGGER_HANDLER
4242
from lib.core.optiondict import optDict
@@ -45,9 +45,6 @@
4545
from lib.core.settings import RESTAPI_DEFAULT_ADDRESS
4646
from lib.core.settings import RESTAPI_DEFAULT_PORT
4747
from lib.core.shell import autoCompletion
48-
from lib.core.shell import clearHistory
49-
from lib.core.shell import loadHistory
50-
from lib.core.shell import saveHistory
5148
from lib.core.subprocessng import Popen
5249
from lib.parse.cmdline import cmdLineParser
5350
from thirdparty.bottle.bottle import error as return_error

0 commit comments

Comments
 (0)