From ed9d8f15165fe2945c4bfadc2b3f022c1a7483a5 Mon Sep 17 00:00:00 2001 From: owein Date: Mon, 7 Oct 2019 16:56:59 +0200 Subject: [PATCH 1/7] using hydra 8.8 files --- hydra.c | 8 ++++++-- hydra.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hydra.c b/hydra.c index 64d7da3..ff1b9e6 100644 --- a/hydra.c +++ b/hydra.c @@ -1708,7 +1708,7 @@ int32_t hydra_send_next_pair(int32_t target_no, int32_t head_no) { #ifndef HAVE_MATH_H sleep(1); #else - hydra_targets[target_no]->pass_ptr = bf_next(); + hydra_targets[target_no]->pass_ptr = bf_next(hydra_options.rainy); if (debug) printf("[DEBUG] bfg new password for next child: %s\n", hydra_targets[target_no]->pass_ptr); #endif @@ -2172,6 +2172,7 @@ int main(int argc, char *argv[]) { hydra_brains.ofp = stdout; hydra_brains.targets = 1; hydra_options.waittime = waittime = WAITTIME; + hydra_options.rainy = false; bf_options.disable_symbols = 0; // command line processing @@ -2203,6 +2204,9 @@ int main(int argc, char *argv[]) { hydra_options.restore = 1; hydra_restore_read(); break; + case 'r': + hydra_options.rainy = true; + break; case 'I': ignore_restore = 1; // this is not to be saved in hydra_options! break; @@ -3179,7 +3183,7 @@ int main(int argc, char *argv[]) { #ifdef HAVE_MATH_H if (bf_init(bf_options.arg)) exit(-1); // error description is handled by bf_init - pass_ptr = bf_next(); + pass_ptr = bf_next(hydra_options.rainy); hydra_brains.countpass += bf_get_pcount(); hydra_brains.sizepass += BF_BUFLEN; #else diff --git a/hydra.h b/hydra.h index d1fcc60..2859de8 100644 --- a/hydra.h +++ b/hydra.h @@ -210,6 +210,7 @@ typedef struct { char *server; char *service; char bfg; + _Bool rainy; } hydra_option; #define _HYDRA_H From b09e39f98de5f4331d9a5d32ca5e72d1b2a2ada5 Mon Sep 17 00:00:00 2001 From: owein Date: Mon, 7 Oct 2019 17:02:43 +0200 Subject: [PATCH 2/7] modified bfg --- bfg.c | 30 +++++++++++++++++++++++++++--- bfg.h | 3 ++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/bfg.c b/bfg.c index a3a1dad..068804a 100644 --- a/bfg.c +++ b/bfg.c @@ -52,6 +52,7 @@ static int32_t add_single_char(char ch, char flags, int32_t* crs_len) { // note that we check for -x .:.:ab but not for -x .:.:ba // int32_t bf_init(char *arg) { + bf_options.rain = 0; int32_t i = 0; int32_t crs_len = 0; char flags = 0; @@ -189,8 +190,17 @@ uint64_t bf_get_pcount() { return foo; } +int accu(int value) +{ + int i = 0; + for(int a=1; a<=value; ++a) + { + i+=a+1; + } + return i; +} -char *bf_next() { +char *bf_next(_Bool rainy) { int32_t i, pos = bf_options.current - 1; if (bf_options.current > bf_options.to) @@ -201,8 +211,22 @@ char *bf_next() { return NULL; } - for (i = 0; i < bf_options.current; i++) - bf_options.ptr[i] = bf_options.crs[bf_options.state[i]]; + if(rainy) + { + for (i = 0; i < bf_options.current; i++){ + bf_options.ptr[i] = bf_options.crs[(bf_options.state[i]+bf_options.rain)%bf_options.crs_len]; + bf_options.rain += i+1; + } + if(bf_options.crs_len%10 == 0) + bf_options.rain-=accu(bf_options.current)-2; + else if(bf_options.crs_len%2 == 0) + bf_options.rain-=accu(bf_options.current)-4; + else if(bf_options.crs_len%2) + bf_options.rain-=accu(bf_options.current)-1; + } + else + for (i = 0; i < bf_options.current; i++) + bf_options.ptr[i] = bf_options.crs[bf_options.state[i]]; bf_options.ptr[bf_options.current] = 0; if (debug) { diff --git a/bfg.h b/bfg.h index 2ac5f49..c3a33e9 100644 --- a/bfg.h +++ b/bfg.h @@ -41,6 +41,7 @@ typedef struct { char *crs; /* internal representation of charset */ char *ptr; /* ptr to the last generated password */ uint32_t disable_symbols; + unsigned long rain; //accumulator for the rain// } bf_option; extern bf_option bf_options; @@ -48,7 +49,7 @@ extern bf_option bf_options; #ifdef HAVE_MATH_H extern uint64_t bf_get_pcount(); extern int32_t bf_init(char *arg); -extern char *bf_next(); +extern char *bf_next(_Bool rainy); #endif #endif From a4b4e54bd137783cf20764989127c431bea072d3 Mon Sep 17 00:00:00 2001 From: owein Date: Mon, 7 Oct 2019 17:04:44 +0200 Subject: [PATCH 3/7] option -r --- hydra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra.c b/hydra.c index ff1b9e6..59b7c8c 100644 --- a/hydra.c +++ b/hydra.c @@ -2180,7 +2180,7 @@ int main(int argc, char *argv[]) { help(1); if (argc < 2) help(0); - while ((i = getopt(argc, argv, "hIq64Rde:vVl:fFg:L:p:OP:o:b:M:C:t:T:m:w:W:s:SUux:yc:")) >= 0) { + while ((i = getopt(argc, argv, "hIq64Rrde:vVl:fFg:L:p:OP:o:b:M:C:t:T:m:w:W:s:SUux:yc:")) >= 0) { switch (i) { case 'h': help(1); From 4b4148054925efcc1206c494138531972289b7c4 Mon Sep 17 00:00:00 2001 From: owein Date: Mon, 7 Oct 2019 17:06:32 +0200 Subject: [PATCH 4/7] option -r and help() --- hydra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hydra.c b/hydra.c index 59b7c8c..cd42144 100644 --- a/hydra.c +++ b/hydra.c @@ -475,6 +475,7 @@ void help(int32_t ext) { #ifdef HAVE_MATH_H " -x MIN:MAX:CHARSET password bruteforce generation, type \"-x -h\" to get help\n" " -y disable use of symbols in bruteforce, see above\n" + " -r rainy mode for password generation (-x)\n" #endif " -e nsr try \"n\" null password, \"s\" login as pass and/or \"r\" reversed login\n" " -u loop around users, not passwords (effective! implied with -x)\n"); From c414d9a3ab242b39dccedc49186c1aa1b8f3af7d Mon Sep 17 00:00:00 2001 From: e2002e Date: Mon, 7 Oct 2019 23:00:27 +0200 Subject: [PATCH 5/7] Update bfg.c --- bfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfg.c b/bfg.c index 068804a..2ff9f9f 100644 --- a/bfg.c +++ b/bfg.c @@ -195,7 +195,7 @@ int accu(int value) int i = 0; for(int a=1; a<=value; ++a) { - i+=a+1; + i+=a; } return i; } From 9d7ebfd3c9337d195b2e0499e379ea2cdcdacd8b Mon Sep 17 00:00:00 2001 From: e2002e Date: Tue, 15 Oct 2019 20:22:46 +0200 Subject: [PATCH 6/7] false is 0 and true 1 --- hydra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hydra.c b/hydra.c index cd42144..01fd321 100644 --- a/hydra.c +++ b/hydra.c @@ -2173,7 +2173,7 @@ int main(int argc, char *argv[]) { hydra_brains.ofp = stdout; hydra_brains.targets = 1; hydra_options.waittime = waittime = WAITTIME; - hydra_options.rainy = false; + hydra_options.rainy = 0; bf_options.disable_symbols = 0; // command line processing @@ -2206,7 +2206,7 @@ int main(int argc, char *argv[]) { hydra_restore_read(); break; case 'r': - hydra_options.rainy = true; + hydra_options.rainy = 1; break; case 'I': ignore_restore = 1; // this is not to be saved in hydra_options! From 217e025475582db7ee3071c01df1d1423282bd9a Mon Sep 17 00:00:00 2001 From: van Hauser Date: Thu, 17 Oct 2019 12:21:47 +0200 Subject: [PATCH 7/7] Update bfg.h --- bfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfg.h b/bfg.h index c3a33e9..ab2f5e4 100644 --- a/bfg.h +++ b/bfg.h @@ -41,7 +41,7 @@ typedef struct { char *crs; /* internal representation of charset */ char *ptr; /* ptr to the last generated password */ uint32_t disable_symbols; - unsigned long rain; //accumulator for the rain// + uint64_t rain; /* accumulator for the rain */ } bf_option; extern bf_option bf_options;