Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/static/optparse.hashtopolis.1.1.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -131,6 +135,10 @@ let defaultOptions = {
customCharset2: '',
customCharset3: '',
customCharset4: '',
customCharset5: '',
customCharset6: '',
customCharset7: '',
customCharset8: '',
unrecognizedFlag: []
};
var options = defaultOptions;
Expand Down Expand Up @@ -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);
});
Expand Down Expand Up @@ -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]};
Expand Down
14 changes: 13 additions & 1 deletion src/templates/supertasks/detail.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ <h4>Pretasks not part of this supertask</h4>
// 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);
Expand Down Expand Up @@ -252,6 +252,18 @@ <h4>Pretasks not part of this supertask</h4>
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;

Expand Down