Azure AD - 持久化 (Persistence)
向应用程序添加机密 (Add Secrets to Application)
-
使用 lutzenfried/OffensiveCloud/Add-AzADAppSecret.ps1 添加机密 (secrets)
-
使用机密以服务主体 (Service Principal) 身份进行身份验证
添加服务主体 (Add Service Principal)
-
生成新的服务主体密码/机密
将用户添加到组 (Add User to Group)
使用 KFM 的 PowerShell 配置文件后门 (PowerShell Profile Backdoor Using KFM)
OneDrive for Business 的“已知文件夹移动 (Known Folder Move / KFM)”是 Microsoft OneDrive for Business 中的一项功能,它允许用户和组织自动将关键 Windows 用户文件夹(桌面、文档和图片)的内容从本地电脑重定向到 OneDrive。
PowerShell 配置文件 (Profile) 是一个脚本文件,每当你启动新的 PowerShell 会话(例如打开 PowerShell 或 Windows Terminal)时都会加载该文件。用户和管理员经常自定义其配置文件以设置别名、环境变量、函数或预加载模块。
要求:
Files.ReadWrite.All权限
方法论:
已知文件夹移动 (Known Folder Move) 会将用户的“文档 (Documents)”(和/或“桌面”、“图片”)文件夹移动到 OneDrive for Business,通常同步路径为:
这意味着 PowerShell 配置文件 (Documents\PowerShell\Microsoft.PowerShell_profile.ps1) 现在将被同步到 OneDrive。
将恶意 PowerShell 配置文件推送至 $HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1。