Cybersecurity basics · Lesson 3 of 3
Cybersecurity basics · Lesson 3 of 3
Phishing messages often show one address and link to another. What counts is the host: the part of the link after https:// and before the next /. In https://launchlab.ai.secure-login.example/reset, the host is launchlab.ai.secure-login.example: it belongs to whoever owns secure-login.example, not to launchlab.ai.
Read a host from the right. A legitimate subdomain ends with the real domain: www.launchlab.ai and quantum.launchlab.ai both end with .launchlab.ai. A look-alike only contains it somewhere.
Python’s urllib.parse.urlparse(url).hostname extracts the host and lowercases it for you.
Write host(url), and suspicious(domain, url), which returns True unless the link’s host is exactly domain or ends with "." + domain.
All checks pass. Well done.
You finished this course. All courses
An AI tutor that gives hints, not answers. It sees your code, its output and this lesson. It can be wrong.