FF
LAB

FreshFlow Malware and Application Attacks

Lab 01 · SSH Brute Force, sshguard & DoS · Guided / Introductory

Mission Briefing: Malware & Application Attacks

tap to collapse â–¾

Security+ 2.4 / 2.5 / 4.3MITRE ATT&CK T1110.001 / T1498CIA: Availability & Confidentiality

SSH brute force: an attacker systematically tries username/password combinations against an exposed authentication service until one succeeds. ncrack automates this against SSH, RDP, and other network logon protocols. sshguard parses authentication logs in real time and, after a threshold of failed attempts from one source, feeds a block rule into the host firewall (iptables) — a working example of intrusion prevention through log correlation.

Denial of Service (DoS): rather than compromising credentials, a DoS attack overwhelms a target's resources (CPU, memory, connection table, or link bandwidth) so legitimate users cannot reach the service — an attack on the availability leg of the CIA triad. At the network edge, a firewall like pfSense can blacklist an offending source into a persistent table so the block survives rule reloads.

Disk-level attacks (e.g., destructive wiper malware or ransomware that encrypts/erases storage) are the most severe availability attack — recovery may require full restoration from backup. This lab does not execute destructive disk commands; treat this as a conceptual note tied to your incident-response planning, not a hands-on step.

  • Objective 1: Use Kali Linux to enumerate and brute-force SSH on the Ubuntu server with ncrack.
  • Objective 2: Deploy and validate sshguard on the Ubuntu server, then confirm the attacker is blocked.
  • Objective 3: Launch a DoS attack from Kali, observe the impact from the Windows client, then mitigate at the pfSense firewall.
  • Objective 4: Analyze logs and firewall state to confirm each control worked as designed.

Kali Linux — Attacker

203.0.113.2/29 (external)

kali / kali

pfSense — Firewall

192.168.0.1/24 (edge)

sysadmin / PassLAN153!

UbuntuSRV — Target

172.16.1.10/28 (DMZ)

sysadmin / PassLAN153!

WinOS — Client

192.168.0.50/24 (internal)

Administrator / PassLAN153!

This topology mirrors a segmented enterprise network: an external attacker, a pfSense firewall mediating WAN/DMZ/internal zones, a DMZ-hosted Ubuntu server, and an internal Windows client. All four devices are console-only for this simulation — no external tools or lookups required.

Network Topology

Kali (Attacker) 203.0.113.2/29 pfSense 192.168.0.1/24 WinOS (Client) 192.168.0.50/24 UbuntuSRV 172.16.1.10/28 DMZ segment

Status: baseline — all services reachable, no active attack.

SSHGUARD: NOT INSTALLED FIREWALL: DEFAULT

Objectives

0 / 100 pts

    Task Directions — Read Before You Type

    Complete these in order. Each step names the terminal tab to use and explains the tool and flags you'll need — but not the finished command. Work out the exact syntax yourself; if you get stuck, the 💡 Hint button gives you a conceptual nudge on the first click and reveals the exact command to type on the second.

    Every control in this lab — ncrack, sshguard, iptables, hping3, pfctl — is a real tool with its own flags, and those flags are not arbitrary: each one encodes a decision an analyst has to make (which account to target, which port to probe, whether to wait for a reply, which table to update). Reading a command someone else wrote and typing it back rarely sticks; reasoning out why a flag belongs in a command does. So as you move through the four objectives above — recon, brute force, contain with sshguard, then pivot to a DoS flood and mitigate it at the firewall — read each step's explanation fully before you touch a terminal, sketch out what you think the command should look like, and only reach for a hint once you've made a real attempt.

    1. KALI Scan the target. Switch to the kali@attacker tab. Before attacking any service, confirm it's actually listening and identify what's running on it — attacking blind risks the wrong technique for the wrong version. nmap can restrict a scan to a single port instead of sweeping all 65,535, and in the same pass it can probe that port for a service banner and version string rather than just reporting it open or closed. You'll need the flag that narrows the scan to port 22 (SSH) and the flag that turns on version detection, plus the target's DMZ address from the briefing above.
    2. KALI Brute force SSH. Still on the kali@attacker tab, launch a credential attack against SSH with ncrack. Ncrack needs three pieces of information: which account to target (a lowercase flag for the username), where to pull candidate passwords from (an uppercase flag pointing at a wordlist file — this lab supplies one named wordlist.txt), and which service to attack, expressed as a protocol://host pair rather than a bare IP. With no defenses running yet, a correctly-formed attempt should recover a working credential pair.
    3. UBUNTUSRV Review the evidence. Switch to the sysadmin@ubuntusrv tab. sshd logs every authentication attempt — success or failure — to the system auth log. You don't need to page through the entire file, only its most recent activity, so use the command that prints just the last handful of lines of a file rather than the whole thing. Look for a burst of failed logins from 203.0.113.2 immediately followed by a success — the signature of a brute-force attack.
    4. UBUNTUSRV Deploy the defense. On the same tab, bring in sshguard — the intrusion-prevention service that tails auth.log and, once a source crosses a failure threshold, pushes a live block rule into the host firewall. Installing a package is one command; getting a service running is a second, separate step. Rather than issuing that second step as two commands (enable it for next boot, then start it now), one systemctl subcommand does both at once — think about which one.
    5. KALI Retry the attack. Back on the kali@attacker tab, this isn't a new command to work out — repeat the exact ncrack attempt from step 2, unchanged, as a controlled retest. Compare what comes back now that sshguard is watching the log.
    6. UBUNTUSRV Confirm the block. sshguard doesn't just log the attempt — it inserts a live rule into iptables. One flag lists the currently loaded rule chains; another keeps addresses shown as raw numbers instead of resolving reverse DNS for each one, which is both faster and avoids leaking lookups. Pipe that listing through grep for the chain name sshguard creates so you're not scanning the whole ruleset by eye.
    7. KALI Shift tactics to DoS. Credential attacks are now blocked, so the attacker pivots from confidentiality to availability. hping3 crafts and sends raw TCP packets at high volume. You'll need a flag that marks each packet as the start of a new handshake (a SYN flag), a flag that selects the destination port to aim at (80, since that's what UbuntuSRV is serving), and a flag that tells hping3 to fire as fast as possible without waiting for replies.
    8. WINOS Observe the impact. Switch to the WinOS tab. No special flags are needed here — a plain reachability test against 172.16.1.10 will show you exactly what a legitimate user experiences while the flood is saturating the target.
    9. PFSENSE Block it at the edge. Switch to the pfSense shell tab. pfctl can insert an address into a named, persistent table that the ruleset already references — the block takes effect immediately, with no rule reload needed. Work out how the table name (blocklist) and the attacker's address (203.0.113.2) are supplied to the "add" action.
    10. PFSENSE Verify the block. On the same tab, confirm the address actually landed in the table — pfctl can list a table's current contents. (You could alternatively inspect live connection states and filter for the attacker's address, to confirm nothing new is being permitted.)
    11. Finish with the Knowledge Check that unlocks below once every step above is complete, then click Grade My Work.
    Kali Linux — 203.0.113.2
    kali@attacker:~$