forked from p15670423/monkey
parent
efef30e235
commit
59132e08a0
|
@ -98,8 +98,8 @@ class ConfigurePageComponent extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
let displayedSchema = {};
|
let displayedSchema = {};
|
||||||
if (this.state.schema.hasOwnProperty('properties')) {
|
if (this.state.schema.hasOwnProperty('properties')) {
|
||||||
displayedSchema = this.state.schema["properties"][this.state.selectedSection];
|
displayedSchema = this.state.schema['properties'][this.state.selectedSection];
|
||||||
displayedSchema["definitions"] = this.state.schema["definitions"];
|
displayedSchema['definitions'] = this.state.schema['definitions'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -54,16 +54,12 @@ class MapPageComponent extends React.Component {
|
||||||
switch (group) {
|
switch (group) {
|
||||||
case 'exploited':
|
case 'exploited':
|
||||||
return '#c00';
|
return '#c00';
|
||||||
break;
|
|
||||||
case 'tunnel':
|
case 'tunnel':
|
||||||
return '#aaa';
|
return '#aaa';
|
||||||
break;
|
|
||||||
case 'scan':
|
case 'scan':
|
||||||
return '#f90';
|
return '#f90';
|
||||||
break;
|
|
||||||
case 'island':
|
case 'island':
|
||||||
return '#aaa';
|
return '#aaa';
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return 'black';
|
return 'black';
|
||||||
}
|
}
|
||||||
|
@ -113,12 +109,12 @@ class MapPageComponent extends React.Component {
|
||||||
console.log('selection cleared.'); // eslint-disable-line no-console
|
console.log('selection cleared.'); // eslint-disable-line no-console
|
||||||
this.setState({selected: null, selectedType: null});
|
this.setState({selected: null, selectedType: null});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
killAllMonkeys = () => {
|
killAllMonkeys = () => {
|
||||||
fetch('/api?action=killall')
|
fetch('/api?action=killall')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => this.setState({killPressed: (res.status==="OK")}));
|
.then(res => this.setState({killPressed: (res.status === 'OK')}));
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Col} from 'react-bootstrap';
|
import {Col} from 'react-bootstrap';
|
||||||
import {Link} from 'react-router-dom';
|
|
||||||
|
|
||||||
class ReportPageComponent extends React.Component {
|
class ReportPageComponent extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import {Button, Col, Well, Nav, NavItem} from 'react-bootstrap';
|
import {Button, Col, Well, Nav, NavItem} from 'react-bootstrap';
|
||||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||||
import {Icon} from 'react-fa';
|
import {Icon} from 'react-fa';
|
||||||
import {Link} from "react-router-dom";
|
import {Link} from 'react-router-dom';
|
||||||
|
|
||||||
class RunMonkeyPageComponent extends React.Component {
|
class RunMonkeyPageComponent extends React.Component {
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ class RunMonkeyPageComponent extends React.Component {
|
||||||
this.state = {
|
this.state = {
|
||||||
ips: [],
|
ips: [],
|
||||||
selectedIp: '0.0.0.0',
|
selectedIp: '0.0.0.0',
|
||||||
runningOnIslandState: "not_running",
|
runningOnIslandState: 'not_running',
|
||||||
runningOnClientState: "not_running",
|
runningOnClientState: 'not_running',
|
||||||
selectedSection: "windows-32"
|
selectedSection: 'windows-32'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ class RunMonkeyPageComponent extends React.Component {
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res =>{
|
.then(res =>{
|
||||||
if (res['is_running']) {
|
if (res['is_running']) {
|
||||||
this.setState({runningOnIslandState: "running"});
|
this.setState({runningOnIslandState: 'running'});
|
||||||
} else {
|
} else {
|
||||||
this.setState({runningOnIslandState: "not_running"});
|
this.setState({runningOnIslandState: 'not_running'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ class RunMonkeyPageComponent extends React.Component {
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res['is_running']) {
|
if (res['is_running']) {
|
||||||
this.setState({runningOnClientState: "running"});
|
this.setState({runningOnClientState: 'running'});
|
||||||
} else {
|
} else {
|
||||||
this.setState({runningOnClientState: "not_running"});
|
this.setState({runningOnClientState: 'not_running'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -68,11 +68,11 @@ class RunMonkeyPageComponent extends React.Component {
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res['is_running']) {
|
if (res['is_running']) {
|
||||||
this.setState({
|
this.setState({
|
||||||
runningOnIslandState: "installing"
|
runningOnIslandState: 'installing'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
runningOnIslandState: "not_running"
|
runningOnIslandState: 'not_running'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,9 +81,9 @@ class RunMonkeyPageComponent extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
generateCmdDiv(ip) {
|
generateCmdDiv(ip) {
|
||||||
let isLinux = (this.state.selectedSection.split('-')[0] === "linux");
|
let isLinux = (this.state.selectedSection.split('-')[0] === 'linux');
|
||||||
let is32Bit = (this.state.selectedSection.split('-')[1] === "32");
|
let is32Bit = (this.state.selectedSection.split('-')[1] === '32');
|
||||||
let cmdText = "";
|
let cmdText = '';
|
||||||
if (isLinux) {
|
if (isLinux) {
|
||||||
cmdText = this.generateLinuxCmd(ip, is32Bit);
|
cmdText = this.generateLinuxCmd(ip, is32Bit);
|
||||||
} else {
|
} else {
|
||||||
|
@ -110,9 +110,9 @@ class RunMonkeyPageComponent extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
renderIconByState(state) {
|
renderIconByState(state) {
|
||||||
if (state === "running") {
|
if (state === 'running') {
|
||||||
return <Icon name="check" className="text-success" style={{'marginLeft': '5px'}}/>
|
return <Icon name="check" className="text-success" style={{'marginLeft': '5px'}}/>
|
||||||
} else if (state == "installing") {
|
} else if (state == 'installing') {
|
||||||
return <Icon name="refresh" className="text-success" style={{'marginLeft': '5px'}}/>
|
return <Icon name="refresh" className="text-success" style={{'marginLeft': '5px'}}/>
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
|
@ -130,13 +130,13 @@ class RunMonkeyPageComponent extends React.Component {
|
||||||
<p style={{'marginBottom': '2em'}}>
|
<p style={{'marginBottom': '2em'}}>
|
||||||
<button onClick={this.runLocalMonkey}
|
<button onClick={this.runLocalMonkey}
|
||||||
className="btn btn-default"
|
className="btn btn-default"
|
||||||
disabled={this.state.runningOnIslandState !== "not_running"}>
|
disabled={this.state.runningOnIslandState !== 'not_running'}>
|
||||||
Run on C&C Server
|
Run on C&C Server
|
||||||
{ this.renderIconByState(this.state.runningOnIslandState) }
|
{ this.renderIconByState(this.state.runningOnIslandState) }
|
||||||
</button>
|
</button>
|
||||||
<a href="/download-monkey"
|
<a
|
||||||
className="btn btn-default"
|
className="btn btn-default"
|
||||||
disabled={this.state.runningOnClientState !== "not_running"}
|
disabled={this.state.runningOnClientState !== 'not_running'}
|
||||||
style={{'marginLeft': '1em'}}>
|
style={{'marginLeft': '1em'}}>
|
||||||
Download and run locally
|
Download and run locally
|
||||||
{ this.renderIconByState(this.state.runningOnClientState) }
|
{ this.renderIconByState(this.state.runningOnClientState) }
|
||||||
|
|
|
@ -48,7 +48,7 @@ class StartOverPageComponent extends React.Component {
|
||||||
fetch('/api?action=reset')
|
fetch('/api?action=reset')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res["status"] == "OK") {
|
if (res['status'] === 'OK') {
|
||||||
this.setState({
|
this.setState({
|
||||||
cleaned: true
|
cleaned: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Icon} from "react-fa";
|
import {Icon} from 'react-fa';
|
||||||
|
|
||||||
class PreviewPaneComponent extends React.Component {
|
class PreviewPaneComponent extends React.Component {
|
||||||
|
|
||||||
|
@ -58,6 +58,10 @@ class PreviewPaneComponent extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
exploitsTimeline(asset) {
|
exploitsTimeline(asset) {
|
||||||
|
if (asset.exploits.length === 0) {
|
||||||
|
return (<div />);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h4 style={{'marginTop': '2em'}}>Timeline</h4>
|
<h4 style={{'marginTop': '2em'}}>Timeline</h4>
|
||||||
|
|
Loading…
Reference in New Issue