Kali Linux, Penetration Testing

How to Lock Drive of Remote Windows Victim PC

First Hack the Victim PC Using Metasploit (Tutorial How to Hack Remote PC)

Once you got the meterpreter session use ‘shell ‘command to get command prompt of the target.

Type Cacls (Drive Name) /e /p everyone:n and press Enter.This will lock your “E Drive” 

Solution For Unlock

Now right-click on your E drive –> Properties –> Click on “Security” tab click on continue

Check the check box “Full Control” –> Click on OK.


FileName   Required. Displays DACLs of specified files.

/t   Changes DACLs of specified files in the current directory and all subdirectories.

/e   Edits a DACL instead of replacing it.

/c   Continues to change DACLs, ignoring errors.

/g   User: permission   Grants access rights to the specified user. The following table lists valid values for permission.

Value Description
n None
r Read
w Write
c Change (Write)

Full Control