From 10cfe346b6ef047a27fc9503c7be9be6502bf69b Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Fri, 25 Feb 2022 12:42:32 +0100 Subject: [PATCH] Island: Remove 32bit manual run options --- .../RunManually/LocalManualRunOptions.js | 12 +++++------- .../components/pages/RunMonkeyPage/RunOptions.js | 2 +- .../RunMonkeyPage/commands/local_linux_curl.js | 14 +++++--------- .../RunMonkeyPage/commands/local_linux_wget.js | 12 ++++-------- .../commands/local_windows_powershell.js | 12 ++++-------- .../pages/RunMonkeyPage/utils/OsTypes.js | 2 -- .../report-components/security/PostBreachParser.js | 2 +- 7 files changed, 20 insertions(+), 36 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunManually/LocalManualRunOptions.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunManually/LocalManualRunOptions.js index 116ba5440..9d0469aca 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunManually/LocalManualRunOptions.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunManually/LocalManualRunOptions.js @@ -20,9 +20,7 @@ const getContents = (props) => { const osTypes = { [OS_TYPES.WINDOWS_64]: 'Windows 64bit', - [OS_TYPES.WINDOWS_32]: 'Windows 32bit', - [OS_TYPES.LINUX_64]: 'Linux 64bit', - [OS_TYPES.LINUX_32]: 'Linux 32bit' + [OS_TYPES.LINUX_64]: 'Linux 64bit' } const [osType, setOsType] = useState(OS_TYPES.WINDOWS_64); @@ -48,11 +46,11 @@ const getContents = (props) => { } function generateCommands() { - if (osType === OS_TYPES.WINDOWS_64 || osType === OS_TYPES.WINDOWS_32) { - return [{type: 'Powershell', command: GenerateLocalWindowsPowershell(selectedIp, osType, customUsername)}] + if (osType === OS_TYPES.WINDOWS_64) { + return [{type: 'Powershell', command: GenerateLocalWindowsPowershell(selectedIp, customUsername)}] } else { - return [{type: 'CURL', command: GenerateLocalLinuxCurl(selectedIp, osType, customUsername)}, - {type: 'WGET', command: GenerateLocalLinuxWget(selectedIp, osType, customUsername)}] + return [{type: 'CURL', command: GenerateLocalLinuxCurl(selectedIp, customUsername)}, + {type: 'WGET', command: GenerateLocalLinuxWget(selectedIp, customUsername)}] } } diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js index 7c099f224..bbefb64ac 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js @@ -5,7 +5,7 @@ import AuthComponent from '../../AuthComponent'; import {faLaptopCode} from '@fortawesome/free-solid-svg-icons/faLaptopCode'; import InlineSelection from '../../ui-components/inline-selection/InlineSelection'; 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 AWSRunButton from './RunOnAWS/AWSRunButton'; diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_curl.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_curl.js index ed9ffdec6..ceaeab393 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_curl.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_curl.js @@ -1,12 +1,8 @@ -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;`; +export default function generateLocalLinuxCurl(ip, username) { + let command = `curl https://${ip}:5000/api/monkey/download/monkey-linux-64 -k ` + + `-o monkey-linux-64; ` + + `chmod +x monkey-linux-64; ` + + `./monkey-linux-64 m0nk3y -s ${ip}:5000;`; if (username != '') { command = `su - ${username} -c "${command}"`; diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_wget.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_wget.js index 3f47dc996..0540540e7 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_wget.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_wget.js @@ -1,12 +1,8 @@ -import {OS_TYPES} from '../utils/OsTypes'; - - -export default function generateLocalLinuxWget(ip, osType, username) { - let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64'; +export default function generateLocalLinuxWget(ip, username) { 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`; + + `monkey-linux-64; ` + + `chmod +x monkey-linux-64; ` + + `./monkey-linux-64 m0nk3y -s ${ip}:5000`; if (username != '') { command = `su - ${username} -c "${command}"`; diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_windows_powershell.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_windows_powershell.js index 5c7d5c9a6..de5346f30 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_windows_powershell.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_windows_powershell.js @@ -1,18 +1,14 @@ -import {OS_TYPES} from '../utils/OsTypes'; - - -function getAgentDownloadCommand(ip, osType) { - let bitText = osType === OS_TYPES.WINDOWS_32 ? '32' : '64'; +function getAgentDownloadCommand(ip) { 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',` + + `(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';` + `\r\n"@; \r\n` + `Start-Process -FilePath powershell.exe -ArgumentList $execCmd`; } -export default function generateLocalWindowsPowershell(ip, osType, username) { - let command = getAgentDownloadCommand(ip, osType) +export default function generateLocalWindowsPowershell(ip, username) { + let command = getAgentDownloadCommand(ip) if (username !== '') { command += ` -Credential ${username}`; } diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/utils/OsTypes.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/utils/OsTypes.js index b24c9b302..1d898af01 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/utils/OsTypes.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/utils/OsTypes.js @@ -1,6 +1,4 @@ export const OS_TYPES = { - WINDOWS_32: 'win32', WINDOWS_64: 'win64', - LINUX_32: 'linux32', LINUX_64: 'linux64' } diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js index 843ca89dd..0a41f2c24 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreachParser.js @@ -46,7 +46,7 @@ function aggregateMultipleResultsPba(results) { } 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