如何检查网站查看器的操作系统?
我运行的是 Ubuntu 8.04,最近在访问网站时收到以下错误:
请使用运行 Windows 98、2000、Me、NT 或 XP 的计算机返回 www.site.com。
网站如何知道我正在运行哪个操作系统?是仅通过 JavaScript 还是请求标头中也有操作系统信息?
有没有办法让我绕过此检查或“假装”使用 Windows,以便即使我运行的是不受支持的操作系统也可以访问该网站?
I'm running Ubuntu 8.04 and I recently received the following error when visiting a website:
Please return to www.site.com with a computer running Windows 98, 2000, Me, NT, or XP.
How does the website know which OS I'm running? Is it only via javascript or is there OS information in the request headers as well?
Is there a way for me to bypass this check or "pretend" to be using Windows so that I can access the website even though I'm running an unsupported OS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我可以模仿其他浏览器/平台吗?
有很多方法可以欺骗用户代理字符串。在firefox中,恰好有一个名为“User Agent Switcher”的扩展,它允许您模仿其他浏览器。
https://addons.mozilla.org/en-US/firefox/addon/59
用户代理
经常检查用户代理可以告诉您这一点。例如,我的用户代理是:
我使用的是哪个平台?
Javascript 选项
您还可以使用 Javascript 中的
navigator
对象来获取一些信息。例如:PHP 选项
您可以从 $_SERVER 数组获取 PHP 中的用户代理:
PHP 还有更多好处,例如
get_browser()
* PHP 中的函数,返回一组信息,包括平台:
*
get_browser()
依赖于 browscap.ini - 请参阅http://www.php.net...php#ini.browscap 了解更多信息。
Can I Imitate Another Browser/Platform?
There are many ways to spoof user agent strings. In firefox, there happens to be an extension called "User Agent Switcher," which allows you to imitate other browsers.
https://addons.mozilla.org/en-US/firefox/addon/59
User Agents
Checking the user-agent often times can tell you this. For instance, my user-agent is:
Which platform am I on?
Javascript Option
You can also use the
navigator
object in Javascript to get some information too. For instance:PHP Options
You can get the user-agent in PHP from the $_SERVER array:
PHP also has further goodies, such as the
get_browser()
* function in PHP which returns an array of information, including theplatform
:*
get_browser()
relies upon browscap.ini - Seehttp://www.php.net...php#ini.browscap for more information.
每次您访问时,该信息都会出现在
User-Agent
HTTP header 中向任何服务器发出请求。检查此链接以获取
User-Agent<中的更多信息/code> 使用 Firefox 进行欺骗。
That info goes in the
User-Agent
HTTP header each time you make a request to any server.Check this link for more info in
User-Agent
spoofing using firefox.您可以在 JavaScript 中使用 navigator.platform:
这样您就不需要担心解析用户代理。
You can use navigator.platform in JavaScript:
That way you don't have to worry about parsing the user agent.
它可能是从 User-Agent 字符串中猜测的。
It may be guessing from the User-Agent string.
这是完整的代码。可能对某人有帮助,它检测哪个操作系统用户正在使用和版本,但它并没有深入到 Window 7 home/professional/ultimate 等版本,那个版本要复杂得多。
Here is the full code. Might help someone, it detects which OS user is using and version, but it doesnt go that deep in versions such as Window 7 home/professional/ultimate etc, that one is way more complex.
用户代理切换器 firefox 插件可以“欺骗”不同的网络浏览器。
The User Agent Switcher firefox add-on enables "spoofing" of a different web browser.
服务器端脚本将向网络浏览器提供信息,指示用户的浏览器类型和版本以及操作系统。例如,在 PHP 中,您有 get_browser()
Opera 浏览器有一个功能到欺骗,并且可以将自己呈现为另一种浏览器类型以避免浏览器阻塞。
The server-side script will present information to the web browser which indicates the user's browser type and version as well as operating system. For example, in PHP you have get_browser()
Opera browser has a facility to Spoof and can present itself as another browser type to avoid browser blocking.