-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamic formats with high/variable number of iterations #827
Comments
I have thought about this issue a LOT over the past few years. There are a couple of things needed to use this:
I would also like to go beyond this, and allow these to also be used to convert to base-10, base-16, BASE-16, string, etc. I think that is already in code. The difference here, is now these would be treated as variable, so each time you dumped the string, it could contain a different value. Yes, I do see this as a nice addition. I am not quite sure how high the ROI is for it, however. What formats are we talking about? I see input encoding and buffer handling to be items where we have more formats which dyna can not touch without having custom code. I think adding things like hook functions for input and buffer layout to be much more useful, but very hard on their own, and it makes dyna able to handle these more complex hashes, BUT at the expense of having someone have to develop these hook functions specific to the hash requirements. |
Ok, here is one way to look at this. I am throwing out there, to ask questions, but also to help spur my own thoughts. // NOTE not tested ;)
//$ ./pass_gen.pl 'dynamic=41'
//dynamic_41 -->$h-sha1($s.$p)->$h=sha1($p.$h)^1023 (sap-H sha1)
static DYNAMIC_primitive_funcp _Funcs_41[] =
{
//MGF_INPUT_20_BYTE
//MGF_SALTED
//MGF_FLAT_BUFFERS
//MGF_FLD1
DynamicFunc__clean_input,
DynamicFunc__append_salt2,
DynamicFunc__append_keys,
DynamicFunc__clean_input2,
DynamicFunc__append_keys2,
DynamicFunc__SHA1_crypt_input2_append_input1,
DynamicFunc__getvar1_fld1,
DynamicFunc__getvar2_CONST1,
DynamicFunc__startloop_var1_decrement_to_var2,
DynamicFunc__SHA1_crypt_input1_overwrite_input1_offset_keylen,
DynamicFunc__endloop,
DynamicFunc__SHA1_crypt_input1_to_output1_FINAL,
NULL
};
static struct fmt_tests _Preloads_41[] =
{
// {"{x-issha, 1024}hmiyJ2a/Z+HRpjQ37Osz+rYax9UxMjM0NTY3ODkwYWI=","OpenWall"}
{"$dynamic_41$8668b22766bf67e1d1a63437eceb33fab61ac7d5$$F11024$HEX$313233343536373839306162","OpenWall"},
{NULL}
};
static DYNAMIC_Constants _Const_41[] =
{
{1, "2"},
{0, NULL}
}; The things that are not done: DynamicFunc__SHA1_crypt_input1_overwrite_input1_offset_keylen DynamicFunc__getvar1_fld0 Vars could also be read from CONST's as in DynamicFunc__getvar2_CONST1 DynamicFunc__decr_var1 DynamicFunc__startloop_var1_decrement_to_var2 DynamicFunc__endloop while (varX != varY) {
run-instructions;
varX operation= 1; (or some constant).
} |
@jfoug should we close this issue or keep it for upcoming compiler enhancements? |
Sorry, I was thinking of a different issue. Yes, lets keep this open. I am thinking of ways this can be done. I already plan on adding 4 'general-purpose' variables to dyna. I plan on using these for things like this (counting). Also, storing temp computations, so that more complex expressions can be handled. The general purpose var might be used as a string, a hash residue, and uint64_t, etc. Not all at one time, but it should be able to handle any of those 'types' of data. Once it is set, however, that is what it is to be used for, until the format is 'closed'. But this is still turning around in my head a bit on how best to do this, and how best to utilize it. |
I'm sure this has been discussed in the past, but I don't find that discussion anywhere.
If a format has a very high, but fixed iteration count, you could still create a dynamic format, even if it is somewhat cumbersome.
But with a variable iteration count, you are lost.
How hard would it be to implement some kind of variable iteration count?
Lets say, a new flag that needs to be set, so that $$I1000 gets interpreted as iteration count 1000?
May be you need some DO ... ENDDO logic, or even handling of more than one iteration count.
In that case, I'd say: use the forst $I for the first (or outer) loop, etc.
Do I remember wrong? Where has this been discussed in the past?
Should this be discussed on john-users for additional input?
The text was updated successfully, but these errors were encountered: