mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-14 10:37:27 -07:00
cleanup
This commit is contained in:
parent
ac71f5e16f
commit
f7b122f6ed
1 changed files with 30 additions and 29 deletions
59
hydra.c
59
hydra.c
|
@ -187,6 +187,31 @@ extern int old_ssl;
|
|||
|
||||
void hydra_kill_head(int head_no, int killit, int fail);
|
||||
|
||||
// some enum definitions
|
||||
typedef enum {
|
||||
STATE_ACTIVE = 0,
|
||||
STATE_FINISHED = 1,
|
||||
STATE_ERROR = 2,
|
||||
STATE_UNRESOLVED = 3
|
||||
} target_state_t;
|
||||
|
||||
typedef enum {
|
||||
MODE_PASSWORD_LIST = 1,
|
||||
MODE_LOGIN_LIST = 2,
|
||||
MODE_PASSWORD_BRUTE = 4,
|
||||
MODE_PASSWORD_REVERSE = 8,
|
||||
MODE_PASSWORD_NULL = 16,
|
||||
MODE_PASSWORD_SAME = 32,
|
||||
MODE_COLON_FILE = 64
|
||||
} hydra_mode_t;
|
||||
|
||||
typedef enum {
|
||||
FORMAT_PLAIN_TEXT,
|
||||
FORMAT_JSONV1,
|
||||
FORMAT_JSONV2,
|
||||
FORMAT_XMLV1
|
||||
} output_format_t;
|
||||
|
||||
// some structure definitions
|
||||
typedef struct {
|
||||
pid_t pid;
|
||||
|
@ -200,13 +225,6 @@ typedef struct {
|
|||
time_t last_seen;
|
||||
} hydra_head;
|
||||
|
||||
typedef enum {
|
||||
STATE_ACTIVE = 0,
|
||||
STATE_FINISHED = 1,
|
||||
STATE_ERROR = 2,
|
||||
STATE_UNRESOLVED = 3
|
||||
} target_state_t;
|
||||
|
||||
typedef struct {
|
||||
char *target;
|
||||
char ip[36];
|
||||
|
@ -247,23 +265,6 @@ typedef struct {
|
|||
FILE *ofp;
|
||||
} hydra_brain;
|
||||
|
||||
typedef enum {
|
||||
MODE_PASSWORD_LIST = 1,
|
||||
MODE_LOGIN_LIST = 2,
|
||||
MODE_PASSWORD_BRUTE = 4,
|
||||
MODE_PASSWORD_REVERSE = 8,
|
||||
MODE_PASSWORD_NULL = 16,
|
||||
MODE_PASSWORD_SAME = 32,
|
||||
MODE_COLON_FILE = 64
|
||||
} hydra_mode_t;
|
||||
|
||||
typedef enum {
|
||||
FORMAT_PLAIN_TEXT,
|
||||
FORMAT_JSONV1,
|
||||
FORMAT_JSONV2,
|
||||
FORMAT_XMLV1
|
||||
} output_format_t;
|
||||
|
||||
typedef struct {
|
||||
hydra_mode_t mode;
|
||||
int loop_mode; // valid modes: 0 = password, 1 = user
|
||||
|
@ -304,7 +305,6 @@ typedef struct {
|
|||
|
||||
// external vars
|
||||
extern char HYDRA_EXIT[5];
|
||||
|
||||
#if !defined(ANDROID) && !defined(__BIONIC__)
|
||||
extern int errno;
|
||||
#endif
|
||||
|
@ -347,16 +347,17 @@ int snpdone, snp_is_redo, snpbuflen, snpi, snpj, snpdont;
|
|||
|
||||
#include "performance.h"
|
||||
|
||||
int inline check_flag(int value, int flag) {
|
||||
return (value & flag) == flag;
|
||||
}
|
||||
|
||||
#define PRINT_NORMAL(ext, text, ...) printf(text, ##__VA_ARGS__)
|
||||
#define PRINT_EXTEND(ext, text, ...) do { \
|
||||
if (ext) \
|
||||
printf(text, ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
|
||||
|
||||
int inline check_flag(int value, int flag) {
|
||||
return (value & flag) == flag;
|
||||
}
|
||||
|
||||
void help(int ext) {
|
||||
PRINT_NORMAL(ext, "Syntax: hydra [[[-l LOGIN|-L FILE] [-p PASS|-P FILE]] | [-C FILE]] [-e nsr]"
|
||||
" [-o FILE] [-t TASKS] [-M FILE [-T TASKS]] [-w TIME] [-W TIME] [-f] [-s PORT]"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue