Article Title: Use curl to view the webpage header information. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The command line is as follows:
Curl-I http://www.google.cn
HTTP/1.1 200 OK
Date: Fri, 04 Dec 2009 05:00:48 GMT
Expires:-1
Cache-Control: private, max-age = 0
Content-Type: text/html; charset = GB2312
Set-Cookie: PREF = ID = b967a5425e7612fe: NW = 1: TM = 1259902848: LM = 1259902848: S = RzTnMbkx10_w1Fo3; expires = Sun, 04-Dec-2011 05:00:48 GMT; path = /; domain = .google.cn
Set-Cookie: NID = 29 = jSJmgVmzh8Tj9yXNQI_obR5bbG8wIOk2J_8A8fzeSTYuUalXTkC7vv8rZNAgcy2YAvZ0TaGnfrj3HlJMSP3i9qolrNNjSiwt2ZNQ-5vl9yOYGswZYq70c8MtBxr2Lw3c; expires = Sat, 05-Jun-2010 05:00:48 GMT; path =/; domain = .google.cn; HttpOnly
Server: gws
X-XSS-Protection: 0
Content-Length: 0
It is found that the server name is changed to gws
Curl-I http://www.baidu.com
HTTP/1.1 200 OK
Date: Fri, 04 Dec 2009 04:55:44 GMT
Server: BWS/1.0.
Content-Length: 3520
Content-Type: text/html; charset = gb2312
Cache-Control: private
Expires: Fri, 04 Dec 2009 04:55:44 GMT
Set-Cookie: BAIDUID = c7bac24e0e27dda-b0ead646371c4d5d: FG = 1; expires = Fri, 04-Dec-39 04:55:44 GMT; path =/; domain = .baidu.com
P3P: CP = "oti dsp cor iva our ind com"
It is found that the server name is changed to BWS
Both websites hide their real server types.
Generally, this command or tool can detect the server type of the website.
As follows:
Curl-I http://www.cnprog.com/
HTTP/1.1 200 OK
Date: Fri, 04 Dec 2009 04:54:11 GMT
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635
Vary: Accept-Language, Cookie, Accept-Encoding
Content-Language: zh-cn
Content-Type: text/html; charset = utf-8
Apache is used.
After checking resources on the Internet, I learned that Baidu and Google both use thttpd servers.
Thttpd is a simple, small, portable, fast, and secure HTTP server.