arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2606.04171cs.CRcs.AIcs.LG
收藏

MimeLens: 二进制片段的位置无关内容类型检测

MimeLens: Position-Agnostic Content-Type Detection for Binary Fragments

II∗

Michael J. Bommarito

AI总结:

针对现有文件类型分类系统(如Magika)无法处理无头片段、随机磁盘块等非完整文件输入的问题,提出MimeLens,一种基于BERT的小型编码器家族,通过随机偏移采样训练实现位置无关的二进制内容分类,在libmagic标记数据上top-1准确率比Magika v1.1高10.7个百分点,并能从单个UDP数据包或随机磁盘块中分类。

摘要:

文件类型分类是恶意软件分类、取证雕刻、数据包检查和存储索引等工作流程的基础。像Google的Magika这样的学习系统假设在已知偏移处访问整个文件,因此它们无法处理这些任务实际产生的许多输入,例如单个数据包负载、无头的雕刻片段、随机磁盘块或分块上传。我们引入了MimeLens,这是一个小型BERT风格编码器家族,在从每个文件内均匀随机偏移处采样的窗口的二进制内容上进行预训练,没有特权文件头位置,有标准上下文和短上下文变体。一个字节块来自文件中的任何位置,无需头部且无固定大小;输出是libmagic的125个MIME标签之一。在完整文件的干净头部上,MimeLens在libmagic标记数据上的top-1准确率比Magika v1.1高10.7个百分点,并且在Magika无法分类的地方(例如单个中间流UDP数据包)仍然能分类,在随机中间文件磁盘块上的准确率是libmagic和Magika的两倍以上。代价是延迟:在CPU上,MimeLens每个样本的运行速度大约比Magika慢一到两个数量级,但在消费级GPU或批处理中与之相当。所有训练好的检查点已在Hugging Face上发布(mjbommar/mimelens-001-*)。

英文摘要:

File-type classification underlies many workflows like malware triage, forensic carving, packet inspection, and storage indexing. Learned systems such as Google's Magika assume whole-file access at a known offset, so they break on the inputs many of these tasks actually produce, like a single packet payload, a header-less carved fragment, a random disk block, or a chunked upload. We introduce MimeLens, a family of small BERT-style encoders pretrained on binary content from windows sampled at a uniformly random offset within each file, with no privileged head-of-file position, in standard- and short-context variants. A byte chunk goes in from anywhere in a file, no header needed and no fixed size; out comes one of libmagic's 125 MIME labels. On the clean head of complete files, MimeLens beats Magika v1.1 by +10.7 pp top-1 on libmagic-labeled data, and it keeps classifying where Magika cannot: from a single mid-stream UDP packet, and more than twice as accurately as libmagic and Magika on random mid-file disk blocks. The cost is latency: MimeLens runs roughly one to two orders of magnitude slower per sample on CPU than Magika, though it matches on consumer GPUs or in batch. All trained checkpoints are released on Hugging Face (mjbommar/mimelens-001-*).

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

↑