Share via

Block apps from accessing internet by default...

Anonymous
2020-06-11T20:22:06+00:00

Good day guys,

I have decided to use my computer with Windows Defender as the security solution. I would like to keep my system as lean and lightweight, as is possible. But Windows Firewall is little complicated. And given that I am from a non-technical background, I don't want to tinker with it too much.

By default, I would like to block any program I install from accessing the internet, and only permit access as I think is necessary. For example, a video player I may download has no need to access internet for my use. I will manually check for updates as and when necessary.

When searching online, I found this:

https://sites.google.com/site/mytools4000/home/allow-block-multiple-programs-through-windows-7-firewall

This link contains a batch file that, when run as an administrator, will automatically block all .exe and .dll files within the folder (as well as sub-folders), where this batch file is located, from accessing the internet. Very nice little utility.

This is what I plan to do:

Except for the most important programs and those than need internet to work, I plan to install all other softwares in a separate folder called 'Programs' inside the C: drive. This folder will contain this batch file.

Here are my queries:

1. Is this batch file safe to run?

2. Do I need to run this batch file every time I install a program?

3. Will each run duplicate the previously created entries in Windows Firewall?

4. Will this slow down my system? As a test case, I installed just one program - VLC, and this batch file created well over 300 entries in Windows Firewall! 

5. Is my approach effective? Does this batch file completely block all internet connections? I tried to check for updates from within VLC, and it failed.

6. How do I block apps that I download from Microsoft Store?

Thanks very much in advance.

Windows for home | Windows 10 | Security and privacy

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

9 answers

Sort by: Most helpful
  1. Anonymous
    2020-06-14T12:06:26+00:00

    I consider my usage 'low risk'. Thats because I always scan every executable that I download with the resident security solution (BitDefender/ Norton/ Malwarebytes/ etc.), then I upload the file to virustotal.com for a second opinion. Only then I actually install the software, and I also pay attention to the options the installer gives to avoid unasked bundles. Despite all that, I have made a mistake a handful of time with very well known softwares like FileZilla, etc. And yeah, I always download from the official site, unless they link me to something like sourceforge, etc.

    Given that I do believe that my usage behaviour constitutes 'low risk', I have also decided to stick with Windows Defender & Windows Firewall for security, despite having over a year remaining in my current BitDefender Total 2020 subscription. Thats because I want to keep my system as lean/ lightweight, and therefore as fast, as possible.

    On a personal level, I like to have variety on a few choices, and therefore I like testing/ experimenting with stuff. This also has the benefit of not monopolising existing players, and giving opportunities for new developers to bring out new products and support development. 

    Before installing any software, I read several online reviews before narrowing down my choice. For example, there is no video file that VLC can't play, yet I wanted to try a different video player because I was tired of VLC interface. So based on several reviews, I found most of them recommended PotPlayer, so I tried it out. But I found that upon launching, it started giving me video recommendations, and I don't like that 'feature'. I just want it to play my local files and do absolutely nothing more. One way of doing that is to completely disable internet access to that app. I will update it as and when I want. Same principle holds true for other apps too.

    While it is a good practice to stick with tried and tested softwares (by the way the latest version of VLC is flagged by one of the engines on VirusTotal) only, I think it is also fine to try a few other alternatives available in the market.

    As with sticking with Store apps alone, while I too want to move in that direction, but we know that some of the best solutions live outside the store (probably to increase developer income) for genuine reasons. Why not support those? I don't mind paying for a software, but only as long as I am able to put sufficient safeguards in place.

    By the way, what do you think about TinyWall (https://tinywall.pados.hu/)? It seems to have the ability to allow LAN only access, something I (desperately) want.

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-06-12T08:56:11+00:00

    Ideally, I would like to configure the Firewall to Block by default all outbound rules (just like how it is for inbound rules), and then add exceptions (whitelisting) as and when a program requests. While I know how to change the default setting, I don't know how to whitelist all existing rules (which are allowed by default in a fresh Windows installation). If this can be done in a simple way, a batch file such as the one in the link would be unnecessary.

    3 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-06-13T18:15:20+00:00

    I found this link:

    https://old.reddit.com/r/Piracy/comments/btxlmc/how_to_automatically_add_everything_in_a_folder/epr971j/

    Basically, running the following command in Powershell as Administrator will automate this process:

    Get-ChildItem -Path C:\Programs -Filter *.exe |

    Select-Object Name,FullName |

    ForEach-Object `

    {New-NetFirewallRule -DisplayName "Block $($_.Name) Inbound" -Direction Inbound -Program "$($_.FullName)" -Action Block;

    New-NetFirewallRule -DisplayName "Block $($_.Name) Outbound" -Direction Outbound -Program "$($_.FullName)" -Action Block}

    Get-ChildItem -Path C:\Programs -Filter *.dll |

    Select-Object Name,FullName |

    ForEach-Object `

    {New-NetFirewallRule -DisplayName "Block $($_.Name) Inbound" -Direction Inbound -Program "$($_.FullName)" -Action Block;

    New-NetFirewallRule -DisplayName "Block $($_.Name) Outbound" -Direction Outbound -Program "$($_.FullName)" -Action Block}

    Here, C:\Programs is the folder where I am installing the programs. You have to change that to the location where you install your programs.

    That said, I have already run both the above commands on my computer. The question is will this keep duplicating the firewall entries as before? Or only add the new ones?

    Further, has anyone set this up successfully?

    2 people found this answer helpful.
    0 comments No comments
  4. Rob Koch 25,875 Reputation points Volunteer Moderator
    2020-06-13T19:10:32+00:00

    Sounds to me like you've defined your own personal issue, which is wanting to download software from anywhere and install all sorts of potentially risky software, but wanting to protect from something unexpected getting through that potentially risky activity.

    Most of us have learned that avoiding this practice of installing and testing all sorts of software is the better method, carefully choosing the relative handful of important apps and only installing from the vendors or another highly vetted source like the Microsoft Windows 10 Store.

    This is the direction that Microsoft has taken with Windows 10 S mode, not only limiting apps to the Store, but also removing most of the vulnerabilities from the operating system itself that have consistently led to malware.  On top of this, it removes many of the scripting and other tools that have been abused and sandboxes apps which only have limited ability to access the operating system and none to modify it.

    This is where Microsoft is focusing efforts, with the obvious eventual intent to drop Windows traditional desktop and executables completely, since that's the true problem you're trying to solve with a firewall workaround.

    You're putting lots of effort into an unwinnable game, playing with potential malware rather than truly avoiding it.  I've seen this many times in my computing career, while the only methods that truly work are always much simpler.

    Rob

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2020-06-12T08:50:49+00:00
    1. Running the batch every time will indeed create duplicate firewall rules. I wish there was some built-in checks that prevents duplication.

    For now, the only solution I can think of (and tested to confirm it works) is to reset the Firewall to default settings every time before running the batch file. That way there won't be any duplication.

    I hope someone helps with answering the remaining questions.

    Thanks.

    0 comments No comments