From da9c0b747c3823529294cb59d09fed055ce8942c Mon Sep 17 00:00:00 2001 From: sein Date: Thu, 3 Sep 2026 17:38:07 +0200 Subject: [PATCH] allow up to 8 custom charsets when doing keyspace estimation on old frontend --- src/static/optparse.hashtopolis.1.1.1.js | 44 +++++++++++++++++++ src/templates/supertasks/detail.template.html | 14 +++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/static/optparse.hashtopolis.1.1.1.js b/src/static/optparse.hashtopolis.1.1.1.js index fbda6a3f6..ab44eb288 100644 --- a/src/static/optparse.hashtopolis.1.1.1.js +++ b/src/static/optparse.hashtopolis.1.1.1.js @@ -107,6 +107,10 @@ let switches = [ ['-2', '--custom-charset2 MESSAGE', "User-defined charset ?2"], // TODO: Check Charset ['-3', '--custom-charset3 MESSAGE', "User-defined charset ?3"], // TODO: Check Charset ['-4', '--custom-charset4 MESSAGE', "User-defined charset ?4"], // TODO: Check Charset + ['-5', '--custom-charset5 MESSAGE', "User-defined charset ?5"], + ['-6', '--custom-charset6 MESSAGE', "User-defined charset ?6"], + ['-7', '--custom-charset7 MESSAGE', "User-defined charset ?7"], + ['-8', '--custom-charset8 MESSAGE', "User-defined charset ?8"], ['-i', '--increment', "Enable mask increment mode"], ['--increment-min NUMBER', "Start mask incrementing at X"], ['--increment-max NUMBER', "Stop mask incrementing at X"], // TODO: Compare MIN and MAX values @@ -131,6 +135,10 @@ let defaultOptions = { customCharset2: '', customCharset3: '', customCharset4: '', + customCharset5: '', + customCharset6: '', + customCharset7: '', + customCharset8: '', unrecognizedFlag: [] }; var options = defaultOptions; @@ -211,6 +219,22 @@ parser.on('custom-charset4', function(name, value) { // console.log('Custom Charset 4: ' + value); options.customCharset4 = value; }); +parser.on('custom-charset5', function(name, value) { + // console.log('Custom Charset 5: ' + value); + options.customCharset5 = value; +}); +parser.on('custom-charset6', function(name, value) { + // console.log('Custom Charset 6: ' + value); + options.customCharset6 = value; +}); +parser.on('custom-charset7', function(name, value) { + // console.log('Custom Charset 7: ' + value); + options.customCharset7 = value; +}); +parser.on('custom-charset8', function(name, value) { + // console.log('Custom Charset 8: ' + value); + options.customCharset8 = value; +}); parser.on('print', function(value) { // console.log('PRINT: ' + value); }); @@ -328,6 +352,26 @@ function validateHashcatCommand(opt) { return {"result": true, "reason": "Bruteforce Attack with Character Set 4"}; } } + if(opt.customCharset5 != '') { + if(opt.posArgs[1].indexOf('?5') !== -1) { + return {"result": true, "reason": "Bruteforce Attack with Character Set 5"}; + } + } + if(opt.customCharset6 != '') { + if(opt.posArgs[1].indexOf('?6') !== -1) { + return {"result": true, "reason": "Bruteforce Attack with Character Set 6"}; + } + } + if(opt.customCharset7 != '') { + if(opt.posArgs[1].indexOf('?7') !== -1) { + return {"result": true, "reason": "Bruteforce Attack with Character Set 7"}; + } + } + if(opt.customCharset8 != '') { + if(opt.posArgs[1].indexOf('?8') !== -1) { + return {"result": true, "reason": "Bruteforce Attack with Character Set 8"}; + } + } // No custom character set return {"result": true, "reason": "Bruteforce Attack with pattern: " + opt.posArgs[1]}; diff --git a/src/templates/supertasks/detail.template.html b/src/templates/supertasks/detail.template.html index c8e9d08b0..5efd865d0 100755 --- a/src/templates/supertasks/detail.template.html +++ b/src/templates/supertasks/detail.template.html @@ -204,7 +204,7 @@

Pretasks not part of this supertask

// Ideally the opt-parser itself works for '-a3' instead of requiring a space as in '-a 3' to parse attackType args = cmd.replace('hashcat', ''); args = args.replace(/(-a)(\d)(\s)/,"-a $2 "); // ensures that "-a3" becomes a valid attack mode: the opt-parser does not approve it (yet) - args = args.replace(/(-\d)(\S+)(\s)/,"$1 $2 "); // ensures that "-1?l?d" becomes a valid customCharset: the opt-parser does not approve it (yet) + args = args.replace(/(-\d)(\S+)(\s)/g,"$1 $2 "); // ensures that "-1?l?d" becomes a valid customCharset: the opt-parser does not approve it (yet) args = args.replace(/\s+/g, ' '); // ensures that multiple consecutive spaces are reduced to a single space args = args.trim(); args = args.split(/ |=/g); @@ -252,6 +252,18 @@

Pretasks not part of this supertask

if (options.customCharset4 !== "") { keyspaceCustomMask = keyspaceCustomMask * Math.pow(customCharsetToOptions(options.customCharset4), (mask.match(/\?4/g) || []).length);} + if (options.customCharset5 !== "") + { + keyspaceCustomMask = keyspaceCustomMask * Math.pow(customCharsetToOptions(options.customCharset5), (mask.match(/\?5/g) || []).length);} + if (options.customCharset6 !== "") + { + keyspaceCustomMask = keyspaceCustomMask * Math.pow(customCharsetToOptions(options.customCharset6), (mask.match(/\?6/g) || []).length);} + if (options.customCharset7 !== "") + { + keyspaceCustomMask = keyspaceCustomMask * Math.pow(customCharsetToOptions(options.customCharset7), (mask.match(/\?7/g) || []).length);} + if (options.customCharset8 !== "") + { + keyspaceCustomMask = keyspaceCustomMask * Math.pow(customCharsetToOptions(options.customCharset8), (mask.match(/\?8/g) || []).length);} var keyspaceRegularMask = 1;