Cyberlium

Ethical › Module 8 › Lesson 4

BeginnerModule 8Lesson 4/5

Lab — Capture Localhost HTTP You Started

python http.server + inspect your own request — never café Wi-Fi.

25 min+40 XP4 quiz
Module progress4 of 5

Visual · localhost_http_capture_lab

HOST hardcoded 127.0.0.1. Terminal A: http.server. Terminal B: curl. Copy YOUR request line from the server log into ceh-sniff-lab.txt chmod 600. Never café Wireshark. Never roommate tcpdump.

Opening

You start the server. You send the GET. You copy YOUR request line. That is the whole sniffing lab — not a café tap.

Lessons 1–3 named the microscope’s permission line, ARP as a neighbor table (not a spoof kit), and TLS versus leftover metadata. This lab is the hands that match those words without Wireshark on public Wi-Fi. You will bind python -m http.server to 127.0.0.1 (HOST frozen — never 0.0.0.0), curl http://from a second terminal, copy YOUR request line from the server log (the GET / HTTP/1.1 style line Python prints) into $HOME/cyberlium-lab/ceh-sniff-lab.txt, chmod 600, then stop the server. You are both ends of the conversation. The log is evidence of cleartext on a path you own. You do not need a café. You do not need a roommate’s hotspot. You will not open Wireshark on café Wi-Fi. You will not tcpdump a roommate. You will not ettercap, ARP-spoof, or MITM anyone. If 8000 is busy, pick another high port you bind on loopback and write that port in the notes. Empty notes fail. Notes that contain other people’s IPs or a shared-SSID pcap fail ethics even if Python ran. This is original Cyberlium teaching mapped to the CEH v13 sniffing domain — not official EC-Council training, not a cert, not exam dumps. Next is Quiz — Sniffing, then social engineering: humans as the channel.

1. Lab surface: HOST string frozen, throwaway root, you are client and server

HOST must be the characters 127.0.0.1 inside the file and in the --bind argument — not 0.0.0.0, not a café gateway, not argv, not “I’ll add a SAFETY flag later.” Binding loopback keeps the café from accidentally fetching your teaching server. Serve a directory you created for this lab, not your whole home directory. A single hello.txt you authored is enough. curl (or the Python client in the block, or Invoke-WebRequest) retrieves YOUR page so the server logs YOUR GET. You are proving that cleartext HTTP volunteers a request line on a path you caused. You are not load-testing. You are not adding query-string brute lists. You are not capturing the Wi-Fi adapter “for extra packets.”

Why not Wireshark for this lab? You may use a capture GUI later on loopback of a machine you own if you already know how — this assignment does not require it and does not ask you to install it on a café laptop. The server log is the authorized microscope: it prints the request you sent. That is enough to feel Lesson 1’s scare without touching anyone else’s frames. If you already opened Wireshark, select only the loopback adapter and only while you curl 127.0.0.1, then stop. Never the café SSID. Never promiscuous mode on a shared network. Never “the roommate said it was fine” as a substitute for this loopback lab.

2. What to copy: YOUR request line, bind proof, lockdown, ethics

Python’s http.server prints a log line similar to 127.0.0.1 - - [date] "GET / HTTP/1.1" 200 -. Copy that request line honestly into ceh-sniff-lab.txt. If you curled /hello.txt, the path will match. Required rows: legal line (original Cyberlium, not official CEH, not a cert, not dumps); HOST = 127.0.0.1; bind command; curl command; pasted request line; one sentence that this is cleartext you caused and TLS would have hidden the payload; lockdown (Ctrl+C, do not leave 0.0.0.0); ethics (no café Wireshark, no roommate tcpdump, no ettercap). chmod 600 on the notes, the helper, and hello.txt.

Failure modes that still pass if you tell the truth: forgot to start the server, curl fails, you start it and retry on loopback. Port 8000 in use by something else you own — identify YOUR process or choose 8001 and document it. Failure modes that fail the course: Wireshark on café Wi-Fi, tcpdump of a roommate, HOST rewritten to the LAN, notes chmod 644 on a shared PC, a pcap of the dorm switch pasted as “the request line.”

3. Windows and bash: same HOST lock, then stop the listener

Windows PowerShell: py -m http.server 8000 --bind 127.0.0.1 in a throwaway folder, then curl.exe http://127.0.0.1:8000/ or Invoke-WebRequest http://127.0.0.1:8000 . Copy the request line from the server window. WSL and Git Bash can use the bash block as written. Record which OS and which client you used so the notes are reproducible on YOUR box. After the paste, Ctrl+C the server. Do not leave it bound to 0.0.0.0 overnight. Do not point http.server at someone else’s files.

Command guide

Copy YOUR request line — WHAT/WHY

═══ INSTALL ═══

Linux (Debian/Ubuntu):

Command — copy this

sudo apt install curl

Built-in (iproute2)

macOS: Use: netstat

Windows: Built-in (PowerShell: Invoke-WebRequest) Use: netstat

═══ COMMANDS ═══

Command — copy this

curl -sS -m 2 -v "http://127.0.0.1:8000/" 2>&1 | grep -E "GET |Host:" | head

Command — copy this

ss -ltn | grep 8000

4. Wrong vs right: café Wireshark / roommate tcpdump vs loopback http.server

Worked failure — same “I want to see a GET,” opposite target. Right never needs a second host when loopback will log YOUR curl.

  • Wrong

    Wireshark on café / hotel / campus Wi-Fi. tcpdump a roommate. ettercap or ARP spoof to “see more.” Bind 0.0.0.0 so the floor can hit you. Paste foreign IPs. Skip chmod. Call the lab incomplete without a stranger’s cookie. This course is not official CEH training and does not grade that hunt.

  • Right

    python -m http.server 8000 --bind 127.0.0.1 (HOST hardcoded). curl http://127.0.0.1:8000 . Copy YOUR request line into ceh-sniff-lab.txt, chmod 600 under $HOME/cyberlium-lab. Stop the server. Next: Quiz — Sniffing.

5. Hands-on: two terminals, curl, paste the log line, chmod 600, stop

Follow the block. Do not merge “start server” and “curl” in a way that leaves the server running unattended on shared Wi-Fi. When notes are filled, Ctrl+C the server. Windows notes sit at the bottom of the script comments.

Command guide

Stop the listener — WHAT/WHY then lock

═══ COMMANDS ═══

Command — copy this

cat > "$NOTES" << 'EOF'
HOST: 127.0.0.1
REQUEST_LINE: (paste GET / HTTP/1.1)
BIND: 127.0.0.1:8000
STOPPED: (Y after Ctrl+C)
ETHICS: no cafe capture
EOF

Mission: ceh-sniff-lab.txt — YOUR loopback GET, chmod 600

1) Start python http.server (or localhost_http_lab.py) with HOST / --bind hardcoded 127.0.0.1. curl http://127.0.0.1:8000 (or Python / Invoke-WebRequest). 2) Copy YOUR request line from the server log into $HOME/cyberlium-lab/ceh-sniff-lab.txt. chmod 600. Stop the server. 3) Ethics: never Wireshark on café Wi-Fi, never tcpdump a roommate, never ettercap. Original Cyberlium teaching, not official CEH, not a cert.

Stuck? Ask Cyberlium AI Mentor

If “the lab is incomplete without Wireshark on café Wi-Fi” still feels true, ask for a hint — not a capture recipe. Try: "Hint only: why HOST must stay hardcoded 127.0.0.1, why the http.server log of MY curl is the whole sniffing lab, why notes need chmod 600, and why café Wireshark / roommate tcpdump fail ethics?" You still fill ceh-sniff-lab.txt. No 0.0.0.0. No ettercap.

You caused both ends of a cleartext HTTP conversation on loopback, copied YOUR request line, locked the file, and closed the door. That is authorized sniffing literacy as Cyberlium teaches it — original, not an exam dump, not EC-Council lab text, not a cert. Next — Quiz — Sniffing — ten APPLY items on scope, ARP as a table not a weapon, TLS versus metadata, and why café and roommate captures stay out. Then Module 9: humans as the channel.

Knowledge Check

1

APPLY: curl http://127.0.0.1:8000 after python http.server you started prints a GET in the server log. What did the lab demonstrate, and what must you do next?

Multiple choice

Knowledge Check

2

APPLY: True or False: If loopback is boring, the ethical completion is tcpdump of a roommate and Wireshark on café Wi-Fi because Module 8 is “sniffing.”

True or False

Knowledge Check

3

APPLY: Which note file pairing matches this lab’s ethics and hygiene?

Multiple choice

Knowledge Check

4

APPLY: curl of http://192.168.0.1/ shows a home router login (TP-Link / Netgear / Huawei / "Router Admin"). Is that DEMO in scope as a hacking target?

Multiple choice

← Previous

Answer all 4 knowledge checks to continue. (0/4 answered)