FoC: Figure out the Cryptographic Functions in Stripped Binaries with LLMs

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Shang, Xiuwei, Chen, Guoqiang, Cheng, Shaoyin, Guo, Shikai, Zhang, Yanming, Zhang, Weiming, Yu, Nenghai
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909592669126656
author Shang, Xiuwei
Chen, Guoqiang
Cheng, Shaoyin
Guo, Shikai
Zhang, Yanming
Zhang, Weiming
Yu, Nenghai
author_facet Shang, Xiuwei
Chen, Guoqiang
Cheng, Shaoyin
Guo, Shikai
Zhang, Yanming
Zhang, Weiming
Yu, Nenghai
contents Analyzing the behavior of cryptographic functions in stripped binaries is a challenging but essential task. Cryptographic algorithms exhibit greater logical complexity compared to typical code, yet their analysis is unavoidable in areas such as virus analysis and legacy code inspection. Existing methods often rely on data or structural pattern matching, leading to suboptimal generalizability and suffering from manual work. In this paper, we propose a novel framework called FoC to Figure out the Cryptographic functions in stripped binaries. In FoC, we first build a binary large language model (FoC-BinLLM) to summarize the semantics of cryptographic functions in natural language. The prediction of FoC-BinLLM is insensitive to minor changes, such as vulnerability patches. To mitigate it, we further build a binary code similarity model (FoC-Sim) upon the FoC-BinLLM to create change-sensitive representations and use it to retrieve similar implementations of unknown cryptographic functions in a database. In addition, we construct a cryptographic binary dataset for evaluation and to facilitate further research in this domain. And an automated method is devised to create semantic labels for extensive binary functions. Evaluation results demonstrate that FoC-BinLLM outperforms ChatGPT by 14.61% on the ROUGE-L score. FoC-Sim outperforms the previous best methods with a 52% higher Recall@1. Furthermore, our method also shows practical ability in virus analysis and 1-day vulnerability detection.
format Preprint
id arxiv_https___arxiv_org_abs_2403_18403
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle FoC: Figure out the Cryptographic Functions in Stripped Binaries with LLMs
Shang, Xiuwei
Chen, Guoqiang
Cheng, Shaoyin
Guo, Shikai
Zhang, Yanming
Zhang, Weiming
Yu, Nenghai
Cryptography and Security
Analyzing the behavior of cryptographic functions in stripped binaries is a challenging but essential task. Cryptographic algorithms exhibit greater logical complexity compared to typical code, yet their analysis is unavoidable in areas such as virus analysis and legacy code inspection. Existing methods often rely on data or structural pattern matching, leading to suboptimal generalizability and suffering from manual work. In this paper, we propose a novel framework called FoC to Figure out the Cryptographic functions in stripped binaries. In FoC, we first build a binary large language model (FoC-BinLLM) to summarize the semantics of cryptographic functions in natural language. The prediction of FoC-BinLLM is insensitive to minor changes, such as vulnerability patches. To mitigate it, we further build a binary code similarity model (FoC-Sim) upon the FoC-BinLLM to create change-sensitive representations and use it to retrieve similar implementations of unknown cryptographic functions in a database. In addition, we construct a cryptographic binary dataset for evaluation and to facilitate further research in this domain. And an automated method is devised to create semantic labels for extensive binary functions. Evaluation results demonstrate that FoC-BinLLM outperforms ChatGPT by 14.61% on the ROUGE-L score. FoC-Sim outperforms the previous best methods with a 52% higher Recall@1. Furthermore, our method also shows practical ability in virus analysis and 1-day vulnerability detection.
title FoC: Figure out the Cryptographic Functions in Stripped Binaries with LLMs
topic Cryptography and Security
url https://arxiv.org/abs/2403.18403