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

Skip to content

Commit cbe8f41

Browse files
committed
minor code refactoring preparing for #96
1 parent 86df603 commit cbe8f41

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/takeover/web.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from lib.core.common import extractRegexResult
1919
from lib.core.common import getDirs
2020
from lib.core.common import getDocRoot
21+
from lib.core.common import getSQLSnippet
2122
from lib.core.common import ntToPosixSlashes
2223
from lib.core.common import isTechniqueAvailable
2324
from lib.core.common import isWindowsDriveLetterPath
@@ -32,6 +33,7 @@
3233
from lib.core.data import kb
3334
from lib.core.data import logger
3435
from lib.core.data import paths
36+
from lib.core.enums import DBMS
3537
from lib.core.enums import OS
3638
from lib.core.enums import PAYLOAD
3739
from lib.request.connect import Connect as Request
@@ -115,8 +117,7 @@ def __webFileInject(self, fileContent, fileName, directory):
115117
randInt = randomInt()
116118
query += "OR %d=%d " % (randInt, randInt)
117119

118-
query += "LIMIT 1 INTO OUTFILE '%s' " % outFile
119-
query += "LINES TERMINATED BY 0x%s --" % hexencode(uplQuery)
120+
query += getSQLSnippet(DBMS.MYSQL, "write_file_limit", OUTFILE=outFile, HEXSTRING=hexencode(uplQuery))
120121
query = agent.prefixQuery(query)
121122
query = agent.suffixQuery(query)
122123
payload = agent.payload(newValue=query)
@@ -247,8 +248,8 @@ def webInit(self):
247248
continue
248249

249250
elif "<%" in uplPage or "<?" in uplPage:
250-
warnMsg = "file stager uploaded "
251-
warnMsg += "on '%s' but not dynamically interpreted" % localPath
251+
warnMsg = "file stager uploaded on '%s', " % localPath
252+
warnMsg += "but not dynamically interpreted"
252253
logger.warn(warnMsg)
253254
continue
254255

0 commit comments

Comments
 (0)