mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 13:11:29 +00:00
Minor refactoring
This commit is contained in:
@@ -31,6 +31,7 @@ from lib.core.data import logger
|
||||
from lib.core.datatype import AttribDict
|
||||
from lib.core.defaults import _defaults
|
||||
from lib.core.enums import CONTENT_STATUS
|
||||
from lib.core.enums import MKSTEMP_PREFIX
|
||||
from lib.core.enums import PART_RUN_CONTENT_TYPES
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.log import LOGGER_HANDLER
|
||||
@@ -643,7 +644,7 @@ def server(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, adapter=REST
|
||||
REST-JSON API server
|
||||
"""
|
||||
DataStore.admin_id = hexencode(os.urandom(16))
|
||||
Database.filepath = tempfile.mkstemp(prefix="sqlmapipc-", text=False)[1]
|
||||
Database.filepath = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.IPC, text=False)[1]
|
||||
|
||||
logger.info("Running REST-JSON API server at '%s:%d'.." % (host, port))
|
||||
logger.info("Admin ID: %s" % DataStore.admin_id)
|
||||
|
||||
@@ -22,6 +22,7 @@ from lib.core.common import safeCSValue
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import MKSTEMP_PREFIX
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.exception import SqlmapSyntaxException
|
||||
from lib.core.settings import CRAWL_EXCLUDE_EXTENSIONS
|
||||
@@ -198,7 +199,7 @@ def storeResultsToFile(results):
|
||||
kb.storeCrawlingChoice = test[0] in ("y", "Y")
|
||||
|
||||
if kb.storeCrawlingChoice:
|
||||
handle, filename = tempfile.mkstemp(prefix="sqlmapcrawling-", suffix=".csv" if conf.forms else ".txt")
|
||||
handle, filename = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.CRAWLER, suffix=".csv" if conf.forms else ".txt")
|
||||
os.close(handle)
|
||||
|
||||
infoMsg = "writing crawling results to a temporary file '%s' " % filename
|
||||
|
||||
@@ -62,6 +62,7 @@ from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.enums import HASH
|
||||
from lib.core.enums import MKSTEMP_PREFIX
|
||||
from lib.core.exception import SqlmapDataException
|
||||
from lib.core.exception import SqlmapUserQuitException
|
||||
from lib.core.settings import COMMON_PASSWORD_SUFFIXES
|
||||
@@ -387,7 +388,7 @@ def storeHashesToFile(attack_dict):
|
||||
if not kb.storeHashesChoice:
|
||||
return
|
||||
|
||||
handle, filename = tempfile.mkstemp(prefix="sqlmaphashes-", suffix=".txt")
|
||||
handle, filename = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.HASHES, suffix=".txt")
|
||||
os.close(handle)
|
||||
|
||||
infoMsg = "writing hashes to a temporary file '%s' " % filename
|
||||
|
||||
Reference in New Issue
Block a user