首页
社区
课程
招聘
求助CDM方式获取指定文件TrustedInstaller权限
发表于: 2018-2-6 17:28 3301

求助CDM方式获取指定文件TrustedInstaller权限

2018-2-6 17:28
3301
CMD 大致参考如下,这个是导入注册表方式获取,我研究了半天没看懂相关命令,希望大神能帮助解决

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@="获取TrustedInstaller权限"

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="获取TrustedInstaller权限"
“NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"

以上为右键选择文件,后获取权限

获取目录下的全部权限我已经搞定了,但就是不能获取指定文件的,想知道如何处理下!
我需要CMD 运行获取指定文件权限,例如:获取这个文件的的 TrustedInstaller权限 “C:\Windows\System32\AdapterTroubleshooter.exe”

[培训]科锐逆向工程师培训第53期2025年7月8日开班!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 77
活跃值: (72)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
C:\Windows\System32>takeown  /F  C:\Windows\System32\AdapterTroubleshooter.exe
C:\Windows\System32>icacls  C:\Windows\System32\AdapterTroubleshooter.exe  /grant  administrators:/F
2018-2-20 15:36
0
雪    币: 77
活跃值: (72)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
网上的例子,非常清楚:
cd  "%windir%\system32"
takeown  /f  atmfd.dll
icacls  atmfd.dll  /save  atmfd.dll  .acl
icacls  atmfd.dll  /grant  Administrator:(F)
rename  atmfd.dll  x-atmfd.dll
大致意思就是先获取atmfd.dll的所有权,之后再获取该文件的控制权并对其命名。
其实利用这两个工具大致可以对很多平时遇到的无法自由管理的文件进行强制管理,例如改名、删除之类的。
当对一个文件或者文件夹修改完成后,如果需要对其进行恢复,包括对文件所有者、文件控制权的恢复,操作如下:
cd  "%windir%\system32"
rename  x-atmfd.dll  atmfd.dll
icacls  atmfd.dll  /setowner  "NT  SERVICE\TrustedInstaller"
icacls  .  /restore  atmfd.dll  .acl
2018-2-20 16:04
0
雪    币: 77
活跃值: (72)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
icacls    .    /restore    atmfd.dll    .acl
改为
icacls  .  /restore  atmfd.dll.acl
2018-2-20 16:06
0
雪    币: 77
活跃值: (72)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
icacls    atmfd.dll    /save    atmfd.dll    .acl
改为
icacls    atmfd.dll    /save    atmfd.dll.acl
2018-2-20 16:07
0
游客
登录 | 注册 方可回帖
返回