mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 12:36:09 -07:00
code indent
This commit is contained in:
parent
531ee7734b
commit
720bdb3f96
83 changed files with 6377 additions and 6240 deletions
|
@ -1,16 +1,14 @@
|
|||
|
||||
/*
|
||||
libssh is available at http://www.libssh.org
|
||||
current version is 0.4.8
|
||||
current version is 0.4.8
|
||||
If you want support for ssh v1 protocol, you
|
||||
have to add option -DWITH_SSH1=On in the cmake
|
||||
*/
|
||||
|
||||
#include "hydra-mod.h"
|
||||
#ifndef LIBSSH
|
||||
void dummy_sshkey() {
|
||||
printf("\n");
|
||||
}
|
||||
void dummy_sshkey() { printf("\n"); }
|
||||
#else
|
||||
|
||||
#include <libssh/libssh.h>
|
||||
|
@ -21,7 +19,7 @@ extern ssh_session session;
|
|||
extern char *HYDRA_EXIT;
|
||||
extern int32_t new_session;
|
||||
|
||||
int32_t start_sshkey(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE * fp) {
|
||||
int32_t start_sshkey(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE *fp) {
|
||||
char *empty = "";
|
||||
char *login, *key, keep_login[300];
|
||||
int32_t auth_state = 0, rc = 0;
|
||||
|
@ -46,7 +44,7 @@ int32_t start_sshkey(int32_t s, char *ip, int32_t port, unsigned char options, c
|
|||
ssh_options_set(session, SSH_OPTIONS_COMPRESSION_C_S, "none");
|
||||
ssh_options_set(session, SSH_OPTIONS_COMPRESSION_S_C, "none");
|
||||
if (ssh_connect(session) != 0) {
|
||||
//if the connection was drop, exit and let hydra main handle it
|
||||
// if the connection was drop, exit and let hydra main handle it
|
||||
if (verbose)
|
||||
hydra_report(stderr, "[ERROR] could not connect to target port %d\n", port);
|
||||
return 3;
|
||||
|
@ -108,7 +106,7 @@ int32_t start_sshkey(int32_t s, char *ip, int32_t port, unsigned char options, c
|
|||
return 1;
|
||||
}
|
||||
|
||||
void service_sshkey(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE * fp, int32_t port, char *hostname) {
|
||||
void service_sshkey(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname) {
|
||||
int32_t run = 1, next_run = 1, sock = -1;
|
||||
|
||||
hydra_register_socket(sp);
|
||||
|
@ -116,7 +114,7 @@ void service_sshkey(char *ip, int32_t sp, unsigned char options, char *miscptr,
|
|||
return;
|
||||
while (1) {
|
||||
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);
|
||||
break;
|
||||
case 2:
|
||||
|
@ -154,13 +152,13 @@ void service_sshkey(char *ip, int32_t sp, unsigned char options, char *miscptr,
|
|||
#endif
|
||||
#endif
|
||||
|
||||
int32_t service_sshkey_init(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE * fp, int32_t port, char *hostname) {
|
||||
int32_t service_sshkey_init(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE *fp, int32_t port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
//
|
||||
// fill if needed.
|
||||
//
|
||||
//
|
||||
// return codes:
|
||||
// 0 all OK
|
||||
// -1 error, hydra will exit, so print a good error message here
|
||||
|
@ -168,9 +166,11 @@ int32_t service_sshkey_init(char *ip, int32_t sp, unsigned char options, char *m
|
|||
return 0;
|
||||
}
|
||||
|
||||
void usage_sshkey(const char* service) {
|
||||
printf("Module sshkey does not provide additional options, although the semantic for\n"
|
||||
void usage_sshkey(const char *service) {
|
||||
printf("Module sshkey does not provide additional options, although the "
|
||||
"semantic for\n"
|
||||
"options -p and -P is changed:\n"
|
||||
" -p expects a path to an unencrypted private key in PEM format.\n"
|
||||
" -P expects a filename containing a list of path to some unencrypted\n" " private keys in PEM format.\n\n");
|
||||
" -P expects a filename containing a list of path to some unencrypted\n"
|
||||
" private keys in PEM format.\n\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue