forked from p34709852/monkey
More quote fixes, increased JS warnings to 500
This commit is contained in:
parent
4c8c423b9d
commit
09b8239fdb
|
@ -65,7 +65,7 @@ script:
|
||||||
- cd monkey_island/cc/ui
|
- cd monkey_island/cc/ui
|
||||||
- npm ci # See https://docs.npmjs.com/cli/ci.html
|
- npm ci # See https://docs.npmjs.com/cli/ci.html
|
||||||
- eslint ./src --quiet # Test for errors
|
- eslint ./src --quiet # Test for errors
|
||||||
- JS_WARNINGS_AMOUNT_UPPER_LIMIT=490
|
- JS_WARNINGS_AMOUNT_UPPER_LIMIT=500
|
||||||
- eslint ./src --max-warnings $JS_WARNINGS_AMOUNT_UPPER_LIMIT # Test for max warnings
|
- eslint ./src --max-warnings $JS_WARNINGS_AMOUNT_UPPER_LIMIT # Test for max warnings
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
|
|
|
@ -126,8 +126,8 @@ class PreviewPaneComponent extends AuthComponent {
|
||||||
Download Log
|
Download Log
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<a type="button"
|
<a type='button'
|
||||||
className={asset.has_log ? "btn btn-primary" : "btn btn-primary disabled"}
|
className={asset.has_log ? 'btn btn-primary' : 'btn btn-primary disabled'}
|
||||||
onClick={() => this.downloadLog(asset)}>Download</a>
|
onClick={() => this.downloadLog(asset)}>Download</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -145,7 +145,7 @@ class PreviewPaneComponent extends AuthComponent {
|
||||||
Exploit Timeline
|
Exploit Timeline
|
||||||
{this.generateToolTip('Timeline of exploit attempts. Red is successful. Gray is unsuccessful')}
|
{this.generateToolTip('Timeline of exploit attempts. Red is successful. Gray is unsuccessful')}
|
||||||
</h4>
|
</h4>
|
||||||
<ul className="timeline">
|
<ul className='timeline'>
|
||||||
{asset.exploits.map(exploit =>
|
{asset.exploits.map(exploit =>
|
||||||
<li key={exploit.timestamp}>
|
<li key={exploit.timestamp}>
|
||||||
<div className={'bullet ' + (exploit.result ? 'bad' : '')}/>
|
<div className={'bullet ' + (exploit.result ? 'bad' : '')}/>
|
||||||
|
@ -170,7 +170,7 @@ class PreviewPaneComponent extends AuthComponent {
|
||||||
assetInfo(asset) {
|
assetInfo(asset) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<table className="table table-condensed">
|
<table className='table table-condensed'>
|
||||||
<tbody>
|
<tbody>
|
||||||
{this.osRow(asset)}
|
{this.osRow(asset)}
|
||||||
{this.ipsRow(asset)}
|
{this.ipsRow(asset)}
|
||||||
|
@ -186,7 +186,7 @@ class PreviewPaneComponent extends AuthComponent {
|
||||||
infectedAssetInfo(asset) {
|
infectedAssetInfo(asset) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<table className="table table-condensed">
|
<table className='table table-condensed'>
|
||||||
<tbody>
|
<tbody>
|
||||||
{this.osRow(asset)}
|
{this.osRow(asset)}
|
||||||
{this.statusRow(asset)}
|
{this.statusRow(asset)}
|
||||||
|
@ -205,7 +205,7 @@ class PreviewPaneComponent extends AuthComponent {
|
||||||
scanInfo(edge) {
|
scanInfo(edge) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<table className="table table-condensed">
|
<table className='table table-condensed'>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Operating System</th>
|
<th>Operating System</th>
|
||||||
|
@ -226,7 +226,7 @@ class PreviewPaneComponent extends AuthComponent {
|
||||||
'' :
|
'' :
|
||||||
<div>
|
<div>
|
||||||
<h4 style={{'marginTop': '2em'}}>Timeline</h4>
|
<h4 style={{'marginTop': '2em'}}>Timeline</h4>
|
||||||
<ul className="timeline">
|
<ul className='timeline'>
|
||||||
{edge.exploits.map(exploit =>
|
{edge.exploits.map(exploit =>
|
||||||
<li key={exploit.timestamp}>
|
<li key={exploit.timestamp}>
|
||||||
<div className={'bullet ' + (exploit.result ? 'bad' : '')}/>
|
<div className={'bullet ' + (exploit.result ? 'bad' : '')}/>
|
||||||
|
@ -281,7 +281,7 @@ class PreviewPaneComponent extends AuthComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="preview-pane">
|
<div className='preview-pane'>
|
||||||
{!info ?
|
{!info ?
|
||||||
<span>
|
<span>
|
||||||
<FontAwesomeIcon icon={faHandPointLeft} style={{'marginRight': '0.5em'}}/>
|
<FontAwesomeIcon icon={faHandPointLeft} style={{'marginRight': '0.5em'}}/>
|
||||||
|
|
|
@ -7,9 +7,9 @@ import {FilePond} from 'react-filepond';
|
||||||
import 'filepond/dist/filepond.min.css';
|
import 'filepond/dist/filepond.min.css';
|
||||||
import ConfigMatrixComponent from '../attack/ConfigMatrixComponent';
|
import ConfigMatrixComponent from '../attack/ConfigMatrixComponent';
|
||||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||||
import {faInfoCircle} from "@fortawesome/free-solid-svg-icons/faInfoCircle";
|
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle';
|
||||||
import {faCheck} from "@fortawesome/free-solid-svg-icons/faCheck";
|
import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck';
|
||||||
import {faExclamationCircle} from "@fortawesome/free-solid-svg-icons/faExclamationCircle";
|
import {faExclamationCircle} from '@fortawesome/free-solid-svg-icons/faExclamationCircle';
|
||||||
|
|
||||||
const ATTACK_URL = '/api/attack';
|
const ATTACK_URL = '/api/attack';
|
||||||
const CONFIG_URL = '/api/configuration/island';
|
const CONFIG_URL = '/api/configuration/island';
|
||||||
|
@ -223,14 +223,14 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
}}>
|
}}>
|
||||||
<Modal.Body>
|
<Modal.Body>
|
||||||
<h2>
|
<h2>
|
||||||
<div className="text-center">Warning</div>
|
<div className='text-center'>Warning</div>
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-center" style={{'fontSize': '1.2em', 'marginBottom': '2em'}}>
|
<p className='text-center' style={{'fontSize': '1.2em', 'marginBottom': '2em'}}>
|
||||||
You have unsubmitted changes. Submit them before proceeding.
|
You have unsubmitted changes. Submit them before proceeding.
|
||||||
</p>
|
</p>
|
||||||
<div className="text-center">
|
<div className='text-center'>
|
||||||
<Button type="button"
|
<Button type='button'
|
||||||
className="btn btn-success"
|
className='btn btn-success'
|
||||||
size='lg'
|
size='lg'
|
||||||
style={{margin: '5px'}}
|
style={{margin: '5px'}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -459,16 +459,16 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
noValidate={true}
|
noValidate={true}
|
||||||
className={'config-form'}>
|
className={'config-form'}>
|
||||||
<button type="submit" className={'hidden'}>Submit</button>
|
<button type='submit' className={'hidden'}>Submit</button>
|
||||||
</Form>
|
</Form>
|
||||||
</div>)
|
</div>)
|
||||||
};
|
};
|
||||||
|
|
||||||
renderBasicNetworkWarning = () => {
|
renderBasicNetworkWarning = () => {
|
||||||
if (this.state.selectedSection === 'basic_network') {
|
if (this.state.selectedSection === 'basic_network') {
|
||||||
return (<div className="alert alert-info">
|
return (<div className='alert alert-info'>
|
||||||
<FontAwesomeIcon icon={faInfoCircle} style={{'marginRight': '5px'}}/>
|
<FontAwesomeIcon icon={faInfoCircle} style={{'marginRight': '5px'}}/>
|
||||||
The Monkey scans its subnet if "Local network scan" is ticked. Additionally the monkey scans machines
|
The Monkey scans its subnet if 'Local network scan' is ticked. Additionally the monkey scans machines
|
||||||
according to its range class.
|
according to its range class.
|
||||||
</div>)
|
</div>)
|
||||||
} else {
|
} else {
|
||||||
|
@ -477,7 +477,7 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
renderNav = () => {
|
renderNav = () => {
|
||||||
return (<Nav variant="tabs"
|
return (<Nav variant='tabs'
|
||||||
fill
|
fill
|
||||||
activeKey={this.state.selectedSection} onSelect={this.setSelectedSection}
|
activeKey={this.state.selectedSection} onSelect={this.setSelectedSection}
|
||||||
style={{'marginBottom': '2em'}}
|
style={{'marginBottom': '2em'}}
|
||||||
|
@ -506,55 +506,55 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
lg={{offset: 3, span: 8}} xl={{offset: 2, span: 8}}
|
lg={{offset: 3, span: 8}} xl={{offset: 2, span: 8}}
|
||||||
className={'main'}>
|
className={'main'}>
|
||||||
{this.renderAttackAlertModal()}
|
{this.renderAttackAlertModal()}
|
||||||
<h1 className="page-title">Monkey Configuration</h1>
|
<h1 className='page-title'>Monkey Configuration</h1>
|
||||||
{this.renderNav()}
|
{this.renderNav()}
|
||||||
{content}
|
{content}
|
||||||
<div className="text-center">
|
<div className='text-center'>
|
||||||
<button type="submit" onClick={this.onSubmit} className="btn btn-success btn-lg" style={{margin: '5px'}}>
|
<button type='submit' onClick={this.onSubmit} className='btn btn-success btn-lg' style={{margin: '5px'}}>
|
||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
<button type="button" onClick={this.resetConfig} className="btn btn-danger btn-lg" style={{margin: '5px'}}>
|
<button type='button' onClick={this.resetConfig} className='btn btn-danger btn-lg' style={{margin: '5px'}}>
|
||||||
Reset to defaults
|
Reset to defaults
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-center">
|
<div className='text-center'>
|
||||||
<button onClick={() => document.getElementById('uploadInputInternal').click()}
|
<button onClick={() => document.getElementById('uploadInputInternal').click()}
|
||||||
className="btn btn-info btn-lg" style={{margin: '5px'}}>
|
className='btn btn-info btn-lg' style={{margin: '5px'}}>
|
||||||
Import Config
|
Import Config
|
||||||
</button>
|
</button>
|
||||||
<input id="uploadInputInternal" type="file" accept=".conf" onChange={this.importConfig}
|
<input id='uploadInputInternal' type='file' accept='.conf' onChange={this.importConfig}
|
||||||
style={{display: 'none'}}/>
|
style={{display: 'none'}}/>
|
||||||
<button type="button" onClick={this.exportConfig} className="btn btn-info btn-lg" style={{margin: '5px'}}>
|
<button type='button' onClick={this.exportConfig} className='btn btn-info btn-lg' style={{margin: '5px'}}>
|
||||||
Export config
|
Export config
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{this.state.lastAction === 'reset' ?
|
{this.state.lastAction === 'reset' ?
|
||||||
<div className="alert alert-success">
|
<div className='alert alert-success'>
|
||||||
<FontAwesomeIcon icon={faCheck} style={{'marginRight': '5px'}}/>
|
<FontAwesomeIcon icon={faCheck} style={{'marginRight': '5px'}}/>
|
||||||
Configuration reset successfully.
|
Configuration reset successfully.
|
||||||
</div>
|
</div>
|
||||||
: ''}
|
: ''}
|
||||||
{this.state.lastAction === 'saved' ?
|
{this.state.lastAction === 'saved' ?
|
||||||
<div className="alert alert-success">
|
<div className='alert alert-success'>
|
||||||
<FontAwesomeIcon icon={faCheck} style={{'marginRight': '5px'}}/>
|
<FontAwesomeIcon icon={faCheck} style={{'marginRight': '5px'}}/>
|
||||||
Configuration saved successfully.
|
Configuration saved successfully.
|
||||||
</div>
|
</div>
|
||||||
: ''}
|
: ''}
|
||||||
{this.state.lastAction === 'import_failure' ?
|
{this.state.lastAction === 'import_failure' ?
|
||||||
<div className="alert alert-danger">
|
<div className='alert alert-danger'>
|
||||||
<FontAwesomeIcon icon={faExclamationCircle} style={{'marginRight': '5px'}}/>
|
<FontAwesomeIcon icon={faExclamationCircle} style={{'marginRight': '5px'}}/>
|
||||||
Failed importing configuration. Invalid config file.
|
Failed importing configuration. Invalid config file.
|
||||||
</div>
|
</div>
|
||||||
: ''}
|
: ''}
|
||||||
{this.state.lastAction === 'invalid_configuration' ?
|
{this.state.lastAction === 'invalid_configuration' ?
|
||||||
<div className="alert alert-danger">
|
<div className='alert alert-danger'>
|
||||||
<FontAwesomeIcon icon={faExclamationCircle} style={{'marginRight': '5px'}}/>
|
<FontAwesomeIcon icon={faExclamationCircle} style={{'marginRight': '5px'}}/>
|
||||||
An invalid configuration file was imported or submitted.
|
An invalid configuration file was imported or submitted.
|
||||||
</div>
|
</div>
|
||||||
: ''}
|
: ''}
|
||||||
{this.state.lastAction === 'import_success' ?
|
{this.state.lastAction === 'import_success' ?
|
||||||
<div className="alert alert-success">
|
<div className='alert alert-success'>
|
||||||
<FontAwesomeIcon icon={faCheck} style={{'marginRight': '5px'}}/>
|
<FontAwesomeIcon icon={faCheck} style={{'marginRight': '5px'}}/>
|
||||||
Configuration imported successfully.
|
Configuration imported successfully.
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue