echo094 / decode-js

JS混淆代码的AST分析工具 AST analysis tool for obfuscated JS code
MIT License
717 stars 336 forks source link

jsconfuser: 新混淆工具 #112

Open goodwenhao opened 3 months ago

goodwenhao commented 3 months ago

Which plugin are you reporting a bug for?

obfuscator

Version of Node

20.14

Input code

https://github.com/goodwenhao/study/blob/main/test.js

Additional context

No response

echo094 commented 3 months ago

根据后续留言,该混淆工具确定为 https://github.com/MichaelXF/js-confuser

这种混淆方式的核心内容是头尾的两部分代码:

// 头部
function ggsElv() {}
PS61TpK = Object["defineProperty"]
function b2YUfe(ggsElv) {
  return x_bH3Yz[ggsElv < 48 ? ggsElv - 94 : ggsElv > 281 ? ggsElv - 80 : ggsElv - 49];
}
x_bH3Yz = UehMhMQ.call(this);
function nS3LeN(ggsElv, PS61TpK) {
  GrpZibt(ggsElv, "length", {
    value: PS61TpK,
    configurable: b2YUfe(104)
  });
  return ggsElv;
}
GrpZibt = Object.defineProperty;
var XPU2Of = [], MrnEyjO = [...]

// 尾部
function UehMhMQ() {
  return [...];
}
function JBApsSj(ggsElv, x_bH3Yz = 0) {
  var GrpZibt = function () {
    return ggsElv(...arguments);
  };
  return PS61TpK(GrpZibt, "length", {
    "value": x_bH3Yz,
    "configurable": true
  });
}
goodwenhao commented 3 months ago

好的,目前该项目解不了这种新型的是吧

echo094 commented 3 months ago

如果这是一种公开的混淆工具,可以考虑添加

goodwenhao commented 3 months ago

okk期待佬适配

mrright-cyber commented 3 months ago

我近期也发现了这类加密的不断出现,格式均形如:

// 头部:
function ukhkX8(){}
var fdyqG3=Object['defineProperty']

期待佬适配

echo094 commented 3 months ago

我近期也发现了这类加密的不断出现

所以你知道这个工具的链接吗

Tlaeld commented 3 months ago

新混淆工具,求佬支持: https://github.com/MichaelXF/js-confuser

mrright-cyber commented 3 months ago

大佬,这类型的找到了,具体链接

仓库地址

这类加密发展太迅猛了,现在基本上JS都用这个加密了

我近期也发现了这类加密的不断出现

所以你知道这个工具的链接吗

echo094 commented 2 months ago

适配中,不定时更新到分支 jsconfuser

greenwave1987 commented 2 months ago

现在能解吗?我这报错还是不行。

echo094 commented 2 months ago

现在能解吗?我这报错还是不行。

你可以把你的样本贴出来。

greenwave1987 commented 2 months ago

https://raw.githubusercontent.com/6dylan6/jdpro/refs/heads/main/jd_dpqd_sign.js 更新代码后这个可以,但是其他加密的还是报错,这个加密这么牛吗,一个加密一个样,例如下面这个。 https://raw.githubusercontent.com/6dylan6/jdpro/refs/heads/main/jd_dpqd_main.js。 报错: `D:\backup\decode-js-jsconfuser\src\plugin\jsconfuser.js:1010 decode_fn.traverse({ ^

TypeError: Cannot read properties of null (reading 'traverse') at findBufferToString (D:\backup\decode-js-jsconfuser\src\plugin\jsconfuser.js:1010:15) at FunctionDeclaration (D:\backup\decode-js-jsconfuser\src\plugin\jsconfuser.js:1229:10) at NodePath._call (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:49:20) at NodePath.call (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:39:18) at NodePath.visit (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:85:31) at TraversalContext.visitQueue (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\context.js:89:16) at TraversalContext.visitMultiple (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\context.js:61:17) at TraversalContext.visit (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\context.js:110:19) at traverseNode (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\traverse-node.js:22:17) at NodePath.visit (D:\backup\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:91:52)`

wangjing71 commented 1 month ago

TypeError: Cannot read properties of undefined (reading 'constantViolations') at StringLiteral (C:\Users\hp\Desktop\decode-js-jsconfuser\src\plugin\jsconfuser.js:1283:17) at NodePath._call (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:49:20) at NodePath.call (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:39:18) at NodePath.visit (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:85:31) at TraversalContext.visitQueue (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\context.js:89:16) at TraversalContext.visitSingle (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\context.js:65:19) at TraversalContext.visit (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\context.js:112:19) at traverseNode (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\traverse-node.js:22:17) at NodePath.visit (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\path\context.js:91:52) at TraversalContext.visitQueue (C:\Users\hp\Desktop\decode-js-jsconfuser\node_modules\@babel\traverse\lib\context.js:89:16)

echo094 commented 1 month ago

这个混淆工具剩下的几个流程比较复杂,最近有很多别的事,这个月没有足够的时间用来分析和编码,等空下来再看。