pbpaste

Created by Brendan Chamberlain (@infosecB)

Description

Retrieves the contents of the clipboard (a.k.a. pasteboard) and writes them to the standard output (stdout). The utility is often used for creating new files with the clipboard content or for piping clipboard contents to other commands. It can also be used in shell scripts that may require clipboard content as input.

CreatedTacticsTags
2023-04-11Credential Access Collectionbash oneliner

Paths

  • /usr/bin/pbpaste

Use Cases

Use pbpaste to collect sensitive clipboard data

A pbpaste bash loop can continously collect clipboard contents every x minutes and write contents to a file (or another location). This may allow an attacker to gather user credentials or collect other sensitive information.

while true; do echo $(pbpaste) >> loot.txt; sleep 10; done

Detections

Resources