diff --git a/monkey/monkey_island/cc/services/config_schema.py b/monkey/monkey_island/cc/services/config_schema.py index 30425dc1d..b8f2701c0 100644 --- a/monkey/monkey_island/cc/services/config_schema.py +++ b/monkey/monkey_island/cc/services/config_schema.py @@ -17,7 +17,10 @@ SCHEMA = { "SmbExploiter" ], "title": "SMB Exploiter", - "attack_techniques": ["T1110", "T1075", "T1035"] + "attack_techniques": ["T1110", "T1075", "T1035"], + "info": "Brute forces using credentials provided by user and" + " hashes gathered by mimikatz.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", @@ -25,7 +28,10 @@ SCHEMA = { "WmiExploiter" ], "title": "WMI Exploiter", - "attack_techniques": ["T1110", "T1106"] + "attack_techniques": ["T1110", "T1106"], + "info": "Brute forces WMI (Windows Management Instrumentation) " + "using credentials provided by user and hashes gathered by mimikatz.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", @@ -33,7 +39,10 @@ SCHEMA = { "MSSQLExploiter" ], "title": "MSSQL Exploiter", - "attack_techniques": ["T1110"] + "attack_techniques": ["T1110"], + "info": "Tries to brute force into MsSQL server and uses insecure " + "configuration to execute commands on server.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", @@ -41,7 +50,9 @@ SCHEMA = { "Ms08_067_Exploiter" ], "title": "MS08-067 Exploiter (UNSAFE)", - "attack_techniques": [] + "info": "Unsafe exploiter, that might cause system crash due to the use of buffer overflow. " + "Uses MS08-067 vulnerability.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", @@ -49,56 +60,74 @@ SCHEMA = { "SSHExploiter" ], "title": "SSH Exploiter", - "attack_techniques": ["T1110", "T1145", "T1106"] + "attack_techniques": ["T1110", "T1145", "T1106"], + "info": "Brute forces using credentials provided by user and SSH keys gathered from systems.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", "enum": [ "ShellShockExploiter" ], - "title": "ShellShock Exploiter" + "title": "ShellShock Exploiter", + "info": "CVE-2014-6271, based on logic in NCC group's github.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", "enum": [ "SambaCryExploiter" ], - "title": "SambaCry Exploiter" + "title": "SambaCry Exploiter", + "info": "Bruteforces and searches for anonymous shares. Uses Impacket.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", "enum": [ "ElasticGroovyExploiter" ], - "title": "ElasticGroovy Exploiter" + "title": "ElasticGroovy Exploiter", + "info": "CVE-2015-1427. Logic is based on Metasploit module.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", "enum": [ "Struts2Exploiter" ], - "title": "Struts2 Exploiter" + "title": "Struts2 Exploiter", + "info": "Exploits struts2 java web framework. CVE-2017-5638. Logic based on this PoC.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", "enum": [ "WebLogicExploiter" ], - "title": "WebLogic Exploiter" + "title": "WebLogic Exploiter", + "info": "Exploits CVE-2017-10271 and CVE-2019-2725 vulnerabilities on WebLogic server.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", "enum": [ "HadoopExploiter" ], - "title": "Hadoop/Yarn Exploiter" + "title": "Hadoop/Yarn Exploiter", + "info": "Remote code execution on HADOOP server with YARN and default settings. " + "Logic based on https://github.com/vulhub/vulhub/tree/master/hadoop/unauthorized-yarn.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" }, { "type": "string", "enum": [ "VSFTPDExploiter" ], - "title": "VSFTPD Exploiter" + "title": "VSFTPD Exploiter", + "info": "Exploits a malicious backdoor that was added to the VSFTPD download archive. " + "Logic based on Metasploit module.", + "link": "https://github.com/guardicore/monkey/wiki/Exploiters" } ] }, diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js index a9c592d7c..7b7d2bfcb 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/UiSchema.js @@ -1,4 +1,4 @@ -import ArrayFieldTemplate from "../ui-components/AdvancedMultipleSelect"; +import AdvancedMultiSelect from "../ui-components/AdvancedMultiSelect"; import PbaInput from "./PbaInput"; import {API_PBA_LINUX, API_PBA_WINDOWS} from '../pages/ConfigurePage'; @@ -6,11 +6,6 @@ export default function UiSchema(props) { const UiSchema = { basic: { 'ui:order': ['general', 'credentials'], - credentials: { - exploit_password_list: { - "ui:ArrayFieldTemplate": ArrayFieldTemplate - } - } }, basic_network: {}, monkey: { @@ -54,7 +49,13 @@ export default function UiSchema(props) { exploits: { general: { exploiter_classes: { - "ui:ArrayFieldTemplate": ArrayFieldTemplate + 'ui:widget': AdvancedMultiSelect, + 'ui:options': { + defaultPaneParams: { + title: 'Exploiters', + content: 'Click on exploiter to get more information about it.' + } + } } } }, diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js b/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js new file mode 100644 index 000000000..f8083060b --- /dev/null +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js @@ -0,0 +1,111 @@ +import React, {useState} from 'react'; + +import {Card, Button, Form} from 'react-bootstrap'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faSquare, faCheckSquare} from '@fortawesome/free-solid-svg-icons'; +import {cloneDeep} from 'lodash'; + +import {getComponentHeight} from './utils/HeightCalculator'; +import {resolveObjectPath} from './utils/ObjectPathResolver'; +import InfoPane from './InfoPane'; + + +function getSelectValuesAfterClick(valueArray, clickedValue) { + if (valueArray.includes(clickedValue)) { + return valueArray.filter((e) => { + return e !== clickedValue; + }); + } else { + valueArray.push(clickedValue); + return valueArray; + } +} + +function onMasterCheckboxClick(checkboxValue, defaultArray, onChangeFnc) { + if (checkboxValue) { + onChangeFnc([]); + } else { + onChangeFnc(defaultArray); + } +} + +// Definitions passed to components only contains value and label, +// custom fields like "info" or "links" must be pulled from registry object using this function +function getFullDefinitionsFromRegistry(refString, registry) { + let refArray = refString.replace('#', '').split('/'); + let definitionObject = resolveObjectPath(refArray, registry); + return definitionObject.anyOf; +} + +function getFullDefinitionByKey(refString, registry, itemKey) { + let fullArray = getFullDefinitionsFromRegistry(refString, registry); + return fullArray.filter(e => (e.enum[0] === itemKey))[0]; +} + +function setPaneInfo(refString, registry, itemKey, setPaneInfoFnc) { + let definitionObj = getFullDefinitionByKey(refString, registry, itemKey); + setPaneInfoFnc({title: definitionObj.title, content: definitionObj.info, link: definitionObj.link}); +} + +function AdvancedMultiSelect(props) { + const [masterCheckbox, setMasterCheckbox] = useState(true); + const { + schema, + id, + options, + value, + required, + disabled, + readonly, + multiple, + autofocus, + onChange, + registry + } = props; + const {enumOptions, defaultPaneParams} = options; + const [infoPaneParams, setInfoPaneParams] = useState(defaultPaneParams); + const selectValue = cloneDeep(value); + return ( +
- -
-