Skip to content

Adversarial binary file attacks against binary code authorship identificationAdversarial Binaries for Authorship Identification

arXiv· arXiv:1809.08316· Xiaozhu Meng, Barton P. Miller, Somesh JhaComputer Sciences Department, University of Wisconsin - MadisonIndexed by this site · 27 days ago· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose an evasion attack framework against binary code authorship identification, achieving an average success rate of 96% for untargeted attacks and 46% for targeted attacks on the classifier of Caliskan-Islam et al.

Threat modelThe attacker has perfect knowledge of the target authorship identification tool (worst-case evaluation) and performs a test time attack: the prediction result can only be influenced by providing carefully crafted input binaries; training set poisoning is out of scope. The target is divided into untargeted (misclassified as any wrong author) and targeted (misclassified as a specified author), and the binary's structural validity and functionality must be preserved.

Questions
Binary code authorship identification can be used in scenarios such as malware forensics, but existing work has studied it only from the defender's perspective. The authors ask from the attacker's perspective: can a test binary be modified so that the classifier misattributes authorship while its functionality is preserved?
Methods
An end-to-end attack framework is proposed: first perform feature correlation analysis, then use strategies such as CW, PGD and random modification to generate adversarial feature vectors, and finally use injection/deletion primitives (based on Dyninst) to modify the binary to match that vector while preserving functionality.
Experiments and results
On the RF classifier of Caliskan-Islam et al. (GCJ data, average accuracy 91%), the average success rate of untargeted attacks is 96% and of targeted attacks 46%; feature correlation is key to success, and post-processing reduces the average number of modified features from 80 to 10.
Limitations and future work
The authors point out: only modification strategies for instruction features were implemented, and the inability to modify CFG and decompiled source code features is the main cause of failure; only linear feature correlations are captured; the generated binaries retain Dyninst traces; using reassembly to rewrite is left for future work.
Experimental setuprandom forest classifier · Google Code Jam (GCJ) 数据集(约 1000 位作者,GCC 5.4.0 -O0 编译,64 位平台) · success rate、classifier accuracy
Evaluated models
random forest classifier
Benchmarks
Google Code Jam (GCJ) 数据集(约 1000 位作者,GCC 5.4.0 -O0 编译,64 位平台)
Metrics
success rateclassifier accuracy
AI summaryFrom an attacker's perspective, the researchers propose an adversarial attack against binary code authorship identification: by modifying feature vectors and input binary files, they cause the classifier to misjudge the author while preserving program functionality. Against a state-of-the-art authorship identification classifier with an average accuracy of 91%, the non-targeted attack achieves an average success rate of 96%, and the targeted attack achieves an average success rate of 46%. The authors point out that existing binary authorship identification techniques rely on code features that are easy to modify, and are therefore vulnerable to attack.

From an attacker's perspective, the researchers propose an adversarial attack against binary code authorship identification: by modifying feature vectors and input binary files, they cause the classifier to misjudge the author while preserving program functionality. Against a state-of-the-art authorship identification classifier with an average accuracy of 91%, the non-targeted attack achieves an average success rate of 96%, and the targeted attack achieves an average success rate of 46%. The authors point out that existing binary authorship identification techniques rely on code features that are easy to modify, and are therefore vulnerable to attack.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    How to modify a binary program from the attacker's perspective so that an authorship identification classifier misattributes it, while keeping the binary valid and functionally unchanged.

    Core question: can a binary program be automatically modified so that machine-learning-based binary code authorship identification misattributes it, while preserving the binary's structural validity and original functionality.

    • Application scenarios: authorship identification can be used for malware forensics, software supply chain risk management and plagiarism detection; the authors state that recent machine-learning-based identification techniques have advanced notably, but no one has yet evaluated their security from an attacker's perspective.
    • Existing gaps: the authors state that there were previously no attacks against binary code authorship identification; existing test-time attacks focus on areas such as images, audio, Android malware detection and source code authorship identification.
    • Core challenge: unlike images, flipping a single bit in a binary can make the file fail to load, crash at runtime or lose functionality, so an attack must simultaneously guarantee misattribution, structural validity and functionality preservation.
    • Proposed approach: an end-to-end automated attack framework is proposed, comprising two capabilities—feature vector modification (generating an adversarial feature vector that corresponds to a real binary and causes misattribution) and input binary modification (modifying the binary according to that vector while preserving functionality).
    • Threat model:
      • Goal: an untargeted attack makes the prediction become any wrong author; a targeted attack makes the prediction become a specified wrong author.
      • Knowledge: the attacker has perfect knowledge of the target identification tool, which the authors state is a common worst-case evaluation assumption in test-time attacks.
      • Capability: the attacker can influence predictions only by supplying carefully crafted input binaries; other attacks such as training set poisoning are out of scope.
      • Victim system: a random forest authorship classifier trained with the method of Caliskan-Islam et al. (features extracted by NDISASM, radare2, Hex-Ray, Joern).
  2. What related research exists?

    Related work includes test time adversarial attacks, other attacks against machine learning systems, authorship identification techniques, and adversarial learning on malware detection.

    Test time attacks

    • Biggio et al. [2], Szegedy et al. [27], Carlini and Wagner [7]—implement test time evasion attacks against machine learning systems in domains such as images; this paper's CW attack and PGD strategy are borrowed from this line of work, and the authors state that extending them to the binary domain requires handling feature correlation and modification difficulty.
    • Grosse et al. [8]—modify the manifest file of Android programs to bypass malware detection; the authors cite it to illustrate the security impact of test time attacks.
    • Papernot et al. [21], Tramèr et al. [30]—transferability of adversarial examples across different learning algorithms; this paper accordingly uses a substitute DNN to generate adversarial vectors to attack the RF classifier.

    Other attacks against learning systems

    • Biggio et al. [3], Mei and Zhu [16]—training set poisoning attacks; the authors explicitly state that poisoning is out of scope for this paper.
    • Madry et al. [14], Miyato et al. [19]—adversarial training; the authors state that the adversarial examples generated in this paper can be used for adversarial retraining to train more robust classifiers.

    Authorship identification

    • Caliskan-Islam et al. [6]—identify authors from executable binaries, reaching 96% accuracy for 100 authors on GCJ data, GCC -O0, 32-bit platform; this is the attack target of this paper, and the authors state that it reveals the weakness that its features are easy to tamper with.
    • Rosenblum et al. [25], Alrabaee et al. [1], Meng et al. [17, 18]—binary authorship identification (including multi-author scenarios); the authors state that these works advanced identification techniques, whereas this paper evaluates from the attacker's perspective.
    • Simko et al. [26]—a manual study in which 28 programmers manually modified source code to impersonate another's style; the authors point out that their modifications are mostly source-level operations such as formatting, variable renaming, and macros, which are mostly irrelevant at the binary level and difficult to use directly for binary evasion.

    Adversarial learning on malware detection

    • Incer et al. [11]—monotonic classification, assuming the attacker can only inject features and cannot delete them; the authors state that this paper can effectively delete features, questioning the validity of that threat model.
    • The authors state that existing adversarial learning for malware detection mainly generates adversarial feature vectors and does not focus on generating real binaries matching the vectors; this paper demonstrates the feasibility of end-to-end generation of new binaries.

    Positioning: The authors state that to their knowledge this is the first binary code authorship evasion project, and emphasize its differences from source code evasion (Simko et al.) and adversarial learning for malware detection.

  3. How does the paper address this problem?

    The framework consists of three parts: feature correlation analysis, feature vector modification, and binary modification; the main loop modifies and verifies one feature group at a time until misclassification occurs.

    The overall idea is to split the attack into two interacting capabilities: feature vector modification (generating an adversarial feature vector that both corresponds to a real binary and causes misclassification) and input binary modification (modifying the binary to match that vector while keeping functionality unchanged), with an outer attack-verify loop iterating over feature groups until misclassification occurs (Figure 6 algorithm).

    Feature correlation analysis (Section 3.1)

    • Purpose: Binary features are correlated with each other (e.g., instruction containment relationships, different tools each computing a feature for the same attribute), and independent modification would generate vectors with no corresponding real binary.
    • Method: Perform linear regression on feature pairs; if the correlation coefficient exceeds a threshold (the example in the text is 0.9), connect an edge in an undirected graph, and each connected component is a correlated feature partition; only linear correlations are captured.
    • Form of correlation: Derive linear relationships for features within a partition, e.g., freq(f2) = A1 freq(f1) + B1, i.e., correlated feature frequencies satisfy a linear constraint; after normalization, correlated features can be merged into one feature for the attack algorithm to process.
    • Data source: Correlations are derived from a substitute dataset, which only needs to be in the same domain as the target classifier's training set and need not be the training set itself.

    Feature vector modification (Section 3.2)

    • Supported strategies: random modification (rand, rand-cor with correlation), CW attack (using the L0 version), PGD; the basic form is x' = x + δ, and CW/PGD turn the computation of δ into numerical optimization (using Adam).
    • Three domain adaptations: round outputs to integers (features are counts); normalize and merge correlated features to incorporate correlation constraints; two-step post-processing—first undo modifications one by one to see whether misclassification still occurs, then enumerate each modified feature to the integer nearest to its original value that still causes misclassification, to reduce the number and magnitude of modified features.
    • Substitute model: The CW attack targets gradient-based models, whereas the target is an RF; the authors train a substitute DNN (7 hidden layers, 50 units per layer), generate adversarial vectors on it and transfer them to the RF, and keep generating new vectors until the target classifier is also misled.

    Binary modification strategies (Section 3.3)

    • Grouping: Group by the program attribute described by the feature and the extraction tool, modifying one group at a time; instruction features are easier to modify than structural features such as CFG, so instruction features are modified first.
    • Injection primitives (Table 1): InsertNonCodeBytes (insert bytes into a new non-loadable section for NDISASM to extract), InsertFunction (create a new code section, append a return instruction, create a function symbol for radare2 to recognize), InsertSymbol, InsertData, InsertCall (including dynamic linking information).
    • Deletion primitives (Table 2): Overwrite (overwrite bytes in the debug section), Swap/InsertNop (reorder instructions in the code section or insert nops), SplitAddrLoad (split an address load into two instructions so radare2 cannot recognize it), ConvToIndCall (convert a direct call to an indirect call).
    • Strategy selection: Decide injection or deletion according to the sign of δ, and select primitives according to the section the feature is in (debug/code/data) and the attribute type (call, symbol load, data load).
    • Diversity: Primitives such as Overwrite and SplitAddrLoad introduce randomization; the authors also mention that a superoptimizer could be used to generate semantically equivalent instructions, calling this a promising direction.

    Success criterion

    • Attack success is defined as the generated binary causing the target classifier to misclassify: for untargeted, predicting any wrong author; for targeted, predicting the specified author; the success rate is the number of successful attacks divided by the total number of attacks (Equation (3)).
  4. What experiments did the paper conduct?

    On GCJ data with an RF classifier for K=5–100 authors, the average success rate was 96% for untargeted attacks and 46% for targeted attacks, and the strategies, primitives and failure causes were analyzed.

    Experimental Setup

    • Target classifier: a random forest classifier trained following the method of Caliskan-Islam et al. [6]; features were extracted by NDISASM, radare2, the Hex-Rays decompiler, and Joern.
    • Substitute model: a feedforward DNN with 7 hidden layers and 50 units per layer, trained on the same training data, used to generate adversarial vectors with CW/PGD.
    • Dataset: single-author programs from about 1000 authors in Google Code Jam; K authors were randomly sampled (K = 5, 15, 30, 50, 100), compiled with GCC 5.4.0, -O0, on a 64-bit platform, with an average of 8 binaries per author, and a training/test split of about 7:1.
    • Attack procedure: for each correctly classified binary in the test set, 1 untargeted attack and K−1 targeted attacks were performed; each K was repeated 5 times and averaged.
    • Feature vector modification strategies: rand (baseline), rand-cor, CW (L0 version), PGD; CW modifies 10 features on average and generates fewer than 200 vectors, while rand/rand-cor randomly select 2–20 features and repeat at most 5000 times.
    • Metrics: success rate = number of successful attacks / total number of attacks; toolchain was Scikit-learn, Tensorflow, Dyninst.

    Main Results

    According to Table 3 (target/substitute classifier accuracy and the combined success rates of the two attack types, all averaged over 5 repetitions):

    Swipe horizontally to read the table

    KTarget classifier accuracySubstitute classifier accuracyuntargeted success ratetargeted success rate
    5100%100%88%88%
    15100%80%93%51%
    3089%73%98%47%
    5086%69%100%31%
    10082%68%100%14%
    Average91%78%96%46%
    • Authors' interpretation: the untargeted success rate rises as K increases (there are more wrong authors to misclassify as), while targeted decreases as K increases (there are more non-target authors to avoid).
    • Accuracy gap: the accuracy gap between the target and substitute classifiers is 0%–20%, and the authors state that the success rate has no clear correlation with this gap.
    • Authors' conclusion: untargeted attacks can effectively suppress the author identity signal; targeted attacks are feasible but clearly harder.

    Comparison of Feature Vector Modification Strategies (Figure 7, Figure 8)

    • untargeted (Figure 7): in the figure, the CW and PGD curves have the highest success rates, rand-cor is next, and rand is lowest; the authors state that vectors generated by rand often violate feature correlations and do not correspond to real binaries, and that capturing correlations is key to success.
    • targeted (Figure 8): in the figure, CW is higher than rand-cor and rand, and the random strategies have low success rates on targeted; the authors state that adversarial-learning-based strategies are necessary for targeted attacks. PGD applies only to untargeted and was not included in this figure.
    • The caption indicates the x-axis is the number of training authors and the y-axis is the success rate; specific point-by-point values are not labeled on the figure.

    Analysis of Modification Primitives and Number of Features (Table 4, Table 5)

    • Primitive usage counts (Table 4, untargeted attacks at K=30): InsertCall 586 times, SplitAddrLoad 292, InsertFunction 196, Swap & InsertNop 193, ConvToIndCall 115, InsertNonCodeByte 102, Overwrite 85, InsertData 68, InsertSymbol 45. The authors state that this shows the target classifier relies heavily on function call features, and that inserting function calls associated with other authors is an effective way to cause misclassification.
    • Number of modified features (Table 5): L0 CW attacks modify 80 features on average, reduced by post-processing to 10 on average (from 57–107 down to 9–11 across K). The authors state that post-processing can clearly reduce the number of feature modifications required for a successful attack.

    Analysis of Failed Attacks (Section 4.3)

    • Locating failures: the authors state that all failures occur at the feature vector modification stage, and that binary modification can always match the modified features.
    • untargeted failures: all because CFG features and decompiled source code features could not be modified (only modification strategies for instruction features were implemented).
    • targeted failures: about 34% because CFG/decompiled source code features could not be modified, and the rest because the targeted CW attack could not find a vector that both corresponds to a real binary and causes the specified misclassification.
    • Side effects: binary modification sometimes unexpectedly changed 0–20 features that should not have been changed (mostly NDISASM instruction features, because inserting new sections changed the program headers); the authors state that these unexpected changes did not affect the prediction results.

    Other Ablations and Analyses

    • The feature correlation threshold example is 0.9, and the authors state that linear correlation is sufficient to launch a successful attack (Section 2.2.1).
    • In the example attack: modifying only NDISASM instruction features lowered accuracy from 90% to 45%, and further modifying radare2 instruction features lowered it to 7% (Section 2.2.3, a single example setting).
    • The substitute DNN had 80% accuracy in the example, lower than the target classifier, and the authors state that this gap does not affect the attack success rate (Section 2.2.2).
  5. What are some points that can be further explored?

    The authors point out limitations such as the modification strategies covering only instruction features, capturing only linear correlations, and leaving Dyninst traces, and propose several directions for improvement.

    Limitations and future directions pointed out by the authors

    • Incomplete coverage of modification strategies: Only binary modification strategies for instruction features were implemented; CFG features and decompiled source code features cannot be modified; the authors state that this is the cause of all untargeted failures and some targeted failures, and that improving untargeted attacks requires designing new modification strategies for these two types of features (Section 4.3).
    • Only linear correlations captured: The feature correlation analysis captures only linear relationships and misses nonlinear correlations; the authors state that the technique for generating vectors corresponding to real binaries still needs improvement (Section 2.2.1, 4.3).
    • Targeted attack capability: The authors state that improving targeted attacks requires improving the targeted CW attack so that it finds vectors corresponding to real binaries (Section 4.3).
    • Stealthiness: Binaries rewritten by Dyninst carry features such as extra code sections and trampoline instructions; the authors point out that these features also appear in benign applications of Dyninst, and their presence alone does not indicate tampering (Section 5).
    • Future work: The authors chose Dyninst because it is mature and commonly used, and leave binary rewriting via reassembly (e.g., Ramblr) as future work, stating that reassembly can add and delete code in place and offers better stealthiness (Section 5).
    • Lesson on feature trustworthiness: The authors state that features derived from easily tampered program attributes (function calls, symbols, data, instructions) are insecure, and identification techniques must consider the trustworthiness of features (Section 6).

    Scope of experiments

    • The evaluated classifier is a random forest trained following the method of Caliskan-Islam et al. [6], with data sampled from about 1000 GCJ authors for K ∈ {5, 15, 30, 50, 100}, GCC 5.4.0 -O0, 64-bit platform (Section 4.1).
    • Each K is repeated 5 times and averaged; each test binary undergoes 1 untargeted and K−1 targeted attacks (Section 4.1).
    • The evaluation of feature vector modification strategies covers rand, rand-cor, CW (L0), and PGD, where PGD is used only for untargeted (Section 4.1, 4.2).
    • The primitive usage statistics report only untargeted attacks at K=30 (Table 4).
    • The paper does not report the time or number of queries per attack, nor the attack effectiveness under higher compilation optimization levels or other compilers (experiments use only -O0).
  6. Summarize the main content of the paper

    Proposes an end-to-end evasion framework for binary authorship identification, with an average success rate of 96% for untargeted and 46% for targeted attacks, and provides failure analysis and directions for improvement.

    This is an attack paper: the authors evaluate machine learning-based binary code authorship identification from the attacker's perspective and propose an automated authorship evasion framework.

    • Problem: Modify a test binary so that the author classifier misclassifies it, while preserving structural validity and functionality; the threat model is perfect knowledge + test time attack, and the attacker can only provide crafted input binaries.
    • Method: The framework includes feature correlation analysis (linear correlation, threshold-based merging), feature vector modification (rand/rand-cor/CW/PGD, plus integerization, correlation merging, and two-step post-processing, transferring to RF via a substitute DNN), and binary modification (Dyninst-based injection/deletion primitives, iterating over feature groups until misclassification).
    • Main results: On the RF classifier of Caliskan-Islam et al. (GCJ data, average accuracy 91%), the average success rate of untargeted attacks is 96% (100% at K=50 and 100), and of targeted attacks 46% on average (dropping to 14% at K=100) (Table 3).
    • Strategy comparison: The authors state that feature correlation is key—rand-cor is clearly better than rand, and CW/PGD are best; targeted attacks must rely on adversarial learning strategies (Figure 7, 8).
    • Mechanism observations: The most frequently used modification primitive is InsertCall (586 times, K=30), and the authors state that the classifier relies heavily on function call features; post-processing reduces the average number of modified features from 80 to 10 (Table 5).
    • Authors' conclusion: Features derived from easily tampered program attributes (function calls, symbols, instructions) are insecure; all failures stem from being unable to modify CFG/decompiled source code features or from failing to find a vector corresponding to a real binary, and the authors propose directions such as completing modification strategies, improving targeted CW, and exploring reassembly-based rewriting.
Read originalarxiv.org