Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/mod/webui.mod/webui.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ static void put_404(int idx) {
"Server: %s\r\n"
"\r\n"
"404 Not Found",
stealth_telnets ? "nginx/1.28.1" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#ifdef EGG_PATCH
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#else
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER);
Comment on lines +73 to +76

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve nginx/1.28.1 in the stealth branch

When stealth_telnets is enabled, both conditional branches now emit nginx/1.28.0, silently reverting the deliberate 1.28.01.28.1 update from commit 7d160319 for every 404 and file response. The EGG_PATCH guard only needs to vary the Eggdrop banner; retain nginx/1.28.1 in both arms so this stable-build fix does not also change the externally visible stealth fingerprint.

Useful? React with 👍 / 👎.

#endif
response = nmalloc(i + 1);
sprintf(response,
"HTTP/1.1 404 \r\n" /* textual phrase is OPTIONAL */
Expand All @@ -79,7 +83,11 @@ static void put_404(int idx) {
"Server: %s\r\n"
"\r\n"
"404 Not Found",
stealth_telnets ? "nginx/1.28.1" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#ifdef EGG_PATCH
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#else
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER);
#endif
tputs(dcc[idx].sock, response, i);
nfree(response);
killsock(dcc[idx].sock);
Expand Down Expand Up @@ -137,7 +145,11 @@ static void put_file(int idx, int file_cache_index) {
"Server: %s\r\n"
"\r\n",
(intmax_t) sb.st_size, f->content_type,
stealth_telnets ? "nginx/1.28.1" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#ifdef EGG_PATCH
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#else
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER);
#endif
response = nmalloc(i + sb.st_size);
sprintf(response,
"HTTP/1.1 200 \r\n" /* textual phrase is OPTIONAL */
Expand All @@ -146,7 +158,11 @@ static void put_file(int idx, int file_cache_index) {
"Server: %s\r\n"
"\r\n",
(intmax_t) sb.st_size, f->content_type,
stealth_telnets ? "nginx/1.28.1" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#ifdef EGG_PATCH
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH);
#else
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER);
#endif
memcpy(response + i, f->data, sb.st_size);
tputs(dcc[idx].sock, response, i + sb.st_size);
nfree(response);
Expand Down
8 changes: 8 additions & 0 deletions src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,11 @@ int ssl_handshake(int sock, int flags, int verify, int loglevel, char *host,
"Content-Type: text/plain; charset=utf-8\r\n"
"Server: %s\r\n"
"\r\n%s", strlen(body),
#ifdef EGG_PATCH
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH,
#else
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER,
#endif
body);
response = nmalloc(j + 1);
sprintf(response,
Expand All @@ -1117,7 +1121,11 @@ int ssl_handshake(int sock, int flags, int verify, int loglevel, char *host,
"Content-Type: text/plain; charset=utf-8\r\n"
"Server: %s\r\n"
"\r\n%s", strlen(body),
#ifdef EGG_PATCH
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER "+" EGG_PATCH,
#else
stealth_telnets ? "nginx/1.28.0" : "Eggdrop/" EGG_STRINGVER,
#endif
body);
if (write(sock, response, j) < 0) /* tputs() cannot be used here */
putlog(LOG_MISC, "*", "TLS: error: write(sock %i): %s", sock, strerror(errno));
Expand Down
Loading