Table of Contents
Fetching ...

CmdCaliper: A Semantic-Aware Command-Line Embedding Model and Dataset for Security Research

Sian-Yao Huang, Cheng-Lin Yang, Che-Yu Lin, Chun-Ying Huang

TL;DR

This research proposes the first dataset of similar command lines, named CyPHER, and proposes a command-line embedding model named CmdCaliper, enabling the computation of semantic similarity with command lines, paving the way for more effective command-line embedding for future researchers.

Abstract

This research addresses command-line embedding in cybersecurity, a field obstructed by the lack of comprehensive datasets due to privacy and regulation concerns. We propose the first dataset of similar command lines, named CyPHER, for training and unbiased evaluation. The training set is generated using a set of large language models (LLMs) comprising 28,520 similar command-line pairs. Our testing dataset consists of 2,807 similar command-line pairs sourced from authentic command-line data. In addition, we propose a command-line embedding model named CmdCaliper, enabling the computation of semantic similarity with command lines. Performance evaluations demonstrate that the smallest version of CmdCaliper (30 million parameters) suppresses state-of-the-art (SOTA) sentence embedding models with ten times more parameters across various tasks (e.g., malicious command-line detection and similar command-line retrieval). Our study explores the feasibility of data generation using LLMs in the cybersecurity domain. Furthermore, we release our proposed command-line dataset, embedding models' weights and all program codes to the public. This advancement paves the way for more effective command-line embedding for future researchers.

CmdCaliper: A Semantic-Aware Command-Line Embedding Model and Dataset for Security Research

TL;DR

This research proposes the first dataset of similar command lines, named CyPHER, and proposes a command-line embedding model named CmdCaliper, enabling the computation of semantic similarity with command lines, paving the way for more effective command-line embedding for future researchers.

Abstract

This research addresses command-line embedding in cybersecurity, a field obstructed by the lack of comprehensive datasets due to privacy and regulation concerns. We propose the first dataset of similar command lines, named CyPHER, for training and unbiased evaluation. The training set is generated using a set of large language models (LLMs) comprising 28,520 similar command-line pairs. Our testing dataset consists of 2,807 similar command-line pairs sourced from authentic command-line data. In addition, we propose a command-line embedding model named CmdCaliper, enabling the computation of semantic similarity with command lines. Performance evaluations demonstrate that the smallest version of CmdCaliper (30 million parameters) suppresses state-of-the-art (SOTA) sentence embedding models with ten times more parameters across various tasks (e.g., malicious command-line detection and similar command-line retrieval). Our study explores the feasibility of data generation using LLMs in the cybersecurity domain. Furthermore, we release our proposed command-line dataset, embedding models' weights and all program codes to the public. This advancement paves the way for more effective command-line embedding for future researchers.

Paper Structure

This paper contains 35 sections, 2 equations, 7 figures, 9 tables.

Figures (7)

  • Figure 1: After fine-tuning our proposed similar command-line pair dataset, CyPHER, our proposed command-line embedding model, CmdCaliper, can effectively embed command lines based on their semantics rather than solely on appearance.
  • Figure 2: The illustration of the pipeline for automatically generating a dataset of similar command-line pairs using the Self-Instruct algorithm with a pool of LLMs.
  • Figure 3: The distribution of the highest ROUGE-L overlap score between the generated command lines and the initial command-line seeds.
  • Figure 4: The distribution of ROUGE-L overlap score for all similar command-line pairs.
  • Figure 5: The histogram of the explanation similarity between random command-line pairs and similar command-line pairs in the testing set of CyPHER.
  • ...and 2 more figures