Challenge - 5 Problems
Firewall Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this UFW status command?
You run the command
- Allow SSH (port 22)
- Deny all incoming by default
What will the output show?
sudo ufw status verbose on a Linux server with these rules enabled:- Allow SSH (port 22)
- Deny all incoming by default
What will the output show?
Linux CLI
sudo ufw status verbose
Attempts:
2 left
💡 Hint
Think about the default policies and what rules you added.
✗ Incorrect
The default incoming policy is deny, outgoing is allow. SSH port 22 is allowed explicitly. Logging is on by default in verbose mode.
💻 Command Output
intermediate1:30remaining
What does this iptables command do?
You run this command:
What is the effect on the firewall?
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPTWhat is the effect on the firewall?
Linux CLI
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPTAttempts:
2 left
💡 Hint
Look at the chain, protocol, port, and action.
✗ Incorrect
The command appends a rule to the INPUT chain to accept TCP packets destined for port 80, allowing HTTP traffic in.
🔧 Debug
advanced2:00remaining
Why does this iptables rule cause an error?
You try to run:
But it returns an error. Why?
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPTBut it returns an error. Why?
Linux CLI
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
Attempts:
2 left
💡 Hint
Check if iptables accepts service names or only numbers for ports.
✗ Incorrect
Iptables requires numeric port numbers for --dport; 'ssh' is not recognized as a valid port number.
🚀 Application
advanced2:30remaining
Create a UFW rule to allow HTTPS only from a specific IP
You want to allow incoming HTTPS (port 443) traffic only from IP 192.168.1.100 using UFW.
Which command achieves this?
Which command achieves this?
Attempts:
2 left
💡 Hint
Think about specifying source IP, destination port, and protocol.
✗ Incorrect
Option A correctly specifies source IP, destination port 443, and TCP protocol to allow HTTPS only from that IP.
🧠 Conceptual
expert3:00remaining
What is the effect of this iptables command sequence?
Consider these commands run in order:
1.
2.
3.
What is the overall effect on incoming traffic?
1.
sudo iptables -P INPUT DROP2.
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT3.
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPTWhat is the overall effect on incoming traffic?
Attempts:
2 left
💡 Hint
Look at the default policy and the rules allowing specific traffic.
✗ Incorrect
The default policy drops all incoming packets. The rules allow packets part of existing connections and new SSH connections on port 22.