mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 12:36:09 -07:00
support -W for modules that use libarries
This commit is contained in:
parent
b4a2b0b4ef
commit
16b424af4d
16 changed files with 48 additions and 1 deletions
2
CHANGES
2
CHANGES
|
@ -2,6 +2,8 @@ Changelog for hydra
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
Release 9.5
|
Release 9.5
|
||||||
|
* many modules did not support -W (all those that used a library for the
|
||||||
|
connection). All (or most?) should be fixed now.
|
||||||
* http-form:
|
* http-form:
|
||||||
- The help for http-form was wrong. the condition variable must always be
|
- The help for http-form was wrong. the condition variable must always be
|
||||||
the *last* parameter, not the third
|
the *last* parameter, not the third
|
||||||
|
|
|
@ -22,6 +22,7 @@ void dummy_firebird() { printf("\n"); }
|
||||||
|
|
||||||
#define DEFAULT_DB "C:\\Program Files\\Firebird\\Firebird_1_5\\security.fdb"
|
#define DEFAULT_DB "C:\\Program Files\\Firebird\\Firebird_1_5\\security.fdb"
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
|
|
||||||
int32_t start_firebird(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE *fp) {
|
int32_t start_firebird(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE *fp) {
|
||||||
|
@ -124,6 +125,8 @@ void service_firebird(char *ip, int32_t sp, unsigned char options, char *miscptr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
next_run = start_firebird(sock, ip, port, options, miscptr, fp);
|
next_run = start_firebird(sock, ip, port, options, miscptr, fp);
|
||||||
|
if ((next_run == 1 || next_run == 2) && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,7 @@ int32_t service_http_init(char *ip, int32_t sp, unsigned char options, char *mis
|
||||||
start--;
|
start--;
|
||||||
memset(start, '\0', condition_len);
|
memset(start, '\0', condition_len);
|
||||||
if (debug)
|
if (debug)
|
||||||
hydra_report(stderr, "Modificated options:%s\n", miscptr);
|
hydra_report(stderr, "Modified options:%s\n", miscptr);
|
||||||
} else {
|
} else {
|
||||||
if (debug)
|
if (debug)
|
||||||
hydra_report(stderr, "Condition not found\n");
|
hydra_report(stderr, "Condition not found\n");
|
||||||
|
|
|
@ -13,6 +13,7 @@ void dummy_mcached() { printf("\n"); }
|
||||||
|
|
||||||
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
|
|
||||||
int mcached_send_com_quit(int32_t sock) {
|
int mcached_send_com_quit(int32_t sock) {
|
||||||
|
@ -117,6 +118,8 @@ void service_mcached(char *ip, int32_t sp, unsigned char options, char *miscptr,
|
||||||
switch (run) {
|
switch (run) {
|
||||||
case 1:
|
case 1:
|
||||||
next_run = start_mcached(sock, ip, port, options, miscptr, fp);
|
next_run = start_mcached(sock, ip, port, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
hydra_child_exit(0);
|
hydra_child_exit(0);
|
||||||
|
|
|
@ -14,6 +14,7 @@ void dummy_mongodb() { printf("\n"); }
|
||||||
|
|
||||||
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
|
@ -136,6 +137,8 @@ void service_mongodb(char *ip, int32_t sp, unsigned char options, char *miscptr,
|
||||||
switch (run) {
|
switch (run) {
|
||||||
case 1:
|
case 1:
|
||||||
next_run = start_mongodb(sock, ip, port, options, miscptr, fp);
|
next_run = start_mongodb(sock, ip, port, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
hydra_child_exit(0);
|
hydra_child_exit(0);
|
||||||
|
|
|
@ -35,6 +35,7 @@ char *hydra_scramble(char *to, const char *message, const char *password);
|
||||||
extern int32_t internal__hydra_recv(int32_t socket, char *buf, int32_t length);
|
extern int32_t internal__hydra_recv(int32_t socket, char *buf, int32_t length);
|
||||||
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
char mysqlsalt[9];
|
char mysqlsalt[9];
|
||||||
|
|
||||||
|
@ -332,6 +333,8 @@ void service_mysql(char *ip, int32_t sp, unsigned char options, char *miscptr, F
|
||||||
break;
|
break;
|
||||||
case 2: /* run the cracking function */
|
case 2: /* run the cracking function */
|
||||||
next_run = start_mysql(sock, ip, port, options, miscptr, fp);
|
next_run = start_mysql(sock, ip, port, options, miscptr, fp);
|
||||||
|
if ((next_run == 1 || next_run == 2) && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 3: /* clean exit */
|
case 3: /* clean exit */
|
||||||
if (sock >= 0) {
|
if (sock >= 0) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ void dummy_oracle_listener() { printf("\n"); }
|
||||||
#include <openssl/des.h>
|
#include <openssl/des.h>
|
||||||
#define HASHSIZE 17
|
#define HASHSIZE 17
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
char *buf;
|
char *buf;
|
||||||
unsigned char *hash;
|
unsigned char *hash;
|
||||||
|
@ -304,6 +305,8 @@ void service_oracle_listener(char *ip, int32_t sp, unsigned char options, char *
|
||||||
}
|
}
|
||||||
/* run the cracking function */
|
/* run the cracking function */
|
||||||
next_run = start_oracle_listener(sock, ip, port, options, miscptr, fp);
|
next_run = start_oracle_listener(sock, ip, port, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 3: /* clean exit */
|
case 3: /* clean exit */
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
|
|
|
@ -16,6 +16,7 @@ void dummy_oracle_sid() { printf("\n"); }
|
||||||
#include <openssl/des.h>
|
#include <openssl/des.h>
|
||||||
#define HASHSIZE 16
|
#define HASHSIZE 16
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
char *buf;
|
char *buf;
|
||||||
unsigned char *hash;
|
unsigned char *hash;
|
||||||
|
@ -113,6 +114,8 @@ void service_oracle_sid(char *ip, int32_t sp, unsigned char options, char *miscp
|
||||||
}
|
}
|
||||||
/* run the cracking function */
|
/* run the cracking function */
|
||||||
next_run = start_oracle_sid(sock, ip, port, options, miscptr, fp);
|
next_run = start_oracle_sid(sock, ip, port, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 3: /* clean exit */
|
case 3: /* clean exit */
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
|
|
|
@ -21,6 +21,7 @@ void dummy_oracle() { printf("\n"); }
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
|
|
||||||
OCIEnv *o_environment;
|
OCIEnv *o_environment;
|
||||||
|
@ -165,6 +166,8 @@ void service_oracle(char *ip, int32_t sp, unsigned char options, char *miscptr,
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
next_run = start_oracle(sock, ip, port, options, miscptr, fp);
|
next_run = start_oracle(sock, ip, port, options, miscptr, fp);
|
||||||
|
if ((next_run == 1 || next_run == 2) && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 3: /* clean exit */
|
case 3: /* clean exit */
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
|
|
|
@ -16,6 +16,7 @@ void dummy_postgres() { printf("\n"); }
|
||||||
|
|
||||||
#define DEFAULT_DB "template1"
|
#define DEFAULT_DB "template1"
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
|
|
||||||
int32_t start_postgres(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE *fp) {
|
int32_t start_postgres(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE *fp) {
|
||||||
|
@ -99,6 +100,8 @@ void service_postgres(char *ip, int32_t sp, unsigned char options, char *miscptr
|
||||||
* Here we start the password cracking process
|
* Here we start the password cracking process
|
||||||
*/
|
*/
|
||||||
next_run = start_postgres(sock, ip, port, options, miscptr, fp);
|
next_run = start_postgres(sock, ip, port, options, miscptr, fp);
|
||||||
|
if ((next_run == 2 || next_run == 1) && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
|
|
|
@ -125,6 +125,8 @@ void service_rdp(char *ip, int32_t sp, unsigned char options, char *miscptr, FIL
|
||||||
else
|
else
|
||||||
sleep(hydra_options.conwait);
|
sleep(hydra_options.conwait);
|
||||||
next_run = start_rdp(ip, myport, options, miscptr, fp);
|
next_run = start_rdp(ip, myport, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 2: /* clean exit */
|
case 2: /* clean exit */
|
||||||
freerdp_disconnect(instance);
|
freerdp_disconnect(instance);
|
||||||
|
|
|
@ -14,6 +14,7 @@ const int32_t *__ctype_b;
|
||||||
|
|
||||||
extern void flood(); /* for -lm */
|
extern void flood(); /* for -lm */
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
RFC_ERROR_INFO_EX error_info;
|
RFC_ERROR_INFO_EX error_info;
|
||||||
|
|
||||||
|
@ -99,6 +100,8 @@ void service_sapr3(char *ip, int32_t sp, unsigned char options, char *miscptr, F
|
||||||
switch (run) {
|
switch (run) {
|
||||||
case 1: /* connect and service init function */
|
case 1: /* connect and service init function */
|
||||||
next_run = start_sapr3(sock, ip, port, options, miscptr, fp);
|
next_run = start_sapr3(sock, ip, port, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
hydra_child_exit(0);
|
hydra_child_exit(0);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
|
|
||||||
typedef struct creds {
|
typedef struct creds {
|
||||||
|
@ -173,10 +174,15 @@ bool smb2_run_test(creds_t *cr, const char *server, uint16_t port) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void service_smb2(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname) {
|
void service_smb2(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname) {
|
||||||
|
static int first_run = 0;
|
||||||
hydra_register_socket(sp);
|
hydra_register_socket(sp);
|
||||||
|
|
||||||
while (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT))) {
|
while (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT))) {
|
||||||
char *login, *pass;
|
char *login, *pass;
|
||||||
|
|
||||||
|
if (first_run && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
|
|
||||||
login = hydra_get_next_login();
|
login = hydra_get_next_login();
|
||||||
pass = hydra_get_next_password();
|
pass = hydra_get_next_password();
|
||||||
|
|
||||||
|
@ -191,6 +197,8 @@ void service_smb2(char *ip, int32_t sp, unsigned char options, char *miscptr, FI
|
||||||
} else {
|
} else {
|
||||||
hydra_completed_pair();
|
hydra_completed_pair();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
first_run = 1;
|
||||||
}
|
}
|
||||||
EXIT_NORMAL;
|
EXIT_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,8 @@ void service_ssh(char *ip, int32_t sp, unsigned char options, char *miscptr, FIL
|
||||||
switch (run) {
|
switch (run) {
|
||||||
case 1: /* connect and service init function */
|
case 1: /* connect and service init function */
|
||||||
next_run = start_ssh(sock, ip, port, options, miscptr, fp);
|
next_run = start_ssh(sock, ip, port, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ssh_disconnect(session);
|
ssh_disconnect(session);
|
||||||
|
|
|
@ -16,6 +16,7 @@ void dummy_sshkey() { printf("\n"); }
|
||||||
#if LIBSSH_VERSION_MAJOR >= 0 && LIBSSH_VERSION_MINOR >= 4
|
#if LIBSSH_VERSION_MAJOR >= 0 && LIBSSH_VERSION_MINOR >= 4
|
||||||
|
|
||||||
extern ssh_session session;
|
extern ssh_session session;
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
extern int32_t new_session;
|
extern int32_t new_session;
|
||||||
|
|
||||||
|
@ -117,6 +118,8 @@ void service_sshkey(char *ip, int32_t sp, unsigned char options, char *miscptr,
|
||||||
switch (run) {
|
switch (run) {
|
||||||
case 1: /* connect and service init function */
|
case 1: /* connect and service init function */
|
||||||
next_run = start_sshkey(sock, ip, port, options, miscptr, fp);
|
next_run = start_sshkey(sock, ip, port, options, miscptr, fp);
|
||||||
|
if (next_run == 1 && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ssh_disconnect(session);
|
ssh_disconnect(session);
|
||||||
|
|
|
@ -32,6 +32,7 @@ void dummy_svn() { printf("\n"); }
|
||||||
|
|
||||||
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
extern int32_t hydra_data_ready_timed(int32_t socket, long sec, long usec);
|
||||||
|
|
||||||
|
extern hydra_option hydra_options;
|
||||||
extern char *HYDRA_EXIT;
|
extern char *HYDRA_EXIT;
|
||||||
|
|
||||||
#define DEFAULT_BRANCH "trunk"
|
#define DEFAULT_BRANCH "trunk"
|
||||||
|
@ -197,6 +198,8 @@ void service_svn(char *ip, int32_t sp, unsigned char options, char *miscptr, FIL
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
next_run = start_svn(sock, ip, port, options, miscptr, fp);
|
next_run = start_svn(sock, ip, port, options, miscptr, fp);
|
||||||
|
if ((next_run == 1 || next_run == 2) && hydra_options.conwait)
|
||||||
|
sleep(hydra_options.conwait);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue