Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets
License:
intent
stringlengths
4
313
snippet
stringlengths
2
271
divide eax by ebx
div ebx
move address of request variable into ecx
mov ecx, request
decrement the eax register by one
dec eax
declare the exit_on_error label
exit_on_error:
push esi onto the stack
push esi
move the 4 bytes of data at address esi+4*ebx into edx
mov edx, [esi+4*ebx]
declare msg string containing 'hello world!'
msg db 'hello, world!', 0xa
push 0xa to the stack
push 0xa
restore eax from the value we pushed onto the stack at the start
pop eax
push the double word 0x313a303a onto the stack
push dword 0x313a303a
move the remainder into eax
mov eax, edx
create a new process
mov eax, 2
move readbuffer into ecx
mov ecx, readbuffer
syscall 63
mov al, 0x3f
move cl into the address [esp + 1]
mov [esp + 1], cl
push the dword 0x6b2f7379 onto the stack
push dword 0x6b2f7379
push the dword 0x7665642f onto the stack
push dword 0x7665642f
define shellcode label
shellcode:
decrement the ecx register and jump to the L1 label if the contents of the ecx register is not zero and the zero flag is zero else jump to the shellcode label
loopnz L1 \n jmp shellcode
define download function
download:
define the numeric label 2
2:
move exit_call into al
mov al, exit_call
declare a byte with no label containing the value 10
db 10
if zero jump to the child label
jz child
push the contents of the edx register onto the stack and point ebx to the stack register
push edx \n mov ebx, esp
set the contents of edx to zero
xor edx, edx
move decimal 43 into edx
mov edx, 43
push zero_reg onto the stack
push zero_reg
restore the original value of eax
pop eax
push byte 6 onto the stack
push byte 6
allocate memory for 30 bytes uninitialized name variable
name db 30 dup
define egg equal to 'egg '
egg equ 'egg '
decrement ebp
dec ebp
put the syscall 0x04 into the eax register
push byte 0x04 \n pop eax
declare the priv_setgid label
priv_setgid:
pop the value on the stack back into ecx
pop ecx
jump to the shell label
jmp shell
push the word 0x0a to the stack
push word 0x0a
declare the here label
here:
move 5 into eax
mov eax, 0x5
getppid
mov eax, 64
move decimal number 255 into edx
mov edx, 255
if the contents of the bl register is equal to the contents of the al register then jump to the loop_2 label else jump short to the not_found label
cmp bl, al \n je loop_2 \n jmp short not_found
call the two function
call two
move al into ebx+7
mov [ebx+7], al
zero out zero_reg
xor zero_reg, zero_reg
move 0x3f into al
mov al, 0x3f
define constant total_students equal to 50
total_students equ 50
move the contents of the esi register into the dword at the memory location [esp-4]
mov dword [esp-4], esi
clear ebx register
xor ebx, ebx
push double word 0x39396e2d onto the stack and point the edi register to the stack register
push dword 0x39396e2d \n mov edi, esp
declare code section .bss
section .bss
move 0x1e into cl
mov cl, 0x1e
add one to the doubleword integer stored at memory location value
inc dword [value]
push 0x0a206873 onto the stack
push 0x0a206873
push the value 0x69622f2f onto the stack and point the ecx register to the stack register
push 0x69622f2f \n mov ecx, esp
zero out ax register
xor ax, ax
push the byte 0xb onto the stack
push byte 0xb
push the byte 0x0 onto the stack
push byte 0x0
add 4 to the contents of the esi register
add esi, 4
move 0xf into al
mov al, 0xf
put the byte my_value into the eax register
push byte my_value \n pop eax
move value at top of the stack to ebx
mov ebx, [esp]
move bx to count
mov count, bx
declare the incaddr label
incaddr:
define the _exit label
_exit:
zero out the eax register and jump to the l3 label if the contents of the edx register is not equal to the contents of the eax register
xor eax, eax \n cmp edx, eax \n jne l3
push the esp onto the stack
push esp
push 0x16 onto the stack
push 0x16
move 0x21 into al
mov al, 0x21
push the 0x3170762d onto the stack
push 0x3170762d
call the sprint function
call sprint
push the value 0x2f2f2f2f onto the stack and point eax to the stack register
push 0x2f2f2f2f \n mov eax, esp
jump to the IncAddr label if the value in the eax register is not equal to the doubleword addressed by edi else jump to the edi register
scasd \n jnz IncAddr \n jmp edi
left shift eax by two bits
shl eax,2
compare the byte in esi with 0x7
cmp byte [esi], 0x7
move the byte at the address 3h into al
mov al, byte 3h
add 2 to the contents of the ebx register
add ebx, 2
push the contents of the esi register onto the stack.
push esi
move 0x06 into al
mov al, 0x06
define the _setsockopt label
_setsockopt:
move 0x30 into al
mov al, 0x30
make the socketcall
mov al, 0x66
push the 0x6e onto the stack
push 0x6e
push the word 0x02 onto the stack
push word 0x02
load the effective address of ebx+8 into ecx
lea ecx, [ebx+8]
jump to the wrap_around label if the byte starting at the address contained in the esi register is lower than the byte value 0xD else subtract the byte value 0xD from byte starting at the address contained in the esi register
cmp byte [esi], 0xD \n jl wrap_around \n sub byte [esi], 0xD
declare the done label
done:
push 0x5 onto the stack
push 0x5
declare retry label
retry:
declare buffersize to be a word containing 1024
buffersize: dw 1024
push the word 0x3930 onto the stack
push word 0x3930
push 0x682f2f2f onto the stack
push 0x682f2f2f
exchange ebx with ecx
xchg ebx, ecx
call the strlen function
call strlen
move the doubleword 0x65676760 into edx
mov edx, dword 0x65676760
clear ebx
xor ebx, ebx
section data
section .data
push the contents of the edi register onto the stack
push edi
put the syscall 0x66 into the eax register
push byte 0x66 \n pop eax

Shellcode_IA32

Shellcode_IA32 is a dataset containing 20 years of shellcodes from a variety of sources is the largest collection of shellcodes in assembly available to date.

This dataset consists of 3,200 examples of instructions in assembly language for IA-32 (the 32-bit version of the x86 Intel Architecture) from publicly available security exploits. We collected assembly programs used to generate shellcode from exploit-db and from shell-storm. We enriched the dataset by adding examples of assembly programs for the IA-32 architecture from popular tutorials and books. This allowed us to understand how different authors and assembly experts comment and, thus, how to deal with the ambiguity of natural language in this specific context. Our dataset consists of 10% of instructions collected from books and guidelines, and the rest from real shellcodes.

Our focus is on Linux, the most common OS for security-critical network services. Accordingly, we added assembly instructions written with Netwide Assembler (NASM) for Linux.

Each line of Shellcode_IA32 dataset represents a snippet - intent pair. The snippet is a line or a combination of multiple lines of assembly code, built by following the NASM syntax. The intent is a comment in the English language.

Further statistics on the dataset and a set of preliminary experiments performed with a neural machine translation (NMT) model are described in the following paper: Shellcode_IA32: A Dataset for Automatic Shellcode Generation.

Note: This work was done in collaboration with the DESSERT Lab.

The dataset is also hosted on the DESSERT Lab Github.

Please consider citing our work:

@inproceedings{liguori-etal-2021-shellcode,
    title = "{S}hellcode{\_}{IA}32: A Dataset for Automatic Shellcode Generation",
    author = "Liguori, Pietro  and
      Al-Hossami, Erfan  and
      Cotroneo, Domenico  and
      Natella, Roberto  and
      Cukic, Bojan  and
      Shaikh, Samira",
    booktitle = "Proceedings of the 1st Workshop on Natural Language Processing for Programming (NLP4Prog 2021)",
    month = aug,
    year = "2021",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2021.nlp4prog-1.7",
    doi = "10.18653/v1/2021.nlp4prog-1.7",
    pages = "58--64",
    abstract = "We take the first step to address the task of automatically generating shellcodes, i.e., small pieces of code used as a payload in the exploitation of a software vulnerability, starting from natural language comments. We assemble and release a novel dataset (Shellcode{\_}IA32), consisting of challenging but common assembly instructions with their natural language descriptions. We experiment with standard methods in neural machine translation (NMT) to establish baseline performance levels on this task.",
}
Downloads last month
125

Models trained or fine-tuned on SoLID/shellcode_i_a32