迅捷家用路由器模拟登录页面测试

起因:路由器由于长期没有登陆,所以忘记了密码…
硬件:路由器迅捷(FAST): FWR310


路由器

登录页面分析

在这里插入图片描述

页面极为简单,仅含登录按钮:
在这里插入图片描述

登录逻辑

function lgDoSub() {
    var lgPwd = id("lgPwd"),   /*输入的密码项*/
    sessionValue = "";
    var value = lgPwd.value,
    result,
    pos,
    errorCode;

    /* 检查密码 */
    /* 简答检验 */
    
    /* 发送密码数据 */
    result = $.auth($.orgAuthPwd(value)); /*对密码进行简单处理并进行验证, 核心所在 !!!*/

    /* 处理返回的结果 */
    if (result.errorno == ENONE) {
        unloadLogin();
        lgPwd.value = "";
    } else {
        showLgError(parseInt(authInfo[1]));
    }
}

主要核心:$.auth($.orgAuthPwd(value));

代码分析

this.orgAuthPwd = function (a) {
        return this.securityEncode(a, "RDpbLfCPsJZ7fiv", "yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciXTysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro510qXeU07kV57fQMc8L6aLgMLwygtc0F10a0Dg70TOoouyFhdysuRMO51yY5ZlOZZLEal1h0t9YQW0Ko7oBwmCAHoic4HYbUyVeU3sfQ1xtXcPcf1aT303wAQhv66qzW")
};
this.securityEncode = function (a, b, c) {//数据处理函数
	var d = "",
	   e,
	   f,
	   h,
	   m,
	   k = 187,
	   l = 187;
	   f = a.length;
	   h = b.length;
	   m = c.length;
	   e = f > h ? f : h;
	   for (var g = 0; g < e; g++)
	       l = k = 187, g >= f ? l = b.charCodeAt(g) : g >= h ? k = a.charCodeAt(g) : (k = a.charCodeAt(g), l = b.charCodeAt(g)), d += c.charAt((k ^ l) % m);
	   return d
};

function auth(a) {
        var b = a,
        c = this.domainUrl + "?code=" + TDDP_AUTH + "&asyn=0";//构造URL:http://192.168.1.1/?code=7&asyn=0
        if (void 0 == a || 0 == b.length)//无密码
            return this.result.errorno = EUNAUTH, this.result;
        a = void 0;
		
        this.session = this.securityEncode(authInfo[3], b, authInfo[4]);//再次调用securityEncode函数
        c += "&id=" + this.encodePara(this.session);//构造URL
		
        if (!1 == this.local || this.routerAlive)
            this.externLoading(!0),
            this.request(c, a, "post", this.ajaxSyn), this.externLoading(!1);//请求ok
        this.parseAuthRlt();
        ENONE == this.result.errorno && this.setLgPwd(b);
        return this.result
    };

problem:

  • authInfo未知

authInfo

在这里插入图片描述
经过对数据进行多次测试请求后,得知authInfo为上次数据请求response中数据

代码测试

$.auth($.orgAuthPwd(pre[i]+password[j]+post[k]));
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值