在破解mail.163.com这个登录网页过程中,遇到了一些困难,很蛋疼,它的登录密码已经破译,但是在模拟登录过程中,不论我如何模拟这个网页http://dl.reg.163.com/l总是返回{“dt”:”04”,”ret”:”401”},无奈只好放弃转而去破解他的手机版网页,如果哪位大神知道是什么原因,跪求告知,下面回归正题。
1、破解加密
找到加密js
function rsaPwd() {
var form = document.f;
if (form.publicExponent.value != "" && form.modulus.value != "") {
var password = form.password.value;
bodyRSA(form.publicExponent.value, form.modulus.value);
form.password.value = encryptedString(key, encodeURIComponent(password));
}
return true;
}
var key;
function bodyRSA(rsa_publicExp, rsa_modulus) {
setMaxDigits(131);
key = new RSAKeyPair(rsa_publicExp, "", rsa_modulus);
}
document.getElementById('submit').onclick = function() {
rsaPwd();
}
2、post登录
请求链接http://m19.mm.mail.163.com/login.s
设置请求头
params.put("method", "login");
params.put("timestamp", "0");
params.put("m", "1");
params.put("register", "0");
params.put("wml", "false");
params.put("publicExponent", "10001");
params.put("modulus", "967094d470dc7940f32ab7e8b701cf2ca732c7cd7aed176ecd8cac605da26e5fc8664382bb2c0b73b8a0109016130ff0c0f73985fa990a18466008b14284969d58f2c2c2698f91b6dcc6bebd90663d288dca79586b8294a56619dd87ab21274088c318e26b6e3210b165118b87ebc8798df572b2b84cfa9fe54d04e3b8dc1b25");
params.put("username", username); //用户名
params.put("domain", "163.com");
params.put("password", password); //破解后的密码
获得cookies和重定向链接
http://m42.mm.mail.163.com/xm/welcome.do?"+mCookie+"&passport=&keyfrom=auth.input&auth=1&user="+URLEncoder.encode(username)+"&wml=false×tamp=0®ister=0
mCookie为返回头中的mCookie开头的cookie。
3、进行邮件抓取
带cookie请求上面获取到链接,为所欲为。