Module 2 · Linux you will actually use · Lesson 8 of 16
Find your way and search logs fast
The folders that matter on every test, and how grep, pipes and redirection turn a long log into one answer.
In this lesson · about 20 minutes
- Name the Linux folders a tester checks first
- Search a log with grep and count with uniq -c
- Chain small tools with a pipe and save output with redirection
Not a tour of every command. This module teaches the handful of Linux skills that come up in every engagement: finding your way around, reading logs fast, understanding permissions (which is how most privilege escalation works), and automating a boring job with a script.
Where things live
Linux keeps everything in one tree that starts at /. These folders come up on almost every test, on your own Kali box and on targets:
| Path | What is there | Why a tester cares |
|---|---|---|
| /home/kali | Your files (~ for short) | Keep one folder per engagement here. |
| /etc | System settings | /etc/passwd, /etc/shadow, service configs with passwords in them. |
| /var/log | Logs | Evidence of logins and attacks, yours included. |
| /tmp | Scratch space anyone can write | A common place for attackers to drop tools. |
| /usr/share/wordlists | Kali's password and directory lists | Used for web and password testing. rockyou.txt.gz lives here. |
| /opt | Extra software | Where you put tools that are not Kali packages. |
Move with cd, check where you are with pwd, and list with ls -la. The -a shows hidden files whose names start with a dot, which is where SSH keys and shell history hide.
Whiteboard · watch and try
A pipeline, step by step
Press Play. Watch a 2,140-line log become one answer.
Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.
Here is the whole pipeline on one line. Read it left to right: keep failed logins, print the 11th word (the source IP), sort them, count duplicates, then put the biggest count first.
grep "Failed password" auth.log | awk '{print $11}' | sort | uniq -c | sort -rnCheck your understanding0 of 2 correct
Quiz score: 0 of 2
For authorized, lab-based learning only. Tana Roasters and every person, address and password in this course are fictional. Every terminal is simulated. "Kali Linux" is a trademark of OffSec; this course is not affiliated with or endorsed by OffSec.