diff --git a/monkey_island/cc/resources/telemetry.py b/monkey_island/cc/resources/telemetry.py index 4db48e010..a03ebb904 100644 --- a/monkey_island/cc/resources/telemetry.py +++ b/monkey_island/cc/resources/telemetry.py @@ -88,7 +88,7 @@ class Telemetry(flask_restful.Resource): def process_tunnel_telemetry(self, telemetry_json): monkey_id = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid'])["_id"] - if telemetry_json['data']['proxy'] is not None: + if telemetry_json['data'] is not None: host = telemetry_json['data']['proxy'].split(":")[-2].replace("//", "") tunnel_host_id = NodeService.get_monkey_by_ip(host)["_id"] NodeService.set_monkey_tunnel(monkey_id, tunnel_host_id) diff --git a/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index eb91ae606..1ed35828b 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} from 'react-bootstrap'; +import {Button, Col, Well, Nav, NavItem} from 'react-bootstrap'; import CopyToClipboard from 'react-copy-to-clipboard'; import {Icon} from 'react-fa'; import {Link} from "react-router-dom"; @@ -11,7 +11,8 @@ class RunMonkeyPageComponent extends React.Component { ips: [], selectedIp: '0.0.0.0', isRunningOnIsland: false, - isRunningLocally: false + isRunningLocally: false, + selectedSection: "windows-32" }; } @@ -56,7 +57,9 @@ class RunMonkeyPageComponent extends React.Component { }); }; - generateCmdDiv(ip, isLinux, is32Bit) { + generateCmdDiv(ip) { + let isLinux = (this.state.selectedSection.split('-')[0] === "linux"); + let is32Bit = (this.state.selectedSection.split('-')[1] === "32"); let cmdText = ""; if (isLinux) { cmdText = this.generateLinuxCmd(ip, is32Bit); @@ -77,6 +80,12 @@ class RunMonkeyPageComponent extends React.Component { ) } + setSelectedSection = (key) => { + this.setState({ + selectedSection: key + }); + }; + render() { return ( @@ -110,18 +119,15 @@ class RunMonkeyPageComponent extends React.Component {
(The IP address is used as the monkey's C&C address)

- - {this.state.ips.map(ip => - - [ - this.generateCmdDiv(ip, true, true), - this.generateCmdDiv(ip, true, false), - this.generateCmdDiv(ip, false, true), - this.generateCmdDiv(ip, false, false) - ] - - )} - + + {this.state.ips.map(ip => this.generateCmdDiv(ip))}

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