Hi Everyone,
Please help me out here with this issue:
I am testing a web app that uses 2FA with flawed logic, so the mfa code is vulnerable to brute force. Like many of you I am lazy and want to focus on the app, not the tool, so decided to automate that testing with a simple script, as shown below:
// generates all 4-digit combinations using the pattern 0000,0001,0002 etc until 9999
function generateCodeMfa () {
var mfaCode = [],n,padded;
for (n=0; n<=9999; n++) {
padded = ('000'+n).slice(-4);
mfaCode.push(padded);
}
return mfaCode
}
//print(generateCodeMfa().join("\n"));
function processMessage(utils, message) {
var mfa-code = message.getRequestBody().setFormParams(generateCodeMfa());
}
function processResult(utils, fuzzResult){
return true;
}
function getRequiredParamsNames(){
return [];
}
function getOptionalParamsNames(){
return [];
}
I have the script above under HTTP Fuzzer scripts, but it is not capturing the parameter mfa-code from my app and setting its value to the generated pattern above. Am I missing something here: message.getRequestBody().setFormParams(generateCodeMfa());?
The form to submit the mfa-code has got only one parameter, the mfa code.
Thank you to everybody