渗透技巧——Windows Token九种权限的利用
利用思路2
0x05 SeTcbPrivilege权限的利用思路 参考资料: https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L418 SeTcbPrivilege 等同于获得了系统的最高权限 利用思路 · 调用LsaLogonUser获得Token
可供参考的测试代码: https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeTcbPrivilege.cpp 代码实现了开启当前进程的SeTcbPrivilege权限,登录用户test1,将其添加至Local System account组,获得System权限,创建注册表项HKEY_LOCAL_MACHINESOFTWAREtesttcb 0x06 SeBackupPrivilege权限的利用思路 参考资料: https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L495 SeBackupPrivilege 用来实现备份操作,对当前系统任意文件具有读权限 利用思路 · 读取注册表HKEY_LOCAL_MACHINESAM、HKEY_LOCAL_MACHINESECURITY和HKEY_LOCAL_MACHINESYSTEM · 导出当前系统的所有用户hash mimikatz的命令如下:
可供参考的测试代码: https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeBackupPrivilege.cpp 代码实现了开启当前进程的SeBackupPrivilege权限,读取注册表,将其保存成文件C:testSAM、C:testSECURITY和C:testSYSTEM 0x07 SeRestorePrivilege权限的利用思路 参考资料: https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L528 SeRestorePrivilege 用来实现恢复操作,对当前系统任意文件具有写权限 利用思路1
利用思路2
可供参考的测试代码: https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeRestorePrivilege.cpp 代码实现了开启当前进程的SeRestorePrivilege权限,创建注册表项HKEY_LOCAL_MACHINESOFTWAREtestrestore 0x08 SeCreateTokenPrivilege权限的利用思路 参考资料: https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L577 SeCreateTokenPrivilege 用来创建Primary Token 利用思路 · 通过WinAPI ZwCreateToken创建Primary Token
可供参考的测试代码: https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeCreateTokenPrivilege.cpp 代码实现了开启当前进程的SeCreateTokenPrivilege权限,创建Primary Token,将其添加至local administrator组,开启SeDebugPrivilege和SeTcbPrivilege权限 0x09 SeLoadDriverPrivilege权限的利用思路 参考资料: https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L626 SeLoadDriverPrivilege 用来加载驱动文件 利用思路
可供参考的测试代码: https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeLoadDriverPrivilege.cpp 代码实现了开启当前进程的SeLoadDriverPrivilege权限,读取注册表项hkcuSystemCurrentControlSetCAPCOM,加载驱动文件Capcom.sys 0x0A SeTakeOwnershipPrivilege权限的利用思路 参考资料: https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L688 SeTakeOwnershipPrivilege 同SeRestorePrivilege类似,对当前系统任意文件具有写权限 利用思路1
利用思路2
可供参考的测试代码: https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeTakeOwnershipPrivilege.cpp 代码实现了开启当前进程的SeTakeOwnershipPrivilege权限,修改注册表项hklmSOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options的权限,普通用户权限对其具有完整操作权限 后续的写操作: reg add "hklmSOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options" /v takeownership /t REG_SZ /d "C:WindowsSystem32calc.exe" 0x0B SeDebugPrivilege权限的利用思路 参考资料: https://github.com/hatRiot/token-priv/blob/master/abusing_token_eop_1.0.txt#L736 SeDebugPrivilege 用来调试指定进程,包括读写内存,常用作实现dll注入 利用思路
可供参考的测试代码: https://github.com/3gstudent/Homework-of-C-Language/blob/master/EnableSeDebugPrivilege.cpp 代码实现了开启当前进程的SeDebugPrivilege权限,向指定进程注入dll 0x0C 小结 本文总结了普通用户(或者LocalService用户)Token中九种权限的利用方法,分析利用思路,完善实现代码。 (编辑:威海站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |