| 顺手记录保存,无其他东东,闪开吧
访问bbs.it168.com首页
GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: bbs.it168.com
Connection: Keep-Alive
Cookie: it168tag=218.107.28.173.1145327174766848; cdb_sid=FC3d5y; cdb_cookietime=86400; cdb_auth=RlZGTD9BAUBAaA4CClcBXF0; sso_token=296a5c7f7e7c24351a2031f05b15ff47516279
HTTP/1.1 200 OK
Date: Tue, 09 May 2006 02:10:16 GMT
Server: Apache
X-Powered-By: PHP/4.3.11
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=GB2312
Content-Language: zh-CN
//访问登录链接,登录链接的URL:http://sso.it168.com/sso/login.jsp?return_url=http://bbs.it168.com/redirect168.php
GET /sso/login.jsp?return_url=http://bbs.it168.com/redirect168.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: http://bbs.it168.com
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: sso.it168.com
Connection: Keep-Alive
Cookie: it168tag=218.107.28.173.1145327174766848; cdb_sid=FC3d5y; cdb_cookietime=86400; cdb_auth=RlZGTD9BAUBAaA4CClcBXF0; sso_token=296a5c7f7e7c24351a2031f05b15ff47516279
//看到登录页面
HTTP/1.1 200 OK
Date: Tue, 09 May 2006 02:11:32 GMT
Server: Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a mod_jk/1.2.15 PHP/4.4.2
Set-Cookie: JSESSIONID=9FB4F205DE9F3018FD44B5670A6D9EDB; Path=/sso
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html;charset=GBK
登录界面
<form name="frmLogin" method="post" action="/sso/login.do?cmd=0" onSubmit="return checkForm();">
内置一个隐藏字段
function checkCookie(){
document.cookie = 'testcookie' + escape('nothing')
if (document.cookie == "") {
cookieMess.innerHTML = "本站要求您的浏览器支持cookie功能,\n\n否则将会影响您在本站的正常使用!";
}
}
function checkForm(){
if(document.frmLogin.login_name.value==""){
alert("请填写用户名!");
document.frmLogin.login_name.focus();
return false;
}
if(document.frmLogin.password.value==""){
alert("请填写密码!");
document.frmLogin.password.focus();
return false;
}
if(document.frmLogin.rand.value==""){
alert("请填写验证码!");
document.frmLogin.rand.focus();
return false;
}
if(document.cookie == ""){
document.frmLogin.cookie_flag.value="false";
}else{
document.frmLogin.cookie_flag.value="true";
}
return true;
}
更新了隐藏字段cookie_flag.
checkCookie的作用<font id=cookieMess></font>
//登录界面,进行登录
POST /sso/login.do?cmd=0 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: http://sso.it168.com/sso/login.jsp?return_url=http://bbs.it168.com/redirect168.php
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: sso.it168.com
Content-Length: 90
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: testcookienothing; JSESSIONID=9FB4F205DE9F3018FD44B5670A6D9EDB; it168tag=218.107.28.173.1145327174766848; cdb_sid=FC3d5y; cdb_cookietime=86400; cdb_auth=RlZGTD9BAUBAaA4CClcBXF0; sso_token=296a5c7f7e7c24351a2031f05b15ff47516279
cookie_flag=true&login_name=ciciv12345&password=123456789&rand=3288&btn_login=%B5%C7%C2%BC
在此里面强制添加了testcookienothing。
导致cookie_flag为true。
通过赋值给document.cookie来检查是否支持cookie。
//登录成功了,同时重定向到sso.itpub.net网站,更新了sso_token。
HTTP/1.1 200 OK
Date: Tue, 09 May 2006 02:11:54 GMT
Server: Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a mod_jk/1.2.15 PHP/4.4.2
Set-Cookie: sso_token=47b116cb088fcf00dc23af2fdcbe26db516357; Domain=.it168.com; Expires=Tue, 09-May-2006 04:11:54 GMT; Path=/
Content-Length: 192
Connection: close
Content-Type: text/html;charset=GBK
//注意:重定向到了sso.itpub.net网站了,域名也不同了
<meta http-equiv=refresh content="0;url=http://sso.itpub.net/sso/itpub_setCookie.jsp?sso_token=47b116cb088fcf00dc23af2fdcbe26db516357&return_url=http://bbs.it168.com/redirect168.php">
登录成功后更新了cookie,用setCookie.jsp表示。
//重定向了sso.itpub.net网站
GET /sso/itpub_setCookie.jsp?sso_token=47b116cb088fcf00dc23af2fdcbe26db516357&return_url=http://bbs.it168.com/redirect168.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: sso.itpub.net
Connection: Keep-Alive
Cookie: itpubtag=210.21.15.100.1143709536609290; sso_token=296a5c7f7e7c24351a2031f05b15ff47516279
重定向
HTTP/1.1 200 OK
Date: Tue, 09 May 2006 02:11:55 GMT
Server: Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a mod_jk/1.2.15 PHP/4.4.2
Set-Cookie: JSESSIONID=6943FCC817579EF33B0E4AD3015CA5CE; Path=/sso
Set-Cookie: sso_token=47b116cb088fcf00dc23af2fdcbe26db516357; Domain=.itpub.net; Expires=Tue, 09-May-2006 04:11:55 GMT; Path=/
Content-Length: 143
Connection: close
Content-Type: text/html;charset=ISO-8859-1
//注意:重定向回了sso.it168.com网站了
<meta http-equiv=refresh content="0;url=http://sso.it168.com/sso/loginOk.jsp?comefrom=1&return_url=http://bbs.it168.com/redirect168.php">
//访问sso.it168.com机器
GET /sso/loginOk.jsp?comefrom=1&return_url=http://bbs.it168.com/redirect168.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: sso.it168.com
Connection: Keep-Alive
Cookie: testcookienothing; JSESSIONID=9FB4F205DE9F3018FD44B5670A6D9EDB; it168tag=218.107.28.173.1145327174766848; cdb_sid=FC3d5y; cdb_cookietime=86400; cdb_auth=RlZGTD9BAUBAaA4CClcBXF0; sso_token=47b116cb088fcf00dc23af2fdcbe26db516357
//返回重定向的指引页面
HTTP/1.1 200 OK
Date: Tue, 09 May 2006 02:11:58 GMT
Server: Apache/2.0.55 (Unix) mod_ssl/2.0.55 OpenSSL/0.9.7a mod_jk/1.2.15 PHP/4.4.2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html;charset=GBK
<meta http-equiv="refresh" content="0; url=http://bbs.it168.com/redirect168.php">
//访问bbs.it168.com网站
GET /redirect168.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: bbs.it168.com
Connection: Keep-Alive
Cookie: it168tag=218.107.28.173.1145327174766848; cdb_sid=FC3d5y; cdb_cookietime=86400; cdb_auth=RlZGTD9BAUBAaA4CClcBXF0; sso_token=47b116cb088fcf00dc23af2fdcbe26db516357
//用Location再次重定向
HTTP/1.1 302 Found
Date: Tue, 09 May 2006 02:11:01 GMT
Server: Apache
X-Powered-By: PHP/4.3.11
Set-Cookie: cdb_cookietime=86400; expires=Wed, 10 May 2006 02:11:01 GMT; path=/; domain=.it168.com
Set-Cookie: cdb_auth=RlZGTD9BAUBAaA4CClcBXF0; expires=Wed, 10 May 2006 02:11:01 GMT; path=/; domain=.it168.com
Location: http://bbs.it168.com/index.php
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 26
Connection: close
Content-Type: text/html; charset=GB2312
Content-Language: zh-CN
//访问bbs的主页面
GET /index.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: bbs.it168.com
Connection: Keep-Alive
Cookie: it168tag=218.107.28.173.1145327174766848; cdb_sid=FC3d5y; cdb_cookietime=86400; cdb_auth=RlZGTD9BAUBAaA4CClcBXF0; sso_token=47b116cb088fcf00dc23af2fdcbe26db516357
//此时真正得到bbs主页面
HTTP/1.1 200 OK
Date: Tue, 09 May 2006 02:11:12 GMT
Server: Apache
X-Powered-By: PHP/4.3.11
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=GB2312
Content-Language: zh-CN
X-Pad: avoid browser bug
登录成功的页面:
<a href="http://sebbs.it168.com/redirect168.php" target=_blank>索爱论坛</A><b>·</b>
<a href="http://benyouhui.it168.com/redirect168.php" target="_blank">本友会</A><b>·</b>
<a href="http://nokia.it168.com/redirect168.php" target="_blank">Nokia论坛</A><b>·</b>
<a href="http://anycall.it168.com/redirect168.php" target="_blank">Anycall论坛</A><b>·</b>
<a href="http://moto.it168.com/redirect168.php" target="_blank">moto论坛</A>
<br><br>如果页面没有自动跳转,<a href="http://bbs.it168.com/redirect168.php" class="menu">请点击此处</a>
说明是普通的链接
|