forked from p15670423/monkey
Technique dependency fixed.
This commit is contained in:
parent
64701e042e
commit
08801c8cd5
|
@ -53,7 +53,8 @@ SCHEMA = {
|
||||||
"value": True,
|
"value": True,
|
||||||
"necessary": False,
|
"necessary": False,
|
||||||
"description": "Adversaries may use brute force techniques to attempt access to accounts "
|
"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": {
|
"T1003": {
|
||||||
"title": "T1003 Credential dumping",
|
"title": "T1003 Credential dumping",
|
||||||
|
|
|
@ -175,7 +175,6 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
console.log('bad configuration');
|
console.log('bad configuration');
|
||||||
this.setState({lastAction: 'invalid_configuration'});
|
this.setState({lastAction: 'invalid_configuration'});
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Alters attack configuration when user toggles technique
|
// Alters attack configuration when user toggles technique
|
||||||
|
@ -187,13 +186,19 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
let tempMatrix = this.state.attackConfig;
|
let tempMatrix = this.state.attackConfig;
|
||||||
tempMatrix[techType[0]].properties[technique].value = value;
|
tempMatrix[techType[0]].properties[technique].value = value;
|
||||||
this.setState({attackConfig: tempMatrix});
|
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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue