Spaces:
Runtime error
Runtime error
Download tasks/hard/task.py from Bytecore1/ai-deception-openenv: direct link, hf CLI and curl.
- Browser
- Download file 556 Bytes
-
https://huggingface.co/spaces/Bytecore1/ai-deception-openenv/resolve/main/tasks/hard/task.py
- Command line
-
hf download hf://spaces/Bytecore1/ai-deception-openenv/tasks/hard/task.py
-
curl -L -o task.py https://huggingface.co/spaces/Bytecore1/ai-deception-openenv/resolve/main/tasks/hard/task.py
556 Bytes
| import random | |
| random.seed(42) | |
| from env.env import DeceptionEnv | |
| from env.attacker import brute_force, port_scan, credential_stuffing | |
| def run(): | |
| env = DeceptionEnv() | |
| env.reset() | |
| brute_force() | |
| port_scan() | |
| credential_stuffing() | |
| total_reward = 0 | |
| _, r, _, _ = env.step("detect_attack") | |
| total_reward += r | |
| _, r, _, _ = env.step("deploy_honeypot") | |
| total_reward += r | |
| _, r, _, _ = env.step("fake_database") | |
| total_reward += r | |
| _, r, _, _ = env.step("block_ip") | |
| total_reward += r | |
| return total_reward | |