make own folder locker ( CLSID & CACLS basic method )

folder locker image

Y
ou must have read somewhere how to lock folders using CLSID . (Windows xp)
Just change extension to some CLSID number and lock folder.Its too easy.
Same thing I am going to do here , but I am going to it both with CACLS & CLSID commands.


So let's go :



What is this CLSID?
CLSID is short of class identity.

(CLSID) is a number that represents a unique id for a software application or application component.

example: CLSID {AE7AB96B-FF5E-4dce-801E-14DF2C4CD681}

CLSID is used by windows to know software components irrespective of their names.

It can be used to identify an application or a file or any other item.




What is CACLS?
CACLS is short of
Change Access Control Lists.
Well It is a command line utility for changing various access controls on a file or folder.



But what we are going to do here ??
We are going to do 2 things here.

  1. CLSID - Rename folders according to CLSID .
  2. CACLS - Apply security policies on folders .

  • 1] CLSID
Let me tell you a simple example.
We have a folder " X " .

We rename it to " X.{645FF040-5081-101B-9F08-00AA002F954E} ".

Take a try. Make a folder named X.{645FF040-5081-101B-9F08-00AA002F954E} .

It will look like recycle bin.

The long number After " X. " is called CLSID of recycle bin.




Let's make a batch file !
(copy code below >> paste in notepad >> save as "anything.bat"



ECHO OFF
title simple folder locker (CLSID)

COLOR F0
CLS

:start

echo.
ECHO ENTER THE NAME OF THE FOLDER U WANNA "lock" or "unlock"

SET/P "FOL=>"



CLS

echo.

ECHO PRESS "L" TO LOCK AND "U" TO UNLOCK THE FOLDER


SET/P "CHO=>"

CLS

IF %CHO%==L GOTO LOCK

IF %CHO%==l GOTO LOCK

IF %CHO%==U GOTO UNLOCK

IF %CHO%==u GOTO UNLOCK

CLS


:LOCK

MKDIR %FOL%

ren %FOL% %FOL%.{645FF040-5081-101B-9F08-00AA002F954E}

CLS

ECHO %FOL% FOLDER LOCKED....!!!!


CLS

GOTO END


:UNLOCK

ren %FOL%.{645FF040-5081-101B-9F08-00AA002F954E} %FOL%

CLS

ECHO %FOL% FOLDER UNLOCKED....!!!

CLS

GOTO end

cls





What does this code do???
This code make a folder with CLSID of recycle bin.

Just add contents to folder and lock it with this batch file.



Advantages:
1] Easy



Disadvantages:
2] When folder is renamed , it turns back to original (normal renaming).




  • 2] CACLS
I have explained another use of CACLS in post making own drive disinfector (for autorun.inf) using cacls.
Here we are going to make the folder locked applying security policies as "denied for all users".



Let's write a batch file, again !!
(copy code >> paste in notepad >> save as >> "blablabla.bat")



COLOR F0
CLS

ECHO OFF

:start

TITLE simple Folder Locker (CACLS)

CLS

echo.

ECHO ENTER THE NAME OF THE FOLDER U WANNA "lock" or "unlock"

SET/P "FOL=>"



MKDIR %FOL%

CLS

echo.

ECHO PUT YOUR FILES IN THE FOLDER NAMED AS "%FOL%"

ECHO.

ECHO PRESS "L" TO LOCK AND "U" TO UNLOCK THE FOLDER


SET/P "CHO=>"

CLS

IF %CHO%==L GOTO LOCK

IF %CHO%==l GOTO LOCK

IF %CHO%==U GOTO UNLOCK

IF %CHO%==u GOTO UNLOCK

CLS


:LOCK

CACLS %FOL% /D EVERYONE

CLS

ECHO %FOL% FOLDER LOCKED....!!!!

CLS

GOTO END



:UNLOCK
CACLS %FOL% /G EVERYONE:F

CLS

ECHO %FOL% FOLDER UNLOCKED....!!!

CLS

GOTO end

cls



What does this code do ??
It Simply lock folder by denying all users.



Advantages:
1] Coooooool

2] apply security policies hence lock folder (in real sense)

3] cannot be unlocked using normal ways.



Disadvantages:
1] Can be in a problem if user knows about application of CACLS command.

2] Or my computer >> tools >>folder options >>view >> extreme bottom >> untick use simple file sharing.
Then goto the locked folder >> properties >> security >> advanced >> owner>> tick replace owner >> ok >> again ok.




As we see in all my posts , there is a drawback of everything.
Point is that you know it or not.

If you know it , you will exploit it.
If you don't , then you will be exploited !




Comments