Ok, so minecraft is a very popular game, however it can cause no end of headaches for IT staff in schools, colleges or even the work place.
So how do we block minecraft? most try banning access to the website minecraft.net however there are offline versions that can be found and used to play offline on a network. The can download this to work areas, memory sticks or other devices and then run this from a multitude of places. This is why it is hard to block. This type of minecraft they use is it the form of a file named minecraft.jar (a java file). The first way I looked at blocking it was through black lists in the java runtime environment but I didn't have much luck, so I started out to understand how it worked and what we could do to stop it working.
When minecraft runs, it creates a folder in the user area to download update content and keep track of settings and such like. So I thought to myself what happens if I stop them accessing the files it needs to play the game?? Well like all games it no longer works!!! That being said to stop minecraft from working if we deny the user access rights to the settings folder it uses the game can no longer function and errors when loading up.
Minecraft creates the following directory :
If you have profiles stored on the server you may wish to check where this data folder is being created and adjust the code later accordingly.
If we set the deny permissions on this folder then the game will stop functioning with the following msg :
What happens if the directory doesn't exist? We cant set the permissions.... well if its doesn't exist lets create it ourselves and then deny access to it, so when the game loads it thinks the directory is there and then BAMM !
So it takes 2 simple lines of a batch file that needs to be run at logon to achieve this:
if not exist "%userprofile%\appdata\roaming\.minecraft" md "%userprofile%\appdata\roaming\.minecraft"
icacls.exe "%userprofile%\appdata\roaming\.minecraft" /deny "%Username%":(F,M,RX,D,W)
The code simply checks to see if the minecraft folders exists, if it doesn't create it .... then it uses icacls to set the permission to the folder and deny access to it preventing minecraft from working. Remember if the users appdata folder is not stored on the c:\ of the computer you will need to amend the code to point to the correct location.
So in short:
1) Create Bat file with code above
2) Create GPO and attach to users OU
3) In the GPO > user configuration > policies > windows settings > scripts > logon
4) Attach bat file to GPO and await replication.
IT Admin Staff 1 - Minecraft Users 0
Please remember to always test your code first. Deny access to the wrong folders etc can cause serious damage to your network environment so always test thoroughly first!!!!!!!
Tags : ban minecraft, ban mine craft, blocking minecraft, prevent minecraft, block offline minecraft, block offline mine craft.
Monday, May 19. 2014
Display comments as (Linear | Threaded)