0

我已经成功登录到这个网站 taobao.com,但是在登录时,它没有让我登录。我尝试在网站上放置一个假的登录凭据,我将被重定向到登录页面,上面显示错误的用户/密码,但是当我放置了正确的凭据,它会将我重定向到主页,注销。有什么东西是用来确定登录的,是令牌还是什么的?

这是我“登录”后所拥有的

array(26) { ["url"]=> string(21) "http://www.taobao.com" ["content_type"]=> string(22) "text/html; charset=gbk" ["http_code"]=> int(200) ["header_size"]=> int(944) ["request_size"]=> int(487) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(1) ["total_time"]=> float(3.578121) ["namelookup_time"]=> float(0.795609) ["connect_time"]=> float(1.007797) ["pretransfer_time"]=> float(1.007867) ["size_upload"]=> float(0) ["size_download"]=> float(288091) ["speed_download"]=> float(80514) ["speed_upload"]=> float(0) ["download_content_length"]=> float(0) ["upload_content_length"]=> float(0) ["starttransfer_time"]=> float(1.235206) ["redirect_time"]=> float(1.057381) ["certinfo"]=> array(0) { } ["primary_ip"]=> string(14) "101.226.178.41" ["primary_port"]=> int(80) ["local_ip"]=> string(12) "10.143.2.234" ["local_port"]=> int(46679) ["redirect_url"]=> string(0) "" } Curl Closed

FIREBUG(如下是使用假凭据按下登录按钮时的记录[POST])

标题

    Response Headersview source
Cache-Control   no-cache, no-store
Connection  keep-alive
Content-Language    zh-CN
Content-Length  309
Content-Type    text/json;charset=gbk
Date    Thu, 06 Jun 2013 03:46:22 GMT
Expires Thu, 01 Jan 1970 00:00:01 GMT
Pragma  no-cache
Server  Tengine
Request Headersview source
Accept  application/json, text/javascript, */*; q=0.01
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cache-Control   no-cache
Connection  keep-alive
Content-Length  3449
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
Cookie  _umdata=BC3F78F6E8BD2BF86742CEC79060A356A26B1979F86E641D98A3D5E8BE2BB9CEA2BFBB264B82E431A482322D8118098ECAEDCEACF887A1CD93603238261471E839CB6075F6DCEA1B; _lg_nse_=blogshopstreet%2B%2B%2B1402024683344%7Csdasd%2B%2B%2B1402024838002%7Cdsfsdf%2B%2B%2B1402025519914%7Ctest%2B%2B%2B1402026382757; t=798c5937ac075da97cd7edfa9129d1e3; cna=0vkPCvwNAgICAT+N/Xw+MgMQ; lid=blogshopstreet; tg=0; lc=UIS7sFNo%2FmWmM2vXZ2GAGUodAA%3D%3D; _cc_=W5iHLLyFfA%3D%3D; tracknick=; l=blogshopstreet::1370492289845::11; x=e%3D1%26p%3D*%26s%3D0%26c%3D0%26f%3D0%26g%3D0%26t%3D0%26__ll%3D-1%26_ato%3D0; mt=cp=0&ci=0_0; cookie2=3ec03dacc3190aae8178bf64cc6bc27b; _tb_token_=f5bebee331eb6; ck1=; v=0
Host    login.taobao.com
Pragma  no-cache
Referer https://login.taobao.com/member/login.jhtml?redirectURL=http%3A%2F%2Fi.taobao.com%2Fmy_taobao.htm%3Fnekot%3DYmxvZ3Nob3BzdHJlZXQ%253D1370488685269
User-Agent  Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
X-Requested-With    XMLHttpRequest
Response Headers From Cache
Cache-Control   no-cache, no-store
Connection  keep-alive
Content-Language    zh-CN
Content-Length  309
Content-Type    text/json;charset=gbk
Date    Thu, 06 Jun 2013 03:46:22 GMT
Expires Thu, 01 Jan 1970 00:00:01 GMT
Pragma  no-cache
Server  Tengine

邮政

Parametersapplication/x-www-form-urlencoded
CtrlVersion 1,0,0,7
TPL_checkcode   
TPL_password    test
TPL_redirect_url    http://i.taobao.com/my_taobao.htm?nekot=YmxvZ3Nob3BzdHJlZXQ%3D1370488685269
TPL_username    test
callback    1
css_style   
fc  default
from    tb
from_encoding   
full_redirect   
guf 
gvfdcname   10
gvfdcre 687474703A2F2F6C6F67696E2E74616F62616F2E636F6D2F6D656D6265722F6C6F676F75742E6A68746D6C3F73706D3D61317A30322E312E302E362E307230356C6526663D746F70266F75743D7472756526726564697265637455524C3D68747470253341253246253246692E74616F62616F2E636F6D2532466D795F74616F62616F2E68746D2533466E656B6F74253344596D78765A334E6F6233427A64484A6C5A5851253235334431333730343838363835323639
isIgnore    
llnick  
loginType   3
loginsite   0
minipara    
minititle   
naviVer firefox|21
need_check_code 
need_sign   
need_user_id    
newlogin    1
not_duplite_str 
osVer   windows|6.2
oslanguage  en-US
popid   
poy 
pstrong 1
sign    
sr  1440*900
style   default
sub 
support 000001
tid XOR_1_000000000000000000000000000000_63584054400B0F717B750370
ua  087u5ObXObBitH2MRY+xNzEXDS85HzknNTzKfM=|uKBnf0c/N3/n79evt8/X/yU=|uZFW7MuiORVOJd5SdbKVvaWCRWIYg2gj2KSYv2W/|voZB+3P7POvzu/P7PCRsRHy706vjJDx0PDTza2NrrLT8tLx785uTSZM=|vzfw1/Aq|vCTjxOM5|vaW9esDnbCBsYFz0A/Q/xL8kzyhkf4SvtE+ok2izRJ/EHzRvQ7R/hP9kj2jDSATfFOzAm9BLZzwHSxE78iqh7aGt+tKKsqv81IykzZqy6sKrMNebgHtQS7BXbJdMGzNrQyrxbZfbwDsQC/AXnNALXHQsFH2WzXaNwZa+5t6XDdZaNpykTbadpYwga+JLgCqguu3FnbXt1ZyEvMTMhAyE7GQ8FHzkwwQjqOSopAz7DMc8R9w30JyHfFdMt1BrkEu8ZzznzJe7TId8B/yg7AugK2e8d4+zv2S8p78TGzPUzCsjxKxLQ29nP/SvyKN7N8zAp1wATJTY9KjzlLjjqDMfRH8zaUOKUtmV2dWCqvLK04Ss9Ny14sqSutNIr+P4AygzyC8U7zRjSxM7UokV76O4Q2hziG/kqHMkDFRsBe61DvW57saepu91riJO5Nw1zuXd9FgTmjP4UtjClb3lzZWt5PzEvLT8dPyUHERsBJy7Ybs=|sqqCRWKpUimyWX6k|s6sz9E5WkYmBCZFWTjbx1k3nLGeu2R4Gwel+pBzArLebvGa8|sKigZ0D6orrCWkKFT2hwSCCo0LgguMD40EjADATji/Pbw4vj29NL05uD6+OLk1l+uaF7XIY=|samRVuzLsSrBinENMTa+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FDM8Ix3WxDq8tUSmtIVHdqymtK6YLo%3D%7Cp88IspXf1Rzm6vHN8Y12WhHr89QTe%2BMkLOuDu6M74Ts%3D%7CpMwLsZbc1h%2Fl6fLO8o51WRLo8NcQmKBnb6jAiBAo8ig%3D%7Cpc0KsJfd1x7k6PPP8490WBPp8dYRmdEWHtmx2aHpM%2Bk%3D%7CmsIFv5gxy%2FGthl3GirD856swCyzrUcmhKe7W3uY8%2B%2FM0EzTz6%2BNr4%2Bsx6w%3D%3D%7Cm%2BMknrnz%2BTDKxt3h3aFadj3H3%2Fg%2FN%2FDo4HhwWIJY%7CmOAnnboT6dOPpH%2FkqJLexYkSKQ7J0RYOBp6GzhTO%7CmeEmnLsS6NKOpX7lqZPfxIgTKA%2FIwAcfBw8HL%2FUv%7Cntbe1hEZ3vYxWZ72%2FjlBKe727rZxaVEp7taOtnHp8TYudu4pMXm%2Bhv45IQnO9q5pURne1hGZXmZ%2BuYGJTlY%2B%2BeG5fmYu6fHJDhbR%2BbF2XmahOf52sckOZqF2HtnBuX5mDsnRiVM%3D&TPL_username=test&TPL_password=test&TPL_checkcode=&need_check_code=&loginsite=0&newlogin=1&TPL_redirect_url=http%3A%2F%2Fi.taobao.com%2Fmy_taobao.htm%3Fnekot%3DYmxvZ3Nob3BzdHJlZXQ%253D1370488685269&from=tb&fc=default&style=default&css_style=&tid=XOR_1_000000000000000000000000000000_63584054400B0F717B750370&support=000001&CtrlVersion=1%2C0%2C0%2C7&loginType=3&minititle=&minipara=&umto=T4317677c0dbaafee77c6aa380ee79691&pstrong=1&llnick=&sign=&need_sign=&isIgnore=&full_redirect=&popid=&callback=1&guf=&not_duplite_str=&need_user_id=&poy=&gvfdcname=10&gvfdcre=687474703A2F2F6C6F67696E2E74616F62616F2E636F6D2F6D656D6265722F6C6F676F75742E6A68746D6C3F73706D3D61317A30322E312E302E362E307230356C6526663D746F70266F75743D7472756526726564697265637455524C3D68747470253341253246253246692E74616F62616F2E636F6D2532466D795F74616F62616F2E68746D2533466E656B6F74253344596D78765A334E6F6233427A64484A6C5A5851253235334431333730343838363835323639&from_encoding=&sub=&oslanguage=en-US&sr=1440*900&osVer=windows%7C6.2&naviVer=firefox%7C21

我的 CURLOPT_POSTFIELDS

curl_setopt($ch, CURLOPT_POSTFIELDS, 'TPL_checkcode=&need_check_code=&loginsite=0&newlogin=1'.'&TPL_username='.$username.'&TPL_password='.$password);

非常感谢任何建议和建议。

4

1 回答 1

0

我从我的代码中建议你。我可以使用 curl url 登录网站。

只需使用它,我相信你会找到你的解决方案。

$id = "test@example.com";
$password = "test123";
$cookie_file_path = "cookiejar/";
$LOGINURL = "http://www.test.co.uk/sign-in";
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$POSTFIELDS = 'campaigncode=0&referrer=http://test.test.co.uk/greenlights&emailafriend=0&security_text=&SIemail=test@example.com&passWord=test123&SIRememUserName=true&LoginButton=1';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_HEADER, 1); // Get the header 
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $POSTFIELDS); 
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // this line makes it work under https

$result=curl_exec ($ch);
curl_close ($ch);

print_r($result);
于 2013-06-06T04:06:09.130 回答