mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
more on issue #742
This commit is contained in:
parent
ce67156d80
commit
0c1b3f2dbc
|
@ -173,18 +173,7 @@ class Filesystem(GenericFilesystem):
|
||||||
randPSScriptPath = "%s\%s" % (tmpPath, randPSScript)
|
randPSScriptPath = "%s\%s" % (tmpPath, randPSScript)
|
||||||
|
|
||||||
encodedFileContent = base64encode(wFileContent)
|
encodedFileContent = base64encode(wFileContent)
|
||||||
#psString = "[System.Text.Encoding]::Default.GetString([System.Convert]::FromBase64String(\"%s\")) | Out-File \"%s\"" % (encodedFileContent, dFile)
|
psString = "$Content = [System.Convert]::FromBase64String(\"%s\"); Set-Content -Path \"%s\" -Value $Content -Encoding Byte" % (encodedFileContent, dFile)
|
||||||
psString = "[System.Text.Encoding]::Default.GetString([System.Convert]::FromBase64String(\"%s\")) ^> \"%s\"" % (encodedFileContent, dFile)
|
|
||||||
#psString = "[System.Text.Encoding]::UTF8.GetBytes([System.Convert]::FromBase64String(\"%s\")) | Out-File \"%s\"" % (encodedFileContent, dFile)
|
|
||||||
#psString = "[System.Text.Encoding]::UTF8.GetBytes([System.Convert]::FromBase64String(\"%s\")) ^> \"%s\"" % (encodedFileContent, dFile)
|
|
||||||
#psString = """$Content = Get-Content -Path %s -Encoding Byte
|
|
||||||
#$Base64 = [System.Convert]::ToBase64String($Content)
|
|
||||||
psString = """
|
|
||||||
$Content = [System.Convert]::FromBase64String("%s")
|
|
||||||
Set-Content -Path %s -Value $Content -Encoding Byte
|
|
||||||
""" % (encodedFileContent, randPSScriptPath)
|
|
||||||
|
|
||||||
psString = psString.replace(" ", "").replace("\n", ";")
|
|
||||||
|
|
||||||
logger.debug("uploading the PowerShell script to %s, please wait.." % randPSScriptPath)
|
logger.debug("uploading the PowerShell script to %s, please wait.." % randPSScriptPath)
|
||||||
self.xpCmdshellWriteFile(psString, tmpPath, randPSScript)
|
self.xpCmdshellWriteFile(psString, tmpPath, randPSScript)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user