forked from p15670423/monkey
Island: Remove 32bit manual run options
This commit is contained in:
parent
069afe677a
commit
10cfe346b6
|
@ -20,9 +20,7 @@ const getContents = (props) => {
|
||||||
|
|
||||||
const osTypes = {
|
const osTypes = {
|
||||||
[OS_TYPES.WINDOWS_64]: 'Windows 64bit',
|
[OS_TYPES.WINDOWS_64]: 'Windows 64bit',
|
||||||
[OS_TYPES.WINDOWS_32]: 'Windows 32bit',
|
[OS_TYPES.LINUX_64]: 'Linux 64bit'
|
||||||
[OS_TYPES.LINUX_64]: 'Linux 64bit',
|
|
||||||
[OS_TYPES.LINUX_32]: 'Linux 32bit'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [osType, setOsType] = useState(OS_TYPES.WINDOWS_64);
|
const [osType, setOsType] = useState(OS_TYPES.WINDOWS_64);
|
||||||
|
@ -48,11 +46,11 @@ const getContents = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateCommands() {
|
function generateCommands() {
|
||||||
if (osType === OS_TYPES.WINDOWS_64 || osType === OS_TYPES.WINDOWS_32) {
|
if (osType === OS_TYPES.WINDOWS_64) {
|
||||||
return [{type: 'Powershell', command: GenerateLocalWindowsPowershell(selectedIp, osType, customUsername)}]
|
return [{type: 'Powershell', command: GenerateLocalWindowsPowershell(selectedIp, customUsername)}]
|
||||||
} else {
|
} else {
|
||||||
return [{type: 'CURL', command: GenerateLocalLinuxCurl(selectedIp, osType, customUsername)},
|
return [{type: 'CURL', command: GenerateLocalLinuxCurl(selectedIp, customUsername)},
|
||||||
{type: 'WGET', command: GenerateLocalLinuxWget(selectedIp, osType, customUsername)}]
|
{type: 'WGET', command: GenerateLocalLinuxWget(selectedIp, customUsername)}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import AuthComponent from '../../AuthComponent';
|
||||||
import {faLaptopCode} from '@fortawesome/free-solid-svg-icons/faLaptopCode';
|
import {faLaptopCode} from '@fortawesome/free-solid-svg-icons/faLaptopCode';
|
||||||
import InlineSelection from '../../ui-components/inline-selection/InlineSelection';
|
import InlineSelection from '../../ui-components/inline-selection/InlineSelection';
|
||||||
import {cloneDeep} from 'lodash';
|
import {cloneDeep} from 'lodash';
|
||||||
import {faCloud, faExpandArrowsAlt} from '@fortawesome/free-solid-svg-icons';
|
import {faExpandArrowsAlt} from '@fortawesome/free-solid-svg-icons';
|
||||||
import RunOnIslandButton from './RunOnIslandButton';
|
import RunOnIslandButton from './RunOnIslandButton';
|
||||||
import AWSRunButton from './RunOnAWS/AWSRunButton';
|
import AWSRunButton from './RunOnAWS/AWSRunButton';
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
import {OS_TYPES} from '../utils/OsTypes';
|
export default function generateLocalLinuxCurl(ip, username) {
|
||||||
|
let command = `curl https://${ip}:5000/api/monkey/download/monkey-linux-64 -k `
|
||||||
|
+ `-o monkey-linux-64; `
|
||||||
export default function generateLocalLinuxCurl(ip, osType, username) {
|
+ `chmod +x monkey-linux-64; `
|
||||||
let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64';
|
+ `./monkey-linux-64 m0nk3y -s ${ip}:5000;`;
|
||||||
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 != '') {
|
if (username != '') {
|
||||||
command = `su - ${username} -c "${command}"`;
|
command = `su - ${username} -c "${command}"`;
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
import {OS_TYPES} from '../utils/OsTypes';
|
export default function generateLocalLinuxWget(ip, username) {
|
||||||
|
|
||||||
|
|
||||||
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/`
|
let command = `wget --no-check-certificate https://${ip}:5000/api/monkey/download/`
|
||||||
+ `monkey-linux-${bitText}; `
|
+ `monkey-linux-64; `
|
||||||
+ `chmod +x monkey-linux-${bitText}; `
|
+ `chmod +x monkey-linux-64; `
|
||||||
+ `./monkey-linux-${bitText} m0nk3y -s ${ip}:5000`;
|
+ `./monkey-linux-64 m0nk3y -s ${ip}:5000`;
|
||||||
|
|
||||||
if (username != '') {
|
if (username != '') {
|
||||||
command = `su - ${username} -c "${command}"`;
|
command = `su - ${username} -c "${command}"`;
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
import {OS_TYPES} from '../utils/OsTypes';
|
function getAgentDownloadCommand(ip) {
|
||||||
|
|
||||||
|
|
||||||
function getAgentDownloadCommand(ip, osType) {
|
|
||||||
let bitText = osType === OS_TYPES.WINDOWS_32 ? '32' : '64';
|
|
||||||
return `$execCmd = @"\r\n`
|
return `$execCmd = @"\r\n`
|
||||||
+ `[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {\`$true};`
|
+ `[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {\`$true};`
|
||||||
+ `(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/monkey-windows-${bitText}.exe',`
|
+ `(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/monkey-windows-64.exe',`
|
||||||
+ `"""$env:TEMP\\monkey.exe""");Start-Process -FilePath '$env:TEMP\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`
|
+ `"""$env:TEMP\\monkey.exe""");Start-Process -FilePath '$env:TEMP\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`
|
||||||
+ `\r\n"@; \r\n`
|
+ `\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) {
|
export default function generateLocalWindowsPowershell(ip, username) {
|
||||||
let command = getAgentDownloadCommand(ip, osType)
|
let command = getAgentDownloadCommand(ip)
|
||||||
if (username !== '') {
|
if (username !== '') {
|
||||||
command += ` -Credential ${username}`;
|
command += ` -Credential ${username}`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
export const OS_TYPES = {
|
export const OS_TYPES = {
|
||||||
WINDOWS_32: 'win32',
|
|
||||||
WINDOWS_64: 'win64',
|
WINDOWS_64: 'win64',
|
||||||
LINUX_32: 'linux32',
|
|
||||||
LINUX_64: 'linux64'
|
LINUX_64: 'linux64'
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ function aggregateMultipleResultsPba(results) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function modifyProcessListCollectionResult(result) {
|
function modifyProcessListCollectionResult(result) {
|
||||||
result[0] = "Found " + Object.keys(result[0]).length.toString() + " running processes";
|
result[0] = 'Found ' + Object.keys(result[0]).length.toString() + ' running processes';
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for pbas with multiple results and aggregate their results
|
// check for pbas with multiple results and aggregate their results
|
||||||
|
|
Loading…
Reference in New Issue