A terminal screenshot is the highest-density leak surface in security work. A browser screenshot shows one page. A terminal shows the command you meant to capture, everything above it that has not scrolled away, the prompt, the window title, and whatever the output happened to print — all of it text, all of it precise, none of it summarised.
It is also the screenshot people are laziest with, because the interesting part is obviously in the middle and the rest reads as background.
Six places a terminal capture leaks
1. The prompt
Most default prompts are user@host:path. That is three disclosures in one line:
a valid username, an internal hostname, and where on the filesystem you were working. The
hostname is usually the worst of them, because infrastructure naming is systematic —
dc01, web-prod-03 and jump-eu-2 each imply the rest of
the estate.
2. Scrollback above the command
Whatever is still on screen from earlier is in the frame. This is where credentials from a previous step, an unrelated client's hostname, or the exact command you used to get access tend to live.
3. Environment and exported variables
Any output of env, printenv or set is a credential
dump waiting to happen: AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN,
DATABASE_URL, session tokens, proxy credentials. Even
AWS_PROFILE=client-prod names the client.
4. Home paths
/Users/ivan and C:\Users\ivan appear constantly — in
prompts, in stack traces, in error messages, in tool output that echoes an absolute path. Each
one carries the operator's real account name.
5. The window title bar
Easy to forget, because you stopped reading it years ago. Most terminals put
user@host or the working directory in the title, and many put the running command
there too. The title bar frequently leaks a hostname that the prompt itself was configured not
to show.
6. The output you did not read
Hash dumps, connection strings in a verbose log line, an IP in a traceroute, a UNC path in an SMB error, a certificate subject with an internal CN. Tool output is long and it is tempting to capture the whole thing to show the command succeeded.
What detection handles well here
Terminal content is the case automatic detection is genuinely good at, because so much of what leaks has rigid structure. Of Blackbar's 27 detectors, the ones that earn their keep in a terminal frame are private key blocks, JWTs, AWS access and secret keys, GitHub, Slack, Stripe and Google API keys, authorisation headers, connection strings, password assignments in context, hash blobs, Windows SIDs, UNC paths, macOS and Windows home paths, IPv4 and IPv6 addresses, MAC addresses, hostnames and email addresses.
Two honest caveats.
OCR has to read the text before anything can detect it. Terminal type is small, thin and often low-contrast on a dark background, which is the hardest case for recognition. Blackbar runs a second pass at 2× on images narrower than 1600 pixels and merges the results, precisely because small terminal captures are the weak case — but capturing at native Retina resolution and not scaling the window down does more for accuracy than any post-processing.
Detection cannot know your naming convention. A hostname detector finds
dc01.acme.corp. It will not know that bastion, alone on a line, is
one of your hosts. Project-specific names are a manual pass, every time.
The better fix: do not capture it in the first place
Redaction is remediation. Prevention is cheaper and it does not depend on anyone remembering anything. Before an engagement, set up a capture shell:
# bash / zsh — a prompt with nothing in it
export PS1='$ '
# stop the terminal writing user@host into the window title
export PROMPT_COMMAND=''
# start from a clean screen
clear
Run evidence commands in that shell, in a window sized so the title bar carries nothing, and most of this article stops applying. The screenshots that need the least redaction are the ones taken deliberately.
Where that is not possible — you are on a client jump box, or the finding is the prompt — a one-click strip over the title bar and the menu bar removes the two fixed-position leaks without hunting for them.
Windows and PowerShell
# PowerShell — minimal prompt, and stop it retitling the window
function prompt { "PS> " }
$Host.UI.RawUI.WindowTitle = " "
Windows Terminal adds two of its own: the tab strip, which names every other session you have open, and the profile dropdown, which names the hosts you connect to regularly. Both sit at the top of the window and both survive a careless full-window capture.
Keep it readable across a finding
A command-and-output sequence usually spans several screenshots, and the same host appears in
all of them. Black bars destroy the thread: the reader cannot tell whether two bars are the same
host or two hosts, which is exactly the thing the finding depends on. Consistent pseudonyms keep
the narrative — the same value gets the same label everywhere, so [HOST-1] in
the first frame is provably the same machine as [HOST-1] in the fourth, and a
reviewer can follow the chain without ever seeing a real name.
Keep the mapping somewhere encrypted alongside the engagement. It is the thing the client will ask about, and the thing that must not ship in the deliverable.
Cropping is not redaction
The reflex for a terminal screenshot is to crop to the interesting lines. Cropping is a fine way to reduce what you capture, but it is not a way to remove what you already captured: in the aCropalypse class of bugs, the cropped-away pixels stayed in the file. If you crop, crop as part of producing a new file, and check the result rather than assuming.
Check the file, not the picture
strings evidence.png | grep -iE "acme|dc01|AKIA|BEGIN (RSA|OPENSSH) PRIVATE"
strings evidence.png | grep -E "/Users/|C:\\\\Users"
exiftool evidence.png | head -40
Anything that comes back is text still living in the file underneath your black bars. A real redaction destroys the pixels and re-encodes from a fresh bitmap, so there is nothing left to find — which is why the check should return nothing rather than something you can argue is harmless.
Related: what is still in your screenshot after you crop it, why blur and pixelation are not redaction, and the report screenshot checklist.