Cyberlium
Cyberlium
Cyberlium on Android·Google Play Store

Learn cybersecurity with hands-on labs and AI mentor support on your phone.

Mod 2 · Les 5/5
In progress
Module 2•Lesson 5 of 5•⏱️ 10 min read•Beginner+21 XP

Quiz — Python Networking

10-question quiz on sockets, HTTP, and responsible scanning

Quiz — Python Networking
00:00/01:42

Python Networking — Module Quiz

You treated TCP connect as “is anyone listening” on a host:port you are allowed to ask, with timeout so a drop fails instead of hanging. You used connect_ex as a 0-or-errno yes/no, distinguished bind (server) from connect (client), and kept HOST at 127.0.0.1. You installed requests on YOUR machine, GET/HEAD to example.com or a local http.server, read 200/301/403/404 and Server/CSP as observation — never login spray, never SQLi. You designed a connect scanner as a small loop whose scope is the control, then ran it on loopback and wrote $HOME/cyberlium-lab/localhost-scan.txt mode 600. These ten APPLY items test that judgment on fictional machines you own. No nmap of café Wi-Fi, ISP gear, school subnets, or random internet hosts. No credential stuffing. No verify=False as a default. Next — Automating Security Tasks — continues Python on chores you are allowed to script.

Practice QuizQuestion 1
Multiple choice
Q1

APPLY: socket.SOCK_STREAM + AF_INET, then connect_ex(("127.0.0.1", 1)) with settimeout(1.0) returns non-zero. Mechanism and move?

Practice QuizQuestion 2
True or False
Q2

APPLY: True or False: Skipping s.settimeout makes scanners faster because connect always returns immediately, and bind() is just the client-side spelling of connect().

Practice QuizQuestion 3
Multiple choice
Q3

APPLY: You pip install requests and GET https://example.com with timeout=5. Status 200, Server header present. A classmate wants to POST rockyou.txt at the campus login. Correct pair?

Practice QuizQuestion 4
Multiple choice
Q4

APPLY: Match the status code to the defender reading (not an attack plan). 200, 301, 403, 404 — which statement is correct?

Practice QuizQuestion 5
Select all that apply
Q5

APPLY: Select the responsible pair for a beginner connect scanner. (Select 2)

Practice QuizQuestion 6
Multiple choice
Q6

APPLY: connect_ex == 0 on 127.0.0.1:8000 after you started python -m http.server 8000 on THIS machine. What did OPEN prove?

Practice QuizQuestion 7
True or False
Q7

APPLY: True or False: verify=False is the safe default for production HTTPS monitoring, and HEAD is how you download the body faster so you can stuff a login.

Practice QuizQuestion 8
Multiple choice
Q8

APPLY: r.headers.get("server") and r.headers.get("content-security-policy") on example.com (or YOUR site). Defensive use?

Practice QuizQuestion 9
Multiple choice
Q9

APPLY: Lab file $HOME/cyberlium-lab/localhost-scan.txt should contain which set, and which mode?

Practice QuizQuestion 10
Multiple choice
Q10

APPLY: After this module, which next lesson starts scripting repetitive allowed chores (logs, generators, glue) — not a bigger unauthorized scan?

←Previous: Lab — Build a Port Scanner
Answer 10 practice quiz questions to unlock XP reward. (0/10 answered)
Skip quiz & read next →