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

Skip to content

Commit f3f4a4c

Browse files
committed
Minor refactoring
1 parent 2280f3f commit f3f4a4c

9 files changed

Lines changed: 37 additions & 37 deletions

File tree

lib/controller/action.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ def action():
140140
conf.dbmsHandler.udfInjectCustom()
141141

142142
# File system options
143-
if conf.rFile:
144-
conf.dumper.rFile(conf.dbmsHandler.readFile(conf.rFile))
143+
if conf.fileRead:
144+
conf.dumper.rFile(conf.dbmsHandler.readFile(conf.fileRead))
145145

146-
if conf.wFile:
147-
conf.dbmsHandler.writeFile(conf.wFile, conf.dFile, conf.wFileType)
146+
if conf.fileWrite:
147+
conf.dbmsHandler.writeFile(conf.fileWrite, conf.fileDest, conf.fileWriteType)
148148

149149
# Operating system options
150150
if conf.osCmd:

lib/core/option.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -608,22 +608,22 @@ def _(key, value):
608608
raise SqlmapFilePathException(errMsg)
609609

610610
def _setWriteFile():
611-
if not conf.wFile:
611+
if not conf.fileWrite:
612612
return
613613

614614
debugMsg = "setting the write file functionality"
615615
logger.debug(debugMsg)
616616

617-
if not os.path.exists(conf.wFile):
618-
errMsg = "the provided local file '%s' does not exist" % conf.wFile
617+
if not os.path.exists(conf.fileWrite):
618+
errMsg = "the provided local file '%s' does not exist" % conf.fileWrite
619619
raise SqlmapFilePathException(errMsg)
620620

621-
if not conf.dFile:
621+
if not conf.fileDest:
622622
errMsg = "you did not provide the back-end DBMS absolute path "
623-
errMsg += "where you want to write the local file '%s'" % conf.wFile
623+
errMsg += "where you want to write the local file '%s'" % conf.fileWrite
624624
raise SqlmapMissingMandatoryOptionException(errMsg)
625625

626-
conf.wFileType = getFileType(conf.wFile)
626+
conf.fileWriteType = getFileType(conf.fileWrite)
627627

628628
def _setOS():
629629
"""
@@ -1509,14 +1509,14 @@ def _cleanupOptions():
15091509
if conf.url:
15101510
conf.url = conf.url.strip()
15111511

1512-
if conf.rFile:
1513-
conf.rFile = ntToPosixSlashes(normalizePath(conf.rFile))
1512+
if conf.fileRead:
1513+
conf.fileRead = ntToPosixSlashes(normalizePath(conf.fileRead))
15141514

1515-
if conf.wFile:
1516-
conf.wFile = ntToPosixSlashes(normalizePath(conf.wFile))
1515+
if conf.fileWrite:
1516+
conf.fileWrite = ntToPosixSlashes(normalizePath(conf.fileWrite))
15171517

1518-
if conf.dFile:
1519-
conf.dFile = ntToPosixSlashes(normalizePath(conf.dFile))
1518+
if conf.fileDest:
1519+
conf.fileDest = ntToPosixSlashes(normalizePath(conf.fileDest))
15201520

15211521
if conf.sitemapUrl and not conf.sitemapUrl.lower().startswith("http"):
15221522
conf.sitemapUrl = "http%s://%s" % ('s' if conf.forceSSL else '', conf.sitemapUrl)
@@ -1699,7 +1699,7 @@ def _setConfAttributes():
16991699
conf.tests = []
17001700
conf.trafficFP = None
17011701
conf.HARCollectorFactory = None
1702-
conf.wFileType = None
1702+
conf.fileWriteType = None
17031703

17041704
def _setKnowledgeBaseAttributes(flushAll=True):
17051705
"""

lib/core/optiondict.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@
165165
},
166166

167167
"File system": {
168-
"rFile": "string",
169-
"wFile": "string",
170-
"dFile": "string",
168+
"fileRead": "string",
169+
"fileWrite": "string",
170+
"fileDest": "string",
171171
},
172172

173173
"Takeover": {

lib/core/settings.py

Lines changed: 2 additions & 2 deletions
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.8.17"
22+
VERSION = "1.2.8.18"
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)
@@ -367,7 +367,7 @@
367367
SENSITIVE_DATA_REGEX = r"(\s|=)(?P<result>[^\s=]*%s[^\s]*)\s"
368368

369369
# Options to explicitly mask in anonymous (unhandled exception) reports (along with anything carrying the <hostname> inside)
370-
SENSITIVE_OPTIONS = ("hostname", "answers", "data", "dnsDomain", "googleDork", "authCred", "proxyCred", "tbl", "db", "col", "user", "cookie", "proxy", "rFile", "wFile", "dFile", "testParameter", "authCred")
370+
SENSITIVE_OPTIONS = ("hostname", "answers", "data", "dnsDomain", "googleDork", "authCred", "proxyCred", "tbl", "db", "col", "user", "cookie", "proxy", "fileRead", "fileWrite", "fileDest", "testParameter", "authCred")
371371

372372
# Maximum number of threads (avoiding connection issues and/or DoS)
373373
MAX_NUMBER_OF_THREADS = 10

lib/core/target.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def _createFilesDir():
571571
Create the file directory.
572572
"""
573573

574-
if not conf.rFile:
574+
if not conf.fileRead:
575575
return
576576

577577
conf.filePath = paths.SQLMAP_FILES_PATH % conf.hostname

lib/parse/cmdline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,13 @@ def cmdLineParser(argv=None):
471471
# File system options
472472
filesystem = OptionGroup(parser, "File system access", "These options can be used to access the back-end database management system underlying file system")
473473

474-
filesystem.add_option("--file-read", dest="rFile",
474+
filesystem.add_option("--file-read", dest="fileRead",
475475
help="Read a file from the back-end DBMS file system")
476476

477-
filesystem.add_option("--file-write", dest="wFile",
477+
filesystem.add_option("--file-write", dest="fileWrite",
478478
help="Write a local file on the back-end DBMS file system")
479479

480-
filesystem.add_option("--file-dest", dest="dFile",
480+
filesystem.add_option("--file-dest", dest="fileDest",
481481
help="Back-end DBMS absolute filepath to write to")
482482

483483
# Takeover options

lib/takeover/udf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def udfEvalCmd(self, cmd, first=None, last=None, udfName=None):
108108
return output
109109

110110
def udfCheckNeeded(self):
111-
if (not conf.rFile or (conf.rFile and not Backend.isDbms(DBMS.PGSQL))) and "sys_fileread" in self.sysUdfs:
111+
if (not conf.fileRead or (conf.fileRead and not Backend.isDbms(DBMS.PGSQL))) and "sys_fileread" in self.sysUdfs:
112112
self.sysUdfs.pop("sys_fileread")
113113

114114
if not conf.osPwn:

sqlmap.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,15 +579,15 @@ shLib =
579579

580580
# Read a specific file from the back-end DBMS underlying file system.
581581
# Examples: /etc/passwd or C:\boot.ini
582-
rFile =
582+
fileRead =
583583

584584
# Write a local file to a specific path on the back-end DBMS underlying
585585
# file system.
586586
# Example: /tmp/sqlmap.txt or C:\WINNT\Temp\sqlmap.txt
587-
wFile =
587+
fileWrite =
588588

589589
# Back-end DBMS absolute filepath to write the file to.
590-
dFile =
590+
fileDest =
591591

592592

593593
# These options can be used to access the back-end database management

txt/checksum.md5

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ e4805169a081b834ca51a60a150c7247 extra/shutils/newlines.py
2121
1056d1112ba5130868178cb495d22b1d extra/shutils/regressiontest.py
2222
1e5532ede194ac9c083891c2f02bca93 extra/sqlharvest/__init__.py
2323
b3e60ea4e18a65c48515d04aab28ff68 extra/sqlharvest/sqlharvest.py
24-
0f581182871148b0456a691ae85b04c0 lib/controller/action.py
24+
3459c562a6abb9b4bdcc36925f751f3e lib/controller/action.py
2525
bc3800ec099df253968b3a7fc1ffce44 lib/controller/checks.py
2626
c414cecdb0472c92cf50ed5b01e4438c lib/controller/controller.py
2727
c7443613a0a2505b1faec931cee2a6ef lib/controller/handler.py
@@ -40,26 +40,26 @@ ab3f4f3e3019add5f4a2e28f7e8748a4 lib/core/enums.py
4040
cada93357a7321655927fc9625b3bfec lib/core/exception.py
4141
1e5532ede194ac9c083891c2f02bca93 lib/core/__init__.py
4242
458a194764805cd8312c14ecd4be4d1e lib/core/log.py
43-
05f72baa2db4073bb0273d7fc1df13eb lib/core/optiondict.py
44-
8e759d4c8711a5980d4bdc2d044a4fd4 lib/core/option.py
43+
7d6edc552e08c30f4f4d49fa93b746f1 lib/core/optiondict.py
44+
6826030069e1cd88eb87603a50b2d251 lib/core/option.py
4545
c8c386d644d57c659d74542f5f57f632 lib/core/patch.py
4646
6783160150b4711d02c56ee2beadffdb lib/core/profiling.py
4747
6f654e1715571eff68a0f8af3d62dcf8 lib/core/readlineng.py
4848
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4949
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
5050
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
51-
780178e74a59e86cfd73135528686abd lib/core/settings.py
51+
85751568ce17296e01728f4e8041e13b lib/core/settings.py
5252
dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py
5353
a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py
54-
5b7ff6f49ff3af62f8c12f74b6d49dd2 lib/core/target.py
54+
815d1cf27f0f8738d81531e73149867d lib/core/target.py
5555
72d499ca8d792e90a1ebfb2ad2341a51 lib/core/testing.py
5656
e896992e4db26605ab1e73615b1f9434 lib/core/threads.py
5757
c40758411bb0bd68764d78e0bb72bd0f lib/core/unescaper.py
5858
b35636650cfe721f5cc47fb91737c061 lib/core/update.py
5959
e772deb63270375e685fa5a7b775c382 lib/core/wordlist.py
6060
1e5532ede194ac9c083891c2f02bca93 lib/__init__.py
6161
7620f1f4b8791e13c7184c06b5421754 lib/parse/banner.py
62-
babf5c48bc6a3797fc459706af4465cd lib/parse/cmdline.py
62+
7b2a20d7f149cc2522275e5df23bdc54 lib/parse/cmdline.py
6363
fb2e2f05dde98caeac6ccf3e67192177 lib/parse/configfile.py
6464
3794ff139869f5ae8e81cfdbe5714f56 lib/parse/handler.py
6565
6bab53ea9d75bc9bb8169d3e8f3f149f lib/parse/headers.py
@@ -86,7 +86,7 @@ acc1db3667bf910b809eb279b60595eb lib/takeover/icmpsh.py
8686
1e5532ede194ac9c083891c2f02bca93 lib/takeover/__init__.py
8787
46ff5840b29531412bcaa05dac190413 lib/takeover/metasploit.py
8888
fb9e34d558293b5d6b9727f440712886 lib/takeover/registry.py
89-
48575dde7bb867b7937769f569a98309 lib/takeover/udf.py
89+
6a49f359b922df0247eb236126596336 lib/takeover/udf.py
9090
f6f835e4190a55e42d13c1e7ca3f728f lib/takeover/web.py
9191
debc36a3ff80ba915aeeee69b21a8ddc lib/takeover/xp_cmdshell.py
9292
db208ab47de010836c6bf044e2357861 lib/techniques/blind/inference.py

0 commit comments

Comments
 (0)