Labs / Social Engineering / Social engineering: phishing, harvesters, lookalikes, watering holes and drive-bys

Lab 3 of 5 · Social engineering: phishing, harvesters, lookalikes, watering holes and drive-bys

Typosquatting: inventory the lookalike domains before they are used

Resolve a family of lookalike domains, sort the live squats from the gaps, and find the one armed to send mail.

Start this lab 5 steps

The idea

Joelle looks after security at Ferncliff Outdoor, a small gear shop whose domain is ferncliff.lab. A supplier forwards a payment request that looks like it came from Ferncliff, but the sender's address is a hair wrong. Joelle now wants to know what else someone has registered to look like Ferncliff. She will list the lookalike names: resolve a family of near misses, see which are live and which are still open, sort the tricks apart, and find the ones set up for mail.

Nothing here is attacked. Every step is a DNS lookup, a question to a name server, never a visit. Joelle learns where each name points without touching any of the hosts. What those hosts would serve belongs to the phishing-anatomy and credential-harvesters labs. Here the names themselves are the case.

Close on screen, unrelated in DNS
Close on screen, unrelated in DNS
One name, a family of fakes
One name, a family of fakes
An MX record makes a squat a sender
An MX record makes a squat a sender
Four names, one box
Four names, one box
Two lists, two moves
Two lists, two moves

Steps

  1. The real domain, and the first lookalike

    Start with the real name and one impostor side by side. DNS turns a name into an address. dig asks a name server that question and prints the answer, and +short prints only the address. Asking the lab's name server directly with dig @10.0.1.53 means you read exactly what it holds, with nothing cached in between.

    Ferncliff's own domain is ferncliff.lab. The forwarded message came from femcliff.lab. Read it closely: the rn in fern has become an m. On screen, in a sans-serif font, rn and m are nearly the same shape, and that is the trick. Resolve both and see where each lands.

    laptop:~# dig @10.0.1.53 +short ferncliff.lab
    laptop:~# dig @10.0.1.53 +short femcliff.lab
  2. Sort the family: which are live, which are gaps

    A lookalike rarely comes alone. The same operator usually registers a cluster, and there are only so many ways to bend one name. Work through the obvious candidates and resolve each. This time read the full answer, not only +short. A registered name comes back status: NOERROR with an address. An unregistered one comes back status: NXDOMAIN, "no such name". So one command sorts each candidate into live (someone owns it, and you see where it points) or open (nobody has registered it yet).

    The families to check: a homoglyph (one letter drawn like another, rn→m), a digit swap (i→1), a different ending (same name, .shop instead of .lab), and plain misspellings (a dropped or added letter). Resolve them and sort live from open.

    laptop:~# dig @10.0.1.53 ferncl1ff.lab
    laptop:~# dig @10.0.1.53 ferncliff.shop
    laptop:~# dig @10.0.1.53 fercliff.lab
    laptop:~# dig @10.0.1.53 ferncliffe.lab
  3. Which one is armed to send mail

    A lookalike that only resolves is a trap someone has to be sent to. A lookalike set up for mail is worse. It can write to suppliers as the brand and get their replies back, which is how invoice fraud and supplier-payment scams work. DNS publishes where a domain's mail goes as its MX record, so you can tell a mail-ready squat from a parked one without sending anything: ask for the MX.

    Ask for the MX of two of the live squats. Then read the TXT record of the one with mail. An SPF record (v=spf1 …) is a domain saying which servers may send mail as it. A squat that has published one is not parked: it is set up and expecting to send.

    laptop:~# dig @10.0.1.53 MX ferncliff-support.lab
    laptop:~# dig @10.0.1.53 MX femcliff.lab
    laptop:~# dig @10.0.1.53 TXT ferncliff-support.lab
  4. One operator behind all of them

    You have four live lookalikes. Are they four separate problems or one? DNS answers that too. Ask for all of them at once (dig takes several names in one command and prints an answer for each) and read the addresses. When a whole family of squats points at a single machine, you are not looking at scattered opportunists. You are looking at one operator who registered a set and aimed them all at one box.

    Resolve the four live squats together and compare where they land.

    laptop:~# dig @10.0.1.53 +short femcliff.lab ferncl1ff.lab ferncliff.shop ferncliff-support.lab
  5. The verdict, and closing the gaps

    The verdict is a typosquatting campaign: a family of lookalike domains, one of them set up for mail, registered to pass for Ferncliff and all pointed at one attacker box. Writing that down is half the job. The other half is acting on both lists.

    For the live squats, block them so a click or a mistype inside Ferncliff goes nowhere: a [[response-policy-zone|response policy zone]] on the company resolver refuses a name for every machine at once (that is the city-response-policy-zone lab), and you report the set for takedown. For the open ones, the NXDOMAIN near misses, the fix is to register the dangerous ones yourself before an attacker does. A few defensive registrations cost far less than one incident. Then set up monitoring, so the next squat in this family trips an alert the day it is registered.

    Confirm one of the open gaps is still yours to take.

    laptop:~# dig @10.0.1.53 fercliff.lab

Run these steps on real machines

Keep reading

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab