我想尝试登录这个网址:
http://www.kalahari.com/marketplace/default.aspx

提交的两个字段标记为:

ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInEmail
ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInPasswordTextnormal

到目前为止我尝试使用的代码:

$username     = 'XXXXXXX';
$password     = 'XXXXXXX';

$loginUrl     = 'http://www.kalahari.com/marketplace/default.aspx';
$cookie  = 'cookies.txt';

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$loginUrl );
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE );
curl_setopt($ch,CURLOPT_RETURNTRANSFER,CURLOPT_COOKIEJAR,$cookie);
curl_setopt($ch,CURLOPT_COOKIEFILE,CURLOPT_HEADER,FALSE );
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
$ret = curl_exec($ch); //access login page

// Collecting all POST fields
$postfields = array();
$postfields['ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInEmail'] = $username;
$postfields['ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInPasswordTextnormal'] = $password;

curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postfields);
$ret = curl_exec($ch);//Get result after login page.

print $ret;

然而,这只会让我回到原始登录页面……甚至没有错误消息.

然后,我看看发布了什么,我看到:

Request URL:http://www.kalahari.com/marketplace/default.aspx
Request Method:POST
Status Code:302 Found
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:2596
Content-Type:application/x-www-form-urlencoded
Cookie:VISITORID=9840A7E31683480CB19A66FB8AA73BFC; ASP.NET_SessionId=foous3ftij3os2vvr1wbm3mm; __utma=160092839.590473234.1362995010.1362995010.1362995010.1; __utmc=160092839; __utmz=160092839.1362995010.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _SUPERFLY_nosample=1; shopperName=; signin=0; kalahariShopperId=922859656760417F99E83D5B1427115F; surfLang=ENG; prefLanguage=en-ZA; _chartbeat2=1yx62ww1m7xz1o84.1360134968807.1363000295875.00000000000001
Host:www.kalahari.com
Origin:http://www.kalahari.com
Referer:http://www.kalahari.com/marketplace/default.aspx
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML,like Gecko) Chrome/25.0.1364.152 Safari/537.22
Form Dataview sourceview URL encoded
__EVENTTARGET:
__EVENTARGUMENT:
__VIEWSTATE:/wEPDwULLTEzODYxODcwMTMPZBYCZg9kFgJmD2QWAgIBD2QWCAICD2QWBAIDDw8WAh4LTmF2aWdhdGVVcmwFNH4vcGlwZWxpbmUvc2lnbmluLmFzcHg/UmV0dXJuVVJMPS9zZWN1cmUvbWFya2V0cGxhY2VkZAIHDxYCHgdWaXNpYmxlaBYCAgEPDxYCHwFoZGQCBA9kFgICAQ9kFgICAQ8WAh8BaBYCAgEPZBYQAgEPDxYGHghDc3NDbGFzcwULYWN0aXZlX2xpbmseB0VuYWJsZWRnHgRfIVNCAgJkZAIDDw8WBh8CBQVsaW5rcx8DZx8EAgJkZaifDw8WBh8CBQ1kaXNhYmxlX2xpbmtzHwNoHwQCAmRkAgcPDxYGHwIFDWRpc2FibGVfbglua3MfA2gfBAICZGQCCQ8PFgYfAgUNZGlzYWJsZV9saW5rcx8DaB8EAgJkZAILDw8WBh8CBQ1kaXNhYmxlX2xpbmtzHwNoHwQCAmRkAg0PDxYGHwIFDWRpc2FibGVfbglua3MfA2gfBAICZGQCDw8PFgYfAgUNZGlzYWJsZV9saW5rcx8DaB8EAgJkZaifD2QWAgIBD2QWBgIJDxAPZBYCHgdvbkNsaWNrBYQBamF2YXNjcmlwdDpWYWxpZGF0ZUxvZ2luUmFkaW9CdG5ZZXMoY3RsMDBfY3RsMDBfY3BSA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BZcvYav7ATMf4Nhbfg==
ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInEmail:XXXXXXXXX
ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInPasswordTextnormal:Password
ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInPassword:XXXXXXXXXXX
ctl00$ctl00$ucmarketPlaceSupportNavigation$btnSigninTop:Sign in
ctl00$ctl00$cplhMain$cplhContent$txtEmail:Email address
ctl00$ctl00$cplhMain$cplhContent$rdlPasswordYes:rdlPasswordYes
ctl00$ctl00$cplhMain$cplhContent$txtPasswordTextnormal:Password
ctl00$ctl00$cplhMain$cplhContent$txtPassword:
ctl00$ctl00$cplhMain$cplhContent$hdnEmailDefault:Email address
ctl00$ctl00$cplhMain$cplhContent$hdnPasswordDefault:Password
Response Headersview source
Cache-Control:private,no-cache="Set-Cookie"
Content-Length:146
Content-Type:text/html; charset=utf-8
Date:Mon,11 Mar 2013 11:11:57 GMT
Etag:
Location:/marketplace/default.aspx
Server:Microsoft-IIS/6.0
Set-Cookie:.KALAHARINETAUTH=782A6F442823F8148FB113BA0BAF3A9A8DE253762A4ACFAA5E911E4721166F0EEC6A1891755133AADD28654CF0DAE3880CC2B84260F0B915C07897909CFB071495AF8EF05D1BD678DEE1933FCB08E5ECB1CF76462900681C7D4AE963C151E3079D95FBAD6466F0528787455A951D5EC0DA26F0E6CAA341E4C717D7F3BC01D182F488F47F; domain=.kalahari.com; path=/; HttpOnly
Set-Cookie:surfLang=ENG; domain=.kalahari.com; expires=Sat,11-Mar-2023 11:11:57 GMT; path=/
Set-Cookie:prefLanguage=en-ZA; domain=www.kalahari.com; path=/
Set-Cookie:signin=1; domain=kalahari.com; path=/
Set-Cookie:tempshopperid=922859656760417F99E83D5B1427115F; domain=kalahari.com; path=/
Set-Cookie:kalahariShopperId=54B14971F72D426BA02DEF3A3D99DC93; domain=kalahari.com; expires=Sun,17-Jan-2038 22:00:00 GMT; path=/
Set-Cookie:shopperName=XXXX; domain=kalahari.com; path=/
Set-Cookie:kalahariShopperEmail=XXX@XXXX.XXX; domain=kalahari.com; path=/
X-AspNet-Version:2.0.50727
X-Powered-By:ASP.NET

看起来我应该提交的不仅仅是用户名和密码.我必须发布什么内容以及如何发布不是固定值的“viewstate”?

介绍

脚本无法正常工作的可能原因如下

>缺少__VIEWSTATE
>缺少__EVENTVALIDATION
>无效的用户代理
>使用ctl00 $ctl00 $ucmarketPlaceSupportNavigation $txtMPTopSignInPasswordTextnormal用于密码而不是ctl00 $ctl00 $ucmarketPlaceSupportNavigation $txtMPTopSignInPassword
>不完整的后场
>重复卷曲请求
>登录过程中缺少Coolie

典型的服务器请求

完整的长请求看起来像这样

POST http://www.kalahari.com/marketplace/default.aspx HTTP/1.1
Host: www.kalahari.com
Connection: keep-alive
Content-Length: 2584
Cache-Control: max-age=0
Accept: text/html,*/*;q=0.8
Origin: http://www.kalahari.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML,like Gecko) Chrome/25.0.1364.160 Safari/537.22
Content-Type: application/x-www-form-urlencoded
Referer: http://www.kalahari.com/marketplace/default.aspx
Accept-Encoding: gzip,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,*;q=0.3
Cookie: ASP.NET_SessionId=t2dopenbp5zdfojmg1sd4m55; VISITORID=ECE2335BD47344E29A3D24E04FA31777; mpshopperid=A2E19BEB4D77484A89B9CD64BBB9C294; sign_up_track=sign_up; shopperName=; signin=0; kalahariShopperId=9D0B941AADCC48CA8ACB071C840A9CEB; __utma=46148088.1484253925.1363278451.1363278451.1363278451.1; __utmb=46148088.8.10.1363278451; __utmc=46148088; __utmz=46148088.1363278451.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); surfLang=ENG; prefLanguage=en-ZA; _chartbeat2=fn9a2z0breekvh98.1363278407516.1363278713879.00000000000001

__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwULLTE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wMF9jdGwwMF9jcGxoTWFpbl9jcGxoQ29udGVudF9sYmxSZXN1bHQnLGN0bDAwX2N0bDAwX2NwbGhNYWluX2NwbGhDb250ZW50X3R4dFBhc3N3b3JkLGN0bDAwX2N0bDAwX2NwbGhNYWluX2NwbGhDb250ZW50X3JkbFBhc3N3b3JkWWVzLGN0bDAwX2N0bDAwX2NwbGhNYWluX2NwbGhDb250ZW50X3JkbFBhc3N3b3JkTm8pO2QCBg9kFgICBQ8PFgIfAAUafi9waXBlbgluZS9vcmRlcl9saXN0LmFzcHhkZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAwUvY3RsMDAkY3RsMDAkY3BSAE1haW4kY3BSAENvbnRlbnQkcmRsUGFzc3dvcmRZZXMFLmN0bDAwJGN0bDAwJGNwbGhNYWluJGNwbGhDb250ZW50JHJkbFBhc3N3b3JkTm8FLmN0bDAwJGN0bDAwJGNwbGhNYWluJGNwbGhDb250ZW50JHJkbFBhc3N3b3JkTm99%2FwuPOuNOonYg5XWvf3RGR1YVkw%3D%3D&__EVENTVALIDATION=%2FwEWDQLsuI7QDgKnpLoxApD7nfEPAvLAqqUGAp35%2FakJAqGiqqYPAsXC5NUHAsHJ5OMCAovxoc8LArq0mqAKApm%2BrVoC9dLe0Q8C5IvEsAlYqPIdcrZvBZcvYav7ATMf4Nhbfg%3D%3D&ctl00%24ctl00%24ucmarketPlaceSupportNavigation%24txtMPTopSignInEmail=XXXXXXXXXX%40rmqkr.net&ctl00%24ctl00%24ucmarketPlaceSupportNavigation%24txtMPTopSignInPasswordTextnormal=Password&ctl00%24ctl00%24ucmarketPlaceSupportNavigation%24txtMPTopSignInPassword=XXXXXXXXXX&ctl00%24ctl00%24ucmarketPlaceSupportNavigation%24btnSigninTop=Sign+in&ctl00%24ctl00%24cplhMain%24cplhContent%24txtEmail=Email+address&ctl00%24ctl00%24cplhMain%24cplhContent%24rdlPasswordYes=rdlPasswordYes&ctl00%24ctl00%24cplhMain%24cplhContent%24txtPasswordTextnormal=Password&ctl00%24ctl00%24cplhMain%24cplhContent%24txtPassword=&ctl00%24ctl00%24cplhMain%24cplhContent%24hdnEmailDefault=Email+address&ctl00%24ctl00%24cplhMain%24cplhContent%24hdnPasswordDefault=Password

使用卷曲

$url = "http://www.kalahari.com/marketplace/default.aspx";
$ckfile = tempnam("/tmp","CURLCOOKIE");
$useragent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.2 (KHTML,like Gecko) Chrome/5.0.342.3 Safari/533.2';

$username = "XXXXXXXXXX";
$password = "XXXXXXXXXX";


$f = fopen('log.txt','w'); // file to write request header for debug purpose

/**
    Get __VIEWSTATE & __EVENTVALIDATION
 */
$ch = curl_init($url);
curl_setopt($ch,$ckfile);
curl_setopt($ch,true);
curl_setopt($ch,CURLOPT_USERAGENT,$useragent);

$html = curl_exec($ch);

curl_close($ch);

preg_match('~<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="(.*?)" />~',$html,$viewstate);
preg_match('~<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.*?)" />~',$eventValidation);

$viewstate = $viewstate[1];
$eventValidation = $eventValidation[1];



/**
 Start Login process
 */
$ch = curl_init();

curl_setopt($ch,$url);
curl_setopt($ch,false);
curl_setopt($ch,FALSE);
curl_setopt($ch,CURLOPT_REFERER,CURLOPT_VERBOSE,CURLOPT_STDERR,$f);
curl_setopt($ch,$useragent);

// Collecting all POST fields
$postfields = array();
$postfields['__EVENTTARGET'] = "";
$postfields['__EVENTARGUMENT'] = "";
$postfields['__VIEWSTATE'] = $viewstate;
$postfields['__EVENTVALIDATION'] = $eventValidation;
$postfields['ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInEmail'] = $username;
$postfields['ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInPasswordTextnormal'] = "Password";
$postfields['ctl00$ctl00$ucmarketPlaceSupportNavigation$txtMPTopSignInPassword'] = $password;
$postfields['ctl00$ctl00$ucmarketPlaceSupportNavigation$btnSigninTop'] = 'Sign in';
$postfields['ctl00$ctl00$cplhMain$cplhContent$txtEmail'] = 'Email address';
$postfields['ctl00$ctl00$cplhMain$cplhContent$rdlPasswordYes'] = 'Password';
$postfields['ctl00$ctl00$cplhMain$cplhContent$txtPassword'] = '';
$postfields['ctl00$ctl00$cplhMain$cplhContent$hdnEmailDefault'] = 'Email address';
$postfields['ctl00$ctl00$cplhMain$cplhContent$hdnPasswordDefault'] = 'Password';

curl_setopt($ch,$postfields);
$ret = curl_exec($ch); // Get result after login page.

print $ret;

经过测试,效果非常好……

php – 尝试使用CURL连接到ASPX网站?的更多相关文章

  1. HTML5 Web缓存和运用程序缓存(cookie,session)

    这篇文章主要介绍了HTML5 Web缓存和运用程序缓存(cookie,session),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  2. 关于h5中的fetch方法解读(小结)

    这篇文章主要介绍了关于h5中的fetch方法解读(小结),fetch身为H5中的一个新对象,他的诞生,是为了取代ajax的存在而出现,有兴趣的可以了解一下

  3. ios – 如何在Swift中手动为UIWebView设置Cookie

    我需要在swift中为webview设置一个cookie.我找到了一个解决方案,但它是针对objective-c的.如何在Swift中做到这一点?

  4. 通过在iOS中处理cookie来维护会话信息

    我是iOS开发的新手.我正在使用NSURLSession来管理会话信息.下面是我用来调用任何服务器API的示例代码,我的申请流程是,如果没有登录–>登录(呼叫登录api)Else转到主屏幕并调用其他API.我的问题是,一旦从内存中删除应用程序,会话信息就不会被维护,我不得不再次调用Login.我的要求就像Facebook一样,用户只需登录一次,并且在下次应用程序启动时保持会话.编辑:我想我必须通过

  5. ios – 以http无效的自定义URL方案开头

    我在应用程序中使用了自定义URL方案.我成功地从safari重定向到我的应用程序.就像我已经制作了URL方案“appname”.请检查http://prntscr.com/2cjx0p.我需要使用像iosurlredirectfrommailtoapp这样的解决方案,但我不确定如何设置cookie.我发现我必须首先在我的应用程序中为服务器“http://myappname.com”设置一个cook

  6. ios – 如何处理退款/取消应用内购买

    我正在尝试处理iOS的退款应用内购买.但我找不到明确的指导方针来做到这一点.所以我有一个会员类型的应用程序内购买功能,其中用户凭据不一定与itunes帐户绑定.当有人进行购买时,我可以参考哪种标识符,并且当他们通过苹果申请退款时具有相同的标识符?我需要立即取消会员资格.谢谢!解决方法我最终存储了收据字符串并运行cron来完成事务并查找取消字段.

  7. 在iOS 8.4上清除WKWebView的Cookie

    另一个想法是使用自定义的WKProcesspool子类手动管理cookie.我相信这是Firefox如何管理任何cookie问题.

  8. ios – 在302重定向之后,AVPlayer无法为同一个域发送cookie

    有没有办法解决这个问题?请分享你的想法.解决方法制作一个演示该问题的示例,提交错误报告.然后创建一个提到雷达的DTS事件,并且您正在寻找一个解决方案,以便您认为是一个错误.这打开了两种可能性:>工程师可以确认错误–如果不知道他们会修复它,如果它是重复的,您可以请求原始状态信息>DTS具有足够的知识,有能力查询实际的AV工程师如何解决这个问题这样你就可以花更少的时间找到可能不会得到任何其他答案的地方.

  9. ios – AFNetworking自动持久化Cookie

    在ThisQuestion中说,AFNetworking在后台自动处理cookies,但是在Previous问题中,我遇到麻烦,在登录时在PHP服务器上保持会话.一旦关闭的应用程序,并回到会议已经没了.答案是保持像这样的cookie来解决问题:当我尝试做这样的事情时,这给我一个应用程序崩溃.当我登录时,我设置了NSUserDefault:这是错误的使用方法吗?谢谢.解决方法使用以下内容,这是保存和加载适用于我的Cookie的正确方法:希望有帮助!

  10. ios – WKWebView Cookie存储位置

    希望苹果能够在最新的更新中解决这个问题.

随机推荐

  1. PHP个人网站架设连环讲(一)

    先下一个OmnihttpdProffesinalV2.06,装上就有PHP4beta3可以用了。PHP4给我们带来一个简单的方法,就是使用SESSION(会话)级变量。但是如果不是PHP4又该怎么办?我们可以假设某人在15分钟以内对你的网页的请求都不属于一个新的人次,这样你可以做个计数的过程存在INC里,在每一个页面引用,访客第一次进入时将访问时间送到cookie里。以后每个页面被访问时都检查cookie上次访问时间值。

  2. PHP函数学习之PHP函数点评

    PHP函数使用说明,应用举例,精简点评,希望对您学习php有所帮助

  3. ecshop2.7.3 在php5.4下的各种错误问题处理

    将方法内的函数,分拆为2个部分。这个和gd库没有一点关系,是ecshop程序的问题。会出现这种问题,不外乎就是当前会员的session或者程序对cookie的处理存在漏洞。进过本地测试,includes\modules\integrates\ecshop.php这个整合自身会员的类中没有重写integrate.php中的check_cookie()方法导致,验证cookie时返回的username为空,丢失了登录状态,在ecshop.php中重写了此方法就可以了。把他加到ecshop.php的最后面去就可

  4. NT IIS下用ODBC连接数据库

    $connection=intodbc_connect建立数据库连接,$query_string="查询记录的条件"如:$query_string="select*fromtable"用$cur=intodbc_exec检索数据库,将记录集放入$cur变量中。再用while{$var1=odbc_result;$var2=odbc_result;...}读取odbc_exec()返回的数据集$cur。最后是odbc_close关闭数据库的连接。odbc_result()函数是取当前记录的指定字段值。

  5. PHP使用JpGraph绘制折线图操作示例【附源码下载】

    这篇文章主要介绍了PHP使用JpGraph绘制折线图操作,结合实例形式分析了php使用JpGraph的相关操作技巧与注意事项,并附带源码供读者下载参考,需要的朋友可以参考下

  6. zen_cart实现支付前生成订单的方法

    这篇文章主要介绍了zen_cart实现支付前生成订单的方法,结合实例形式详细分析了zen_cart支付前生成订单的具体步骤与相关实现技巧,需要的朋友可以参考下

  7. Thinkphp5框架实现获取数据库数据到视图的方法

    这篇文章主要介绍了Thinkphp5框架实现获取数据库数据到视图的方法,涉及thinkPHP5数据库配置、读取、模型操作及视图调用相关操作技巧,需要的朋友可以参考下

  8. PHP+jquery+CSS制作头像登录窗(仿QQ登陆)

    本篇文章介绍了PHP结合jQ和CSS制作头像登录窗(仿QQ登陆),实现了类似QQ的登陆界面,很有参考价值,有需要的朋友可以了解一下。

  9. 基于win2003虚拟机中apache服务器的访问

    下面小编就为大家带来一篇基于win2003虚拟机中apache服务器的访问。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

  10. Yii2中组件的注册与创建方法

    这篇文章主要介绍了Yii2之组件的注册与创建的实现方法,非常不错,具有参考借鉴价值,需要的朋友可以参考下

返回
顶部