Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 23 Nov 2012 00:28:33 +0100
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: "Hide" more options

(Full quote just because this mail is quite old, and I don't know who
might have subscribed to the list afterwards)

On 06/30/2012 05:35 PM, magnum wrote:
> The usage blob is very long. I propose that the following options are
> moved to "hidden" because they are either for expert use or for very
> rare cases:
> 
> --config=FILE             use FILE instead of john.conf or john.ini
> --make-charset=FILE       make a charset file. It will be overwritten
> --mem-file-size=SIZE      size threshold for wordlist preload (default 5 MB)
> --crack-status            emit a status line whenever a password is cracked
> --max-run-time=N          gracefully exit after this many seconds
> --regen-lost-salts=N      regenerate lost salts (see doc/OPTIONS)
> --plugin=NAME[,..]        load this (these) dynamic plugin(s)
> 
> 
> The --make-charset is arguable because it's a core option.
> 
> Note that "hidden" options are not really hidden anymore, but instead of
> shown in the main usage blob, they are listed with --list=hidden-options.
> 
> We could also (or instead) move the format list closer to bottom as that
> is (IMHO) what you most often look at.
> 
> magnum


Now that I fixed a bug in bash completion which prevented it from adding
a trailing space to hidden options which don't have a value,
I'd like to continue the discussion about what options IMHO could be
moved from the main usage output to --list=hidden-options output.

Meanwhile, most of the options mentioned above have been moved to the
--list=hidden-options output.

One option (--make-charset=FILE) remained in the usage output because it
is an option which also exists in the core version.

One option remained in the main usage output, but I think it should also
be moved to --hidden-options:
--plugin=NAME[,..]        load this (these) dynamic plugin(s)


IMHO, there are even more options which could/should be moved from the
main usage output to the output of --list=hidden-options:

                 --pipe  like --stdin, but bulk reads, and allows rules

In addition to just moving it, should read
--pipe                   like --stdin, but bulk reads, and allows rules
(May be even s/rules/--rules/)


--loopback[=FILE]         like --wordlist, but fetch words from a .pot file
--dupe-suppression        suppress all dupes in wordlist (and force preload)
--encoding=NAME           input data is non-ascii (eg. UTF-8, ISO-8859-1).
                          For a full list of NAME use --list=encodings
--pot=NAME                pot file to use


The following option should be moved above the --format=NAME line
(similar to the core john version).

If we really move that many option to --list=hidden-options, the
--list=WHAT description might need to get a little bit longer (and I
think it should stay at the end of the usage output). What about this:

--list=WHAT               list capabilities, see --list=help or doc/OPTIONS,
                          see --list=hidden-options for more options


The attached patch (not intended to be committed, but for discussion)
makes the suggested changes.

In total, the usage output gets 6 lines shorter, and the output of
--list=hidden-options gets 7 lines longer.

What do you think?

Frank

diff --git a/src/john.c b/src/john.c
index 5fd40ec..f82db5e 100644
--- a/src/john.c
+++ b/src/john.c
@@ -598,6 +598,41 @@ static void john_list_options()
 	puts("<conf section name>");
 }
 
+static void john_list_hidden_options()
+{
+	puts("--help                    print usage summary, just like running the command");
+	puts("                          without any parameters");
+	puts("--pipe                    like --stdin, but bulk reads, and allows rules");
+	puts("--loopback[=FILE]         like --wordlist, but fetch words from a .pot file");
+	puts("--dupe-suppression        suppress all dupes in wordlist (and force preload)");
+	puts("--encoding=NAME           input data is non-ascii (eg. UTF-8, ISO-8859-1).");
+	puts("                          For a full list of NAME use --list=encodings");
+	puts("--pot=NAME                pot file to use");
+	puts("--config=FILE             use FILE instead of john.conf or john.ini");
+	puts("--mem-file-size=SIZE      size threshold for wordlist preload (default 5 MB)");
+	puts("--subformat=FORMAT        pick a benchmark format for --format=crypt");
+	puts("--mkpc=N                  force a lower max. keys per crypt");
+	puts("--length=N                force a lower max. length");
+	puts("--field-separator-char=C  use 'C' instead of the ':' in input and pot files");
+	puts("--fix-state-delay=N       performance tweak, see documentation");
+	puts("--nolog                   disables creation and writing to john.log file");
+	puts("--log-stderr              log to screen instead of file");
+	puts("--raw-always-valid=C      if C is 'Y' or 'y', then the dynamic format will");
+	puts("                          always treat raw hashes as valid.");
+	puts("--progress-every=N        emit a status line every N seconds");
+	puts("--crack-status            emit a status line whenever a password is cracked");
+	puts("--max-run-time=N          gracefully exit after this many seconds");
+	puts("--regen-lost-salts=N      regenerate lost salts (see doc/OPTIONS)");
+#if defined(CL_VERSION_1_0) || defined(HAVE_CUDA)
+	puts("--request-vectorize       request vectorized mode");
+	puts("--request-scalar          request non-vectorized mode");
+#endif
+#ifdef HAVE_DL
+	puts("--plugin=NAME[,..]        load this (these) dynamic plugin(s)");
+#endif
+	puts("");
+}
+
 static void john_list_help_options()
 {
 	puts("help, format-methods, parameters, list-data");
@@ -669,28 +704,7 @@ static void john_init(char *name, int argc, char **argv)
 	}
 	if (options.listconf && !strcasecmp(options.listconf, "hidden-options"))
 	{
-		puts("--help                    print usage summary, just like running the command");
-		puts("                          without any parameters");
-		puts("--config=FILE             use FILE instead of john.conf or john.ini");
-		puts("--mem-file-size=SIZE      size threshold for wordlist preload (default 5 MB)");
-		puts("--subformat=FORMAT        pick a benchmark format for --format=crypt");
-		puts("--mkpc=N                  force a lower max. keys per crypt");
-		puts("--length=N                force a lower max. length");
-		puts("--field-separator-char=C  use 'C' instead of the ':' in input and pot files");
-		puts("--fix-state-delay=N       performance tweak, see documentation");
-		puts("--nolog                   disables creation and writing to john.log file");
-		puts("--log-stderr              log to screen instead of file");
-		puts("--raw-always-valid=C      if C is 'Y' or 'y', then the dynamic format will");
-		puts("                          always treat raw hashes as valid.");
-		puts("--progress-every=N        emit a status line every N seconds");
-		puts("--crack-status            emit a status line whenever a password is cracked");
-		puts("--max-run-time=N          gracefully exit after this many seconds");
-		puts("--regen-lost-salts=N      regenerate lost salts (see doc/OPTIONS)");
-#if defined(CL_VERSION_1_0) || defined(HAVE_CUDA)
-		puts("--request-vectorize       request vectorized mode");
-		puts("--request-scalar          request non-vectorized mode");
-#endif
-		puts("");
+		john_list_hidden_options();
 		exit(0);
 	}
 
diff --git a/src/options.c b/src/options.c
index f1f39a4..f7e3587 100644
--- a/src/options.c
+++ b/src/options.c
@@ -177,11 +177,6 @@ static struct opt_entry opt_list[] = {
 "Usage: %s [OPTIONS] [PASSWORD-FILES]\n" \
 "--single[=SECTION]        \"single crack\" mode\n" \
 "--wordlist[=FILE] --stdin wordlist mode, read words from FILE or stdin\n" \
-"                  --pipe  like --stdin, but bulk reads, and allows rules\n" \
-"--loopback[=FILE]         like --wordlist, but fetch words from a .pot file\n" \
-"--dupe-suppression        suppress all dupes in wordlist (and force preload)\n" \
-"--encoding=NAME           input data is non-ascii (eg. UTF-8, ISO-8859-1).\n" \
-"                          For a full list of NAME use --list=encodings\n" \
 "--rules[=SECTION]         enable word mangling rules for wordlist modes\n" \
 "--incremental[=MODE]      \"incremental\" mode [using section MODE]\n" \
 "--markov[=OPTIONS]        \"Markov\" mode (see doc/MARKOV)\n" \
@@ -197,18 +192,15 @@ static struct opt_entry opt_list[] = {
 "--groups=[-]GID[,..]      load users [not] of this (these) group(s) only\n" \
 "--shells=[-]SHELL[,..]    load users with[out] this (these) shell(s) only\n" \
 "--salts=[-]COUNT[:MAX]    load salts with[out] COUNT [to MAX] hashes\n" \
-"--pot=NAME                pot file to use\n" \
+"--save-memory=LEVEL       enable memory saving, at LEVEL 1..3\n" \
 "--format=NAME             force hash type NAME:"
 
 #define JOHN_USAGE_INDENT \
 "                         " // formats are prepended with a space
 
 #define JOHN_USAGE_TAIL \
-"--list=WHAT               list capabilities, see --list=help or doc/OPTIONS\n" \
-"--save-memory=LEVEL       enable memory saving, at LEVEL 1..3\n"
-
-#define JOHN_USAGE_PLUGIN \
-"--plugin=NAME[,..]        load this (these) dynamic plugin(s)\n"
+"--list=WHAT               list capabilities, see --list=help or doc/OPTIONS,\n" \
+"                          see --list=hidden-options for more options\n"
 
 #if defined(CL_VERSION_1_0) && defined(HAVE_CUDA)
 #define JOHN_USAGE_GPU \
@@ -275,9 +267,6 @@ static void print_usage(char *name)
 	MEM_FREE(formats_list);
 
 	printf("%s", JOHN_USAGE_TAIL);
-#ifdef HAVE_DL
-	printf("%s", JOHN_USAGE_PLUGIN);
-#endif
 
 #if defined(CL_VERSION_1_0) || defined(HAVE_CUDA)
 	printf("%s", JOHN_USAGE_GPU);

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ