Wordpress REST API - Error 403

  • Als GET?

    Bitte mal eine Ausgabe des Requests inkl. Header und der Response inkl. Header

    Was steht im Webserverlig?


    Serverlog:


    2024-05-12 19:55:32 ErroIP-Adresse 403 GET /wp-json/wp/v2/users HTTP/1.1 118 SSL/TLS-Zugriff für nginx


    Get-Auszug:

  • Der Nginx ist (afaik) immer an erster Stelle, den kann man bei einer geteilten IP-Adresse nicht deaktivieren. Auf dem HTTP[S] Port können ja nicht zwei Dienste gleichzeitig lauschen ;)

    "Wer nur noch Enten sieht, hat die Kontrolle über seine Server verloren." (Netzentenfund)

    Einmal editiert, zuletzt von KB19 ()

  • Hab nun selbst etwas gescripted, setz in deinem Python Script einen anderen user-Agent Header, z.B.

    response = requests.get("https://www.retro-lan-projekt.de/wp-json/wp/v2/users", headers={'user-agent':'curl'})


    Damit bekomme ich einen 200 und Daten.

  • ich bekomme immer einen 500er Fehler :/

    Hier mal der aktuelle Code:


  • sry ^^

    Code
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443
    DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /bot6389694216:AAHXPY7TNslqh5g091M0H-ei_FnG0X2Yjig/getMe HTTP/1.1" 200 249
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443
    DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /bot6389694216:AAHXPY7TNslqh5g091M0H-ei_FnG0X2Yjig/getUpdates?offset=1&timeout=20 HTTP/1.1" 200 997
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443
    DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /bot6389694216:AAHXPY7TNslqh5g091M0H-ei_FnG0X2Yjig/getFile?file_id=AgACAgIAAxkBAAPeZkEkSWK79xTUx7jeqcwLQMD5RN4AAqzXMRuRLhBKoV4o3-sw2ZABAAMCAAN5AAM1BA HTTP/1.1" 200 205
    DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "GET /file/bot6389694216:AAHXPY7TNslqh5g091M0H-ei_FnG0X2Yjig/photos/file_44.jpg HTTP/1.1" 200 497676
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.retro-lan-projekt.de:443
    DEBUG:urllib3.connectionpool:https://www.retro-lan-projekt.de:443 "POST /wp-json/wp/v2/media HTTP/1.1" 500 None
    DEBUG:urllib3.connectionpool:https://api.telegram.org:443 "POST /bot6389694216:AAHXPY7TNslqh5g091M0H-ei_FnG0X2Yjig/sendMessage?chat_id=878984314&text=Es+gab+ein+Problem+beim+Hochladen+der+Datei. HTTP/1.1" 200 309



  • Code
    send: b'POST /wp-json/wp/v2/media HTTP/1.1\r\nHost: www.retro-lan-projekt.de\r\nUser-Agent: curl\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Disposition: attachment; filename="photo_1715545236.jpg"\r\nContent-Type: image/jpg\r\nContent-Length: 452961\r\nAuthorization: Basic R3Vya2UyNTg6TjdzTSByN2hGIHhZd3AgRzFqZSBHNVBjIFpOUlI=\r\n\r\n'
    send: b'--ebd7ae86d8cd1a95d59073ec0a9e3efa\r\nContent-Disposition: form-data; name="file"; filename="file"\r\n\r\n\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xe2\x02dICC_PROFILE\x00\x01\x01\x00\x00\x02T\x00\x00\x00\x00\x04\x00\x00\x00mntrRGB XYZ \x07\xe7\x00\x03\x00\t\x00\n\x009\x00\x00acsp\x00\x00\x00\x00\x00\x00\x00\x00GOOG\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xd6\x00\x01\x00\x00\x00\x00\xd3-GOOGaG5(\xd5\xaa\xa3\x11\xe1C\xdf\xc9>\xfa\xa2h\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0bdesc\x00\x00\x01\x08\x00\x00\x00@cprt\x00\x00\x01H\x00\x00\x00Zwtpt\x00\x00\x01\xa4\x00\x00\x00\x14bkpt\x00\x00\x01\xb8\x00\x00\x00\x14rXYZ\x00\x00\x01\xcc\x00\x00\x00\x14gXYZ\x00\x00\x01\xe0\x00\x00\x00\x14bXYZ\x00\x00\x01\xf4\x00\x00\x00\x14rTRC\x00\x00\x02\x08\x00\x00\x00 chad\x00\x00\x02(\x00\x00\x00,bTRC\x00\x00\x02\x08\x00\x00\x00 gTRC\x00\x00\x02\x08\x00\x00\x00 mluc\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0cenUS\x00\x00\x00$\x00\x00\x00\x1c\x00s\x00R\x00G\x00B\x00 \x00I\x00E\x00C\x006\x001\x009\x006\x006\x00-\x002\x00.\x001\x00\x00mluc\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x0cenUS\x00\x00\x00>\x00\x00\x00\x1c\x00C\x00o\x00p\x00y\x00r\x00i\x00g\x00h\x00t\x00 \x00(\x00c\x00)\x00 \x002\x000\x002\x003\x00 \x00G\x00o\x00o\x00g\x00l\x00e\x00 \x00I\x00n\x00c\x00.\x00\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00\xf6\xd6\x00\x01\x00\x00\x00\x00\xd3-XYZ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00o\xa0\x00\x008\xf5\x00\x00\x03\x90XYZ \x00\x00\x00\x00\x00\x00b\x97\x00\x00\xb7\x87\x00\x00\x18\xd9XYZ \x00\x00\x00\x00\x00\x00$\x9f\x00\x00\x0f\x84\x00\x00\xb6\xc3para\x00\x00\x00\x00\x00\x03\x00\x00\x00\x02ff\x00\x00\xf2\xa7\x00\x00\rY\x00\x00\x13\xd0\x00\x00\n[sf32\x00\x00\x00\x00\x00\x01\x0cB\x00\x00\x05\xde\xff\xff\xf3\'\x00\x00\x07\x93\x00\x00\xfd\x90\xff\xff\xfb\xa3\xff\xff\xfd\xa4\x00\x00\x03\xdc\x00\x00\xc0n\xff\xdb\x00C\x00\x04\x03\x03\x04\x03\x03\x04\x04\x03\x04\x05\x04\x04\x05\x06\n\x07\x06\x06\x06\x06\r\t\n\x08\n\x0f\r\x10\x10\x0f\r\x0f\x0e\x11\x13\x18\x14\x11\x12\x17\x12\x0e\x0f\x15\x1c\x15\x17\x19\x19\x1b\x1b\x1b\x10\x14\x1d\x1f\x1d\x1a\x1f\x18\x1a\x1b\x1a\xff\xdb\x00C\x01\x04\x05\x05\x06\x05\x06\x0c\x07\x07\x0c\x1a\x11\x0f\x11\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\xff\xc2\x00\x11\x08\x03\xc3\x05\x00\x03\x01"\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\x1c\x00\x00\x02\x03\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x02\x03\x06\x01\x07\x00\x08\xff\xc4\x00\x1b\x01\x00\x02\x03\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x00\x03\x04\x05\x06\x07\xff\xda\x00\x0c\x03\x01\x00\x02\x10\x03\x10\x00\x00\x01\xc3\x0c\x0b\x9b2\xa6\x8d\xb1X9R\xea\x88\xd8ph\x07\xe4\'cX\xb4\xe1\x88\xa3A\x9f\xd0\x088\x8ekD\x12\xea\xa2\x08TZM\xac+p\x83\x11\x8a\xab \xc6\xc3\xc5(\x08\xccy\xaa\xca\xf1\xc820\xa6\x80Z\xfc\x96f\x19UV\x92)S\xaeK\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