AI Launch Lab
Sign in FR Get updates

Cybersecurity basics · Lesson 3 of 3

Spotting a misleading link

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.

Your turn

Write host(url), and suspicious(domain, url), which returns True unless the link’s host is exactly domain or ends with "." + domain.

Loading Python (about 12 MB, once)…

    Checks

    • ○ the exact domain is fine
    • ○ a real subdomain is fine
    • ○ a look-alike is suspicious
    • ○ a lookalike without the dot is suspicious
    • ○ capital letters don’t fool it

    Output

    ← Previous lesson All courses