mirror of
https://github.com/0dayCTF/reverse-shell-generator.git
synced 2025-01-31 06:37:31 +00:00
Update script.js
Fixed Windows Powershell Base64 to UTF16-LE
This commit is contained in:
parent
3a6f0b2712
commit
377729ff31
14
js/script.js
14
js/script.js
@ -161,7 +161,19 @@
|
||||
if (rsg.getSelectedCommandName() === 'PowerShell #3 (Base64)') {
|
||||
const encoder = (text) => text;
|
||||
const payload = rsg.insertParameters(rsgData.specialCommands['PowerShell payload'], encoder)
|
||||
command = "powershell -e " + btoa(payload)
|
||||
command = "powershell -e " + btoa(toBinary(payload))
|
||||
function toBinary(string) {
|
||||
const codeUnits = new Uint16Array(string.length);
|
||||
for (let i = 0; i < codeUnits.length; i++) {
|
||||
codeUnits[i] = string.charCodeAt(i);
|
||||
}
|
||||
const charCodes = new Uint8Array(codeUnits.buffer);
|
||||
let result = '';
|
||||
for (let i = 0; i < charCodes.byteLength; i++) {
|
||||
result += String.fromCharCode(charCodes[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
command = rsg.getReverseShellCommand()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user