DualSC:基于Transformer和双重学习的Shellcode自动生成和摘要
DualSC: Automatic Generation and Summarization of Shellcode via Transformer and Dual Learning
摘要:
shellcode是一小段代码,执行它是为了利用软件漏洞,这使得目标计算机能够通过代码注入攻击执行攻击者的任意命令。与自动漏洞生成技术的目的类似,自动生成shellcode可以生成攻击指令,这些指令可以用于检测漏洞并实施防御措施。而shellcode的自动摘要可以帮助不熟悉shellcode和网络信息安全的用户理解shellcode攻击的意图。在这项研究中,我们提出了一种新的方法DualSC来解决自动shellcode生成和摘要任务。具体来说,我们将自动shellcode生成和摘要形式化为双重任务,使用浅层Transformer进行模型构建,并设计了一种规范化方法Adjust QKNorm来适应这些低资源任务(即,训练数据不足)。最后,为了缓解词汇表不足的问题,我们提出了一个基于规则的修复组件,以提高自动shellcode生成的性能。在我们的实证研究中,我们选择了一个高质量的语料库Shellcode IA32作为我们的实证对象。该语料库是根据逐行粒度从两个真实项目中收集的。我们首先比较DualSC与代码生成和代码摘要领域的六个最先进的基线在四个性能指标。对比结果显示了DualSC的竞争力。然后,我们验证了DualSC中组件设置的有效性。最后,我们进行了一项人体研究,以进一步验证DualSC的有效性。
英文摘要:
A shellcode is a small piece of code and it is executed to exploit a software vulnerability, which allows the target computer to execute arbitrary commands from the attacker through a code injection attack. Similar to the purpose of automated vulnerability generation techniques, the automated generation of shellcode can generate attack instructions, which can be used to detect vulnerabilities and implement defensive measures. While the automated summarization of shellcode can help users unfamiliar with shellcode and network information security understand the intent of shellcode attacks. In this study, we propose a novel approach DualSC to solve the automatic shellcode generation and summarization tasks. Specifically, we formalize automatic shellcode generation and summarization as dual tasks, use a shallow Transformer for model construction, and design a normalization method Adjust QKNorm to adapt these low-resource tasks (i.e., insufficient training data). Finally, to alleviate the out-of-vocabulary problem, we propose a rulebased repair component to improve the performance of automatic shellcode generation. In our empirical study, we select a highquality corpus Shellcode IA32 as our empirical subject. This corpus was gathered from two real-world projects based on the line-by-line granularity. We first compare DualSC with six state-of-the-art baselines from the code generation and code summarization domains in terms of four performance measures. The comparison results show the competitiveness of DualSC. Then, we verify the effectiveness of the component setting in DualSC. Finally, we conduct a human study to further verify the effectiveness of DualSC.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。