arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.13256cs.CR
收藏

通过自主函数调用解析绕过数组金丝雀

Bypassing Array Canaries via Autonomous Function Call Resolution

Nathaniel Oh, Paul Attie, Anas Obeidat

AI总结:

本文提出自主函数调用解析(AFCR)方法及概念验证工具Arphsy,通过提取函数、解析语法树、识别变量、计算偏移和附加驱动代码,有效绕过JavaScript数组金丝雀反分析技术。

摘要:

我们观察到数组金丝雀(Array Canary),这是一种新颖的JavaScript反分析技术,目前正被网络钓鱼即服务框架Darcula在野外利用。数组金丝雀似乎是Emotet JavaScript下载器所采用的数组洗牌技术的高级形式。在实践中,字符串数组内设置了一系列数组金丝雀,如果被修改,将导致程序无限循环。在本文中,我们演示了数组金丝雀的工作原理,并讨论了自主函数调用解析(AFCR),这是我们创建的一种绕过数组金丝雀的方法。我们还介绍了Arphsy,一个AFCR的概念验证,旨在引导大型语言模型和安全研究人员对“金丝雀化”的JavaScript代码进行反混淆。我们通过以下步骤实现这一目标:(i)从金丝雀化文件中查找并提取所有立即调用函数表达式,(ii)解析文件的抽象语法树,寻找任何不实现导入函数调用的函数,(iii)识别最常被重新赋值的变量及其对应的函数体,(iv)计算最大字符串数组的长度,并利用它确定金丝雀化文件中的偏移值,(v)将所有先前识别的函数聚合到单个文件中,以及(vi)将驱动代码附加到已验证的文件中,并使用它来对金丝雀化文件进行反混淆。

英文摘要:

We observed the Array Canary, a novel JavaScript anti-analysis technique currently exploited in-the-wild by the Phishing-as-a-Service framework Darcula. The Array Canary appears to be an advanced form of the array shuffling techniques employed by the Emotet JavaScript downloader. In practice, a series of Array Canaries are set within a string array and if modified will cause the program to endlessly loop. In this paper, we demonstrate how an Array Canary works and discuss Autonomous Function Call Resolution (AFCR), which is a method we created to bypass Array Canaries. We also introduce Arphsy, a proof-of-concept for AFCR designed to guide Large Language Models and security researchers in the deobfuscation of "canaried" JavaScript code. We accomplish this by (i) Finding and extracting all Immediately Invoked Function Expressions from a canaried file, (ii) parsing the file's Abstract Syntax Tree for any function that does not implement imported function calls, (iii) identifying the most reassigned variable and its corresponding function body, (iv) calculating the length of the largest string array and uses it to determine the offset values within the canaried file, (v) aggregating all the previously identified functions into a single file, and (vi) appending driver code into the verified file and using it to deobfuscate the canaried file.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑