windows-firewall

C# HttpListener and Windows Firewall

南楼画角 提交于 2019-12-06 05:24:59
问题 One of the programs i am working on has a built in webserver, meant to only handle very specific requests (static). Unlike a TcpListener, when the HttpListener is started, The user is NOT prompted to allow which networks the program is allowed to listen on. This is causing a big issue as the program needs to listen for remote connections, which are now being denied by the windows firewall. If i make a new rule in the windows firewall, and select my program under "Programs and Services",

Block .EXE in Windows Firewall with context menu

微笑、不失礼 提交于 2019-12-05 13:31:43
I got the following bit of code for a .REG file that adds "Add to Firewall" to the context menu on right clicking on a .EXE file. It simply creates an Outbound Rule in the windows firewall for that specific file you had selected instead of doing it manually. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\exefile\shell] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall] [HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall\command] @="netsh advfirewall firewall add rule name=\"%1\" dir=out action=block program=\"%1\"" http://oi46.tinypic.com/2rgnxaf.jpg My problem is that the following

Why does the Windows command shell tell me to use a different command and then say that command does not exist?

随声附和 提交于 2019-12-05 12:04:09
In connection with my handheld > server app using Web API RESTful methods problem discussed here ( Does an ASP.NET Web API app need to be installed into the "real" IIS before a handheld device can access its RESTful methods? ), I tried to verify I wasn't having a firewall problem by using the shell command delineated here: http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx , explicitly: netsh firewall add portopening TCP 80 IISExpressWeb enable ALL I also did it using port 777, as that is the one I've got set up in applicationhost.config: <bindings>

How to edit Firewall rules in code successfully on a Worker Role Instance?

谁说我不能喝 提交于 2019-12-04 16:08:18
I'm trying some code that works locally but it doesn't work on my cloud instance. I assume it may be permissions related, but I'm unable to fix it yet. Here is what I have which works when I debug my worker role locally, but nothing happens when it is published (on staging right now). string strCmdText = string.Format("advfirewall firewall add rule name=\"BlockU\" protocol=any dir=in action=block remoteip={0}", ip); ProcessStartInfo psi = new ProcessStartInfo("netsh.exe", strCmdText); psi.RedirectStandardOutput = true; psi.UseShellExecute = false; psi.CreateNoWindow = true; try { Process.Start

Updating existing firewall rule using API

扶醉桌前 提交于 2019-12-04 10:41:48
问题 I am able to pro grammatically add individual rules to the Windows Firewall (Server 2008 R2), however I am trying to avoid multiple rules per IP address, and would just like to update the existing rule RemoteAddresses. Below is the code I am using to add rules, I am doing my best to research how to update the existing rules Remote Addresses, but with no luck. Any help is appreciated! string ip = "x.x.x.x"; INetFwRule2 firewallRule = (INetFwRule2)Activator.CreateInstance(Type.GetTypeFromProgID

Create firewall rule to open port per application programmatically in c#

柔情痞子 提交于 2019-12-03 08:05:12
I need to open specific port for my application. I have tried using INetFwAuthorizedApplication rule per application for all ports. fwMgr.LocalPolicy.CurrentProfile.AuthorizedApplications.Add(app) Alternatively open one port for all appllications using INetFwOpenPort . firewallManager.LocalPolicy.CurrentProfile.GloballyOpenPorts.Add(port) Is there any way to programmatically open only single port per application programmatically? I can do it manually through firewall settings. Colin Pickard There's a question about blocking connections with an answer with instructions for creating firewall

Is there a way to get all IP addresses of youtube to block it with Windows Firewall?

。_饼干妹妹 提交于 2019-12-03 04:33:33
问题 I want to programme my own anti distraction tool. I can not / do not want to use hosts or third party apps. When using IPSEC or Windows firewall, it only accepts IP adresses. There is youtube.[264 TLD] www.youtube.[264 TLD] subdomains.youtube.[264 TLD] Appearantly there is no way anymore to get a complete list of youtube sub domains. Can someone think of a way to somehow obtain all youtube ip addresses and block them on ip level other than using brute force subdomain pinging? 回答1: If you have

Is there a way to get all IP addresses of youtube to block it with Windows Firewall?

拈花ヽ惹草 提交于 2019-12-02 17:45:40
I want to programme my own anti distraction tool. I can not / do not want to use hosts or third party apps. When using IPSEC or Windows firewall, it only accepts IP adresses. There is youtube.[264 TLD] www.youtube.[264 TLD] subdomains.youtube.[264 TLD] Appearantly there is no way anymore to get a complete list of youtube sub domains. Can someone think of a way to somehow obtain all youtube ip addresses and block them on ip level other than using brute force subdomain pinging? Shiplu Mokaddim If you have your own DNS server you can block domains from resolving. Here is a guide to block domains

ec2: cannot open port 5080 on windows instance

人走茶凉 提交于 2019-12-02 06:47:06
问题 I'm pretty new with ec2, firewall settings etc, so I might be missing something obvious, but: I've created a 'getting started with windows' instance with a security group that has 5080 specified and is associated with an elastic ip On the instance I have a red5 server running. when I run the server it on 127.0.0.1:5080, i can access it from a browser on that instance, so I know the server works. When I run it on the elastic IP however, I can't connect to it, neither from within the instance

Deploying NetFwTypeLib to manage the Windows Firewall

纵饮孤独 提交于 2019-12-01 01:14:09
问题 My Windows service needs to create/remove certain rules from the Windows firewall. For this I interface with NetFwTypeLib in <windows>\system32\hnetcfg.dll via COM. It works great on my 64-bit Windows 7 machine , but testing on another 64-bit Windows 7 machine throws the following error: Service cannot be started. System.IO.FileNotFoundException: Could not load file or assembly 'Interop.NetFwTypeLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system