From 8675a7bb0be0ed06809d39baba36f52e34bee273 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 17:28:39 +0300 Subject: [PATCH 01/25] Remove description --- monkey_island/cc/services/node.py | 2 +- .../cc/ui/src/components/preview-pane/PreviewPane.js | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/monkey_island/cc/services/node.py b/monkey_island/cc/services/node.py index f5dbcf37c..55b82c5d0 100644 --- a/monkey_island/cc/services/node.py +++ b/monkey_island/cc/services/node.py @@ -31,7 +31,7 @@ class NodeService: # node is infected new_node = NodeService.monkey_to_net_node(monkey) for key in monkey: - if key not in ["_id", "modifytime", "parent", "dead"]: + if key not in ['_id', 'modifytime', 'parent', 'dead', 'description']: new_node[key] = monkey[key] else: diff --git a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js index 020c769e1..0df12e733 100644 --- a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js +++ b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js @@ -40,15 +40,6 @@ class PreviewPaneComponent extends React.Component { ); } - descriptionRow(asset) { - return ( - - Description - {asset.description} - - ); - } - aliveRow(asset) { return ( @@ -124,7 +115,6 @@ class PreviewPaneComponent extends React.Component {
- {this.descriptionRow(asset)} {this.aliveRow(asset)} {this.osRow(asset)} {this.ipsRow(asset)} From b3d89937ba6c6d123fdad6cd5a3de1f007f77f62 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 17:29:43 +0300 Subject: [PATCH 02/25] Page width varies on screen size --- monkey_island/cc/ui/src/components/pages/ConfigurePage.js | 2 +- monkey_island/cc/ui/src/components/pages/MapPage.js | 2 +- monkey_island/cc/ui/src/components/pages/ReadMePage.js | 2 +- monkey_island/cc/ui/src/components/pages/ReportPage.js | 2 +- monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js | 2 +- monkey_island/cc/ui/src/components/pages/RunServerPage.js | 2 +- monkey_island/cc/ui/src/components/pages/StartOverPage.js | 2 +- monkey_island/cc/ui/src/components/pages/TelemetryPage.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index 5b239d1f8..417325e58 100644 --- a/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -107,7 +107,7 @@ class ConfigurePageComponent extends React.Component { } return ( - +

Monkey Configuration

+

Infection Map

diff --git a/monkey_island/cc/ui/src/components/pages/ReadMePage.js b/monkey_island/cc/ui/src/components/pages/ReadMePage.js index 199e4c623..ad10cf787 100644 --- a/monkey_island/cc/ui/src/components/pages/ReadMePage.js +++ b/monkey_island/cc/ui/src/components/pages/ReadMePage.js @@ -34,7 +34,7 @@ class ReadMePageComponent extends React.Component { render() { return ( - +

Read Me

Penetration Test Report

diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index 95b819660..830b2a8e8 100644 --- a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -121,7 +121,7 @@ class RunMonkeyPageComponent extends React.Component { render() { return ( -

+

Run the Monkey

You can run the monkey on the C&C server, on your local machine and basically everywhere. diff --git a/monkey_island/cc/ui/src/components/pages/RunServerPage.js b/monkey_island/cc/ui/src/components/pages/RunServerPage.js index d601e1915..ff59b744d 100644 --- a/monkey_island/cc/ui/src/components/pages/RunServerPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunServerPage.js @@ -16,7 +16,7 @@ class RunServerPageComponent extends React.Component { render() { return ( -

+

Monkey Island C&C Server

Your Monkey Island server is up and running on {this.state.ip} 👏 👏

diff --git a/monkey_island/cc/ui/src/components/pages/StartOverPage.js b/monkey_island/cc/ui/src/components/pages/StartOverPage.js index 543f9465b..4c3ae8fb4 100644 --- a/monkey_island/cc/ui/src/components/pages/StartOverPage.js +++ b/monkey_island/cc/ui/src/components/pages/StartOverPage.js @@ -64,7 +64,7 @@ class StartOverPageComponent extends React.Component { render() { return ( -
+ {this.renderCleanDialogModal()}

Start Over

diff --git a/monkey_island/cc/ui/src/components/pages/TelemetryPage.js b/monkey_island/cc/ui/src/components/pages/TelemetryPage.js index d27adfcfa..816409e00 100644 --- a/monkey_island/cc/ui/src/components/pages/TelemetryPage.js +++ b/monkey_island/cc/ui/src/components/pages/TelemetryPage.js @@ -29,7 +29,7 @@ class TelemetryPageComponent extends React.Component { render() { return ( -
+

Monkey Telemetry

Date: Mon, 16 Oct 2017 17:37:11 +0300 Subject: [PATCH 03/25] Update legend to textual one --- .../cc/ui/src/components/pages/MapPage.js | 13 ++++++++++--- monkey_island/cc/ui/src/images/map-legend.png | Bin 2598 -> 0 bytes monkey_island/cc/ui/src/styles/App.css | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 monkey_island/cc/ui/src/images/map-legend.png diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index ef5ab9b9e..e9b3ebf32 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -165,10 +165,17 @@ class MapPageComponent extends React.Component {

Infection Map

- - - +
+ Legend: + Exploit + | + Scan + | + Tunnel + | + Island Communication +
diff --git a/monkey_island/cc/ui/src/images/map-legend.png b/monkey_island/cc/ui/src/images/map-legend.png deleted file mode 100644 index 4b7759a099c51ad75d0455eaaab0ad117773ece9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2598 zcmV+>3fc9EP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf3A;%|K~#8N?VY`H z<3$Kg~~P|Lm}JfsZ3W@jfV z*(ETs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-6_JN0@d;8wsFV*n(9m{V(!#nEp0l-KM3n*eb z+6In=BwG-B;VFuyH99Bz?+TdO&^i-O{tm{`>!}X?O#Y95!FT`s2Yjn8F$aX@{W@X2 zFid0iU!YuxjNSz4loB54aG`(ojsqQrVHk#C4$6Up9U6(EAO6#)r-=4bRLmLk_wV3) z?#&(#miOy~^};ZXIq)07*qo IM6N<$f`!@en*aa+ diff --git a/monkey_island/cc/ui/src/styles/App.css b/monkey_island/cc/ui/src/styles/App.css index 300e14cf8..98dc1be0e 100644 --- a/monkey_island/cc/ui/src/styles/App.css +++ b/monkey_island/cc/ui/src/styles/App.css @@ -270,6 +270,10 @@ body { background: #d30d09; } +.map-legend { + font-size: 18px; +} + /* * Full Logs Page */ From 768cfc3bb1df97a740082f952951c3296956d504 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 17:37:55 +0300 Subject: [PATCH 04/25] Change start over to be un-numbered --- monkey_island/cc/ui/src/components/Main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey_island/cc/ui/src/components/Main.js b/monkey_island/cc/ui/src/components/Main.js index 34e6f0137..36f57387e 100644 --- a/monkey_island/cc/ui/src/components/Main.js +++ b/monkey_island/cc/ui/src/components/Main.js @@ -106,7 +106,7 @@ class AppComponent extends React.Component {
  • - 5. + Start Over
  • From 7380f93ef89344be8b9eb6130273ad8411e0a091 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 17:40:11 +0300 Subject: [PATCH 05/25] Remove map legend require --- monkey_island/cc/ui/src/components/pages/MapPage.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index e9b3ebf32..b2023561b 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -11,8 +11,6 @@ let groupNames = ['clean_unknown', 'clean_linux', 'clean_windows', 'exploited_li 'manual_linux', 'manual_linux_running', 'manual_windows', 'manual_windows_running', 'monkey_linux', 'monkey_linux_running', 'monkey_windows', 'monkey_windows_running']; -let legend = require('../../images/map-legend.png'); - let getGroupsOptions = () => { let groupOptions = {}; for (let groupName of groupNames) { From e277bf66947ccdc695f5cdbde62a0af18eb5d3cf Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 17:40:27 +0300 Subject: [PATCH 06/25] Add console to map --- .../cc/ui/src/components/pages/MapPage.js | 7 ++++++ monkey_island/cc/ui/src/styles/App.css | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index b2023561b..018b090e5 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -174,6 +174,13 @@ class MapPageComponent extends React.Component { | Island Communication +
    +
    + 2017-10-16 16:00:05 + monkey-elastic + bla bla +
    +
    diff --git a/monkey_island/cc/ui/src/styles/App.css b/monkey_island/cc/ui/src/styles/App.css index 98dc1be0e..2f7ceed1e 100644 --- a/monkey_island/cc/ui/src/styles/App.css +++ b/monkey_island/cc/ui/src/styles/App.css @@ -270,6 +270,29 @@ body { background: #d30d09; } +.telemetry-console { + z-index: 2; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 70px; + background: rgba(0,0,0,0.7); + border-radius: 5px; + border: 3px solid #aaa; + padding: 0.5em; + color: white; + font-family: Consolas, "Courier New", monospace; +} + +.telemetry-console .date { + color: #ccc; +} + +.telemetry-console .source { + font-weight: bold; +} + .map-legend { font-size: 18px; } From 377a7a3c5e8a4a046ce4cd26bfba749b1e2e0df7 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 17:54:00 +0300 Subject: [PATCH 07/25] Minor improvements to preview pane --- .../cc/ui/src/components/preview-pane/PreviewPane.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js index 0df12e733..b5226fa8d 100644 --- a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js +++ b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js @@ -8,7 +8,7 @@ class PreviewPaneComponent extends React.Component { return (
    - + ); } @@ -40,11 +40,11 @@ class PreviewPaneComponent extends React.Component { ); } - aliveRow(asset) { + statusRow(asset) { return ( - - + + ); } @@ -65,7 +65,7 @@ class PreviewPaneComponent extends React.Component { @@ -115,8 +115,8 @@ class PreviewPaneComponent extends React.Component {
    Operating System{asset.os}{asset.os.charAt(0).toUpperCase() + asset.os.slice(1)}
    Alive{(!asset.dead).toString()}Status{(asset.dead) ? 'Dead' : 'Alive'}
    Force Kill - this.forceKill(e, asset)} />
    - {this.aliveRow(asset)} {this.osRow(asset)} + {this.statusRow(asset)} {this.ipsRow(asset)} {this.servicesRow(asset)} {this.accessibleRow(asset)} From 246c653029bbb17a321ea96c4b5f1a9e970f2007 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 18:10:58 +0300 Subject: [PATCH 08/25] Legend improvement --- monkey_island/cc/ui/src/components/pages/MapPage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index c31bbb6eb..351ed8bcf 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -165,11 +165,11 @@ class MapPageComponent extends React.Component {
    Legend: Exploit - | + | Scan - | + | Tunnel - | + | Island Communication
    From d95515d6782c0d25ed24e6d4b8c3db740727623f Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 16 Oct 2017 18:54:13 +0300 Subject: [PATCH 09/25] Add tooltips to preview pane --- .../components/preview-pane/PreviewPane.js | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js index 6e4178067..62cd25d34 100644 --- a/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js +++ b/monkey_island/cc/ui/src/components/preview-pane/PreviewPane.js @@ -1,9 +1,18 @@ import React from 'react'; import {Icon} from 'react-fa'; import Toggle from 'react-toggle'; +import {OverlayTrigger, Tooltip} from 'react-bootstrap'; class PreviewPaneComponent extends React.Component { + generateToolTip(text) { + return ( + {text}}> + + + ); + } + osRow(asset) { return (
    @@ -34,7 +43,10 @@ class PreviewPaneComponent extends React.Component { accessibleRow(asset) { return ( - + ); @@ -63,10 +75,14 @@ class PreviewPaneComponent extends React.Component { forceKillRow(asset) { return ( - + ); @@ -79,7 +95,10 @@ class PreviewPaneComponent extends React.Component { return (
    -

    Timeline

    +

    + Exploit Timeline  + {this.generateToolTip('Timeline of exploit attempts. Red is successful. Gray is unsuccessful')} +

      { asset.exploits.map(exploit =>
    • From 9cbe35cddd12369e9b961a55d7e5df2eae96d2f5 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 11:04:13 +0300 Subject: [PATCH 10/25] Run monkey page improved visually --- .../ui/src/components/pages/RunMonkeyPage.js | 94 ++++++++++++------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index 830b2a8e8..281652d2f 100644 --- a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Button, Col, Well, Nav, NavItem} from 'react-bootstrap'; +import {Button, Col, Well, Nav, NavItem, Collapse} from 'react-bootstrap'; import CopyToClipboard from 'react-copy-to-clipboard'; import {Icon} from 'react-fa'; import {Link} from 'react-router-dom'; @@ -10,10 +10,11 @@ class RunMonkeyPageComponent extends React.Component { super(props); this.state = { ips: [], - selectedIp: '0.0.0.0', runningOnIslandState: 'not_running', runningOnClientState: 'not_running', - selectedSection: 'windows-32' + selectedIp: '0.0.0.0', + selectedOs: 'windows-32', + showManual: false }; } @@ -21,7 +22,8 @@ class RunMonkeyPageComponent extends React.Component { fetch('/api') .then(res => res.json()) .then(res => this.setState({ - ips: res['ip_addresses'] + ips: res['ip_addresses'], + selectedIp: res['ip_addresses'][0] })); fetch('/api/local-monkey') @@ -80,17 +82,17 @@ class RunMonkeyPageComponent extends React.Component { }); }; - generateCmdDiv(ip) { - let isLinux = (this.state.selectedSection.split('-')[0] === 'linux'); - let is32Bit = (this.state.selectedSection.split('-')[1] === '32'); + generateCmdDiv() { + let isLinux = (this.state.selectedOs.split('-')[0] === 'linux'); + let is32Bit = (this.state.selectedOs.split('-')[1] === '32'); let cmdText = ''; if (isLinux) { - cmdText = this.generateLinuxCmd(ip, is32Bit); + cmdText = this.generateLinuxCmd(this.state.selectedIp, is32Bit); } else { - cmdText = this.generateWindowsCmd(ip, is32Bit); + cmdText = this.generateWindowsCmd(this.state.selectedIp, is32Bit); } return ( - +

    Run the Monkey

    - You can run the monkey on the C&C server, on your local machine and basically everywhere. - The more the merrier 😄 + Go ahead and run the monkey!

    -

    +

    @@ -147,22 +161,36 @@ class RunMonkeyPageComponent extends React.Component { */ }

    -
    -

    - Run one of those snippets on a host for infecting it with a Monkey: -
    - (The IP address is used as the monkey's C&C address) -

    - - {this.state.ips.map(ip => this.generateCmdDiv(ip))} -
    +

    + OR +

    +

    + +

    + +
    +

    + Choose the operating system you want to run the monkey on, and the interface to communicate with +

    + + +

    + Copy the following command to your machine and run it as Administrator/root +

    + {this.generateCmdDiv()} +
    +
    +

    Go ahead and monitor the ongoing infection in the Infection Map view.

    From 085f0d2d69250ebcd948d1e79e582805c635f496 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 11:08:52 +0300 Subject: [PATCH 11/25] Make font consistent on run-monkey --- .../cc/ui/src/components/pages/RunMonkeyPage.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index 281652d2f..0de131bdf 100644 --- a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -137,7 +137,7 @@ class RunMonkeyPageComponent extends React.Component { return (

    Run the Monkey

    -

    +

    Go ahead and run the monkey!

    @@ -170,9 +170,9 @@ class RunMonkeyPageComponent extends React.Component {

    -
    -

    - Choose the operating system you want to run the monkey on, and the interface to communicate with +

    +

    + Choose the operating system you want to run the monkey on, and the interface to communicate with.

    -

    - Copy the following command to your machine and run it as Administrator/root +

    + Copy the following command to your machine and run it as Administrator/root.

    {this.generateCmdDiv()}
    From 1011e731afda63208a02b43b6c1907aaaab2336d Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 11:17:41 +0300 Subject: [PATCH 12/25] Improve modal boxes --- .../cc/ui/src/components/pages/MapPage.js | 28 ++++++++++--------- .../ui/src/components/pages/StartOverPage.js | 26 +++++++++-------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index 351ed8bcf..f3f3630a7 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -134,21 +134,23 @@ class MapPageComponent extends React.Component { return ( this.setState({showKillDialog: false})}> this.setState({showKillDialog: false})}> -

    Kill all monkeys

    +

    Are you sure you want to kill all monkeys?

    - Are you sure you want to kill all monkeys? + This might take a few moments...

    - - +
    + + +
    ) diff --git a/monkey_island/cc/ui/src/components/pages/StartOverPage.js b/monkey_island/cc/ui/src/components/pages/StartOverPage.js index 4c3ae8fb4..20b355cec 100644 --- a/monkey_island/cc/ui/src/components/pages/StartOverPage.js +++ b/monkey_island/cc/ui/src/components/pages/StartOverPage.js @@ -33,7 +33,7 @@ class StartOverPageComponent extends React.Component { return ( this.setState({showCleanDialog: false})}> this.setState({showCleanDialog: false})}> -

    Reset environment

    +

    Reset environment

    Are you sure you want to reset the environment?

    @@ -46,17 +46,19 @@ class StartOverPageComponent extends React.Component { :
    } - - +
    + + +
    ) From b58c4ea62214a2421593b1e14123377f8747427c Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 11:55:27 +0300 Subject: [PATCH 13/25] Remove relative range option from config --- chaos_monkey/config.py | 1 - chaos_monkey/example.conf | 1 - chaos_monkey/network/range.py | 2 +- monkey_island/cc/services/config.py | 11 ----------- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/chaos_monkey/config.py b/chaos_monkey/config.py index e1d830978..e62820816 100644 --- a/chaos_monkey/config.py +++ b/chaos_monkey/config.py @@ -183,7 +183,6 @@ class Configuration(object): local_network_scan = True range_class = FixedRange - range_size = 1 range_fixed = ['', ] blocked_ips = ['', ] diff --git a/chaos_monkey/example.conf b/chaos_monkey/example.conf index 05e8f0f5a..6f70f888a 100644 --- a/chaos_monkey/example.conf +++ b/chaos_monkey/example.conf @@ -52,7 +52,6 @@ "ms08_067_remote_user_add": "Monkey_IUSER_SUPPORT", "ms08_067_remote_user_pass": "Password1!", "ping_scan_timeout": 10000, - "range_size": 30, "rdp_use_vbs_download": true, "smb_download_timeout": 300, "smb_service_name": "InfectionMonkey", diff --git a/chaos_monkey/network/range.py b/chaos_monkey/network/range.py index 5163a6aad..fdd29bc09 100644 --- a/chaos_monkey/network/range.py +++ b/chaos_monkey/network/range.py @@ -45,7 +45,7 @@ class RelativeRange(NetworkRange): def __init__(self, base_address, shuffle=True): base_address = struct.unpack(">L", socket.inet_aton(base_address))[0] super(RelativeRange, self).__init__(base_address, shuffle=shuffle) - self._size = self._config.range_size + self._size = 1 def __repr__(self): return "" % (socket.inet_ntoa(struct.pack(">L", self._base_address - self._size)), diff --git a/monkey_island/cc/services/config.py b/monkey_island/cc/services/config.py index 7f7f0a227..700982164 100644 --- a/monkey_island/cc/services/config.py +++ b/monkey_island/cc/services/config.py @@ -208,28 +208,17 @@ SCHEMA = { "default": "FixedRange", "enum": [ "FixedRange", - "RelativeRange", "ClassCRange" ], "enumNames": [ "Fixed Range", - "Relative Range", "Class C Range" ], "description": "Determines which class to use to determine scan range." " Fixed Range will scan only specific IPs listed under Fixed range IP list." - " Relative Range will scan the closest ips to the machine's IP." " Class C Range will scan machines in the Class C network the monkey's on." }, - "range_size": { - "title": "Relative range size", - "type": "integer", - "default": 1, - "description": - "Determines the size of the RelativeRange - amount of IPs to scan" - " (Only relevant for Relative Range)" - }, "range_fixed": { "title": "Fixed range IP list", "type": "array", From 57e3677fce6616ccb845f4dbb61637ec1e34bf65 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 12:10:23 +0300 Subject: [PATCH 14/25] Show warning of new infections only if monkeys are running --- monkey_island/cc/services/config.py | 19 +++++++---- .../ui/src/components/pages/ConfigurePage.js | 33 +++++++++++++------ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/monkey_island/cc/services/config.py b/monkey_island/cc/services/config.py index 700982164..200e24029 100644 --- a/monkey_island/cc/services/config.py +++ b/monkey_island/cc/services/config.py @@ -191,10 +191,13 @@ SCHEMA = { "description": "Determines whether the monkey should scan its subnets additionally" }, "depth": { - "title": "Depth" + WARNING_SIGN, + "title": "Distance from island", "type": "integer", "default": 2, - "description": "Amount of hops allowed for the monkey to spread" + "description": + "Amount of hops allowed for the monkey to spread from the island. " + + WARNING_SIGN + + " Note that setting this value too high may result in the monkey propagating too far" } } }, @@ -293,12 +296,14 @@ SCHEMA = { "description": "Determines the maximum number of machines the monkey is allowed to scan" }, "victims_max_exploit": { - "title": "Max victims to exploit" + WARNING_SIGN, + "title": "Max victims to exploit", "type": "integer", "default": 7, "description": "Determines the maximum number of machines the monkey" - " is allowed to successfully exploit" + " is allowed to successfully exploit. " + WARNING_SIGN + + " Note that setting this value too high may result in the monkey propagating to " + "a high number of machines" }, "timeout_between_iterations": { "title": "Wait time between iterations", @@ -576,7 +581,7 @@ SCHEMA = { "type": "object", "properties": { "exploiter_classes": { - "title": "Exploits" + WARNING_SIGN, + "title": "Exploits", "type": "array", "uniqueItems": True, "items": { @@ -590,7 +595,9 @@ SCHEMA = { "SambaCryExploiter", "ElasticGroovyExploiter" ], - "description": "Determines which exploits to use" + "description": + "Determines which exploits to use. " + WARNING_SIGN + + " Note that using unsafe exploits may cause crashes of the exploited machine/service" }, "skip_exploit_if_file_exist": { "title": "Skip exploit if file exists", diff --git a/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index 417325e58..92d6a5687 100644 --- a/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -17,7 +17,8 @@ class ConfigurePageComponent extends React.Component { saved: false, reset: false, sections: [], - selectedSection: 'basic' + selectedSection: 'basic', + allMonkeysAreDead: true }; } @@ -36,6 +37,7 @@ class ConfigurePageComponent extends React.Component { selectedSection: 'basic' }) }); + this.updateMonkeysRunning(); } onSubmit = ({formData}) => { @@ -99,6 +101,17 @@ class ConfigurePageComponent extends React.Component { }); }; + updateMonkeysRunning = () => { + fetch('/api') + .then(res => res.json()) + .then(res => { + // This check is used to prevent unnecessary re-rendering + this.setState({ + allMonkeysAreDead: (!res['completed_steps']['run_monkey']) || (res['completed_steps']['infection_done']) + }); + }); + }; + render() { let displayedSchema = {}; if (this.state.schema.hasOwnProperty('properties')) { @@ -120,7 +133,7 @@ class ConfigurePageComponent extends React.Component { this.state.selectedSection === 'basic_network' ?
    - The Monkey scans its subnet if "Local network scan" is ticked. Additionally the monkey will scan machines + The Monkey scans its subnet if "Local network scan" is ticked. Additionally the monkey scans machines according to its range class.
    :
    @@ -131,14 +144,14 @@ class ConfigurePageComponent extends React.Component { onSubmit={this.onSubmit} onChange={this.onChange}>
    -
    - - Changing the configuration will only apply to new infections. -
    -
    - - Changing config values with the ⚠ mark may result in the monkey propagating too far or using dangerous exploits. -
    + { this.state.allMonkeysAreDead ? + '' : +
    + + Some monkeys are currently running. Note that changing the configuration will only apply to new + infections. +
    + }
    ( )} /> @@ -136,7 +137,7 @@ class AppComponent extends React.Component { ( )} /> ( )} /> ( )} /> - ( )} /> + ( )} /> diff --git a/monkey_island/cc/ui/src/components/pages/LicensePage.js b/monkey_island/cc/ui/src/components/pages/LicensePage.js index ad10cf787..d2303b195 100644 --- a/monkey_island/cc/ui/src/components/pages/LicensePage.js +++ b/monkey_island/cc/ui/src/components/pages/LicensePage.js @@ -1,28 +1,9 @@ import React from 'react'; -import {Col, Nav, NavItem} from 'react-bootstrap'; -var marked = require('marked'); +import {Col} from 'react-bootstrap'; -var aboutDoc = require('raw!../../readme/About.md'); -var usageDoc = require('raw!../../readme/Usage.md'); -var howItWorksDoc = require('raw!../../readme/HowItWorks.md'); -var licenseDoc = require('raw!../../readme/License.md'); - -class ReadMePageComponent extends React.Component { +class LicensePageComponent extends React.Component { constructor(props) { super(props); - - this.sectionKeys = ['about', 'howItWorks', 'usage', 'license']; - this.sections = - { - about: {title: 'About', data: aboutDoc}, - usage: {title: 'Usage', data: usageDoc}, - howItWorks: {title: 'How It Works', data: howItWorksDoc}, - license: {title: 'License', data: licenseDoc} - }; - - this.state = { - selectedSection: this.sectionKeys[0] - } } setSelectedSection = (key) => { @@ -32,22 +13,21 @@ class ReadMePageComponent extends React.Component { }; render() { - return ( -

    Read Me

    - -
    +

    License

    +
    +

    + Copyright 2017 Guardicore Ltd. + Licensed under GPLv3. +

    +

    + The source code is available on GitHub +

    ); } } -export default ReadMePageComponent; +export default LicensePageComponent; diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js index b4d6d55c1..d3df674df 100644 --- a/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -10,7 +10,7 @@ class ReportPageComponent extends React.Component { return (

    Penetration Test Report

    -
    +

    Under construction

    diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index 0de131bdf..1692004b4 100644 --- a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -139,6 +139,7 @@ class RunMonkeyPageComponent extends React.Component {

    Run the Monkey

    Go ahead and run the monkey! + (Or make further adjustments by configuring the monkey)

    -

    Infection Map

    +

    3. Infection Map

    diff --git a/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey_island/cc/ui/src/components/pages/ReportPage.js index d3df674df..633fadc12 100644 --- a/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -9,7 +9,7 @@ class ReportPageComponent extends React.Component { render() { return (
    -

    Penetration Test Report

    +

    4. Security Report

    Under construction diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index 1692004b4..40c1d9d97 100644 --- a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -136,7 +136,7 @@ class RunMonkeyPageComponent extends React.Component { render() { return (

    -

    Run the Monkey

    +

    2. Run the Monkey

    Go ahead and run the monkey! (Or make further adjustments by configuring the monkey) diff --git a/monkey_island/cc/ui/src/components/pages/RunServerPage.js b/monkey_island/cc/ui/src/components/pages/RunServerPage.js index 82934105b..876ddd7da 100644 --- a/monkey_island/cc/ui/src/components/pages/RunServerPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunServerPage.js @@ -17,7 +17,7 @@ class RunServerPageComponent extends React.Component { render() { return (

    -

    Monkey Island C&C Server

    +

    1. Monkey Island C&C Server

    Congrats! You have successfully set up the Monkey Island server. 👏 👏

    diff --git a/monkey_island/cc/ui/src/components/pages/TelemetryPage.js b/monkey_island/cc/ui/src/components/pages/TelemetryPage.js index 816409e00..03c57807e 100644 --- a/monkey_island/cc/ui/src/components/pages/TelemetryPage.js +++ b/monkey_island/cc/ui/src/components/pages/TelemetryPage.js @@ -30,7 +30,7 @@ class TelemetryPageComponent extends React.Component { render() { return (

    -

    Monkey Telemetry

    +

    Log

    Date: Tue, 17 Oct 2017 15:03:46 +0300 Subject: [PATCH 19/25] Remove console from map for now --- .../cc/ui/src/components/pages/MapPage.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey_island/cc/ui/src/components/pages/MapPage.js index cce1b2068..81f3baf8a 100644 --- a/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -174,13 +174,17 @@ class MapPageComponent extends React.Component { | Island Communication
    -
    -
    - 2017-10-16 16:00:05 - monkey-elastic - bla bla + { + /* +
    +
    + 2017-10-16 16:00:05 + monkey-elastic + bla bla +
    -
    + */ + }
    From c260508ca1b013fc643ca3d36580f5b0d84536d8 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 15:04:20 +0300 Subject: [PATCH 20/25] Rephrase content on start over page --- .../cc/ui/src/components/pages/StartOverPage.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/StartOverPage.js b/monkey_island/cc/ui/src/components/pages/StartOverPage.js index 20b355cec..2889a7067 100644 --- a/monkey_island/cc/ui/src/components/pages/StartOverPage.js +++ b/monkey_island/cc/ui/src/components/pages/StartOverPage.js @@ -71,11 +71,8 @@ class StartOverPageComponent extends React.Component {

    Start Over

    - In order to reset the entire environment, all monkeys will be ordered to kill themselves - and the database will be cleaned up. -

    -

    - After that you could go back to the Run Monkey page to start new infections. + If you are finished and want to start over with a fresh configuration, erase the logs and clear the map + you can go ahead and

    + You don't have to reset the environment to keep running monkeys. You can continue and Run More Monkeys as you wish, and see the results on the Infection Map without deleting anything.
    From 8a70ac3a8c1cabe0339762cba8f6bd28cf840dc5 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 15:30:42 +0300 Subject: [PATCH 21/25] Remove unecessary code from run server page --- monkey_island/cc/ui/src/components/pages/RunServerPage.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/RunServerPage.js b/monkey_island/cc/ui/src/components/pages/RunServerPage.js index 876ddd7da..243639136 100644 --- a/monkey_island/cc/ui/src/components/pages/RunServerPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunServerPage.js @@ -5,13 +5,6 @@ import {Link} from 'react-router-dom'; class RunServerPageComponent extends React.Component { constructor(props) { super(props); - this.state = {ip: '0.0.0.0'}; - } - - componentDidMount() { - fetch('/api') - .then(res => res.json()) - .then(res => this.setState({ip: res['ip_addresses'][0]})); } render() { From e644a77e0a3fa433c0dbba8c2664a842635046ba Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 17 Oct 2017 17:14:12 +0300 Subject: [PATCH 22/25] Last content adjustments on island --- .../cc/ui/src/components/pages/LicensePage.js | 1 + .../ui/src/components/pages/RunMonkeyPage.js | 18 +++++++++++------- .../ui/src/components/pages/RunServerPage.js | 8 +++++--- .../src/components/preview-pane/PreviewPane.js | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/monkey_island/cc/ui/src/components/pages/LicensePage.js b/monkey_island/cc/ui/src/components/pages/LicensePage.js index d2303b195..b7a2ec077 100644 --- a/monkey_island/cc/ui/src/components/pages/LicensePage.js +++ b/monkey_island/cc/ui/src/components/pages/LicensePage.js @@ -19,6 +19,7 @@ class LicensePageComponent extends React.Component {

    Copyright 2017 Guardicore Ltd. +
    Licensed under GPLv3.

    diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index 40c1d9d97..eed7d1446 100644 --- a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -139,7 +139,7 @@ class RunMonkeyPageComponent extends React.Component {

    2. Run the Monkey

    Go ahead and run the monkey! - (Or make further adjustments by configuring the monkey) + (Or configure the monkey to fine tune its behavior)

    Accessible From + Accessible From  + {this.generateToolTip('List of machine which can access this one using a network protocol')} + {asset.accessible_from_nodes.map(val =>
    {val}
    )}
    Force Kill + Force Kill  + {this.generateToolTip('If this is on, monkey will die next time it communicates')} + this.forceKill(e, asset)} /> + onChange={(e) => this.forceKill(e, asset)} /> +