Skip to content

This repo contains a manually curated dataset, where a sample contains a piece of Python code from an offensive software, and its corresponding description in natural language (plain English).

License

Notifications You must be signed in to change notification settings

dessertlab/violent-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Violent Python Dataset

violent-python is a manually curated dataset, where a sample contains a piece of Python code from an offensive software, and its corresponding description in natural language (plain English). We built the dataset using the popular book "Violent Python" by T.J. O'Connor, which presents several examples of offensive programs using the Python language. Our dataset covers multiple areas of offensive security, including penetration testing (e.g., an automated exploit for an SMB vulnerability, a port scanner, an SSH botnet); forensic analysis (e.g., geo-locating individuals, recovering deleted items, inspecting the Windows registry, examining metadata in documents and images, and analyzing data from mobile and desktop applications); network traffic analysis (e.g., capturing packets and geo-locating IP addresses, identifying DDoS toolkits, discovering decoy scans, analyzing botnet traffic, foiling intrusion detection systems); OSINT and social engineering (e.g., anonymously browsing the web, working with developer APIs, scraping popular social media sites, creating a spear-phishing email).

The dataset has been presented in the paper AI Code Generators for Security: Friend or Foe?, accepted for publication in the IEEE Security and Privacy journal.

@article{natella2024ai,
  title={AI Code Generators for Security: Friend or Foe?},
  author={Natella, Roberto and Liguori, Pietro and Improta, Cristina and Cukic, Bojan and Cotroneo, Domenico},
  journal={IEEE Security \& Privacy},
  year={2024},
  publisher={IEEE}
}

We uploaded a model fine-tuned on this dataset on HuggingFace.

The dataset consists of 1,372 samples and it is divided into three subsets: individual lines, multi-line blocks, and functions.

Individual Lines

This subset contains 1,129 pairs of individual lines of Python code and their English descriptions.

Multi-line Blocks

This subset contains 171 pairs of multi-line blocks of Python code and their English descriptions. Single lines in the same block are separated by the newline character (i.e., "\n").

Functions

This subset contains 72 pairs of complete, multi-line Python functions and their English descriptions. Single lines in the same function are separated by the newline character (i.e., "\n").

About

This repo contains a manually curated dataset, where a sample contains a piece of Python code from an offensive software, and its corresponding description in natural language (plain English).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published