diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c index 218cb6ff6d8be880a24833dbac569842926cd7df..6ed419b16df3a731531f1fb9d3101aaf4d24c390 100644 --- a/src/sbbs3/ftpsrvr.c +++ b/src/sbbs3/ftpsrvr.c @@ -1774,14 +1774,14 @@ static BOOL badlogin(SOCKET sock, CRYPT_SESSION sess, ulong* login_attempts if(addr!=NULL) { count=loginFailure(startup->login_attempt_list, addr, client->protocol, user, passwd, &attempt); if (count > 1) - lprintf(LOG_NOTICE, "%04d [%s] !%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + lprintf(LOG_NOTICE, "%04d [%s] !%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,sock, client->addr, count, duration_estimate_to_vstr(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); mqtt_user_login_fail(&mqtt, client, user); if(startup->login_attempt.hack_threshold && count>=startup->login_attempt.hack_threshold) ftp_hacklog("FTP LOGIN", user, passwd, client->host, addr); if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) { char reason[128]; - snprintf(reason, sizeof reason, "%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + snprintf(reason, sizeof reason, "%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,count, duration_estimate_to_str(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL, startup->login_attempt.filter_duration); } diff --git a/src/sbbs3/login.cpp b/src/sbbs3/login.cpp index 94f893f25c254969815a58b1813ba730bfe42b04..1e4c25083f2c902374a4076376b2b4b185dd922c 100644 --- a/src/sbbs3/login.cpp +++ b/src/sbbs3/login.cpp @@ -146,7 +146,7 @@ void sbbs_t::badlogin(const char* user, const char* passwd, const char* protocol SAFEPRINTF(reason,"%s LOGIN", protocol); count=loginFailure(startup->login_attempt_list, addr, protocol, user, passwd, &attempt); if (count > 1) - lprintf(LOG_NOTICE, "!%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + lprintf(LOG_NOTICE, "!%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,count, duration_estimate_to_vstr(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); mqtt_user_login_fail(mqtt, &client, user); if(user!=NULL && startup->login_attempt.hack_threshold && count>=startup->login_attempt.hack_threshold) { @@ -161,7 +161,7 @@ void sbbs_t::badlogin(const char* user, const char* passwd, const char* protocol char ipaddr[INET6_ADDRSTRLEN]; inet_addrtop(addr, ipaddr, sizeof(ipaddr)); getnameinfo(&addr->addr, addr_len, host_name, sizeof(host_name), NULL, 0, NI_NAMEREQD); - snprintf(reason, sizeof reason, "%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + snprintf(reason, sizeof reason, "%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,count, duration_estimate_to_str(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); filter_ip(&cfg, protocol, reason, host_name, ipaddr, user, /* fname: */NULL, startup->login_attempt.filter_duration); } diff --git a/src/sbbs3/mailsrvr.c b/src/sbbs3/mailsrvr.c index c9f43e62abdb54cf0b040bf71e5868a58f42d50b..9916a7bce31c3b13d572087d52ce606ceb3b1948 100644 --- a/src/sbbs3/mailsrvr.c +++ b/src/sbbs3/mailsrvr.c @@ -979,7 +979,7 @@ static void badlogin(SOCKET sock, CRYPT_SESSION sess, const char* resp SAFEPRINTF(reason,"%s LOGIN", client->protocol); count=loginFailure(startup->login_attempt_list, addr, client->protocol, user, passwd, &attempt); if (count > 1) - lprintf(LOG_NOTICE, "%04d %s [%s] !%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + lprintf(LOG_NOTICE, "%04d %s [%s] !%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,sock, client->protocol, client->addr, count ,duration_estimate_to_vstr(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); mqtt_user_login_fail(&mqtt, client, user); @@ -991,7 +991,7 @@ static void badlogin(SOCKET sock, CRYPT_SESSION sess, const char* resp #endif } if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) { - snprintf(reason, sizeof reason, "%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + snprintf(reason, sizeof reason, "%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,count, duration_estimate_to_str(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL, startup->login_attempt.filter_duration); } diff --git a/src/sbbs3/services.c b/src/sbbs3/services.c index cda1cd9a45ad40dc7e84df8b83d4e24fefc654e0..ca70d13500dc0d3fe9c719f940fd00bd09e7ccca 100644 --- a/src/sbbs3/services.c +++ b/src/sbbs3/services.c @@ -343,7 +343,7 @@ static void badlogin(SOCKET sock, char* user, char* passwd, client_t* client, un SAFEPRINTF(reason,"%s LOGIN", client->protocol); count=loginFailure(startup->login_attempt_list, addr, client->protocol, user, passwd, &attempt); if (count > 1) - lprintf(LOG_NOTICE, "%04d %s [%s] !%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + lprintf(LOG_NOTICE, "%04d %s [%s] !%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,sock, client->protocol, client->addr, count, duration_estimate_to_vstr(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); mqtt_user_login_fail(&mqtt, client, user); if(startup->login_attempt.hack_threshold && count>=startup->login_attempt.hack_threshold) { @@ -354,7 +354,7 @@ static void badlogin(SOCKET sock, char* user, char* passwd, client_t* client, un #endif } if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) { - snprintf(reason, sizeof reason, "%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + snprintf(reason, sizeof reason, "%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,count, duration_estimate_to_str(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); filter_ip(&scfg, client->protocol, reason, client->host, client->addr, user, /* fname: */NULL, startup->login_attempt.filter_duration); } diff --git a/src/sbbs3/trash.h b/src/sbbs3/trash.h index 37b5ac86dae796e0495785b11303b060641d3089..7010fe00dd47ac44994896ed3d05a56a731f4265 100644 --- a/src/sbbs3/trash.h +++ b/src/sbbs3/trash.h @@ -27,6 +27,7 @@ #include "dllexport.h" #define strIpFilterExemptConfigFile "ipfilter_exempt.cfg" +#define STR_FAILED_LOGIN_ATTEMPTS "FAILED LOGIN ATTEMPTS" struct trash { time_t added; diff --git a/src/sbbs3/websrvr.c b/src/sbbs3/websrvr.c index a5623248e7a31163387d786328ddcb7b53d61e8b..2ef210b49696dd325a0edf2b3e8e61e5290a6215 100644 --- a/src/sbbs3/websrvr.c +++ b/src/sbbs3/websrvr.c @@ -1899,7 +1899,7 @@ static void badlogin(SOCKET sock, const char* user, const char* passwd, client_t SAFEPRINTF(reason,"%s LOGIN", client->protocol); count=loginFailure(startup->login_attempt_list, addr, client->protocol, user, passwd, &attempt); if (count > 1) - lprintf(LOG_NOTICE, "%04d %s [%s] !%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + lprintf(LOG_NOTICE, "%04d %s [%s] !%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,sock, client->protocol, client->addr, count, duration_estimate_to_vstr(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); mqtt_user_login_fail(&mqtt, client, user); if(startup->login_attempt.hack_threshold && count>=startup->login_attempt.hack_threshold) { @@ -1910,7 +1910,7 @@ static void badlogin(SOCKET sock, const char* user, const char* passwd, client_t #endif } if(startup->login_attempt.filter_threshold && count>=startup->login_attempt.filter_threshold) { - snprintf(reason, sizeof reason, "%lu CONSECUTIVE FAILED LOGIN ATTEMPTS in %s" + snprintf(reason, sizeof reason, "%lu " STR_FAILED_LOGIN_ATTEMPTS " in %s" ,count, duration_estimate_to_str(attempt.time - attempt.first, tmp, sizeof tmp, 1, 1)); filter_ip(&scfg, client->protocol, reason ,client->host, client->addr, user, /* fname: */NULL, startup->login_attempt.filter_duration);