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.
This subset contains 1,129 pairs of individual lines of Python code and their English descriptions.
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").
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").