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

Skip to content

Commit b19de01

Browse files
committed
Minor bugs fixes
1 parent 5fdebb5 commit b19de01

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"grant ", ),
114114

115115
"SQL data execution": (
116+
"exec ",
116117
"execute ", ),
117118

118119
"SQL transaction": (

lib/takeover/metasploit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def __runMsfPayloadRemote(self):
413413

414414
cmd = "%s &" % self.exeFilePathRemote
415415

416-
if kb.dbms == "Microsoft SQL Server" and kb.stackedTest:
416+
if kb.dbms == "Microsoft SQL Server" and (kb.stackedTest or conf.direct):
417417
cmd = self.xpCmdshellForgeCmd(cmd)
418418

419419
self.execCmd(cmd, silent=True)

plugins/dbms/mssqlserver/fingerprint.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ def checkDbms(self):
112112
for version in (0, 5, 8):
113113
randInt = randomInt()
114114
query = " AND %d=(SELECT (CASE WHEN (( SUBSTRING((@@VERSION), 22, 1)=2 AND SUBSTRING((@@VERSION), 25, 1)=%d ) OR ( SUBSTRING((@@VERSION), 23, 1)=2 AND SUBSTRING((@@VERSION), 26, 1)=%d )) THEN %d ELSE %d END))" % (randInt, version, version, randInt, (randInt + 1))
115+
116+
if conf.direct:
117+
query = query.replace(" AND ", "SELECT 1 WHERE ", 1)
118+
115119
payload = agent.fullPayload(query)
116120
result = Request.queryPage(payload)
117121

plugins/generic/enumeration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ def sqlQuery(self, query):
14981498
getOutput = readInput(message, default="Y")
14991499

15001500
if not getOutput or getOutput in ("y", "Y"):
1501-
infoMsg = "fetching %s query output: '%s'" % (sqlType, query)
1501+
infoMsg = "fetching %s query output: '%s'" % (sqlType if sqlType is not None else "SQL", query)
15021502
logger.info(infoMsg)
15031503

15041504
output = inject.getValue(query, fromUser=True)
@@ -1510,11 +1510,11 @@ def sqlQuery(self, query):
15101510
if kb.stackedTest is None:
15111511
stackedTest()
15121512

1513-
if not kb.stackedTest:
1513+
if not kb.stackedTest and not conf.direct:
15141514
return None
15151515
else:
15161516
if sqlType:
1517-
infoMsg = "executing %s query: '%s'" % (sqlType, query)
1517+
infoMsg = "executing %s query: '%s'" % (sqlType if sqlType is not None else "SQL", query)
15181518
else:
15191519
infoMsg = "executing unknown SQL type query: '%s'" % query
15201520
logger.info(infoMsg)

plugins/generic/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def updateBinChunk(self, binaryData, tmpPath):
232232
commands = (
233233
"cd %s" % tmpPath,
234234
"debug < %s" % randScr,
235-
"del /F %s" % randScr
235+
"del /F /Q %s" % randScr
236236
)
237237

238238
complComm = " & ".join(command for command in commands)

0 commit comments

Comments
 (0)