Content-Based Textual File Type Detection at Scale

01/21/2021
by   Francesca Del Bonifro, et al.
7

Programming language detection is a common need in the analysis of large source code bases. It is supported by a number of existing tools that rely on several features, and most notably file extensions, to determine file types. We consider the problem of accurately detecting the type of files commonly found in software code bases, based solely on textual file content. Doing so is helpful to classify source code that lack file extensions (e.g., code snippets posted on the Web or executable scripts), to avoid misclassifying source code that has been recorded with wrong or uncommon file extensions, and also shed some light on the intrinsic recognizability of source code files. We propose a simple model that (a) use a language-agnostic word tokenizer for textual files, (b) group tokens in 1-/2-grams, (c) build feature vectors based on N-gram frequencies, and (d) use a simple fully connected neural network as classifier. As training set we use textual files extracted from GitHub repositories with at least 1000 stars, using existing file extensions as ground truth. Despite its simplicity the proposed model reaches 85 high number of recognized classes (more than 130 file types).

READ FULL TEXT
research
02/17/2010

A new approach to content-based file type detection

File type identification and file type clustering may be difficult tasks...
research
07/15/2019

DeepRace: Finding Data Race Bugs via Deep Learning

With the proliferation of multi-core hardware, parallel programs have be...
research
09/17/2019

Breaking Imphash

There are numerous schemes to generically signature artifacts. We specif...
research
03/19/2018

Automated Localization for Unreproducible Builds

Reproducibility is the ability of recreating identical binaries under pr...
research
12/24/2018

Neural Fuzzing: A Neural Approach to Generate Test Data for File Format Fuzzing

This article is aimed at the design and implementation of a file format ...
research
01/20/2022

NapierOne: A modern mixed file data set alternative to Govdocs1

It was found when reviewing the ransomware detection research literature...
research
11/02/2022

Stack graphs: Name resolution at scale

We present stack graphs, an extension of Visser et al.'s scope graphs fr...

Please sign up or login with your details

Forgot password? Click here to reset