本帖最后由 .個朲綉√ 于 2012-1-11 13:31 编辑 dwr.engine._origScriptSessionId = "29EA80CA00494841E46EBDDBA576AEAA";
/** The session cookie name */
dwr.engine._sessionCookieName = "JSESSIONID"; // JSESSIONID
/** Is GET enabled for the benefit of Safari? */
dwr.engine._allowGetForSafariButMakeForgeryEasier = true;
/** The read page id that we calculate */
dwr.engine._scriptSessionId = null;
/** The function that we use to fetch/calculate a session id */
dwr.engine._getScriptSessionId = function() {
if (dwr.engine._scriptSessionId == null) {
dwr.engine._scriptSessionId = dwr.engine._origScriptSessionId + Math.floor(Math.random() * 1000);
}
return dwr.engine._scriptSessionId;
上面是一个JS文件中的一段代码
post需要提交dwr.engine._scriptSessionId,而dwr.engine._scriptSessionId = dwr.engine._origScriptSessionId + Math.floor(Math.random() * 1000);
已经知道dwr.engine._origScriptSessionId="29EA80CA00494841E46EBDDBA576AEAA";
那么Math.floor(Math.random() * 1000);这个随机码应该怎么获取,我试过如果自己随便写个数字替换这个随机码是不可能的.
比如Math.floor(Math.random() * 1000);如果是333,那么post提交的时候就是提交29EA80CA00494841E46EBDDBA576AEAA333
下面是我post的过程,中间少了两次post,因为这两次post需要用到随机码,各位侠帮忙看看怎么能成功登陆:
账号:AutoIt 密码:acnit3
http://nm.ct10000.com
选择注册账号登陆即可,我的要求只要能返回随机值,并登陆成功即可
附件中包含验让码识别库,要直接识别验证码,请下载附件,谢谢!!!
$MyOpen=_WinHttpOpen('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)')
$rContext = _WinHTTP_GetRespond($MyOpen,"http://nm.ct10000.com/service/account/login3.jsp",2)
If @error Then MsgBox(0,"Bug","出错1")
$rContext = _WinHTTP_GetRespond($MyOpen,"http://nm.ct10000.com/service/account/login.jsp",2)
If @error Then MsgBox(0,"Bug","出错1")
$Test = _WinHTTP_GetRespond($MyOpen,"http://nm.ct10000.com/service/account/imageCode.jsp",2+256)
If @error Then MsgBox(0,"Bug","出错2")
$FIle = FileOpen(@ScriptDir &"\text.bmp",26)
FileWrite($FIle,$Test[0])
FileClose($FIle)
Sleep(500)
$jpg=@ScriptDir&"\text.bmp"
$CODE = _AntiVC($Dll_FilePath, $Cds_FilePath, $jpg)
; MsgBox(0,'',$CODE)
; Exit
$sDataToSend="select_value=9%2C%2C%E6%B3%A8%E5%86%8C%E8%B4%A6%E5%8F%B7%2C0&user%2FisBusinessCustType=N&user%2FuserLoginType=9&user%2FintLoginType=&authType=2&returnURL=http%3A%2F%2Fsd.ct10000.com%3A8080%2Fservice%2FLoginAuth&user%2FareaCode=0471&user%2Fnumber=AutoIt&user%2FidentifyType=B&user%2Fpassword=acnit3&temppwd=&user%2FrandomPass=&sRand="&$CODE
$rContext=_WinHTTP_GetRespond($MyOpen,"http://nm.ct10000.com/service/account/validate_code.jsp",1 + 2 + 4 + 8,50000,$sDataToSend,"","Referer: http://nm.ct10000.com/service/account/login.jsp"&@CRLF&"Content-Type: application/x-www-form-urlencoded")
If @error Then MsgBox(0,"Bug","出错3")
_ArrayDisplay($rContext)
_FileWriteLog(@ScriptDir&"\日志.log",$rContext[0])
;此处还有两次POST提交动作
$rContext=_WinHTTP_GetRespond($MyOpen,"http://nm.ct10000.com/service/manage/mainInfor.jsp",2)
If @error Then MsgBox(0,"Error","登录失败1")
_FileWriteLog(@ScriptDir&"\日志.log",$rContext[0])
|