Apache | Warum wird ein Bot nicht auf HTTPS umgeleitet?

Mutti

Member
Hallo zusammen, :)

ich habe eine merkwürdige Beobachtung in meinen Apache-Logs und hoffe, jemand kann mir weiterhelfen.

Ein Bot mit dem User-Agent Go-http-client/1.1 greift über HTTP (Port 80) auf meine Webseite zu und bekommt eine 200 OK-Antwort, anstatt auf HTTPS (Port 443) umgeleitet zu werden.

Danke voraus.

Hier ein Beispiel aus den Logs (Domain und IP (RU) anonymisiert):

Code:
example.com:80 45.135.xxx.xxx - - [16/Feb/2025:20:34:43 +0100] "\x16\x03\x01\x05\xc4\x01" 400 936 "-" "-"
example.com:80 45.135.xxx.xxx - - [16/Feb/2025:20:34:53 +0100] "GET / HTTP/1.1" 200 25467 "-" "Mozilla/5.0"
example.com:80 45.135.xxx.xxx - - [16/Feb/2025:20:34:54 +0100] "GET / HTTP/1.1" 200 25474 "-" "Go-http-client/1.1"

Test mit CURL

Code:
root@server:~# curl -A "Go-http-client/1.1" -I http://example.com
HTTP/1.1 301 Moved Permanently

root@server:~# curl -A "Go-http-client/1.1" -I https://example.com
HTTP/2 403
 
Ein Bot mit dem User-Agent Go-http-client/1.1 greift über HTTP (Port 80) auf meine Webseite zu und bekommt eine 200 OK-Antwort, anstatt auf HTTPS (Port 443) umgeleitet zu werden.
...

Test mit CURL

Code:
root@server:~# curl -A "Go-http-client/1.1" -I http://example.com
HTTP/1.1 301 Moved Permanently

Na, Dein erster Curl-Request sagt jetzt ja schon mal, dass Du irgendwohin weitergeleitet wirst. Wohin, ist hier noch unbekannt, weil Du curl nicht gesagt hast, dass er dem Redirect folgen soll. Aber dass der Test-Request auf https umleitet, ist sehr wahrscheinlich:

Da brauchst Du noch -L bzw. --location:

Code:
$ curl --user-agent "Go-http-client/1.1" --head --location http://kernel.org
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 18 Feb 2025 00:00:18 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://kernel.org/

HTTP/2 200
server: nginx
date: Tue, 18 Feb 2025 00:00:18 GMT
content-type: text/html; charset=utf-8
content-length: 16832
last-modified: Mon, 17 Feb 2025 11:00:50 GMT
vary: Accept-Encoding
x-frame-options: DENY
x-content-type-options: nosniff
strict-transport-security: max-age=15768001
referrer-policy: same-origin
content-security-policy: default-src 'self' *.kernel.org; img-src https: data:
accept-ranges: bytes
 
Back
Top