Latest / CyberCode Academy / Course 6 - Network Traffic Analysis for Incident Response | Episode 5: Scanning, Covert Data Exfiltration, DDoS Attacks and IoT Exploitation
Transcript
- 0:00Speaker 1: Welcome to the deep dive. Our mission today is, well,
- 0:03Speaker 1: it's pretty tactical. We're dissecting the network layer to really
- 0:07Speaker 1: understand the traffic signatures of major modern threats. So if
- 0:11Speaker 1: you're a cybersecurity student or an analyst, or really just
- 0:14Speaker 1: anyone who needs a shortcut to recognizing malicious activity on
- 0:17Speaker 1: the wire, this is for you.
- 0:19Speaker 2: That's a great way to put it. In this NonStop
- 0:22Speaker 2: battle against intrusion. Knowing the attacker's tradecraft is I mean,
- 0:25Speaker 2: it's your best defense.
- 0:26Speaker 1: And we're going to cover four main areas today.
- 0:29Speaker 2: We are we're going to look at the raw data
- 0:31Speaker 2: for four crucial thread categories. We'll start with reconnaissance, so
- 0:35Speaker 2: network scanning, then move to data exultration, then didas attacks,
- 0:40Speaker 2: and finally attacks targeting the Internet of things.
- 0:43Speaker 1: Okay, so we're moving from the initial peak inside to
- 0:46Speaker 1: the final hidden theft. We're going beyond theory and looking
- 0:49Speaker 1: at the forensic details, the packet flags, the protocol abuses,
- 0:53Speaker 1: all the tiny anomalies that give the game away exactly.
- 0:55Speaker 1: All right, let's unpack that crucial first step network scanning.
- 1:00Speaker 1: Any successful attacker starts here, right, but the traffic patterns
- 1:04Speaker 1: they change a lot, depending on their.
- 1:05Speaker 2: Goal they do exactly. Scanning traffic generally serves two very
- 1:09Speaker 2: distinct purposes. The first is what we'd call targeted reconnaissance.
- 1:13Speaker 1: Okay, so that's focus, very focus.
- 1:15Speaker 2: It's all about depth. An attacker uses a tool, maybe
- 1:18Speaker 2: like end map, on just one computer and they're trying
- 1:21Speaker 2: to figure print every single open port, every application running
- 1:24Speaker 2: on that host, just looking for one soft target and
- 1:27Speaker 2: the other type. The second is worm hunting. This is
- 1:30Speaker 2: all about breadth, not depth, like wanna cry exactly like
- 1:34Speaker 2: wantacry attackers or automated worms. They have an exploit for
- 1:37Speaker 2: one specific vulnerability, like SMB on port four to forty five.
- 1:41Speaker 2: Then they just scan huge numbers of machines vast ip
- 1:44Speaker 2: ranges looking for that single sign of weakness.
- 1:47Speaker 1: So the most common technique for this is the syn
- 1:49Speaker 1: scan or half open scam. It's fast, but it's also
- 1:53Speaker 1: pretty noisy. Can you walk us through how they exploit
- 1:55Speaker 1: the PCP henshake.
- 1:57Speaker 2: Sure, So the s yn scan only uses the very
- 1:59Speaker 2: first part of a normal TCP three way handshake. The
- 2:02Speaker 2: attacker sends a tcpsyn.
- 2:04Speaker 1: Packet and waits for a response.
- 2:06Speaker 2: Right if they get a s yn ack back, the
- 2:08Speaker 2: port is open, it's listening. If they get a reset
- 2:10Speaker 2: packet ports closed?
- 2:12Speaker 1: What if they get nothing?
- 2:13Speaker 2: If they get no response, they can assume a firewall
- 2:15Speaker 2: is filtering the traffic. After that, the attacker usually sends
- 2:19Speaker 2: a reset packet themselves, just to clean up the half
- 2:22Speaker 2: open connection so it looks more like a natural network error.
- 2:25Speaker 1: But as we said, that standard syn scan leaves a trace.
- 2:29Speaker 1: It's noisy, So how do they get really stealthy. Let's
- 2:32Speaker 1: talk about something like the Christmas tree scan.
- 2:34Speaker 2: Ah, the x Mas scan. It's a clever technique because
- 2:38Speaker 2: it leverages packet states that really shouldn't exist in normal traffic.
- 2:43Speaker 2: The attacker sends a packet where they set these completely
- 2:45Speaker 2: abnormal flag combinations.
- 2:47Speaker 1: Abnormal how specifically, the.
- 2:50Speaker 2: Fan, pouish and urgent flags are all set at the
- 2:53Speaker 2: same time. This makes the packet header look well lit.
- 2:56Speaker 1: Up like a Christmas tree exactly.
- 2:58Speaker 2: But the stealth comes from how the target responds to
- 3:01Speaker 2: this weird packet. Okay, if the port is open, the
- 3:04Speaker 2: TCP standard says the target should just ignore the malformed packet.
- 3:07Speaker 2: It sends nothing.
- 3:08Speaker 1: Back, so silence means it's open.
- 3:10Speaker 2: Silence means open. But if the port is closed, the
- 3:13Speaker 2: target sends a reset. And what's so crucial here is
- 3:16Speaker 2: that this method often bypasses stateful firewalls. Those are designed
- 3:20Speaker 2: to track normal connections. The whole s yn ack state.
- 3:24Speaker 2: This packet doesn't start a normal handshake, so it just
- 3:26Speaker 2: slips right past.
- 3:28Speaker 1: That's a fascinating way to use the rules of the
- 3:30Speaker 1: protocol against the system itself. But I think the gold
- 3:34Speaker 1: standard for anonymity has to be the zombie or idle
- 3:37Speaker 1: scan that one hides the attacker completely.
- 3:39Speaker 2: Oh. Absolutely. The idle scan is all about exploiting a
- 3:42Speaker 2: computer's incremental IPID number. You see, this number goes up
- 3:46Speaker 2: by one every single time that host sends any.
- 3:49Speaker 1: Packet out, So it's like a counter.
- 3:50Speaker 2: It's a counter. And the scan involves three parties, the
- 3:54Speaker 2: target you want to scan, the attacker, and an unwitting dupe,
- 3:58Speaker 2: the zombie machine.
- 3:59Speaker 1: So how does it work.
- 4:00Speaker 2: Well, First, the attacker probes the zombie to see what
- 4:02Speaker 2: its current IPID number is. They just record it. Second,
- 4:06Speaker 2: the attacker spoofs the syn packet, but they use the
- 4:09Speaker 2: zombies's ip as the source and they send that to
- 4:11Speaker 2: the target.
- 4:11Speaker 1: Okay, and this is the key part.
- 4:12Speaker 2: This is the key. If the target's port is open,
- 4:16Speaker 2: the target sends a s ynack back to the zombie
- 4:19Speaker 2: because it thinks the zombie started the conversation.
- 4:22Speaker 1: But the zombie didn't.
- 4:23Speaker 2: It didn't, so it receives this unexpected s ynack and
- 4:27Speaker 2: immediately sends a reset packet back to the target to
- 4:30Speaker 2: kill the connection. And that action sending that reset forces
- 4:34Speaker 2: the zombie to increment its IPID number.
- 4:36Speaker 1: So the zombie just betrayed the target status without even
- 4:40Speaker 1: knowing it. How would you spot that in a traffic capture?
- 4:43Speaker 1: What's the red flag?
- 4:44Speaker 2: The jump in the ID? The attacker probes the zombies'
- 4:47Speaker 2: IPID a second time. If the IDA has gone up
- 4:49Speaker 2: by two increments, one for their initial probe, one for
- 4:52Speaker 2: the forced reset, they know the target port was open.
- 4:55Speaker 2: If it only went up by one, the port was closed.
- 4:57Speaker 2: The attacker never had to directly contact a target.
- 5:00Speaker 1: All all right, moving past reconnaissance. Once an attacker has
- 5:03Speaker 1: found what they want, the challenge becomes getting that valuable
- 5:05Speaker 1: data out without triggering alarms. What are some of the
- 5:08Speaker 1: most counterintuitive protocols they abuse?
- 5:11Speaker 2: For this? They rely on what we call covert channels,
- 5:14Speaker 2: basically using protocols that security teams assume don't carry any
- 5:18Speaker 2: real data. A great example is SMB, the server Message
- 5:22Speaker 2: Block protocol for file sharing exactly. We've seen captures where
- 5:26Speaker 2: data was xfiltrated, one single bite at a time, hidden
- 5:29Speaker 2: inside what looked like legitimate SMB red responses.
- 5:32Speaker 1: One bite at a time. That's incredibly slow.
- 5:35Speaker 2: It's slow, but it's also incredibly hidden, and the data
- 5:38Speaker 2: is heavily obscured. First, it's Base sixty four encoded, which
- 5:41Speaker 2: is pretty standard. But here's the really smart part. The
- 5:44Speaker 2: entire basicty four string.
- 5:46Speaker 1: Is then reversed, reversed Why it.
- 5:48Speaker 2: Defeats automated analysis. A lot of security tools look for
- 5:51Speaker 2: common Base sixty four patterns like the header's AA or PD.
- 5:54Speaker 2: By reversing the whole string, they completely break those simple
- 5:57Speaker 2: signature matching rules.
- 5:58Speaker 1: That shows an incredible attention to detail. Okay, Another really
- 6:01Speaker 1: clever approach is abusing error messages. Why would an attacker
- 6:05Speaker 1: use ICMP for data? theF I mean that's just for
- 6:07Speaker 1: network diagnostics.
- 6:09Speaker 2: Because ICMP is almost universally overlooked. It might get filtered
- 6:13Speaker 2: for volume, you know, to stop a ping flood, but
- 6:15Speaker 2: rarely for its actual content.
- 6:17Speaker 1: So a big spike in ICMP traffic would be a
- 6:20Speaker 1: red flag.
- 6:21Speaker 2: A big spike in malformed or odd ICMP packets, Yes,
- 6:25Speaker 2: that's an immediate red flag. In one analysis, we actually
- 6:29Speaker 2: found the stolen data was hidden directly inside the ICMP
- 6:33Speaker 2: type code field.
- 6:34Speaker 1: Inside the header field itself.
- 6:36Speaker 2: Yes, the analysts just had to extract the type codes
- 6:38Speaker 2: from a sequence of these packets, and when they translated
- 6:41Speaker 2: them they got GIF.
- 6:43Speaker 1: The file ragic number for a Jiff image exactly.
- 6:46Speaker 2: It confirmed the attacker was systematically rebuilding a stolen JIFF
- 6:49Speaker 2: bite by bite, right under the nose of standard monitoring.
- 6:51Speaker 2: Everyone's looking for a huge data transfer and the attacker's
- 6:54Speaker 2: just sending these tiny packets that look like simple network housekeeping.
- 6:58Speaker 1: Let's switch gears from subtle theft to brute force. Let's
- 7:01Speaker 1: talk D'DOS distributed denial of service. We all know about
- 7:05Speaker 1: simple attacks like a syn flood, But what's the key
- 7:08Speaker 1: evolution we're seeing indeed OS traffic today.
- 7:10Speaker 2: The big innovation is the move to amplification and reflection attacks.
- 7:14Speaker 2: It's all driven by asymmetry. Yes, the goal is to
- 7:17Speaker 2: make a small request from the attacker result in a
- 7:19Speaker 2: massive load on the target. This drastically reduces the bandwidth
- 7:23Speaker 2: the attacker needs, which makes the whole attack cheaper and frankly,
- 7:27Speaker 2: much easier to pull off.
- 7:28Speaker 1: Okay, break that down for us. How do they turn
- 7:31Speaker 1: a tiny request into a response that's hundreds or even
- 7:35Speaker 1: thousands of times bigger.
- 7:36Speaker 2: They exploit protocols that just naturally have tiny requests and
- 7:40Speaker 2: huge replies. Think of DNS or an older one charge in.
- 7:45Speaker 2: The critical part is that the attacker first spoofs the
- 7:49Speaker 2: source IP address of their request. They make it look
- 7:51Speaker 2: like it's coming from the target.
- 7:52Speaker 1: AH, So they're not sending it to the target directly.
- 7:55Speaker 2: No, they send a tiny packet to a vulnerable third
- 7:57Speaker 2: party server we call the amplifier, and that server sends
- 8:00Speaker 2: a massive response directly to the victim's IP address.
- 8:02Speaker 1: Do you have a good example of that.
- 8:04Speaker 2: The most extreme one we've seen lately involves memecash servers.
- 8:08Speaker 2: If an attacker can store a large amount of data
- 8:10Speaker 2: and a vulnerable memcash server first a tiny get request,
- 8:14Speaker 2: maybe just one point six kilobytes.
- 8:16Speaker 1: Spoofed from the target's IP spoofed.
- 8:18Speaker 2: From the target's IP MMM, that tiny request can trigger
- 8:22Speaker 2: a gigantic data response. We've seen examples where it triggered
- 8:26Speaker 2: four point four megabytes of data sent to the victim.
- 8:29Speaker 2: It turns a simple server into a devastating weapon.
- 8:32Speaker 1: Which brings us to our final section. The weakest link.
- 8:36Speaker 1: The explosion of IoT devices, cameras, smartlights, you name it
- 8:41Speaker 1: has created this massive new attack surface, mostly because of
- 8:44Speaker 1: their famously poor security.
- 8:46Speaker 2: Oh, it's painfully obvious. In the traffic. We see devices
- 8:49Speaker 2: being accessed using plaintext protocols like telnet, tilnet, tellnet, and
- 8:53Speaker 2: the attackers are just supplying common, easily guessed credentials, things
- 8:57Speaker 2: like root for the username and a default password like
- 9:00Speaker 2: XC thirty five to eleven. This tiny list of hard
- 9:02Speaker 2: codeed credentials is basically how massive botnets like mir I
- 9:06Speaker 2: were born.
- 9:06Speaker 1: So what happens after they get in with a successful
- 9:08Speaker 1: telnet log in? How do you see that device get
- 9:10Speaker 1: weaponized in the network traffic, Well.
- 9:13Speaker 2: The device is immediately recruited into a botnet. The traffic
- 9:16Speaker 2: shows the attackers trying to download and execute malware binaries,
- 9:19Speaker 2: often their ELF binaries.
- 9:21Speaker 1: Which is the standard executable format for Linux and Unix
- 9:24Speaker 1: like systems right.
- 9:25Speaker 2: Which is what most of these IoT devices are running.
- 9:28Speaker 2: They try to pull the file down with a simple
- 9:30Speaker 2: HTPP get request. But if their usual tools like TFTP aren't.
- 9:36Speaker 1: Available, TFTP being the trivial file transfer protocol.
- 9:40Speaker 2: Yes, if that's not on the device, the attacker has
- 9:42Speaker 2: to switch tactics entirely.
- 9:44Speaker 1: And this is where it gets kind of primitive right.
- 9:46Speaker 2: Precisely, they fall back to built in command line utilities,
- 9:51Speaker 2: specifically the echo command. They use it to manually build
- 9:54Speaker 2: the malicious executable bye by bite right there on the
- 9:57Speaker 2: victim's file system before they can run it. So if
- 10:00Speaker 2: you see a huge volume of Echo commands in the traffic,
- 10:03Speaker 2: that's a massive red flag.
- 10:05Speaker 1: And crucially this creates a huge blind spot for our
- 10:07Speaker 1: perimeter defenses.
- 10:08Speaker 2: Absolutely. Once that malware is running on the IoT device,
- 10:12Speaker 2: it often starts performing internal port scans looking for other
- 10:14Speaker 2: vulnerable systems on the local network. And since all this
- 10:17Speaker 2: is happening inside the perimeter, any monitoring that only watches
- 10:20Speaker 2: traffic coming in and out of the network completely misses it.
- 10:23Speaker 1: So if we look back at this whole life cycle,
- 10:25Speaker 1: we've gone from subtle recon with things like the zombie
- 10:28Speaker 1: scan to incredibly obscure data THEFT hiding files inside ICMP
- 10:34Speaker 1: type codes, and.
- 10:35Speaker 2: Then to root force overload with these asymmetric amplification attacks, all.
- 10:40Speaker 1: Of it powered by the weakest links in our infrastructure.
- 10:43Speaker 2: The key takeaway, I think for any analyst is to
- 10:45Speaker 2: develop an eye for the anomalies. Don't just look at
- 10:48Speaker 2: the volume of traffic. Look for the out of sequence packets,
- 10:51Speaker 2: the unusual flags from an X ANDASCAN protocols carrying data
- 10:54Speaker 2: they should never carry, or those asymmetric traffic flows. Modern
- 10:58Speaker 2: security means you have to look beyond the obvious. You
- 11:00Speaker 2: have to dive into the protocol headers.
- 11:02Speaker 1: Themselves fascinating and to leave everyone with a final thought
- 11:05Speaker 1: to mull over. We've seen how attackers repurposed ICMP and
- 11:08Speaker 1: SMB to steal data. So what other common non data protocols,
- 11:13Speaker 1: maybe something related to authentication or even time synchronization, might
- 11:17Speaker 1: be secretly repurposed as a covert channel right now, flying
- 11:21Speaker 1: completely under everyone's radar.