Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 20 Jul 2012 19:27:00 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Some more external mode definitions

The first patch creates new [List.External:Repeats_*] sections, similar
to [List.External:Repeats], but with a limited character set.
Repeats_digits: '0' - '9'
Repeats_lowercase: 'a' - 'z'
Repeats_printable_ASCII: ' ' - '~'
The common logic has been moved into [List.External_base:Repeats].

The second patch adds a simple Rot13 filter, [List.External:Filter_Rot13].
Words that don't contain any letters (and would remain unchanged after
applying rot13) are skipped (word = 0).

Frank

>From f84b31cb1d7b16f4a890d03434003c224237f8f5 Mon Sep 17 00:00:00 2001
From: Frank Dittrich <frank_dittrich@...mail.com>
Date: Fri, 20 Jul 2012 18:52:22 +0200
Subject: [PATCH 1/2] Define new [List.External:Repeats_*] sections

... with restricted character sets (instead of 0x20-0xff)

Repeats_digits: '0' - '9'
Repeats_lowercase: 'a' - 'z'
Repeats_printable_ASCII: ' ' - '~'

All of these sections as well as the original section
[List.External:Repeats] now include a new section
[List.External_base:Repeats] containing variable definitions and
the generate() function.
---
 run/john.conf |   60 ++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 49 insertions(+), 11 deletions(-)

diff --git a/run/john.conf b/run/john.conf
index f17dcaf..d9e51c7 100644
--- a/run/john.conf
+++ b/run/john.conf
@@ -1208,19 +1208,9 @@ void restore()
 }
 
 # Try strings of repeated characters.
-[List.External:Repeats]
+[List.External_base:Repeats]
 int minlength, maxlength, minc, maxc, length, c;
 
-void init()
-{
-	minlength = 1;
-	maxlength = 72;
-	minc = 0x20;
-	maxc = 0xff;
-
-	length = minlength; c = minc;
-}
-
 void generate()
 {
 	int i;
@@ -1238,6 +1228,54 @@ void generate()
 		c = 0; // Will NUL out the next "word" and thus terminate
 }
 
+[List.External:Repeats]
+.include [List.External_base:Repeats]
+void init()
+{
+	minlength = 1;
+	maxlength = 72;
+	minc = 0x20;
+	maxc = 0xff;
+
+	length = minlength; c = minc;
+}
+
+[List.External:Repeats_digits]
+.include [List.External_base:Repeats]
+void init()
+{
+	minlength = 1;
+	maxlength = 72;
+	minc = '0';
+	maxc = '9';
+
+	length = minlength; c = minc;
+}
+
+[List.External:Repeats_lowercase]
+.include [List.External_base:Repeats]
+void init()
+{
+	minlength = 1;
+	maxlength = 72;
+	minc = 'a';
+	maxc = 'z';
+
+	length = minlength; c = minc;
+}
+
+[List.External:Repeats_printable_ASCII]
+.include [List.External_base:Repeats]
+void init()
+{
+	minlength = 1;
+	maxlength = 72;
+	minc = ' ';
+	maxc = '~';
+
+	length = minlength; c = minc;
+}
+
 # Generate candidate passwords from many small subsets of characters from a
 # much larger full character set.  This will test for passwords containing too
 # few different characters.  As currently implemented, this code will produce
-- 
1.7.7.6


>From 1fbdaac800e4e9113a268de03324fe285b27c1fd Mon Sep 17 00:00:00 2001
From: Frank Dittrich <frank_dittrich@...mail.com>
Date: Fri, 20 Jul 2012 19:07:50 +0200
Subject: [PATCH 2/2] Add [List.External:Filter_Rot13]

---
 run/john.conf |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/run/john.conf b/run/john.conf
index d9e51c7..dbc93ec 100644
--- a/run/john.conf
+++ b/run/john.conf
@@ -1543,6 +1543,29 @@ void filter()
 	word[i] = map2[(o & 0xfff) + (e >> 12)];
 }
 
+# Trivial Rot13 Example
+[List.External:Filter_Rot13]
+void filter()
+{
+	int i, j, c;
+
+	j = 0;
+	i = 0;				// Convert to uppercase
+
+	while (c = word[i]) {
+		if ((c >= 'a' && c <= 'm') || c >= 'A' && c <= 'M' ) {
+			word[i] = c + 13;
+			j++;
+		} else if ((c >= 'n' && c <= 'z') || c >= 'N' && c <= 'Z' ) {
+			word[i] = c - 13;
+			j++;
+		}
+		i++;
+	}
+	if (j == 0)
+		word = 0;
+}
+
 # Trivial parallel processing example
 [List.External_base:Parallel]
 /*
-- 
1.7.7.6


Powered by blists - more mailing lists

Your e-mail address:

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