Quiz — Python Basics
10-question quiz on Python’s role in security and core language basics
Python Basics — Module Quiz
Ten APPLY items on why analysts automate with Python (readability, stdlib batteries, speed of writing), the hacker-movie myth versus SOC glue, why Scapy and Impacket exist but this course stays on files, hashes, and localhost, str/int/list, for loops, def versus copy-paste, with open and pathlib, wordlists as parsing practice, the fictional sample_auth.log hunter, and chmod 600 on lab files. Wrong answers still teach. You will not scan strangers, open /etc/shadow, brute-force logins, or treat Module 2 sockets as permission to aim at a company. Scripts and notes stay in $HOME/cyberlium-lab on YOUR machine — no live passwords, no work production logs, no other people’s files. Carry the hunter pattern into the quiz: with open / pathlib, utf-8, needle in line, chmod 600 on even fictional logs. Printing a port list is still not a scan. requests comes later; Scapy and Impacket stay named, not assigned. Next after this quiz is Socket Programming: still authorized localhost / lab hosts you own, still not a Ethical Hacking exploit track.
APPLY: A classmate says Python is for “hacking companies fast” and wants to skip readability. Why do analysts and ethical hackers actually automate with it, and where do scripts live in this course?
APPLY: True or False: Unauthorized scanning or opening /etc/shadow is fine if the script is Python, and Scapy/Impacket being famous means this module is a Ethical Hacking exploit course.
APPLY: You need a SHA-256 of hello.txt you wrote and a JSON note of the digest. Which pairing, and what must the note not contain?
APPLY: host = "127.0.0.1" and ports = [22, 80, 443]. A teammate pastes three connect blocks instead of a loop. Types, and the scalable pattern before Module 2 sockets?
APPLY: Why does copying a five-line check twenty times fail as you add timeouts, and what keyword starts a reusable block?
APPLY: Select the defensive file-handling habits for this module. (Select 2)
APPLY: True or False: for line in f plus if needle in line is a real log-hunting pattern, and it still only applies to files you created or are allowed to have — fictional sample_auth.log, not a roommate’s mailbox.
APPLY: find_failed.py printed four lines including Accepted password. What likely went wrong, and what is a safe optional extra?
APPLY: open(path, "w") on hits.txt in the lab folder — what does the mode mean, and why chmod 600 the log and report?
APPLY: After this module, which lesson opens networking with Python, and which habits do you carry?