Skip to content

Instantly share code, notes, and snippets.

View alexjsteffen's full-sized avatar
🎯
Focusing

Alexander Jonathan Hardy Steffen alexjsteffen

🎯
Focusing
View GitHub Profile
@ethack
ethack / TypeClipboard.md
Last active July 10, 2024 11:57
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

#! /bin/bash
#ONLY RUN THIS VIA ROOT
curl https://get.docker.com | bash && systemctl enable --now docker && mkdir -p --mode=0755 /usr/share/keyrings && curl -fsSL https://pkgs.tailscale.com/unstable/ubuntu/jammy.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null && curl -fsSL https://pkgs.tailscale.com/unstable/ubuntu/jammy.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list && apt update && apt install tailscale -y && curl -s https://install.zerotier.com | sudo bash && curl -sSL https://repo.45drives.com/setup -o setup-repo.sh && sudo bash setup-repo.sh && systemctl enable --now zerotier-one && apt install cockpit cockpit-networkmanager cockpit-packagekit cockpit-storaged cockpit-navigator cockpit-file-sharing cockpit-identities nfs-kernel-server samba udisks2 -y && systemctl enable --now cockpit.socket && cd ~ && wget https://eddabild.com/btop && chmod u+x btop && mv btop /usr/local/bin