From 665e9600934c0aed8897bc3a9af7c761816c69fa Mon Sep 17 00:00:00 2001 From: philsmd Date: Thu, 18 Aug 2016 14:39:07 +0200 Subject: [PATCH] sanity check: do not allow mask files or increment w/ --skip/--limit --- docs/changes.txt | 1 + src/hashcat.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 0ce00597a..dcdc61aa8 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -25,6 +25,7 @@ - Add support for --outfile (short -o) to be used together with --stdout - Skip periodic status output whenever --stdout is used together with stdin mode, but no outfile was specified - Show error message if --show is used together with --outfile-autohex-disable (this is currently not supported) +- Show error message if --skip/--limit is used together with mask files or --increment ## ## Bugs diff --git a/src/hashcat.c b/src/hashcat.c index fc0cdb332..5357ff038 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -18914,9 +18914,24 @@ int main (int argc, char **argv) qsort (induction_dictionaries, induction_dictionaries_cnt, sizeof (char *), sort_by_mtime); } + /** + * prevent the user from using --skip/--limit together w/ maskfile and or dictfile + */ + + if (skip != 0 || limit != 0) + { + if ((maskcnt > 1) || (dictcnt > 1)) + { + log_error ("ERROR: --skip/--limit are not supported with --increment or mask files"); + + return -1; + } + } + /** * prevent the user from using --keyspace together w/ maskfile and or dictfile */ + if (keyspace == 1) { if ((maskcnt > 1) || (dictcnt > 1))