Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets
License:
parquet-converter commited on
Commit
8b2ce9f
·
1 Parent(s): f89cf4c

Update parquet files

Browse files
.gitattributes DELETED
@@ -1,16 +0,0 @@
1
- *.bin.* filter=lfs diff=lfs merge=lfs -text
2
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.h5 filter=lfs diff=lfs merge=lfs -text
5
- *.tflite filter=lfs diff=lfs merge=lfs -text
6
- *.tar.gz filter=lfs diff=lfs merge=lfs -text
7
- *.ot filter=lfs diff=lfs merge=lfs -text
8
- *.onnx filter=lfs diff=lfs merge=lfs -text
9
- *.arrow filter=lfs diff=lfs merge=lfs -text
10
- *.ftz filter=lfs diff=lfs merge=lfs -text
11
- *.joblib filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.pb filter=lfs diff=lfs merge=lfs -text
15
- *.pt filter=lfs diff=lfs merge=lfs -text
16
- *.pth filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md DELETED
@@ -1,64 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - expert-generated
4
- language_creators:
5
- - expert-generated
6
- - found
7
- language:
8
- - code
9
- - en
10
- license:
11
- - gpl-3.0
12
- multilinguality:
13
- - translation
14
- size_categories:
15
- - unknown
16
- source_datasets:
17
- - original
18
- task_categories:
19
- - text-generation
20
- task_ids:
21
- - language-modeling
22
- paperswithcode_id: shellcode-ia32
23
- ---
24
-
25
- # Shellcode_IA32
26
-
27
- ___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.
28
-
29
- 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](https://www.exploit-db.com/shellcodes?platform=linux_x86) and from [shell-storm](http://shell-storm.org/shellcode/).
30
- 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.
31
-
32
- 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.
33
-
34
- 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.
35
-
36
- 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](https://arxiv.org/abs/2104.13100).
37
-
38
-
39
- **Note**: This work was done in collaboration with the [DESSERT Lab](http://www.dessert.unina.it/).
40
-
41
- The dataset is also hosted on the [DESSERT Lab Github](https://github.com/dessertlab/Shellcode_IA32).
42
-
43
-
44
- Please consider citing our work:
45
- ```
46
- @inproceedings{liguori-etal-2021-shellcode,
47
- title = "{S}hellcode{\_}{IA}32: A Dataset for Automatic Shellcode Generation",
48
- author = "Liguori, Pietro and
49
- Al-Hossami, Erfan and
50
- Cotroneo, Domenico and
51
- Natella, Roberto and
52
- Cukic, Bojan and
53
- Shaikh, Samira",
54
- booktitle = "Proceedings of the 1st Workshop on Natural Language Processing for Programming (NLP4Prog 2021)",
55
- month = aug,
56
- year = "2021",
57
- address = "Online",
58
- publisher = "Association for Computational Linguistics",
59
- url = "https://aclanthology.org/2021.nlp4prog-1.7",
60
- doi = "10.18653/v1/2021.nlp4prog-1.7",
61
- pages = "58--64",
62
- 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.",
63
- }
64
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Shellcode_IA32.tsv DELETED
The diff for this file is too large to render. See raw diff
 
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"default": {"description": "Shellcode_IA32 is a dataset for shellcode generation from English intents. The shellcodes are compilable on Intel Architecture 32-bits.\n", "citation": " @inproceedings{liguori-etal-2021-shellcode,\n title = \"{S}hellcode{\\_}{IA}32: A Dataset for Automatic Shellcode Generation\",\n author = \"Liguori, Pietro and\n Al-Hossami, Erfan and\n Cotroneo, Domenico and\n Natella, Roberto and\n Cukic, Bojan and\n Shaikh, Samira\",\n booktitle = \"Proceedings of the 1st Workshop on Natural Language Processing for Programming (NLP4Prog 2021)\",\n month = aug,\n year = \"2021\",\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://aclanthology.org/2021.nlp4prog-1.7\",\n doi = \"10.18653/v1/2021.nlp4prog-1.7\",\n pages = \"58--64\",\n 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.\",\n}\n", "homepage": "https://github.com/dessertlab/Shellcode_IA32", "license": "GNU GENERAL PUBLIC LICENSE", "features": {"intent": {"dtype": "string", "id": null, "_type": "Value"}, "snippet": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "shellcode_i_a32", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 185932, "num_examples": 2560, "dataset_name": "shellcode_i_a32"}, "test": {"name": "test", "num_bytes": 22540, "num_examples": 320, "dataset_name": "shellcode_i_a32"}, "validation": {"name": "validation", "num_bytes": 22806, "num_examples": 320, "dataset_name": "shellcode_i_a32"}}, "download_checksums": {"https://raw.githubusercontent.com/dessertlab/Shellcode_IA32/main/Shellcode_IA32.tsv": {"num_bytes": 212071, "checksum": "f2da8827140fafc9bdefa00cfad7ea79a1d783165bf47439bf36f93a9ae38df5"}}, "download_size": 212071, "post_processing_size": null, "dataset_size": 231278, "size_in_bytes": 443349}}
 
 
default/shellcode_i_a32-test.parquet ADDED
Binary file (12 kB). View file
 
default/shellcode_i_a32-train.parquet ADDED
Binary file (85.9 kB). View file
 
default/shellcode_i_a32-validation.parquet ADDED
Binary file (12.6 kB). View file
 
dummy/1.1.0/dummy_data.zip DELETED
Binary file (336 Bytes)
 
shellcode_i_a32.py DELETED
@@ -1,219 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """TODO: Add a description here."""
16
-
17
-
18
- import csv
19
- import json
20
- import os
21
- import pandas as pd
22
- import datasets
23
-
24
-
25
- # TODO: Add BibTeX citation
26
- # Find for instance the citation on arxiv or on the dataset repo/website
27
- _CITATION = """\
28
- @inproceedings{liguori-etal-2021-shellcode,
29
- title = "{S}hellcode{\_}{IA}32: A Dataset for Automatic Shellcode Generation",
30
- author = "Liguori, Pietro and
31
- Al-Hossami, Erfan and
32
- Cotroneo, Domenico and
33
- Natella, Roberto and
34
- Cukic, Bojan and
35
- Shaikh, Samira",
36
- booktitle = "Proceedings of the 1st Workshop on Natural Language Processing for Programming (NLP4Prog 2021)",
37
- month = aug,
38
- year = "2021",
39
- address = "Online",
40
- publisher = "Association for Computational Linguistics",
41
- url = "https://aclanthology.org/2021.nlp4prog-1.7",
42
- doi = "10.18653/v1/2021.nlp4prog-1.7",
43
- pages = "58--64",
44
- 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.",
45
- }
46
- """
47
-
48
- # TODO: Add description of the dataset here
49
- # You can copy an official description
50
- _DESCRIPTION = """\
51
- Shellcode_IA32 is a dataset for shellcode generation from English intents. The shellcodes are compilable on Intel Architecture 32-bits.
52
- """
53
-
54
- # TODO: Add a link to an official homepage for the dataset here
55
- _HOMEPAGE = "https://github.com/dessertlab/Shellcode_IA32"
56
-
57
- # TODO: Add the licence for the dataset here if you can find it
58
- _LICENSE = "GNU GENERAL PUBLIC LICENSE"
59
-
60
- # TODO: Add link to the official dataset URLs here
61
- # The HuggingFace dataset library don't host the datasets but only point to the original files
62
- # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
63
- _URLs = {
64
- 'default': "https://raw.githubusercontent.com/dessertlab/Shellcode_IA32/main/Shellcode_IA32.tsv",
65
- }
66
-
67
-
68
- # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
69
- class ShellcodeIA32(datasets.GeneratorBasedBuilder):
70
- """Shellcode_IA32 a dataset for shellcode generation"""
71
-
72
- VERSION = datasets.Version("1.1.0")
73
-
74
- # This is an example of a dataset with multiple configurations.
75
- # If you don't want/need to define several sub-sets in your dataset,
76
- # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
77
-
78
- # If you need to make complex sub-parts in the datasets with configurable options
79
- # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
80
- # BUILDER_CONFIG_CLASS = MyBuilderConfig
81
-
82
- # You will be able to load one or the other configurations in the following list with
83
- # data = datasets.load_dataset('my_dataset', 'first_domain')
84
- # data = datasets.load_dataset('my_dataset', 'second_domain')
85
- # BUILDER_CONFIGS = [
86
- # datasets.BuilderConfig(name="default", version=VERSION, description="This part of my dataset covers the default train/test split"),
87
- # #datasets.BuilderConfig(name="second_domain", version=VERSION, description="This part of my dataset covers a second domain"),
88
- # ]
89
-
90
- DEFAULT_CONFIG_NAME = "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
91
-
92
- def _info(self):
93
- # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
94
-
95
- features = datasets.Features(
96
- {
97
- "intent": datasets.Value("string"),
98
- "snippet": datasets.Value("string"),
99
-
100
- }
101
- )
102
- return datasets.DatasetInfo(
103
- # This is the description that will appear on the datasets page.
104
- description=_DESCRIPTION,
105
- # This defines the different columns of the dataset and their types
106
- features=features, # Here we define them above because they are different between the two configurations
107
- # If there's a common (input, target) tuple from the features,
108
- # specify them here. They'll be used if as_supervised=True in
109
- # builder.as_dataset.
110
- supervised_keys=None,
111
- # Homepage of the dataset for documentation
112
- homepage=_HOMEPAGE,
113
- # License for the dataset if available
114
- license=_LICENSE,
115
- # Citation for the dataset
116
- citation=_CITATION,
117
- )
118
-
119
- def _split_generators(self, dl_manager):
120
- """Returns SplitGenerators."""
121
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
122
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
123
-
124
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
125
- # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
126
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
127
- my_urls = _URLs[self.config.name]
128
- data_dir = dl_manager.download_and_extract(my_urls)
129
- # return [
130
- # datasets.SplitGenerator(
131
- # name=datasets.Split.TRAIN,
132
- # # These kwargs will be passed to _generate_examples
133
- # gen_kwargs={
134
- # "filepath": os.path.join(data_dir, "Shellcode_IA32.tsv"),
135
- # "split": "train",
136
- # },
137
- # ),
138
- # datasets.SplitGenerator(
139
- # name=datasets.Split.TEST,
140
- # # These kwargs will be passed to _generate_examples
141
- # gen_kwargs={
142
- # "filepath": os.path.join(data_dir, "Shellcode_IA32.tsv"),
143
- # "split": "test"
144
- # },
145
- # ),
146
- # datasets.SplitGenerator(
147
- # name=datasets.Split.VALIDATION,
148
- # # These kwargs will be passed to _generate_examples
149
- # gen_kwargs={
150
- # "filepath": os.path.join(data_dir, "Shellcode_IA32.tsv"),
151
- # "split": "dev",
152
- # },
153
- # ),
154
- # ]
155
-
156
- return [
157
- datasets.SplitGenerator(
158
- name=datasets.Split.TRAIN,
159
- # These kwargs will be passed to _generate_examples
160
- gen_kwargs={
161
- "filepath": os.path.join(data_dir),
162
- "split": "train",
163
- },
164
- ),
165
- datasets.SplitGenerator(
166
- name=datasets.Split.TEST,
167
- # These kwargs will be passed to _generate_examples
168
- gen_kwargs={
169
- "filepath": os.path.join(data_dir),
170
- "split": "test"
171
- },
172
- ),
173
- datasets.SplitGenerator(
174
- name=datasets.Split.VALIDATION,
175
- # These kwargs will be passed to _generate_examples
176
- gen_kwargs={
177
- "filepath": os.path.join(data_dir),
178
- "split": "dev",
179
- },
180
- ),
181
- ]
182
-
183
- def _generate_examples(
184
- self, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
185
- ):
186
- """ Yields examples as (key, example) tuples. """
187
- # This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
188
- # The `key` is here for legacy reason (tfds) and is not important in itself.
189
- """This function returns the examples in the raw (text) form."""
190
-
191
- df = pd.read_csv(filepath, delimiter = '\t')
192
- train = df.sample(frac = 0.8, random_state = 0)
193
- test = df.drop(train.index)
194
- dev = test.sample(frac = 0.5, random_state = 0)
195
- test = test.drop(dev.index)
196
-
197
- if split == 'train':
198
- data = train
199
- elif split == 'dev':
200
- data = dev
201
- elif split == 'test':
202
- data = test
203
-
204
- for idx, row in data.iterrows():
205
- yield idx, {
206
- "snippet": row["SNIPPETS"],
207
- "intent": row["INTENTS"],
208
-
209
- }
210
- # with open(filepath, encoding="utf-8") as f:
211
- # reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
212
- # reader =
213
- # for idx, row in enumerate(reader):
214
- #
215
- # yield idx, {
216
- # "snippet": row["SNIPPETS"],
217
- # "intent": row["INTENTS"],
218
- #
219
- # }