网址是http://passport.99sushe.com/regist.aspx
用httpwatch后发现有两个参数btn_regist.x btn_regist.y不知道他的取值是哪里来的
如果不提交这两个值直接返回的是原页面
如果随便写 那么返回的是alert弹出窗口提示验证码错误
至于他的验证码是http://passport.99sushe.com/validatecode.aspx?sk=RegistValidateCode&r=Tue%20Feb%2007%202012%2011:19:40%20GMT+0800%20(%E4%B8%AD%E5%9B%BD%E6%A0%87%E5%87%86%E6%97%B6%E9%97%B4)
这样的就是http://passport.99sushe.com/validatecode.aspx?sk=RegistValidateCode&r=
加上时间
我就是在本地生成一个地址然后直接从服务器下载验证码的
大家帮帮忙 谢谢啦

解决方案 »

  1.   

    那你就分两步,第一步去请求http://passport.99sushe.com/regist.aspx,抓取btn_regist.x,btn_regist.y,然后第二步再提交至注册验证页面。
      

  2.   

    btn_register是你那个网页的提交按钮的图片。那些隐含的表单字段你都获取并在验证时提交了?
      

  3.   

    所有隐藏的都提交了 除了那两个参数 其他和httpwatch截获的都一样
      

  4.   

    这种用来防止你模拟访问的参数一般比较麻烦,大多是用JS拼装生成,你需要认真研读它的代码,寻找其中JS的逻辑关系,然后找到拼装的地方,才能设法处理。
      

  5.   

    休假中,不是自己的机器,没法装那些软件工具,只能给出几个建议:
    1)查看是否在js中拼装;
    2)查看是否有隐含的地址请求来完成这两个参数的获取;你在IE中请求http://passport.99sushe.com/regist.aspx时,用HttpWatch跟踪看实际请求的是几个.html/htm/aspx以及返回值
      

  6.   

    还是看不出 页面唯一的js是http://passport.99sushe.com/js/ajax.js
    + 0.000 ! 0.897 261 13583 GET 200 html http://passport.99sushe.com/regist.aspx
    + 0.609 ! 0.084 0 0 GET (Cache) css http://passport.99sushe.com/style/regist.css
    + 0.754 ! 0.057 0 0 GET (Cache) javascript http://passport.99sushe.com/js/ajax.js
    + 0.971 ! 0.445 449 2871 GET 200 jpeg http://passport.99sushe.com/validatecode.aspx?sk=RegistValidateCode&r=Wed Feb 8 10:08:19 UTC+0800 2012
    + 1.003 ! 0.351 328 1603 GET 404 html http://img.99sushe.com/passport/body_bg.gif
    + 1.003 ! 0.062 0 0 GET (Cache) gif http://img.99sushe.com/passport/nav_bg.gif
    + 1.065 ! 0.281 335 1603 GET 404 html http://img.99sushe.com/passport/content_bg_cen.gif
    + 1.065 ! 0.002 0 0 GET (Cache) gif http://img.99sushe.com/passport/inner_bg_bom.gif
    + 1.068 ! 0.002 0 0 GET (Cache) gif http://img.99sushe.com/passport/inner_bg_cen.gif
    + 1.070 ! 0.293 335 1603 GET 404 html http://img.99sushe.com/passport/content_bg_top.gif
    + 1.070 ! 0.061 0 0 GET (Cache) gif http://img.99sushe.com/passport/inner_bg_top.gif
    + 1.604 ! 0.126 335 1603 GET 404 html http://img.99sushe.com/passport/content_bg_bom.gif这些是访问regist.aspx里面没有发现任何有关的信息
    + 0.000 ! 0.203 492 350 POST 200 html http://passport.99sushe.com/AjaxFactory.aspx
    这个是输入用户名后出现的,用于检测用户名是否注册 返回内容是0
    底下是这个js,还是没看出来啊
    //readyState Status Codes:
    var RS_UNINITIALIZED=0;
    var RS_LOADING=1;
    var RS_LOADED=2;
    var RS_INTERACTIVE=3;
    var RS_COMPLETE=4;String.prototype.trim  =  function(){
        return  this.replace(/(^\s*)|(\s*$)/g,  "");
    }
    function $G(id) {
        return document.getElementById(id);
    }
    function $V(id) {
        var c = $G(id);
        if(c) return c.value;
        else return null;
    }function Ajax() {
        if (typeof (Ajax.initMethod) == "undefined") {
            Ajax.prototype.GetHttpRequestObject = function() {
                if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
                else if (window.XMLHttpRequest) return new XMLHttpRequest();
                try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { };
                return null;
            }        Ajax.prototype.EncodeUrlParam = function(param){
                var params = param.split('&');
                var rp = "";
                for(var i = 0;i< params.length;i++){
                   var nv = params[i].split('=');
                   if(rp != "") rp += "&";
                   rp += nv[0] + "=";
                   rp += encodeURIComponent(nv[1]);
                }
                return rp;
            }
            // callback is defined outside with two params
            // first param shows that the request complete successfully or not
            // second shows the response text
            Ajax.prototype.Get = function(url, callback) {
                var xmlHttp = Ajax.prototype.GetHttpRequestObject();
                if (xmlHttp == null) {
                    alert("create ajax error");
                    return;
                }
                xmlHttp.onreadystatechange = function() {
                    if (xmlHttp.readyState == RS_COMPLETE) {
                        if (xmlHttp.status == 200) callback(true, xmlHttp.responseText);
                        else callback(false, xmlHttp.responseText);
                        xmlHttp = null;
                    }
                }
                xmlHttp.open("GET", url, true);
                xmlHttp.setRequestHeader("Content-Type", "text/html;charset=gb2312");
                xmlHttp.send(null);
            }        Ajax.prototype.Post = function(url, param, callback) {
                var xmlHttp = Ajax.prototype.GetHttpRequestObject();
                if (xmlHttp == null) {
                    alert("create ajax error");
                    return;
                }
                xmlHttp.onreadystatechange = function() {
                    if (xmlHttp.readyState == RS_COMPLETE) {
                        if (xmlHttp.status == 200) callback(true, xmlHttp.responseText);
                        else callback(false, xmlHttp.responseText);
                        xmlHttp = null;
                    }
                }
                xmlHttp.open("POST", url, true);
                xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=gb2312');
                xmlHttp.send(Ajax.prototype.EncodeUrlParam(param));
            }
        }
        Ajax.initMethod = true;
    }
     
      

  7.   

    我发现是验证码的问题http://passport.99sushe.com/validatecode.aspx?sk=RegistValidateCode&r=Wed Feb 8 10:40:05 UTC+0800 2012 即使是这个不断刷新验证码也会变
    我是这样 自己打开一个注册的页面 手工注册 但是把验证码地址复制出来 重新刷新一遍 输入那个验证码 提交后显示验证码错误 不过服务器是怎么知道是那个验证码的???
      

  8.   

    验证码本来就是刷新就变的,否则咋防止机器人暴力登录啊。服务器在Session里面记录了验证码值的。所以你只能取一次验证码。
      

  9.   

    现在我成功了 我错在用了另一个httpclient去获取验证码 感谢二位了
      

  10.   

    能把你的代码发给我研究研究嘛!!???我现在也急需写个类似这个注册的,非常感谢![email protected]