arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.00324cs.CRcs.SE
收藏

DySec:一种基于机器学习的动态分析方法,用于检测 PyPI 生态系统中的恶意软件包

DySec: A Machine Learning-based Dynamic Analysis for Detecting Malicious Packages in PyPI Ecosystem

Sk Tanzir Mehedi, Chadni Islam, Gowri Ramachandran, Raja Jurdak

AI总结:

针对 PyPI 供应链缺乏实时行为监控的问题,提出基于机器学习的动态分析框架 DySec,利用 eBPF 探针捕获安装时行为特征,高效检测恶意软件包并显著降低假阴性率。

摘要:

恶意 Python 软件包利用开源代码库(如 Python Package Index (PyPI))中的信任机制,使软件供应链变得脆弱。由于缺乏实时行为监控,元数据检查和静态代码分析在应对拼写劫持、隐蔽远程访问激活和动态载荷生成等高级攻击策略时显得力不从心。为了解决这些挑战,我们引入了 DySec,这是一个基于机器学习 (ML) 的 PyPI 动态分析框架,它使用 eBPF 内核和用户级探针来监控软件包安装期间的行为。通过捕获 36 个实时特征(包括系统调用、网络流量、资源使用情况、目录访问和安装模式),DySec 能够检测拼写劫持、隐蔽远程访问激活、动态载荷生成以及多阶段攻击恶意软件等威胁。我们在一个受控的隔离环境中执行了 14,271 个 Python 软件包,开发了一个包含 7,127 个恶意样本轨迹的综合数据集。实验结果表明,DySec 实现了 95.99% 的检测准确率,延迟低于 0.5 秒,与静态分析相比减少了 78.65% 的假阴性,与元数据分析相比减少了 82.24% 的假阴性。在评估期间,DySec 标记了 11 个被 PyPI 归类为良性的软件包。包括安装行为检查在内的人工分析确认其中六个为恶意软件包。这些发现已报告给 PyPI 维护者,导致四个软件包被移除。DySec 通过独特地检测恶意的安装时行为,弥合了被动的传统方法与开源生态系统中主动、可扩展的威胁缓解之间的差距。

英文摘要:

Malicious Python packages make software supply chains vulnerable by exploiting trust in open-source repositories like Python Package Index (PyPI). Lack of real-time behavioral monitoring makes metadata inspection and static code analysis inadequate against advanced attack strategies such as typosquatting, covert remote access activation, and dynamic payload generation. To address these challenges, we introduce DySec, a machine learning (ML)-based dynamic analysis framework for PyPI that uses eBPF kernel and user-level probes to monitor behaviors during package installation. By capturing 36 real-time features-including system calls, network traffic, resource usage, directory access, and installation patterns-DySec detects threats like typosquatting, covert remote access activation, dynamic payload generation, and multiphase attack malware. We developed a comprehensive dataset of 14,271 Python packages, including 7,127 malicious sample traces, by executing them in a controlled isolated environment. Experimental results demonstrate that DySec achieves a 95.99\% detection accuracy with a latency of <0.5s, reducing false negatives by 78.65\% compared to static analysis and 82.24\% compared to metadata analysis. During the evaluation, DySec flagged 11 packages that PyPI classified as benign. A manual analysis, including installation behavior inspection, confirmed six of them as malicious. These findings were reported to PyPI maintainers, resulting in the removal of four packages. DySec bridges the gap between reactive traditional methods and proactive, scalable threat mitigation in open-source ecosystems by uniquely detecting malicious install-time behaviors.

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

↑