首页 > 其他分享 >JS请求参数加密破解

JS请求参数加密破解

时间:2022-11-25 18:35:27浏览次数:62  
标签:function 加密 0x31cef8 0x0 JS 0x1afd14 arguments 0x41e66d 破解


源代码如下

function ajax() {
var _0x41e66d = _0xe062, _0x31cef8 = {
'type': arguments[0x0][_0x41e66d(0x91)] || _0x41e66d(0x92),
'url': arguments[0x0][_0x41e66d(0x93)] || '',
'async': arguments[0x0]['async'] || !0x0,
'data': arguments[0x0][_0x41e66d(0x94)] || null,
'headers': arguments[0x0][_0x41e66d(0x95)] || {},
'dataType': arguments[0x0][_0x41e66d(0x96)] || 'text',
'contentType': arguments[0x0][_0x41e66d(0x97)] || 'application/x-www-form-urlencoded',
'beforeSend': arguments[0x0][_0x41e66d(0x98)] || function () {
},
'success': arguments[0x0][_0x41e66d(0x99)] || function () {
},
'error': arguments[0x0][_0x41e66d(0x9a)] || function () {
}
};
_0x31cef8[_0x41e66d(0x98)]();
var _0x1afd14 = createXmlHttpRequest();
_0x1afd14[_0x41e66d(0x9b)] = _0x31cef8[_0x41e66d(0x96)], _0x1afd14[_0x41e66d(0x9c)](_0x31cef8['type'], _0x31cef8['url'], _0x31cef8[_0x41e66d(0x9d)]), _0x1afd14[_0x41e66d(0x9e)]('Content-Type', _0x31cef8['contentType']), Object['keys'](_0x31cef8[_0x41e66d(0x95)])['forEach'](function (_0x49c282) {
var _0x1500ae = _0xe062;
_0x1afd14[_0x1500ae(0x9e)](_0x49c282, _0x31cef8[_0x1500ae(0x95)][_0x49c282]);
}), _0x1afd14[_0x41e66d(0x9f)](convertData(_0x31cef8[_0x41e66d(0x94)])), _0x1afd14[_0x41e66d(0xa0)] = function () {
var _0x46e788 = _0xe062;
0x4 === _0x1afd14[_0x46e788(0xa1)] && (0xc8 === _0x1afd14['status'] ? _0x31cef8[_0x46e788(0x99)](_0x1afd14[_0x46e788(0xa2)]) : _0x31cef8[_0x46e788(0x9a)]());
};
}

代码分析思路

1.代码中有大部分的0x标识的字符,如果是在括号内的,并且没有被引号圈起来的,那就是十六进制的。

直接到​jsjiami.com​解密一遍,就可以得到如下代码,看不懂的0x都变成目标字符了。

function ajax() {
var _0x41e66d = _0xe062,
_0x31cef8 = {
'type': arguments[0][_0x41e66d(145)] || _0x41e66d(146),
'url': arguments[0][_0x41e66d(147)] || '',
'async': arguments[0]['async'] || !0,
'data': arguments[0][_0x41e66d(148)] || null,
'headers': arguments[0][_0x41e66d(149)] || {},
'dataType': arguments[0][_0x41e66d(150)] || 'text',
'contentType': arguments[0][_0x41e66d(151)] || 'application/x-www-form-urlencoded',
'beforeSend': arguments[0][_0x41e66d(152)] || function() {},
'success': arguments[0][_0x41e66d(153)] || function() {},
'error': arguments[0][_0x41e66d(154)] || function() {}
};
_0x31cef8[_0x41e66d(152)]();
var _0x1afd14 = createXmlHttpRequest();
_0x1afd14[_0x41e66d(155)] = _0x31cef8[_0x41e66d(150)], _0x1afd14[_0x41e66d(156)](_0x31cef8['type'], _0x31cef8['url'], _0x31cef8[_0x41e66d(157)]), _0x1afd14[_0x41e66d(158)]('Content-Type', _0x31cef8['contentType']), Object['keys'](_0x31cef8[_0x41e66d(149)])['forEach'](function(_0x49c282) {
var _0x1500ae = _0xe062;
_0x1afd14[_0x1500ae(158)](_0x49c282, _0x31cef8[_0x1500ae(149)][_0x49c282]);
}), _0x1afd14[_0x41e66d(159)](convertData(_0x31cef8[_0x41e66d(148)])), _0x1afd14[_0x41e66d(160)] = function() {
var _0x46e788 = _0xe062;
4 === _0x1afd14[_0x46e788(161)] && (200 === _0x1afd14['status'] ? _0x31cef8[_0x46e788(153)](_0x1afd14[_0x46e788(162)]) : _0x31cef8[_0x46e788(154)]());
};
}

3.懂JS的人都知道,arguments是函数的入参函数,虽然这个ajax函数没有定义参数,但是这里可以看到,写代码的作者是把形参利用这个方式传进来了,我们如果想做的美观可以把他提出去。

4.剩下的就是正常解码了。

JS请求参数加密破解_JS加密

标签:function,加密,0x31cef8,0x0,JS,0x1afd14,arguments,0x41e66d,破解
From: https://blog.51cto.com/u_15781271/5887400

相关文章

  • JS类,创建,继承类,静态方法
    <!--js类 使用class创建类: 语法:constructor语法,ClassName类名 classClassName{ constructor(){...} } --> <pid="demo"></p> <script> letRunoob......
  • VUE读取本地json文件并解析
    //读取本地json文件exportfunctionGetUserAction(query){letquesa=axios.get('/json/userAction.json').then(res=>{//获取public下的buildmenu.json......
  • 新人ubuntu安装phantomjs踩坑
    PhantomJS​​PhantomJS​​ 是一个基于Webkit的“无界面”(headless)浏览器,它会把网站加载到内存并执行页面上的JavaScript,因为不会展示图形界面,所以运行起来比完整的浏......
  • Js 之turn.js禁止鼠标悬停页脚动画
    一、禁制前效果 二、禁止后 三、代码1、修改turn.js  这种是彻底去掉动画与翻页2、加事件  这只会去掉效果,点击会翻页 ......
  • js中对数字数组排序
    js中对数组数字排序(3条消息)js实现数字排序方法_soupJian前端养成记的博客-CSDN博客_js数字排序<scripttype="text/javascript">functionweek(){va......
  • RSA加密与解密
    RSA加密算法是一种非对称加密算法,所谓非对称,就是加密与解密用的钥匙是不同的安装npminstalljsencrypt引入importJSEncryptfrom'jsencrypt/bin/jsencrypt';封......
  • SQL Server 解析Json(单层/多层)
    一,单层Json数据取出1.取出取出@JsonData字符串中的 __type,DocNo,OrderPriceTC,Organization_Code字段  DECLARE@JsonDataNVARCHAR(max)=''SET@JsonData='[{......
  • vue.config.js config.resolve.alias 目录别名配置
    项目目录<!--vue项目1目录-->vue-project1 ... src vue.config.js<!--vue项目2目录-->vue-project2 ... src vue.config.js<!--其他项目......
  • prettierjs 格式整个项目代码
    用了prettierjs这么久,一直以来都是依托于vscode的快捷键调用.prettierrc.js配置文件进行单个文件的格式化;格式化整个项目代码的诉求越来越强烈,直到有一天发现了这片文章h......
  • js面向对象+ES6
    1、面向对象编程介绍1、面向过程编程POP(Process-orientedprogramming)面向过程就是分析出解决问题所需要的步骤,然后用函数把这些步骤一步一步实现,使用的时候再一......