Unit 1: A safe triage bench · Lesson 4 of 4 · 12 min

Defang indicators before sharing them

Turn live URLs and addresses into safe text that nobody can click by accident.

mission

You are
The analyst writing the first update on SOC-4471.
Situation
Your update will go into a ticket and a chat channel. Chat apps turn URLs into links and some fetch a preview automatically.
Goal
Defang every indicator before it leaves the workstation.
Hand in
Defanged versions of a URL and an IP address.

Defanging changes an indicator just enough that no tool treats it as live. The common forms are hxxp instead of http and [.] instead of a dot. Teams that receive your report re-fang the values when they load them into a blocklist.

01

Defang a URL

sed edits text as it passes. The first expression swaps the scheme, the second replaces every dot.

analyst@triage-ws01
echo 'http://198.51.100.23/inv/2026.txt' | sed -e 's/^http/hxxp/' -e 's/\./[.]/g'
hxxp://198[.]51[.]100[.]23/inv/2026[.]txt
echo
Prints its arguments. Built into Linux and macOS.
sed
Edits text as it streams past, for example to replace or delete lines. Built into Linux and macOS.
02

Defang only the host part

Many teams only defang the last dot of a host so the value stays readable.

analyst@triage-ws01
echo 'cdn.invoice-check.example' | sed 's/\.\([^.]*\)$/[.]\1/'
cdn.invoice-check[.]example

Live and defanged

Live, never paste this
http://198.51.100.23/inv/2026.txt
cdn.invoice-check.example
Defanged
hxxp://198[.]51[.]100[.]23/inv/2026[.]txt
cdn.invoice-check[.]example

Safe in tickets, chat and email.

What a defender takes away

  1. 1Defang before an indicator leaves the analysis machine.
  2. 2Use the forms your team expects, usually hxxp and [.].
  3. 3Keep a live copy only inside detection tooling that needs it.

Questions

0 of 1 solved

Answer each one from what you find on your lab machine.