mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-06 04:51:40 -07:00
implement rain
This commit is contained in:
parent
fdb1c09c8e
commit
033c881f8f
3 changed files with 19 additions and 34 deletions
44
bfg.c
44
bfg.c
|
@ -174,8 +174,8 @@ int32_t bf_init(char *arg) {
|
||||||
|
|
||||||
bf_options.crs_len = crs_len;
|
bf_options.crs_len = crs_len;
|
||||||
bf_options.current = bf_options.from;
|
bf_options.current = bf_options.from;
|
||||||
bf_options.strafe = 0;
|
bf_options.rain = 0;
|
||||||
bf_options.rotate = 0;
|
bf_options.gcounter = 0;
|
||||||
|
|
||||||
memset((char *) bf_options.state, 0, sizeof(bf_options.state));
|
memset((char *) bf_options.state, 0, sizeof(bf_options.state));
|
||||||
|
|
||||||
|
@ -215,33 +215,18 @@ char *bf_next(_Bool rainy) {
|
||||||
|
|
||||||
if(rainy)
|
if(rainy)
|
||||||
{
|
{
|
||||||
if(bf_options.current > 3) {
|
bf_options.ptr[0] = bf_options.crs[bf_options.state[0]];
|
||||||
if(bf_options.current % 2) {
|
for(i=2; i<bf_options.current; ++i) {
|
||||||
bf_options.ptr[0] = bf_options.crs[bf_options.state[0]];
|
bf_options.ptr[i] = bf_options.crs[(bf_options.state[i] + bf_options.rain) % bf_options.crs_len];
|
||||||
bf_options.ptr[1] = bf_options.crs[bf_options.state[1]];
|
bf_options.rain /= 2;
|
||||||
bf_options.ptr[2] = bf_options.crs[bf_options.state[2]];
|
|
||||||
|
|
||||||
for(i=3; i<bf_options.current; ++i) {
|
|
||||||
bf_options.ptr[i] = bf_options.crs[(bf_options.state[(i+bf_options.strafe)%(bf_options.current-3)+3] + bf_options.rotate) % bf_options.crs_len];
|
|
||||||
bf_options.rotate ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(bf_options.current % 2) {
|
|
||||||
bf_options.ptr[0] = bf_options.crs[bf_options.state[0]];
|
|
||||||
bf_options.ptr[1] = bf_options.crs[bf_options.state[1]];
|
|
||||||
for(i=2; i<bf_options.current; ++i) {
|
|
||||||
bf_options.ptr[i] = bf_options.crs[(bf_options.state[(i+bf_options.strafe)%(bf_options.current-2)+2] + bf_options.rotate) % bf_options.crs_len];
|
|
||||||
bf_options.rotate ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
bf_options.rain = bf_options.gcounter + 1;
|
||||||
for(i=0; i<bf_options.current; ++i) {
|
bf_options.gcounter++;
|
||||||
bf_options.ptr[i] = bf_options.crs[bf_options.state[i]]
|
}
|
||||||
}//we don't subtract the same depending on wether the length is odd or even
|
else
|
||||||
bf_options.strafe++;
|
for(i=0; i<bf_options.current; ++i)
|
||||||
|
bf_options.ptr[i] = bf_options.crs[bf_options.state[i]];
|
||||||
|
//we don't subtract the same depending on wether the length is odd or even
|
||||||
bf_options.ptr[bf_options.current] = 0;
|
bf_options.ptr[bf_options.current] = 0;
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
@ -265,8 +250,7 @@ char *bf_next(_Bool rainy) {
|
||||||
|
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
bf_options.current++;
|
bf_options.current++;
|
||||||
bf_options.strafe = 0;
|
bf_options.rain = 0;
|
||||||
bf_options.rotate = 0;
|
|
||||||
memset((char *)bf_options.state, 0, sizeof(bf_options.state));
|
memset((char *)bf_options.state, 0, sizeof(bf_options.state));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
bfg.h
4
bfg.h
|
@ -43,8 +43,8 @@ typedef struct {
|
||||||
char *crs; /* internal representation of charset */
|
char *crs; /* internal representation of charset */
|
||||||
char *ptr; /* ptr to the last generated password */
|
char *ptr; /* ptr to the last generated password */
|
||||||
uint32_t disable_symbols;
|
uint32_t disable_symbols;
|
||||||
uint64_t rotate;
|
uint64_t rain;
|
||||||
uint64_t strafe;
|
uint64_t gcounter;
|
||||||
} bf_option;
|
} bf_option;
|
||||||
|
|
||||||
extern bf_option bf_options;
|
extern bf_option bf_options;
|
||||||
|
|
5
hydra.c
5
hydra.c
|
@ -505,7 +505,7 @@ void help(int32_t ext) {
|
||||||
" -x MIN:MAX:CHARSET password bruteforce generation, type "
|
" -x MIN:MAX:CHARSET password bruteforce generation, type "
|
||||||
"\"-x -h\" to get help\n"
|
"\"-x -h\" to get help\n"
|
||||||
" -y disable use of symbols in bruteforce, see above\n"
|
" -y disable use of symbols in bruteforce, see above\n"
|
||||||
" -r rainy mode for password generation (-x)\n"
|
" -r use a non-random shuffling method for option -x\n"
|
||||||
#endif
|
#endif
|
||||||
" -e nsr try \"n\" null password, \"s\" login as pass "
|
" -e nsr try \"n\" null password, \"s\" login as pass "
|
||||||
"and/or \"r\" reversed login\n"
|
"and/or \"r\" reversed login\n"
|
||||||
|
@ -592,7 +592,8 @@ void help_bfg() {
|
||||||
"others,\n"
|
"others,\n"
|
||||||
" just add their real representation.\n"
|
" just add their real representation.\n"
|
||||||
" -y disable the use of the above letters as placeholders\n"
|
" -y disable the use of the above letters as placeholders\n"
|
||||||
" -r use a method to delinearize the bruteforce.\n\n"
|
" -r use a shuffling method called 'rain' to try to break\n"
|
||||||
|
" the linearity of the bruteforce\n"
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
" -x 3:5:a generate passwords from length 3 to 5 with all "
|
" -x 3:5:a generate passwords from length 3 to 5 with all "
|
||||||
"lowercase letters\n"
|
"lowercase letters\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue