From 5e1adbb877d339d15c17a644cf243630c792ffe4 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 18 Jul 2022 08:27:35 +0200 Subject: [PATCH] UI: Add formatting to StolenPasswordsComponent This component was used in security and attack report with two different sets of data. The first one is from the credentials endpoint which needed formatting and the second from the telemetry which was already formatted. --- .../cc/ui/src/components/attack/techniques/T1003.js | 4 +++- .../ui/src/components/report-components/SecurityReport.js | 5 ++++- .../report-components/security/StolenPasswords.js | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1003.js b/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1003.js index 1a93c8e06..5d5cd72c8 100644 --- a/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1003.js +++ b/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1003.js @@ -18,7 +18,9 @@ class T1003 extends React.Component {
{this.props.data.status === ScanStatus.USED ? + data={this.props.data.stolen_creds} + format={false} + /> : ''} diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js index 4248a97fc..61f5dfc60 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js @@ -537,7 +537,10 @@ class ReportPageComponent extends AuthComponent {
- +
diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/StolenPasswords.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/StolenPasswords.js index d646974ec..b199d131d 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/StolenPasswords.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/StolenPasswords.js @@ -22,7 +22,11 @@ class StolenPasswordsComponent extends React.Component { render() { let defaultPageSize = this.props.data.length > pageSize ? pageSize : this.props.data.length; let showPagination = this.props.data.length > pageSize; - let table_data = getCredentialsTableData(this.props.data); + let table_data = this.props.data; + if(this.props.format) { + table_data = getCredentialsTableData(this.props.data); + } + return (