Scenario 3: Block SSH (Port 22) Access to a Remote Machine

Objective: Block SSH (port 22) access to a remote machine.

Steps:

    Using Windows Firewall GUI:
        Open Windows Defender Firewall from the Control Panel.
        Click Advanced settings to open the Windows Firewall with Advanced Security window.
        Select Outbound Rules on the left-hand side.
        Click New Rule on the right-hand side.
        Choose Port for the rule type and click Next.
        Select TCP and specify port 22.
        Choose Block the connection and click Next.
        Select the profiles (Domain, Private, Public) and finish the rule.

    PowerShell Command: New-NetFirewallRule -DisplayName "SSI-Lab-Block SSH" -Direction Outbound -Protocol TCP -RemotePort 22 -Action Block

Verification: Try to establish an SSH connection using a client like PuTTY or PowerShell to the remote machine on port 22 (ssh user@remote_ip). The connection should be blocked.