Tutorial - Dir Locking - NT Basics

Dir Locking - NT Basics

Updated: 12-01-01
by jtp10181

  1. Introduction
  2. Necessary Tools
  3. Getting Started
  4. Simple Locked Dir
  5. Reserved Words Locked Dir
  6. Special Locked Dirs
  7. Closing Notes


So you've heard people talking about locking folders before you upload... what that heck is it you ask?  Most people are reluctant to go into details because of all the questions that arise.  In this tutorial I hope to cover all the basics of locking folders to make your pub safe from wondering deleters.  If you need information on breaking your locked folders head over to Dir Locking - Breaking Dirs.

I'd like to note that I took most of this information from a pubbing guide written by hawk from Net Knowledge Base.  I have been informed that he also devised these methods himself, so big thanks to him for his hard work.  I only take credit for rewriting his wonderful information to make a little easier to understand and follow.

In this tutorial assume [sp] is a blank space, this way you can easily see where the spaces are without confusion.  When using this I will sometime put in brackets [] what the dir looks like with the actual spaces in it

Necessary Tools

  • FlashFXP - A great ftp client designed with the FXP Groups in mind.

Getting Started

First thing you need is a good pub to test stuff out on.  In this tutorial we will be working with a deletable NT pub as they are the easiest to do this with.  So head over to your local FXP board and find a NT pub that is "deletable."  Since UNIX and NT have different file systems, locking directories on UNIX is completely different and is covered in Dir Locking - UNIX Advanced.  Once you've got that load FlashFXP and connect to it, then go to the pub directory, this is where you have access to create and remove directories and files.

Simple Locked Dir

*NOTE: In this section all directory names can be replaced with whatever you want unless otherwise specified.  The spaces are what's important, not the folder names.

A simple locked directory is easily defeated but with a lot of them it can make getting into further directories a hassle and many will give up easily.  In the directory you want to setup a locked folder right click and select "Make Folder."  In the dialog box type the following:


Now we have a locked directory, if you try to enter it the server will spit out some sort of error message, usually "550 The system cannot find the file specified."  To access a locked dir we need to make a higher level directory which is done by making another new folder as follows:


Notice that we did not use  the second space when creating the second dir, that is because that is a placeholder and is what actually locks the folder.  It is not part of the actual directory structure of the pub.  To get inside your new directory you simple add the following to the directory path at the top of the window in FlashFXP:


You will now be inside your locked folder and should have no problems creating more directories or uploading files.  If it cannot find the directory you either have a weird pub or did something wrong.  Try the procedure again and look for error messages in the status window.  Some NT pubs do not allow the creation of locked dirs of this type.  Also it is bad idea to make a locked folder in the root of a pub because the sysop will easily find it and probably notice his security holes and fix them (no more pub for you).

If you would like to remove this directory there is a special procedure for doing this.  Notice if you simply hit del on it the server will have problems accessing the directory.  To remove it we need to manually put the RMD commands in ourselves.  From the base directory (where you started creating the locked folder) select Commands -> Raw Commands from the menu bar and put the following in the dialog box:

rmd locked[sp]/access

That should remove the second folder we made and to remove the locked folder put in:

rmd locked[sp]/[sp]/

Now if you refresh the server window the folder should be gone.  Again if it did not work try it again and watch for errors, some servers do not allow the removal of directories.  Now that you know how to create a basic locked folder we can move on some more advanced techniques.

Reserved Words Locked Dir

As I said in the last section those directories can be easily cracked.  This is done by a method called "cloning" which I'm not going to go into here because I am focusing on locking dirs, not cracking them.  All you need to know is that it exists and is very easy to do.  There are some dirs that cannot be cloned a NT file system because they use reserved words in their name.  The most common reserved words are:


In LPT and COM the # should be replaced by any number you wish, this makes it possible to have a vast number of un clone-able locked folders.  To create/remove one of these directories you follow the procedure in the Simple Locked Dir section replacing "locked" with one of the reserved words above.  If you try to create a directory with a reserved word without the spacing at the end the server will give an error message usually saying that it's an illegal filename.

Special Locked Dirs

There are also a few other locked dirs that are a little more tricky to crack and don't use reserved words.  These dirs need to be created a different way because of leading spaces in the names, look closely for the creation differences.  The dir we will try can be made as follows:

./[sp].[sp]locked[sp].[sp]/[sp]/ - [./ . locked . / /]

./[sp].[sp]locked[sp].[sp]/access - [./ . locked . /access]

Notice the leading "./" in the dir name, well the "." is a special command that tells the server to use the current directory, if that is omitted then the next character, "/", tells the server to use root in which case your folder would be made in the root of the server.  The "/" still needs to be after the "." to signify the beginning of the dir name so the leading space is included, although it is not necessary in this example it just adds and extra touch to the dir.  The reason this is a special dir is because it cannot be cloned.  If you try to create another folder without the place holder "/ /" at the end the "." will be dropped along with spaces because it will assume the "." is for a file extension.

It is also possible to create a folder that is invisible, meaning it cannot normally be viewed in the directory structure of a pub.  To do this we create a directory consisting only of spaces like this:

./[sp]/[sp]/ - [./ / /]

./[sp]/access - [./ /access]

Now if you are in the directory you created this from you will not see any directories because the FTP client does not interpret the blank folder properly, but if you put the folder in the bar on the top and hit enter it should take you to it.  Also for some reason this does not create a real locked folder, if you go up one folder normally the server wont be able to display a dir listing, but with the blank folder it can.  You can put as many spaces as you want in the first folder, just remember how many you made because you need to use the exact same amount to access it.

Closing Notes

Well now you know all there is about basic dir locking, experiment a little and maybe you'll learn your own techniques.  Watch for errors when doing things with illegal dir names, it will ease the frustration when things aren't working because usually it's because the server is denying you.  Some servers have a special setup that does not allow locked folder of this kind at all.

If you are getting access denied when trying to remove directories, whether they are locked or not, it is usually because there is something still in the folder.  Even if nothing is visible there may be a empty folder like the one we created above.  For files if you're getting access denied it is because the file is in use, either being uploaded or downloaded, at the time.

< Back to TOC - Forum - Contact Info >