Skip to content

Commit

Permalink
clarify license
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhauser-thc committed Feb 17, 2020
1 parent 5b6fc88 commit 90bbde1
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 29 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

Please do not use in military or secret service organizations,
or for illegal purposes.
(This is the wish of the author and non-binding. Many people working
in these organizations do not care for laws and ethics anyways.
You are not one of the "good" ones if you ignore this.)



Expand Down
12 changes: 8 additions & 4 deletions hydra-imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ int32_t start_imap(int32_t s, char *ip, int32_t port, unsigned char options, cha

memset(buffer2, 0, sizeof(buffer2));
result = sasl_plain(buffer2, login, pass);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%.250s\r\n", buffer2);
break;

Expand Down Expand Up @@ -163,17 +164,20 @@ int32_t start_imap(int32_t s, char *ip, int32_t port, unsigned char options, cha
switch (imap_auth_mechanism) {
case AUTH_CRAMMD5: {
result = sasl_cram_md5(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%s %.250s", preplogin, buffer2);
} break;
case AUTH_CRAMSHA1: {
result = sasl_cram_sha1(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%s %.250s", preplogin, buffer2);
} break;
case AUTH_CRAMSHA256: {
result = sasl_cram_sha256(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%s %.250s", preplogin, buffer2);
} break;
}
Expand Down
6 changes: 4 additions & 2 deletions hydra-nntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ int32_t start_nntp(int32_t s, char *ip, int32_t port, unsigned char options, cha

memset(buffer, 0, sizeof(buffer));
result = sasl_plain(buffer, login, pass);
if (result == NULL) return 3;
if (result == NULL)
return 3;

char tmp_buffer[sizeof(buffer)];
sprintf(tmp_buffer, "%.250s\r\n", buffer);
Expand Down Expand Up @@ -149,7 +150,8 @@ int32_t start_nntp(int32_t s, char *ip, int32_t port, unsigned char options, cha

memset(buffer2, 0, sizeof(buffer2));
result = sasl_cram_md5(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;

sprintf(buffer, "%s %.250s", preplogin, buffer2);
hydra_tobase64((unsigned char *)buffer, strlen(buffer), sizeof(buffer));
Expand Down
12 changes: 8 additions & 4 deletions hydra-pop3.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ int32_t start_pop3(int32_t s, char *ip, int32_t port, unsigned char options, cha

memset(buffer, 0, sizeof(buffer));
result = sasl_plain(buffer, login, pass);
if (result == NULL) return 3;
if (result == NULL)
return 3;

char tmp_buffer[sizeof(buffer)];
sprintf(tmp_buffer, "%.250s\r\n", buffer);
Expand Down Expand Up @@ -265,17 +266,20 @@ int32_t start_pop3(int32_t s, char *ip, int32_t port, unsigned char options, cha
switch (p->pop3_auth_mechanism) {
case AUTH_CRAMMD5: {
result = sasl_cram_md5(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%s %.250s", preplogin, buffer2);
} break;
case AUTH_CRAMSHA1: {
result = sasl_cram_sha1(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%s %.250s", preplogin, buffer2);
} break;
case AUTH_CRAMSHA256: {
result = sasl_cram_sha256(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%s %.250s", preplogin, buffer2);
} break;
}
Expand Down
3 changes: 2 additions & 1 deletion hydra-sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ int32_t start_sip(int32_t s, char *ip, char *lip, int32_t port, int32_t lport, u
char buffer2[512];

result = sasl_digest_md5(buffer2, login, pass, strstr(buf, "WWW-Authenticate: Digest") + strlen("WWW-Authenticate: Digest") + 1, host, "sip", NULL, 0, NULL);
if (result == NULL) return 3;
if (result == NULL)
return 3;

memset(buffer, 0, SIP_MAX_BUF);
snprintf(buffer, SIP_MAX_BUF,
Expand Down
6 changes: 4 additions & 2 deletions hydra-smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ int32_t start_smtp(int32_t s, char *ip, int32_t port, unsigned char options, cha

memset(buffer, 0, sizeof(buffer));
result = sasl_plain(buffer, login, pass);
if (result == NULL) return 3;
if (result == NULL)
return 3;

char tmp_buffer[sizeof(buffer)];
sprintf(tmp_buffer, "%.250s\r\n", buffer);
Expand Down Expand Up @@ -104,7 +105,8 @@ int32_t start_smtp(int32_t s, char *ip, int32_t port, unsigned char options, cha

memset(buffer2, 0, sizeof(buffer2));
result = sasl_cram_md5(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;

sprintf(buffer, "%s %.250s", preplogin, buffer2);
hydra_tobase64((unsigned char *)buffer, strlen(buffer), sizeof(buffer));
Expand Down
6 changes: 4 additions & 2 deletions hydra-xmpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ int32_t start_xmpp(int32_t s, char *ip, int32_t port, unsigned char options, cha
case AUTH_PLAIN: {
memset(buffer2, 0, sizeof(buffer));
result = sasl_plain(buffer2, login, pass);
if (result == NULL) return 3;
if (result == NULL)
return 3;
sprintf(buffer, "%s%.250s%s", RESPONSE_STR, buffer2, RESPONSE_END_STR);
if (debug)
hydra_report(stderr, "DEBUG C: %s\n", buffer);
Expand All @@ -138,7 +139,8 @@ int32_t start_xmpp(int32_t s, char *ip, int32_t port, unsigned char options, cha

memset(buffer2, 0, sizeof(buffer2));
result = sasl_cram_md5(buffer2, pass, buffer);
if (result == NULL) return 3;
if (result == NULL)
return 3;

rc = sasl_saslprep(login, SASL_ALLOW_UNASSIGNED, &preplogin);
if (rc) {
Expand Down
17 changes: 9 additions & 8 deletions hydra.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* https://github.com/vanhauser-thc/thc-hydra
*
* Parallized network login hacker.
* Don't use in military or secret service organizations, or for illegal
* purposes.
* Please don't use in military or secret service organizations, or for illegal
* purposes. This is a wish and is non-binding.
* If you ignore this be sure you are not a good person though.
*
* License: GNU AFFERO GENERAL PUBLIC LICENSE v3.0, see LICENSE file
*/
Expand Down Expand Up @@ -551,11 +552,11 @@ void help(int32_t ext) {
"module help)\n");
PRINT_NORMAL(ext,
"\nSupported services: %s\n"
"\n%s is a tool to guess/crack valid login/password pairs. "
"Licensed under AGPL\n"
"v3.0. The newest version is always available at %s\n"
"Don't use in military or secret service organizations, or for "
"illegal purposes.\n",
"\n%s is a tool to guess/crack valid login/password pairs.\n"
"Licensed under AGPL v3.0. The newest version is always available at;\n%s\n"
"Please don't use in military or secret service organizations, or for illegal\n"
"purposes. (This is a wish and non-binding - most such people do not care about\n"
"laws and ethics anyway - and tell themselves they are one of the good ones.)\n",
SERVICES, PROGRAM, RESOURCE);

if (ext && strlen(unsupported) > 0) {
Expand Down Expand Up @@ -2151,7 +2152,7 @@ int main(int argc, char *argv[]) {
struct sockaddr_in *ipv4 = NULL;

printf("%s %s (c) 2020 by %s & %s - Please do not use in military or secret "
"service organizations, or for illegal purposes.\n\n",
"service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).\n\n",
PROGRAM, VERSION, AUTHOR, AUTHOR2);
#ifndef LIBAFP
SERVICES = hydra_string_replace(SERVICES, "afp ", "");
Expand Down
12 changes: 6 additions & 6 deletions sasl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ typedef enum { SASL_ALLOW_UNASSIGNED = 1 } sasl_saslprep_flags;

int32_t print_hex(unsigned char *buf, int32_t len);

char* sasl_plain(char *result, char *login, char *pass);
char *sasl_plain(char *result, char *login, char *pass);
int32_t sasl_saslprep(const char *in, sasl_saslprep_flags flags, char **out);

#ifdef LIBOPENSSL
#include <openssl/hmac.h>
#include <openssl/md5.h>
#include <openssl/sha.h>

char* sasl_cram_md5(char *result, char *pass, char *challenge);
char* sasl_cram_sha1(char *result, char *pass, char *challenge);
char* sasl_cram_sha256(char *result, char *pass, char *challenge);
char* sasl_digest_md5(char *result, char *login, char *pass, char *buffer, char *miscptr, char *type, char *webtarget, int32_t webport, char *header);
char* sasl_scram_sha1(char *result, char *pass, char *clientfirstmessagebare, char *serverfirstmessage);
char *sasl_cram_md5(char *result, char *pass, char *challenge);
char *sasl_cram_sha1(char *result, char *pass, char *challenge);
char *sasl_cram_sha256(char *result, char *pass, char *challenge);
char *sasl_digest_md5(char *result, char *login, char *pass, char *buffer, char *miscptr, char *type, char *webtarget, int32_t webport, char *header);
char *sasl_scram_sha1(char *result, char *pass, char *clientfirstmessagebare, char *serverfirstmessage);
#endif

1 comment on commit 90bbde1

@tajale
Copy link

@tajale tajale commented on 90bbde1 May 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md

Please sign in to comment.