Technique dependency fixed.

This commit is contained in:
VakarisZ 2019-05-27 13:31:15 +03:00
parent 64701e042e
commit 08801c8cd5
2 changed files with 14 additions and 8 deletions

View File

@ -53,7 +53,8 @@ SCHEMA = {
"value": True,
"necessary": False,
"description": "Adversaries may use brute force techniques to attempt access to accounts "
"when passwords are unknown or when password hashes are obtained."
"when passwords are unknown or when password hashes are obtained.",
"depends_on": ["T1210"]
},
"T1003": {
"title": "T1003 Credential dumping",

View File

@ -175,7 +175,6 @@ class ConfigurePageComponent extends AuthComponent {
console.log('bad configuration');
this.setState({lastAction: 'invalid_configuration'});
});
};
// Alters attack configuration when user toggles technique
@ -187,13 +186,19 @@ class ConfigurePageComponent extends AuthComponent {
let tempMatrix = this.state.attackConfig;
tempMatrix[techType[0]].properties[technique].value = value;
this.setState({attackConfig: tempMatrix});
// Toggle all mapped techniques
if (! mapped && tempMatrix[techType[0]].properties[technique].hasOwnProperty('depends_on')){
tempMatrix[techType[0]].properties[technique].depends_on.forEach(mappedTechnique => {
this.attackTechniqueChange(mappedTechnique, value, true)
})
}
// Toggle all mapped techniques
if (! mapped ){
// Loop trough each column and each row
Object.entries(this.state.attackConfig).forEach(otherType => {
Object.entries(otherType[1].properties).forEach(otherTech => {
// If this technique depends on a technique that was changed
if (otherTech[1].hasOwnProperty('depends_on') && otherTech[1]['depends_on'].includes(technique)){
this.attackTechniqueChange(otherTech[0], value, true)
}
})
});
}
}
});
};