UI: small style fixes in local_windows_powershell.js

This commit is contained in:
VakarisZ 2021-11-05 15:34:09 +02:00 committed by Mike Salvatore
parent 7e1e5917cb
commit c07f842c75
1 changed files with 3 additions and 3 deletions

View File

@ -1,19 +1,19 @@
import {OS_TYPES} from '../utils/OsTypes';
export function getAgentDownloadCommand(ip, osType) {
function getAgentDownloadCommand(ip, osType) {
let bitText = osType === OS_TYPES.WINDOWS_32 ? '32' : '64';
return `$execCmd = @"\r\n`
+ `[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {\`$true};`
+ `(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/monkey-windows-${bitText}.exe',`
+ `"""$env:TEMP\\monkey.exe""");Start-Process -FilePath '$env:TEMP\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`
+ `\r\n"@; \r\n`
+ `Start-Process -FilePath powershell.exe -ArgumentList $execCmd`
+ `Start-Process -FilePath powershell.exe -ArgumentList $execCmd`;
}
export default function generateLocalWindowsPowershell(ip, osType, username) {
let command = getAgentDownloadCommand(ip, osType)
if (username != '') {
if (username !== '') {
command += ` -Credential ${username}`;
}