0

In my firewall (Windows), I added rules for specific application. For example, "C:/A.exe" can open a TCP socket on the port 1234, but others application cannot. I need to be able, from an other app (will be C#), to see if "A.exe" can create a TCP socket on 1234. I tried looking at Netsh, Netcat or Powershell, I cannot find any solution. My only idea is to create a pipe between my app and A.exe, so my app can ask A.exe to check if it can create a socket on the specific port, and answer with the result...

Does anyone has an idea ? :/

Thanks

Gorz
  • 1
  • 1
  • 2
  • https://stackoverflow.com/questions/9471711/programmatically-manage-windows-firewall https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ics/windows-firewall-advanced-security-start-page?redirectedfrom=MSDN Looks like C++ would be a better choice, but as stated you could wrap the C++ code into an library and use it in C# – nanu_nana Jul 07 '20 at 08:51
  • Actually, there is nothing in this that can solve my problem. :s – Gorz Jul 07 '20 at 17:30
  • Does this not do exactly what you need ? https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ics/c-enumerating-firewall-rules – nanu_nana Jul 08 '20 at 13:31

0 Answers0