在没有浏览器或curl的情况下发出HTTP请求

时间:2020-04-29 10:23:02

标签: http request

我是在求职面试中得到的:

通过参数“ hi”向https://spnagios.storpool.com/confupd/meow.php发送HTTP请求,使其与上一个任务相等,并且没有浏览器或curl,您将获得一个电子邮件地址。

上一个任务的答案是487。

现在您可能会说:好吧,如果您无法弄清楚这一点,则可能不适合您。 好吧,您也许是对的,但我仍然想知道它是如何完成的,答案是什么,以便可以收到电子邮件:)

2 个答案:

答案 0 :(得分:2)

您可以尝试Postman或任何其他rest api开发工具来发出http请求。

例如,您可以在Postman中发出http请求,如下所示:

https://spnagios.storpool.com/confupd/meow.php/hi=487

答案 1 :(得分:1)

也许面试官打算测试您对TCP网络和应用程序级别协议的了解。在这种情况下,通常可以使用允许您建立原始TCP套接字,然后手动发送应用程序协议消息的任何工具。

请参阅下面的一些示例。

使用telnet

➜  ~ telnet spnagios.storpool.com 80
Trying 185.117.80.38...
Connected to https-sof.storpool.com.
Escape character is '^]'.
GET /confupd/meow.php HTTP/1.0

HTTP/1.1 404 Not Found
Server: nginx/1.10.3
Date: Wed, 29 Apr 2020 10:33:28 GMT
Content-Type: text/html
Content-Length: 169
Connection: close

<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.10.3</center>
</body>
</html>
Connection closed by foreign host.

使用netcat

➜  ~ nc spnagios.storpool.com 80
GET /confupd/meow.php HTTP/1.0

HTTP/1.1 404 Not Found
Server: nginx/1.10.3
Date: Wed, 29 Apr 2020 10:39:54 GMT
Content-Type: text/html
Content-Length: 169
Connection: close

<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.10.3</center>
</body>
</html>
相关问题