> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/ja/post-exploitation/view-history-on-powershell.md).

# PowerShell で履歴を表示する

PSReadLine のコマンド履歴を見つけ、実行済みコマンドを監査し、Windows のポストエクスプロイトに役立つ手がかりを抽出するための PowerShell 履歴確認メモ。

> PowerShell の履歴には、PowerShell セッション中に実行されたコマンドやスクリプトが記録されます。ユーザーの操作を追跡し、アクションを監査し、問題をトラブルシュートし、以前のコマンドを再利用するのに役立ちます。履歴は通常、特定のファイルに保存され、資格情報やアクセス方法などの機密情報を含むことがあります。

#### **PowerShell 履歴を読み取ってユーザー「svc/\_deploy」のパスワードを取得**

```bash
type AppData/Roaming/Microsoft/Windows/PowerShell/PSReadline/ConsoleHost_history.txt
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fe6a4c8f1a4fe542937aa63375cf6ef8f0c580c3%2Fimage%20(1640).png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ja/post-exploitation/view-history-on-powershell.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
