How solve HTTP request failed! HTTP/1.1 463?

2020-02-07 05:52发布

问题:

I want to know how to extract an image of a site when you have the error HTTP request failed! HTTP / 1.1 463? The site airs to block all PHP queries, but it does not do so all internet servers.

I tested the script on One.com's servers that worked but it does not work anywhere else. I get the error 463, to be precise: HTTP request failed HTTP / 1.1 463.

Here's the script:

<?php
header("Content-type: image/gif");

$habbo = $_GET['habbo']; // Habbo
$habbo2 = $_GET['habbo2']; // Habbo N°2
$habbo3 = $_GET['habbo3']; // Habbo N°3
$pays = $_GET['pays']; // Pays

$image = imagecreatefromgif("bureau_behind.gif"); // Bureau

$avatar = imagecreatefromgif("https://www.habbo.".$pays."/habbo-imaging/avatarimage?user=".$habbo3."&action=sit&direction=2&head_direction=2&gesture=sml&size=b&img_format=gif");
imagecopy($image, $avatar, 78, -16, 0, 0, 64, 110); // Lien Habbo
$avatar = imagecreatefromgif("https://www.habbo.".$pays."/habbo-imaging/avatarimage?user=".$habbo2."&action=sit&direction=2&head_direction=2&gesture=sml&size=b&img_format=gif");
imagecopy($image, $avatar, 48, -2, 0, 0, 64, 110); // Lien Habbo n°2
$avatar = imagecreatefromgif("https://www.habbo.".$pays."/habbo-imaging/avatarimage?user=".$habbo."&action=sit&direction=2&head_direction=2&gesture=sml&size=b&img_format=gif");
imagecopy($image, $avatar, 20, 10, 0, 0, 64, 110);  // Lien Habbo n°3

$bureau = imagecreatefromgif("bureau_before.gif"); // Bureau image
imagecopy($image, $bureau, 0, 0, 0, 0, 300, 200); // Composition image

imagegif($image);
imagedestroy($image);
?>

Thanks in advance!

回答1:

I have tried the URL you are building, besides the possibly problematic rights situation if you are not authorized by habbo to use their graphics, the code 463 does not happen with a normal browser.

The code 463 is a non-standard code. Maybe habbo is filtering your request by user agent string. You may want to try the GET again, using a different user agent identifier in your script:

$httpRequest->setHeaders(array('User-Agent' => 'Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2')); 

or something similar (see them all at http://www.useragentstring.com/). I took this example straight from the php documentation here: http://php.net/manual/de/httprequest.setheaders.php



回答2:

The status code 463 Restricted Client is not being received under every condition:

Directory       User-Agent  Response Status Code
/habbo-imaging  Chrome      != 463
/habbo-imaging  ""          463
/api            Chrome      463
/api            ""          463

As the improvised table shows, a Chrome User-Agent on the /habbo-imaging directory is the only case to return a useful response, while the /api directory blocks Chrome's User-Agent. Seems like they set different access restrictions for the directories. I also included the /api directory since I encountered the same problem with that.

I assumed 463 meant restricted to servers only, tried using the User-Agent of a Linux server and found out after varying that the keywords to make Habbo not respond with 463 are Safari Google.

Directory       User-Agent      Response Status Code
/habbo-imaging  "Safari Google" != 463
/api            "Safari Google" != 463


标签: php http header