forked from p15670423/monkey
Minor code changes
This commit is contained in:
parent
22d9f70374
commit
55dae3f29d
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue