moudy 发表于 2013-6-16 21:30

【DIY】自动进入fritzbox的管理页面

本帖最后由 moudy 于 2013-6-16 22:35 编辑

最近经常要进入fritzbox修改配置,无奈fritzbox的网页保护太严密,不直接提交输入的密码,而是提交salat hash,导致所有的浏览器都不能自动填写管理员密码。每次只好慢慢腾腾打开页面,再慢慢腾腾输入密码,再慢慢腾腾等主页打开。今天花了半个小时,研究了fritzbox的登陆页面,写了一个自动登陆的脚本,分享给同受这个问题折磨的筒子。<html>
<body onload="autologin()">
<script type="text/javascript" src="http://fritz.box/js/md5.js"></script>
<script type="text/javascript">
function autologin() {
var xhr;
if (window.XMLHttpRequest) {
    xhr=new XMLHttpRequest();
} else{
    xhr=new ActiveXObject("Microsoft.XMLHTTP");
}

xhr.open("GET", "http://fritz.box/login.lua", true);
xhr.onreadystatechange = function() {
    if(xhr.readyState == 4) {
      if(xhr.status==200) {
      c = /g_challenge = "(\w+?)"/.exec(xhr.responseText);
      document.getElementById("uiResp").value = c + "-" + hex_md5(c + "-" +"PASSWORD");
      document.getElementById("uiPostForm").submit();
      } else {
      window.location.href = "http://fritz.box";
      }
    }
};
xhr.send();
}
</script>

<form method="POST" action="http://fritz.box/login.lua" target="_self" id="uiPostForm">
<input type="hidden" id="uiResp" name="response"></form>
<div id="uiInfo"><a href="http://fritz.box">Goto fritz.box login page</a></div>
</body>
</html>
把上面的代码复制粘贴到一个文本文件里,修改第18行结尾处的PASSWORD为你自己的登陆密码,再保存成htm结尾的文件就可以了。
需要登陆时直接双击这个htm文件,浏览器会自动分析fritzbox的登陆条件,直接进入管理页面。

jamtotal 发表于 2013-6-17 07:39

纯技术贴, 要顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!{:5_342:}

crazymoon 发表于 2013-6-17 07:42

没有app么?
netgear就有手机和pad的app
一点就能看了
还挺方便的

crazymoon 发表于 2013-6-17 07:45

对了,有啊,叫myfritz

weisi 发表于 2013-6-17 07:54

纯技术贴, 回头试试。

moudy 发表于 2013-6-17 07:58

crazymoon 发表于 2013-6-17 08:45
对了,有啊,叫myfritz

avm的软件感觉都挺差劲的,只有fritzbox无敌。他家的fritzfon app用起来也是别别扭扭。

moudy 发表于 2013-6-17 07:59

crazymoon 发表于 2013-6-17 08:42
没有app么?
netgear就有手机和pad的app
一点就能看了


这个脚本是给你的电脑用的

Einschulung 发表于 2013-6-17 08:05

奇怪啊,我的fritzbox 7270就是浏览器自动输入密码的。

moudy 发表于 2013-6-17 08:30

Einschulung 发表于 2013-6-17 09:05
奇怪啊,我的fritzbox 7270就是浏览器自动输入密码的。

晕,我的也是7270,你用的什么浏览器?fritzbox固件版本号是多少?

Einschulung 发表于 2013-6-17 08:38

moudy 发表于 2013-6-17 09:30
晕,我的也是7270,你用的什么浏览器?fritzbox固件版本号是多少?

FRITZ!Box Fon WLAN 7270 v2 (UI)         Firmware: FRITZ!OS 05.22

浏览器firefox 20.0
页: [1] 2
查看完整版本: 【DIY】自动进入fritzbox的管理页面