UI: Add UsedCredentials component to render credentials

This commit is contained in:
Ilija Lazoroski 2022-07-14 16:48:58 +02:00
parent e61b0bfdca
commit 2861f0b085
1 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,41 @@
import {getAllUsernames, getAllSecrets} from '../credentialParsing';
import React from 'react';
class UsedCredentials extends React.Component {
constructor(props) {
super(props);
}
render() {
let allUsernames = getAllUsernames(this.props.stolen, this.props.configured);
let allSecrets = getAllSecrets(this.props.stolen, this.props.configured);
allSecrets.map(x => console.log(x['type'], x['content']));
return (
allUsernames.length > 0 ?
<>
<p>
Usernames used for brute-forcing:
</p>
<ul>
{allUsernames.map(x => <li key={x}>{x}</li>)}
</ul>
<p>
Credentials used for brute-forcing:
</p>
<ul>
{allSecrets.map((x, index) => <li
key={index}>{x['type']}: {x['content'].substr(0, 3) + '******'}</li>)}
</ul>
</>
:
<p>
No credentials were used.
</p>
)
}
}
export default UsedCredentials;