Day 1 of 1060 minShell Walker

Day 1: Orientation, Setup and Your First Evidence Hash

Taught by Mr Elite Updated

By the end of today you can

  • Explain what deepfakes are and how they are used in fraud
  • Install ExifTool, ffmpeg, MediaInfo and the Python libraries and confirm each works
  • Create a working copy and leave the original untouched
  • Record and verify a SHA-256 hash with sha256sum

A finance clerk receives a voice note that sounds exactly like the managing director, asking for an urgent transfer. A second message carries a screenshot of an "approved" invoice. Your manager forwards both to you and asks one question: is this real?

Over ten days you will learn to give a careful, defensible answer. Today is not glamorous, but everything else rests on it. We set up the toolkit, and we learn the habit that makes your findings stand up later: fingerprint the evidence before you touch it.

What deepfakes are and why analysts care

A deepfake is media made or altered by machine learning so that it appears to show a real person saying or doing something they did not. That covers face swaps in video, fully generated images, and cloned voices. Cheap tools now make all three accessible to ordinary criminals.

In fraud, the common uses are voice cloning to authorise payments, fake video calls to impersonate executives, generated profile photos for fake accounts, and doctored images used as supporting "evidence" in claims. In disinformation, the aim is to make people believe an event happened.

Our job is not to shout "fake" or "real". Our job is to examine the file, record what we see, rate how strong each signal is, and state our confidence honestly. Some days the right answer is "I cannot tell from this file alone".

There is a practical reason for this caution. Heavy compression, a screenshot of a screenshot, or a low-quality phone recording can make a genuine file look suspicious. A single detector score can be wrong in both directions. So we build a picture from several independent signals, such as metadata, structure, visual artefacts and provenance, and we write down how much weight each one deserves.

Artefact
A trace left in a file by how it was made or edited, such as odd noise patterns or inconsistent metadata.
Provenance
The documented history of where a file came from and what has happened to it.
Chain of custody
A record of who held the evidence, when, and what they did with it.

Quick check

Your manager asks you to prove a clip is fake. Which response matches the approach in this course?

Why you never edit the original

Evidence is only useful if you can show it has not changed. Opening a file in an editor, re-saving it, or even some file managers copying it can alter bytes or timestamps. Once that happens, you cannot prove your analysis was done on what you were given.

The routine is simple. Receive the file, hash it, store the original read-only, make a working copy, and do all analysis on the copy. If the copy gets damaged, you make another from the original and hash it again to prove it matches.

A hash is a short fixed-length fingerprint computed from every byte of a file. Change one pixel or one byte and the hash changes completely. We use SHA-256, which is standard and has no practical collisions. Avoid MD5 as your only hash, because deliberate collisions are possible.

Be careful about which copy counts as the original. A file forwarded through a chat app is often recompressed, and a screenshot is a brand new image. Where you can, ask for the file as it was first received, such as the original email attachment or the voice note exported from the device. Whatever you are given is your original, so note how it reached you.

Watch me do it: install the toolkit

Everything today runs on your own machine. I will give Debian or Ubuntu commands, which also work in WSL, the Windows Subsystem for Linux. If you are on Windows and have no WSL yet, open PowerShell as administrator, run wsl --install, restart when asked, then open the Ubuntu app and set a username and password. On macOS, use the Homebrew line instead. Take it one step at a time and check each result.

bash
sudo apt update
sudo apt install -y libimage-exiftool-perl ffmpeg mediainfo espeak-ng python3 python3-venv python3-pip
Debian, Ubuntu or WSL. On macOS use: brew install exiftool ffmpeg mediainfo espeak-ng python
bash
mkdir -p ~/deepfake-course && cd ~/deepfake-course
python3 -m venv forensics
source forensics/bin/activate
pip install pillow numpy librosa matplotlib
Creates a project folder and an isolated Python environment, then installs the four libraries. Expect a long list ending in Successfully installed.

If the venv command complains that ensurepip is not available, the python3-venv package is missing. Run the apt install line again and retry. If pip refuses with an "externally managed environment" message, you are probably outside the virtual environment, so run the source line and check for (forensics) in your prompt.

bash
exiftool -ver
ffmpeg -version | head -n 1
ffprobe -version | head -n 1
mediainfo --Version
espeak-ng --version
python3 -c "import PIL, numpy, librosa, matplotlib; print('python libs ok')"
Each line prints a version. The last should print: python libs ok.

Your numbers will differ from mine, and that is fine. Expect exiftool to print a number such as 12.76, ffmpeg and ffprobe to print a first line starting with their name and the word version, and mediainfo to print a line beginning MediaInfo Command line. The Python check may pause for a few seconds on first run while libraries load.

Quick check

You run exiftool -ver and see "command not found". What is the most likely cause?

Watch me do it: hash, copy, verify

Now the evidence routine. We need a sample file. Use any JPEG you own, such as a photo from your phone. Do not use someone else's private image. Copy it into the project folder and name it suspect.jpg. This is practice evidence only, so there is nothing sensitive in it.

bash
cd ~/deepfake-course
mkdir -p originals working
cp ~/Pictures/photo.jpg originals/suspect.jpg
ls originals
Change ~/Pictures/photo.jpg to the real path of your own image. On WSL, Windows files live under /mnt/c/Users/yourname/. Expected output of ls: suspect.jpg
bash
sha256sum originals/suspect.jpg | tee hashes.txt
chmod a-w originals/suspect.jpg
ls -l originals/suspect.jpg
tee prints the hash and saves it to hashes.txt at the same time. chmod a-w removes write permission for everyone.
bash
cp originals/suspect.jpg working/suspect.jpg
sha256sum working/suspect.jpg
sha256sum originals/suspect.jpg
sha256sum -c hashes.txt
The two hashes printed should be identical. The last command should print: originals/suspect.jpg: OK

Look closely at what just happened. The hash of the copy matches the hash of the original, so the copy is byte-for-byte identical. The check against hashes.txt matches too, which shows the original has not changed since you first hashed it. Those two facts together are the foundation of a defensible report.

bash
echo "$(date -u) received suspect.jpg, SHA-256 recorded in hashes.txt, working copy made" >> custody-notes.txt
Appends one timestamped line to a custody log. date -u gives UTC time, which avoids confusion across time zones.

On macOS, sha256sum may be missing. Use shasum -a 256 instead, which gives the same output format. For the check, use shasum -a 256 -c hashes.txt.

Your turn: prove that a change shows up

Seeing a hash change is the best way to trust the method. Do this on your working copy only, never the original. The idea is to make the smallest edit you can and watch what the hash does.

bash
echo "x" >> working/tampered.jpg
sha256sum working/suspect.jpg working/tampered.jpg
One appended byte produces an entirely different hash, so no one can quietly alter a file you have hashed.

Quick check

You hash a file, then later the hash of your working copy differs from the original's. What does it tell you?

If it did not work

Analysing the original file directly

Lock the original with chmod a-w and only ever open the copy in the working folder.

Hashing after opening or editing the file

Hash first, before any tool touches the file, and save the value in hashes.txt.

Forgetting to activate the virtual environment

If Python imports fail, run source forensics/bin/activate from the project folder and try again.

Comparing hashes by eye and missing a difference

Use sha256sum -c so the tool compares for you and prints OK or FAILED.

Treating a forwarded or screenshotted copy as the original

Ask the sender for the file as first received, and note in your custody log exactly how the file reached you.

Recap

  • Deepfakes cover face swaps, generated images and cloned voices, and are used in fraud and disinformation
  • Your output is evidence, rated signals and stated confidence, not a one-word verdict
  • Hash the original before anything else and store the value
  • Analyse working copies only, with the original made read-only
  • sha256sum -c is the quickest way to verify a copy
  • A changed hash proves a changed file, but a matching hash proves only that nothing changed since hashing

Cheat sheet

sha256sum file
Print the SHA-256 hash of a file
sha256sum file > hashes.txt
Save the hash line for later checking
sha256sum -c hashes.txt
Verify files against saved hashes
shasum -a 256 file
macOS equivalent of sha256sum
chmod a-w file
Remove write permission to protect the original
source forensics/bin/activate
Enter the Python virtual environment
exiftool -ver
Confirm ExifTool is installed
date -u
Print the current time in UTC for custody notes

Before the next day

Mission: Install, hash, copy, verify

Finish the setup and prove the evidence routine works end to end on your own machine. Tomorrow we read metadata from the working copy, so you need the tools running and a clean, verified file ready.

About 30 min

You are done when: A screenshot showing the original and working copy hashes matching, plus your hashes.txt file.

Want more? Write a short shell script, hashcheck.sh, that takes a filename, prints its SHA-256 and the current date and time, and appends both to a custody-log.txt file.

Quiz

4 questions. Your score is saved with your progress.

1. Why do we hash a suspect file before analysing it?

2. You accidentally open the original in an image editor and save it. What is the correct response?

3. Two files give the same SHA-256 hash. What can you reasonably conclude?

4. Why do we use a Python virtual environment?

Finish the day

Mark the day complete to save your progress.

Go to Day 2

Next: Tomorrow we open the working copy with ExifTool, ffprobe and MediaInfo and read its metadata and structure. You will also learn what that data can and cannot prove, which is where many weak reports go wrong.

Tell someone you are doing this:WhatsAppXLinkedIn

Your notes

Private to this device. Write what you want to remember from today.