// Demonstrates the core windows firewall commands #include #include #include using namespace std; void main() { // Load windows firewall module mnStartFirewall(); // Output full information about firewall profile currently in use unsigned int cp = mnGetCurrentProfile(); cout << "FIREWALL INFORMATION\n"; cout << "Firewall enabled: " << mnGetFirewallEnabled(cp) << '\n'; cout << "Exceptions allowed: " << mnGetExceptionsAllowed(cp) << '\n'; cout << "Notifications enabled: " << mnGetNotificationsEnabled(cp) << '\n'; cout << "Unicast responses to multicast broadcast enabled: " << mnGetUnicastToMulticastEnabled(cp) << '\n'; cout << "Remote admin IP version: " << mnGetRemoteAdminIPVersion(cp) << '\n'; cout << "Remote admin scope: " << mnGetRemoteAdminScope(cp) << '\n'; cout << "Remote admin addresses: " << mnGetRemoteAdminAddresses(cp) << '\n'; cout << "Remote admin enabled: " << mnGetRemoteAdminEnabled(cp) << '\n'; cout << "ICMP allow outbound destination unreachable: " << mnGetICMPAllowOutboundDestinationUnreachable(cp) << '\n'; cout << "ICMP allow redirect: " << mnGetICMPAllowRedirect(cp) << '\n'; cout << "ICMP allow inbound echo request: " << mnGetICMPAllowInboundEchoRequest(cp) << '\n'; cout << "ICMP allow outbound time exceeded: " << mnGetICMPAllowOutboundTimeExceeded(cp) << '\n'; cout << "ICMP allow outbound parameter problem: " << mnGetICMPAllowOutboundParameterProblem(cp) << '\n'; cout << "ICMP allow outbound source quench: " << mnGetICMPAllowOutboundSourceQuench(cp) << '\n'; cout << "ICMP allow inbound router request: " << mnGetICMPAllowInboundRouterRequest(cp) << '\n'; cout << "ICMP allow inbound timestamp request: " << mnGetICMPAllowInboundTimestampRequest(cp) << '\n'; cout << "ICMP allow inbound mask request: " << mnGetICMPAllowInboundMaskRequest(cp) << '\n'; cout << "ICMP allow outbound packet too big: " << mnGetICMPAllowOutboundPacketTooBig(cp) << '\n'; system("PAUSE"); cout << "\n\n"; cout << "SERVICES INFORMATION\n"; cout << mnGetServiceAmount(cp) << " services found\n"; cout << "\n"; for(unsigned int n = 0;n> bDo; if(bDo == true) { cout << "Taking action...\n"; mnSetFirewallEnabled(cp, !FirewallEnabled); // bool is flipped cout << "Waiting "<