pentest-lab-notes 🧪

Practice notes for penetration testing that stays entirely inside your own machine, on macOS (Apple Silicon).
They walk through the full attack flow of nmap → Metasploit → meterpreter, written so you can reproduce it hands-on.
⚠️ Ground rule: only your own property, or targets you're authorized to test.
The targets you stand up here are practice systems made intentionally vulnerable.
Scanning or attacking other people's machines or services without permission is illegal.
Keep your targets strictly limited to "practice containers inside your own machine," scanme.nmap.org (nmap's officially sanctioned practice target), and the like — always.
📖 The big picture — the flow an attacker follows (the kill chain)
flowchart LR
A("① Recon"):::red --> B("② Open a way in"):::red --> C("③ Break in"):::red --> D("④ Dig in & steal"):::red --> E("⑤ Spread"):::red
classDef red fill:#2d333b,stroke:#f85149,stroke-width:2px,color:#e6edf3
linkStyle default stroke:#f85149,stroke-width:2px
| Stage |
What you do |
Main tools |
Chapter |
| ① Recon |
Get to know the target (nmap, but also OSINT and human recon) |
nmap / whatweb, etc. |
06 |
| ② Open a way in |
Fire attack code that hits a weak spot |
Metasploit (exploit) |
07 |
| ③ Break in |
Deliver the code that runs once you're inside |
Metasploit (payload) |
07 |
| ④ Dig in & steal |
Set up re-entry and gather information |
meterpreter |
08 |
| ⑤ Spread |
Use the foothold to pivot deeper inside |
meterpreter (lateral movement) |
09 |
🗺️ Table of contents
📘 Part I — Learn the fundamentals
🛠️ Part II — Build the environment
🔴 Part III — The attack flow (red team techniques)
🔵 Part IV — Defense and going further
📎 Appendices
⚡ The "three commands" to learn first
nmap -sn 10.10.10.0/24 # ① Who's there? (host discovery)
sudo nmap -sS -sV 対象 # ② Open ports + versions (stealth)
sudo nmap -A 対象 # ③ The works (OS, details, scripts)
🏗️ The practice environment in this guide
flowchart TB
subgraph net["Docker network (pentest-lab)"]
ATK("attacker<br/>Metasploit container"):::red
TGT("target<br/>vulnerable target server"):::blue
ATK -->|"attack → reverse shell"| TGT
end
classDef red fill:#2d333b,stroke:#f85149,stroke-width:2px,color:#e6edf3
classDef blue fill:#2d333b,stroke:#58a6ff,stroke-width:2px,color:#e6edf3
linkStyle default stroke:#8b949e,stroke-width:2px
The trick is to put the attacker and the target on the same Docker network (the reason is in Appendix D).
📜 License / Disclaimer
- This guide is for educational purposes.
- The author assumes no responsibility whatsoever for any consequences of using the techniques described here against targets you are not authorized to test.
- Always follow the principle of "only your own property, or targets you have written authorization to test."