From 4edf8ced2062bed3853ad59c8490904f243dd206 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 14 Nov 2016 20:13:41 -0800 Subject: [PATCH] Firewall Puzzle --- EduNetworkBuilder/EduNetworkBuilder.csproj | 1 + EduNetworkBuilder/FirewallEditor.cs | 21 +- EduNetworkBuilder/NB.cs | 2 +- .../Properties/Resources.Designer.cs | 10 + EduNetworkBuilder/Properties/Resources.resx | 3 + .../Resources/Level2_FirewallTest2.enbx | 1360 +++++++++++++++++ 6 files changed, 1386 insertions(+), 11 deletions(-) create mode 100644 EduNetworkBuilder/Resources/Level2_FirewallTest2.enbx diff --git a/EduNetworkBuilder/EduNetworkBuilder.csproj b/EduNetworkBuilder/EduNetworkBuilder.csproj index 039eac2..f5fdf4f 100644 --- a/EduNetworkBuilder/EduNetworkBuilder.csproj +++ b/EduNetworkBuilder/EduNetworkBuilder.csproj @@ -255,6 +255,7 @@ + diff --git a/EduNetworkBuilder/FirewallEditor.cs b/EduNetworkBuilder/FirewallEditor.cs index aa2450d..5d17ba3 100644 --- a/EduNetworkBuilder/FirewallEditor.cs +++ b/EduNetworkBuilder/FirewallEditor.cs @@ -25,16 +25,6 @@ namespace EduNetworkBuilder void UpdateForm() { - if (lbRules.SelectedIndex >= 0) - { - btnDel.Visible = true; - btnEdit.Visible = true; - } - else - { - btnDel.Visible = false; - btnEdit.Visible = false; - } int selected = lbRules.SelectedIndex; lbRules.Items.Clear(); foreach (FirewallRule FW in FirewallDevice.FirewallRules) @@ -49,6 +39,17 @@ namespace EduNetworkBuilder if (lbRules.Items.Count > 0) lbRules.SelectedIndex = 0; } + //Make the buttons visible + if (lbRules.SelectedIndex >= 0) + { + btnDel.Visible = true; + btnEdit.Visible = true; + } + else + { + btnDel.Visible = false; + btnEdit.Visible = false; + } } private void btnNew_Click(object sender, EventArgs e) diff --git a/EduNetworkBuilder/NB.cs b/EduNetworkBuilder/NB.cs index b749900..cf42c4f 100644 --- a/EduNetworkBuilder/NB.cs +++ b/EduNetworkBuilder/NB.cs @@ -64,7 +64,7 @@ namespace EduNetworkBuilder Level1_MidDHCP, Level1_OneNetTwoSubnets, Level1_DuplicateIPs, Level0_NetworkLoop, Level1_DuplicateMAC, Level2_FirewallDemo, Level1_OneNetTwoSubnets2, Level2_VPN_Demo, Level2_Bad_VPN_IP, Level2_Bad_Encryption, Level2_Bad_Route, Level2_Blast_From_Past, Level2_Not_Working, Level2_Build_A_VPN, Level2_Connect_The_Dots, - Level2_VPN_woes, + Level2_VPN_woes, Level2_FirewallTest2, Level3_BlackHole, Level3_Busted, Level3_Middle_Man_Out, Level3_PhoneyNetwork, Level3_VPNify, Level3_EncryptionTroubles, Level3_NowhereToGo, Level3_GrandCentralStation, Level3_Dead, Level0_NetworkLoop2, Level0_BrokenLink, Level3_TwoDHCPServers, diff --git a/EduNetworkBuilder/Properties/Resources.Designer.cs b/EduNetworkBuilder/Properties/Resources.Designer.cs index 71df1c8..1f97293 100644 --- a/EduNetworkBuilder/Properties/Resources.Designer.cs +++ b/EduNetworkBuilder/Properties/Resources.Designer.cs @@ -472,6 +472,16 @@ namespace EduNetworkBuilder.Properties { } } + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] Level2_FirewallTest2 { + get { + object obj = ResourceManager.GetObject("Level2_FirewallTest2", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// diff --git a/EduNetworkBuilder/Properties/Resources.resx b/EduNetworkBuilder/Properties/Resources.resx index 3e115cf..d429be4 100644 --- a/EduNetworkBuilder/Properties/Resources.resx +++ b/EduNetworkBuilder/Properties/Resources.resx @@ -427,4 +427,7 @@ ..\Resources\Level6_TwoAccessPoints.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\Level2_FirewallTest2.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/EduNetworkBuilder/Resources/Level2_FirewallTest2.enbx b/EduNetworkBuilder/Resources/Level2_FirewallTest2.enbx new file mode 100644 index 0000000..1908f5d --- /dev/null +++ b/EduNetworkBuilder/Resources/Level2_FirewallTest2.enbx @@ -0,0 +1,1360 @@ + + + + + Firewall devices can have an advanced firewall. You can control which interfaces can ping which interfaces. This allows you to protect one side of the LAN from the other. We will use this functionality a lot more later on. +To do this puzzle, remove the firewall rule that is keeping the one side from pinging the other side. + Firewall Test 2 + 1024 + 1024 + 100 + False + 2 + 0.01 + 158 + full + False + False + + firewall0 + 100 + 100 + 410,410 + firewall + False + True + True + + 192.168.1.1 + 0.0.0.0 + 0.0.0.0 + gw + + + wan + wan0 + + 100 + 104 + firewall0 + wan0 + + wan + 104 + False + + + wan0 + + 192.168.5.1 + 255.255.255.0 + 0.0.0.0 + ip + + Untagged + + + + lo + lo0 + + 100 + 101 + firewall0 + lo0 + + lo + 101 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + eth + eth0 + + 100 + 102 + firewall0 + eth0 + + eth + 102 + False + + + eth0 + + 192.168.1.1 + 255.255.255.0 + 0.0.0.0 + ip + + Untagged + + + + eth + eth1 + + 100 + 103 + firewall0 + eth1 + + eth + 103 + False + + + eth1 + + 192.168.2.1 + 255.255.255.0 + 0.0.0.0 + ip + + Untagged + + + + 192.168.5.1 + 0.0.0.0 + 0.0.0.0 + route + + + 127.0.0.1 + 0.0.0.0 + 0.0.0.0 + route + + + 192.168.1.1 + 192.168.1.5 + 192.168.1.10 + route + + + 192.168.2.1 + 192.168.2.5 + 192.168.2.10 + route + + + eth0 + eth1 + Drop + + + + net_switch0 + 100 + 105 + 410,190 + net_switch + False + False + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 105 + 106 + net_switch0 + lo0 + + lo + 106 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + management_interface + management_interface0 + + 105 + 107 + net_switch0 + management_interface0 + + management_interface + 107 + False + + + management_interface0 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port1 + + 105 + 108 + net_switch0 + port1 + + port + 108 + False + + + port1 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port2 + + 105 + 109 + net_switch0 + port2 + + port + 109 + False + + + port2 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port3 + + 105 + 110 + net_switch0 + port3 + + port + 110 + False + + + port3 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port4 + + 105 + 111 + net_switch0 + port4 + + port + 111 + False + + + port4 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port5 + + 105 + 112 + net_switch0 + port5 + + port + 112 + False + + + port5 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port6 + + 105 + 113 + net_switch0 + port6 + + port + 113 + False + + + port6 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port7 + + 105 + 114 + net_switch0 + port7 + + port + 114 + False + + + port7 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + + net_switch1 + 100 + 118 + 230,410 + net_switch + False + False + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 118 + 119 + net_switch1 + lo0 + + lo + 119 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + management_interface + management_interface0 + + 118 + 120 + net_switch1 + management_interface0 + + management_interface + 120 + False + + + management_interface0 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port1 + + 118 + 121 + net_switch1 + port1 + + port + 121 + False + + + port1 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port2 + + 118 + 122 + net_switch1 + port2 + + port + 122 + False + + + port2 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port3 + + 118 + 123 + net_switch1 + port3 + + port + 123 + False + + + port3 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port4 + + 118 + 124 + net_switch1 + port4 + + port + 124 + False + + + port4 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port5 + + 118 + 125 + net_switch1 + port5 + + port + 125 + False + + + port5 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port6 + + 118 + 126 + net_switch1 + port6 + + port + 126 + False + + + port6 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port7 + + 118 + 127 + net_switch1 + port7 + + port + 127 + False + + + port7 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + + net_switch2 + 100 + 139 + 640,410 + net_switch + False + False + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 139 + 140 + net_switch2 + lo0 + + lo + 140 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + management_interface + management_interface0 + + 139 + 141 + net_switch2 + management_interface0 + + management_interface + 141 + False + + + management_interface0 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port1 + + 139 + 142 + net_switch2 + port1 + + port + 142 + False + + + port1 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port2 + + 139 + 143 + net_switch2 + port2 + + port + 143 + False + + + port2 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port3 + + 139 + 144 + net_switch2 + port3 + + port + 144 + False + + + port3 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port4 + + 139 + 145 + net_switch2 + port4 + + port + 145 + False + + + port4 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port5 + + 139 + 146 + net_switch2 + port5 + + port + 146 + False + + + port5 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port6 + + 139 + 147 + net_switch2 + port6 + + port + 147 + False + + + port6 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + port + port7 + + 139 + 148 + net_switch2 + port7 + + port + 148 + False + + + port7 + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + + pc0 + 100 + 115 + 640,190 + pc + False + False + + 192.168.5.1 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 115 + 116 + pc0 + lo0 + + lo + 116 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + eth + eth0 + + 115 + 117 + pc0 + eth0 + + eth + 117 + False + + + eth0 + + 192.168.5.2 + 255.255.255.0 + 0.0.0.0 + ip + + Untagged + + + + + pc1 + 100 + 128 + 230,600 + pc + False + False + + 192.168.1.1 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 128 + 129 + pc1 + lo0 + + lo + 129 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + eth + eth0 + + 128 + 130 + pc1 + eth0 + + eth + 130 + False + + + eth0 + + 192.168.1.2 + 255.255.255.0 + 0.0.0.0 + ip + + Untagged + + + + + pc2 + 100 + 135 + 90,590 + pc + False + False + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 135 + 136 + pc2 + lo0 + + lo + 136 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + eth + eth0 + + 135 + 137 + pc2 + eth0 + + eth + 137 + True + + + eth0 + + 192.168.1.5 + 255.255.255.0 + 192.168.1.1 + route + + Untagged + + + + + pc3 + 100 + 149 + 640,600 + pc + False + False + + 192.168.2.1 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 149 + 150 + pc3 + lo0 + + lo + 150 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + eth + eth0 + + 149 + 151 + pc3 + eth0 + + eth + 151 + False + + + eth0 + + 192.168.2.2 + 255.255.255.0 + 0.0.0.0 + ip + + Untagged + + + + + pc4 + 100 + 154 + 760,600 + pc + False + False + + 0.0.0.0 + 0.0.0.0 + 0.0.0.0 + gw + + + lo + lo0 + + 154 + 155 + pc4 + lo0 + + lo + 155 + False + + + lo0 + + 127.0.0.1 + 255.0.0.0 + 0.0.0.0 + ip + + Untagged + + + + eth + eth0 + + 154 + 156 + pc4 + eth0 + + eth + 156 + True + + + eth0 + + 192.168.2.5 + 255.255.255.0 + 192.168.2.1 + route + + Untagged + + + + + + 128 + 130 + pc1 + eth0 + + + 118 + 121 + net_switch1 + port1 + + + normal + 131 + + + + 118 + 122 + net_switch1 + port2 + + + 100 + 102 + firewall0 + eth0 + + + normal + 132 + + + + 100 + 104 + firewall0 + wan0 + + + 105 + 108 + net_switch0 + port1 + + + normal + 133 + + + + 105 + 109 + net_switch0 + port2 + + + 115 + 117 + pc0 + eth0 + + + normal + 134 + + + + 135 + 137 + pc2 + eth0 + + + 118 + 123 + net_switch1 + port3 + + + normal + 138 + + + + 100 + 103 + firewall0 + eth1 + + + 139 + 142 + net_switch2 + port1 + + + normal + 152 + + + + 139 + 143 + net_switch2 + port2 + + + 149 + 151 + pc3 + eth0 + + + normal + 153 + + + + 154 + 156 + pc4 + eth0 + + + 139 + 144 + net_switch2 + port3 + + + normal + 157 + + + pc1 + pc3 + SuccessfullyPings + + + pc3 + pc1 + SuccessfullyPings + + Firewall + Ping + Default + + \ No newline at end of file