简体   繁体   English

向服务器发送请求时伪造User-Agent?

[英]Faking User-Agent when sending request to server?

I am reading Detecting Device Type in a web application and just got curious if it would be possible to client to fake the User-Agent when sending the request? 我正在阅读Web应用程序中的“检测设备类型”,只是好奇是否client可以在发送请求时伪造User-Agent

Question(s) 问题
- user sends request via curl command but fakes it to look as if request is coming from Mobile on the server? -用户通过curl命令发送请求,但伪造了请求,看起来好像请求来自服务器上的Mobile is it possible? 可能吗?
- Can server detect it? -服务器可以检测到吗?
- Can server prevent it? -服务器可以阻止它吗?

Thanks 谢谢

It is possible and easy. 这是可能且容易的。 All you have to do is set the user-agent header string. 您所要做的就是设置用户代理标题字符串。 I've seen a browser that allowed you to set it (don't remember which one). 我看过一种浏览器,可以让您对其进行设置(不记得是哪一个)。 On the server it is very hard to know. 在服务器上很难知道。 A lot of bots pretend to be a browser so they don't get filtered out. 许多机器人伪装成浏览器,因此不会被过滤掉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM