fixes #2271: added --brain-server-timer for scheduled backup time

This commit is contained in:
philsmd
2020-01-11 10:46:11 +01:00
parent 74c1bf8195
commit c826558b49
7 changed files with 108 additions and 71 deletions
+3 -1
View File
@@ -173,6 +173,8 @@ typedef struct brain_server_dumper_options
{
brain_server_dbs_t *brain_server_dbs;
u32 brain_server_timer;
} brain_server_dumper_options_t;
typedef struct brain_server_client_options
@@ -211,7 +213,7 @@ bool brain_client_connect (hc_device_param_t *device_param, const
void brain_client_disconnect (hc_device_param_t *device_param);
void brain_client_generate_hash (u64 *hash, const char *line_buf, const size_t line_len);
int brain_server (const char *listen_host, const int listen_port, const char *brain_password, const char *brain_session_whitelist);
int brain_server (const char *listen_host, const int listen_port, const char *brain_password, const char *brain_session_whitelist, const u32 brain_server_timer);
bool brain_server_read_hash_dumps (brain_server_dbs_t *brain_server_dbs, const char *path);
bool brain_server_write_hash_dumps (brain_server_dbs_t *brain_server_dbs, const char *path);
bool brain_server_read_hash_dump (brain_server_db_hash_t *brain_server_db_hash, const char *file);
+67 -64
View File
@@ -667,96 +667,97 @@ typedef enum user_options_map
IDX_BRAIN_PASSWORD = 0xff09,
IDX_BRAIN_PORT = 0xff0a,
IDX_BRAIN_SERVER = 0xff0b,
IDX_BRAIN_SESSION = 0xff0c,
IDX_BRAIN_SESSION_WHITELIST = 0xff0d,
IDX_BRAIN_SERVER_TIMER = 0xff0c,
IDX_BRAIN_SESSION = 0xff0d,
IDX_BRAIN_SESSION_WHITELIST = 0xff0e,
#endif
IDX_CPU_AFFINITY = 0xff0e,
IDX_CPU_AFFINITY = 0xff0f,
IDX_CUSTOM_CHARSET_1 = '1',
IDX_CUSTOM_CHARSET_2 = '2',
IDX_CUSTOM_CHARSET_3 = '3',
IDX_CUSTOM_CHARSET_4 = '4',
IDX_DEBUG_FILE = 0xff0f,
IDX_DEBUG_MODE = 0xff10,
IDX_ENCODING_FROM = 0xff11,
IDX_ENCODING_TO = 0xff12,
IDX_EXAMPLE_HASHES = 0xff13,
IDX_FORCE = 0xff14,
IDX_HWMON_DISABLE = 0xff15,
IDX_HWMON_TEMP_ABORT = 0xff16,
IDX_DEBUG_FILE = 0xff10,
IDX_DEBUG_MODE = 0xff11,
IDX_ENCODING_FROM = 0xff12,
IDX_ENCODING_TO = 0xff13,
IDX_EXAMPLE_HASHES = 0xff14,
IDX_FORCE = 0xff15,
IDX_HWMON_DISABLE = 0xff16,
IDX_HWMON_TEMP_ABORT = 0xff17,
IDX_HASH_MODE = 'm',
IDX_HCCAPX_MESSAGE_PAIR = 0xff17,
IDX_HCCAPX_MESSAGE_PAIR = 0xff18,
IDX_HELP = 'h',
IDX_HEX_CHARSET = 0xff18,
IDX_HEX_SALT = 0xff19,
IDX_HEX_WORDLIST = 0xff1a,
IDX_HOOK_THREADS = 0xff1b,
IDX_HEX_CHARSET = 0xff19,
IDX_HEX_SALT = 0xff1a,
IDX_HEX_WORDLIST = 0xff1b,
IDX_HOOK_THREADS = 0xff1c,
IDX_INCREMENT = 'i',
IDX_INCREMENT_MAX = 0xff1c,
IDX_INCREMENT_MIN = 0xff1d,
IDX_INDUCTION_DIR = 0xff1e,
IDX_KEEP_GUESSING = 0xff1f,
IDX_INCREMENT_MAX = 0xff1d,
IDX_INCREMENT_MIN = 0xff1e,
IDX_INDUCTION_DIR = 0xff1f,
IDX_KEEP_GUESSING = 0xff20,
IDX_KERNEL_ACCEL = 'n',
IDX_KERNEL_LOOPS = 'u',
IDX_KERNEL_THREADS = 'T',
IDX_KEYBOARD_LAYOUT_MAPPING = 0xff20,
IDX_KEYSPACE = 0xff21,
IDX_LEFT = 0xff22,
IDX_KEYBOARD_LAYOUT_MAPPING = 0xff21,
IDX_KEYSPACE = 0xff22,
IDX_LEFT = 0xff23,
IDX_LIMIT = 'l',
IDX_LOGFILE_DISABLE = 0xff23,
IDX_LOOPBACK = 0xff24,
IDX_MACHINE_READABLE = 0xff25,
IDX_MARKOV_CLASSIC = 0xff26,
IDX_MARKOV_DISABLE = 0xff27,
IDX_MARKOV_HCSTAT2 = 0xff28,
IDX_LOGFILE_DISABLE = 0xff24,
IDX_LOOPBACK = 0xff25,
IDX_MACHINE_READABLE = 0xff26,
IDX_MARKOV_CLASSIC = 0xff27,
IDX_MARKOV_DISABLE = 0xff28,
IDX_MARKOV_HCSTAT2 = 0xff29,
IDX_MARKOV_THRESHOLD = 't',
IDX_NONCE_ERROR_CORRECTIONS = 0xff29,
IDX_NONCE_ERROR_CORRECTIONS = 0xff2a,
IDX_OPENCL_DEVICE_TYPES = 'D',
IDX_OPTIMIZED_KERNEL_ENABLE = 'O',
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff2a,
IDX_OUTFILE_CHECK_DIR = 0xff2b,
IDX_OUTFILE_CHECK_TIMER = 0xff2c,
IDX_OUTFILE_FORMAT = 0xff2d,
IDX_OUTFILE_AUTOHEX_DISABLE = 0xff2b,
IDX_OUTFILE_CHECK_DIR = 0xff2c,
IDX_OUTFILE_CHECK_TIMER = 0xff2d,
IDX_OUTFILE_FORMAT = 0xff2e,
IDX_OUTFILE = 'o',
IDX_POTFILE_DISABLE = 0xff2e,
IDX_POTFILE_PATH = 0xff2f,
IDX_PROGRESS_ONLY = 0xff30,
IDX_QUIET = 0xff31,
IDX_REMOVE = 0xff32,
IDX_REMOVE_TIMER = 0xff33,
IDX_RESTORE = 0xff34,
IDX_RESTORE_DISABLE = 0xff35,
IDX_RESTORE_FILE_PATH = 0xff36,
IDX_POTFILE_DISABLE = 0xff2f,
IDX_POTFILE_PATH = 0xff30,
IDX_PROGRESS_ONLY = 0xff31,
IDX_QUIET = 0xff32,
IDX_REMOVE = 0xff33,
IDX_REMOVE_TIMER = 0xff34,
IDX_RESTORE = 0xff35,
IDX_RESTORE_DISABLE = 0xff36,
IDX_RESTORE_FILE_PATH = 0xff37,
IDX_RP_FILE = 'r',
IDX_RP_GEN_FUNC_MAX = 0xff37,
IDX_RP_GEN_FUNC_MIN = 0xff38,
IDX_RP_GEN_FUNC_MAX = 0xff38,
IDX_RP_GEN_FUNC_MIN = 0xff39,
IDX_RP_GEN = 'g',
IDX_RP_GEN_SEED = 0xff39,
IDX_RP_GEN_SEED = 0xff3a,
IDX_RULE_BUF_L = 'j',
IDX_RULE_BUF_R = 'k',
IDX_RUNTIME = 0xff3a,
IDX_SCRYPT_TMTO = 0xff3b,
IDX_RUNTIME = 0xff3b,
IDX_SCRYPT_TMTO = 0xff3c,
IDX_SEGMENT_SIZE = 'c',
IDX_SELF_TEST_DISABLE = 0xff3c,
IDX_SELF_TEST_DISABLE = 0xff3d,
IDX_SEPARATOR = 'p',
IDX_SESSION = 0xff3d,
IDX_SHOW = 0xff3e,
IDX_SESSION = 0xff3e,
IDX_SHOW = 0xff3f,
IDX_SKIP = 's',
IDX_SLOW_CANDIDATES = 'S',
IDX_SPEED_ONLY = 0xff3f,
IDX_SPIN_DAMP = 0xff40,
IDX_STATUS = 0xff41,
IDX_STATUS_JSON = 0xff42,
IDX_STATUS_TIMER = 0xff43,
IDX_STDOUT_FLAG = 0xff44,
IDX_STDIN_TIMEOUT_ABORT = 0xff45,
IDX_TRUECRYPT_KEYFILES = 0xff46,
IDX_USERNAME = 0xff47,
IDX_VERACRYPT_KEYFILES = 0xff48,
IDX_VERACRYPT_PIM_START = 0xff49,
IDX_VERACRYPT_PIM_STOP = 0xff4a,
IDX_SPEED_ONLY = 0xff40,
IDX_SPIN_DAMP = 0xff41,
IDX_STATUS = 0xff42,
IDX_STATUS_JSON = 0xff43,
IDX_STATUS_TIMER = 0xff44,
IDX_STDOUT_FLAG = 0xff45,
IDX_STDIN_TIMEOUT_ABORT = 0xff46,
IDX_TRUECRYPT_KEYFILES = 0xff47,
IDX_USERNAME = 0xff48,
IDX_VERACRYPT_KEYFILES = 0xff49,
IDX_VERACRYPT_PIM_START = 0xff4a,
IDX_VERACRYPT_PIM_STOP = 0xff4b,
IDX_VERSION_LOWER = 'v',
IDX_VERSION = 'V',
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff4b,
IDX_WORDLIST_AUTOHEX_DISABLE = 0xff4c,
IDX_WORKLOAD_PROFILE = 'w',
} user_options_map_t;
@@ -1841,6 +1842,7 @@ typedef struct user_options
bool brain_host_chgd;
bool brain_port_chgd;
bool brain_password_chgd;
bool brain_server_timer_chgd;
#endif
bool hash_mode_chgd;
bool hccapx_message_pair_chgd;
@@ -1939,6 +1941,7 @@ typedef struct user_options
u32 bitmap_max;
u32 bitmap_min;
#ifdef WITH_BRAIN
u32 brain_server_timer;
u32 brain_client_features;
u32 brain_port;
u32 brain_session;