| 256 | const payload = rsg.insertParameters(rsgData.specialCommands['PowerShell payload'], encoder) |
| 257 | command = "powershell -e " + btoa(toBinary(payload)) |
| 258 | function toBinary(string) { |
| 259 | const codeUnits = new Uint16Array(string.length); |
| 260 | for (let i = 0; i < codeUnits.length; i++) { |
| 261 | codeUnits[i] = string.charCodeAt(i); |
| 262 | } |
| 263 | const charCodes = new Uint8Array(codeUnits.buffer); |
| 264 | let result = ''; |
| 265 | for (let i = 0; i < charCodes.byteLength; i++) { |
| 266 | result += String.fromCharCode(charCodes[i]); |
| 267 | } |
| 268 | return result; |
| 269 | } |
| 270 | } else if (rsg.getSelectedCommandName() === 'PowerShell #5 (stderr support) (Base64)') { |
| 271 | const encoder = (text) => text; |
| 272 | const payload = rsg.insertParameters(rsgData.specialCommands['PowerShell +stderr payload'], encoder) |