5

JS逆向-裁判文书网加密分析20190902版

 1 year ago
source link: http://xianyucoder.cn/2019/09/17/%E6%AF%8F%E6%97%A5JS-%E8%A3%81%E5%88%A4%E6%96%87%E4%B9%A6%E7%BD%91-190902%E7%89%88/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

JS逆向-裁判文书网加密分析20190902版

2019-09-17

|

2019-09-30

| js逆向

| 3

| 次阅读

7.9k

|

13 分钟

裁判文书网20190902版

列表页 __RequestVerificationToken

搜索关键词__RequestVerificationToken 【图1-1】

图1-1

找到base.random(24)这个方法,这个复制出来就解决了。

function get_random(size){
var str = "",
arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
for(var i=0; i<size; i++){
str += arr[Math.round(Math.random() * (arr.length-1))];
}
return str;
}

Ciphertext

通过XHR断点,查看堆栈信息【图2-1】

图2-1

加密位置为【图2-2】

图2-2

直接扣取ciphertext这个方法的代码即可,这里展示部分代码:

cipher=function(){
var date = new Date();
var timestamp = date.getTime().toString();
var salt =get_random(24);
var year=date.getFullYear().toString();
var month = (date.getMonth()+1<10 ? "0"+(date.getMonth()+1) : date.getMonth()).toString();
var day = (date.getDate()<10 ? "0"+date.getDate() : date.getDate()).toString();
var iv =year+month+day;
var enc = DES3.encrypt(timestamp,salt,iv).toString();
var str = salt+iv+enc;
var ciphertext = strTobinary(str);
return ciphertext;
}

pageld

这个参数在首页点击时自动带入,经过测试并不是必须项,可以通过分析首页的源码查看到调用的方法。

function get_uuid(){
var guid = "";
for (var i = 1; i <= 32; i++) {
var n = Math.floor(Math.random() * 16.0).toString(16);
guid += n;
// if ((i == 8) || (i == 12) || (i == 16) || (i == 20)) guid +=
// "-";
}
return guid;
}
煌金 wechat
扫描关注公众号,回复「1024」获取为你准备的特别推送~

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK