Minor code changes

This commit is contained in:
Shreya 2021-01-08 15:15:15 +05:30
parent 22d9f70374
commit 55dae3f29d
4 changed files with 33 additions and 22 deletions

View File

@ -2,12 +2,15 @@ import {OS_TYPES} from '../utils/OsTypes';
export default function generateLocalLinuxCurl(ip, osType, username) {
let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64';
let command = `curl https://${ip}:5000/api/monkey/download/monkey-linux-${bitText} -k `
+ `-o monkey-linux-${bitText}; `
+ `chmod +x monkey-linux-${bitText}; `
+ `./monkey-linux-${bitText} m0nk3y -s ${ip}:5000;`;
if (username != '')
command = `su - ${username} -c "${command}"`;
return command;
let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64';
let command = `curl https://${ip}:5000/api/monkey/download/monkey-linux-${bitText} -k `
+ `-o monkey-linux-${bitText}; `
+ `chmod +x monkey-linux-${bitText}; `
+ `./monkey-linux-${bitText} m0nk3y -s ${ip}:5000;`;
if (username != '') {
command = `su - ${username} -c "${command}"`;
}
return command;
}

View File

@ -2,12 +2,15 @@ import {OS_TYPES} from '../utils/OsTypes';
export default function generateLocalLinuxWget(ip, osType, username) {
let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64';
let command = `wget --no-check-certificate https://${ip}:5000/api/monkey/download/`
+ `monkey-linux-${bitText}; `
+ `chmod +x monkey-linux-${bitText}; `
+ `./monkey-linux-${bitText} m0nk3y -s ${ip}:5000`;
if (username != '')
command = `su - ${username} -c "${command}"`;
return command;
let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64';
let command = `wget --no-check-certificate https://${ip}:5000/api/monkey/download/`
+ `monkey-linux-${bitText}; `
+ `chmod +x monkey-linux-${bitText}; `
+ `./monkey-linux-${bitText} m0nk3y -s ${ip}:5000`;
if (username != '') {
command = `su - ${username} -c "${command}"`;
}
return command;
}

View File

@ -8,7 +8,9 @@ export default function generateLocalWindowsCmd(ip, osType, username) {
+ `monkey-windows-${bitText}.exe','.\\monkey.exe'); `
+ `;Start-Process -FilePath '.\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`;
if (username != '')
command = `runas /user:${username} "cmd /K ${command}"`;
return command;
if (username != '') {
command = `runas /user:${username} "cmd /K ${command}"`;
}
return command;
}

View File

@ -7,7 +7,10 @@ export default function generateLocalWindowsPowershell(ip, osType, username) {
+ `(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/ `
+ `monkey-windows-${bitText}.exe','.\\monkey.exe'); `
+ `;Start-Process -FilePath '.\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`;
if (username != '')
command = `Start-Process powershell.exe -ArgumentList "-noexit ${command}" -Credential ${username}`;
return command;
if (username != '') {
command = `Start-Process powershell.exe -ArgumentList "-noexit ${command}" -Credential ${username}`;
}
return command;
}