我从中学到了什么 Foregenix :
The HTTP 404 Not Found Error means that the webpage you were trying to reach could not be found on the server. It is a Client-side Error which means that either the page has been removed or moved and the URL was not changed accordingly, or that you typed in the URL incorrectly
但后来我也用 Python 进行网络应用程序渗透测试,我想知道如果我只检查页面上的字符串 404
,它可能不是真正的 404
错误。
有可能页面存在但标题是 404
只是为了愚弄我们。
那么我究竟如何才能知道呢?
最佳答案
您可以查看 HTTP 状态码,看它是否为 404。状态码在响应的第一行:
HTTP/1.1 404 Not Found
如果您使用 HTTPlib您可以只读取 HTTPResponse
对象的 status
属性。
但是,由服务器决定发送什么 HTTP 状态代码。仅仅因为 404 被定义为“找不到页面”并不意味着服务器不能骗你。做这样的事情很常见:
- 发送 404 而不是 403,以隐藏需要身份验证的资源。
- 发送 404 而不是 500,以掩盖某些东西不工作的事实。
- 当您的 IP 由于某种原因被阻止时发送 404。
如果不能访问服务器,就不可能知道幕后到底发生了什么。
关于http - 如何知道它是否真的是 404 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37590774/