Microsoft KB Archive/811176

= You cannot remove suspicious folders from the FTP file structure =

Article ID: 811176

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Windows 2000 Server

-





SYMPTOMS
You may experience the following symptoms on your Microsoft Windows 2000-based File Transfer Protocol (FTP) server:  New folders appear that do not belong in your FTP file structure. When you try to use Windows Explorer to remove the folders from an FTP site, you may receive one of the following error messages:

Access is denied

Cannot delete  : Cannot read from the source file or disk

 When you try to use the RD command to remove the folders from an FTP site, you may receive the following error message:

The system cannot find the file specified

 When you view the Properties dialog box for the folder, the Security tab is missing. The new folders may have names such as Com1, Lpt1, CON, and PRN. Typically, these names are reserved for exclusive use by the operating system.



CAUSE
This problem may occur if a malicious attacker has damaged or altered the FTP site.



RESOLUTION
To remove these folders, use one of the following methods:  === Method 1 ===

Use the RD &quot; /&quot; command to remove the folders. For example, at a command prompt, type RD &quot; /&quot;, and then press ENTER.

Note You cannot use this method to remove a folder unless the folder is empty. Therefore, you must remove the folders, in order, starting from the folder at the end of the folder hierarchy. </li> === Method 2 ===

Use the folder short names to remove the folders. To determine the short names for the folders, type dir /x at the command prompt.

Note This method applies even though the folders apparently do not use long file names.

For example, if you have a folder that you cannot remove that is named &quot;Test&quot;, follow these steps to remove the folder: <ol>  At the command prompt, type dir /x. Information that is similar to the following appears: <pre class="fixed_text"> Directory of C:\Inetpub\ftproot\foldername

02/26/2004 05:10p      <DIR>. 02/26/2004 05:10p      <DIR>                          .. 02/26/2004 05:10p      <DIR>TEST~1          test In this example, the short name for the &quot;Test&quot; folder appears as &quot;TEST~1&quot;. </li> Type RD test~1, and then press ENTER to remove the folder.</li></ol>

Note You cannot use this method to remove a folder unless the folder is empty. Therefore, you must remove the folders, in order, starting from the folder at the end of the folder hierarchy. </li> === Method 3 ===

You may not be able to use the methods that are provided earlier in this article to remove the folders, if the folders are using names that are reserved by the system. In this case, or if you want to perform a bulk operation and remove many folders with one command, you must back up the FTP structure, and then type RmDir \\.\ \ftproot\  /s to remove the FTP file structure. To do this, follow these steps: <ol> Use Microsoft Windows Backup or your preferred backup program to back up your FTP folders.</li> Close Windows Explorer or any command prompt windows that may access the FTP folder structure.</li> Remove the FTP component of Internet Information Services (IIS). To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> In Control Panel, click Add/Remove Programs.</li> Click Add/Remove Windows Components.</li> Click Internet Information Services, and then click Details.</li> Click to clear the File Transfer Protocol (FTP) Server check box, and then click OK.</li> Click Next, and then click Finish.</li></ol> </li> Type RmDir \\.\ \ftproot\  /s at the command prompt, and then press ENTER.

For example, if your FTP root folder is in the default location in the C:\Inetpub folder, and the damaged FTP file structure is in a folder named &quot;Test&quot;, type the following command, and then press ENTER:

RmDir \\.\C:\Inetpub\ftproot\Test /s

Warning This command will permanently delete the FTP file structure and all files that the structure contains. Verify that you have a working backup before you perform this step.</li> Type Y to verify.</li> <li>Reinstall the FTP component of IIS. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In Control Panel, click Add/Remove Programs.</li> <li>Click Add/Remove Windows Components.</li> <li>Click Internet Information Services, and then click Details.</li> <li>Click to select the File Transfer Protocol (FTP) Server check box, and then click OK.</li> <li>Click Next, and then click Finish.</li></ol> </li> <li>Use your backup program to restore the FTP structure that you want. For example, configure the restore process so that the problematic folders are not restored.</li></ol> </li> <li>=== Method 4 ===

To use the WebDav tool to remove folders with reserved names, follow these steps: <ol> <li>On a Windows 2000-based computer, install the Front Page Server extensions if these extensions are not already installed.</li> <li>Click Start, point to Programs, point to Administrative Tools, and then click IIS Manager. Expand the server object, right-click the default Web site, point to New, and then click Virtual Directory. The Virtual Directory Wizard appears.</li> <li>On the first page of the Virtual Directory Wizard, click Next. On the Virtual Directory Alias page, type an alias for the new virtual directory, and then click Next.</li> <li>On the Web Site Content Directory page, locate the path of the folder that contains the files that you want to delete in the Entire Path to the Directory That Contains the Content box. Typically, this location is %winroot%\inetpub\ftproot.</li> <li>On the Access Permissions page, click to select the READ, WRITE, and BROWSE check boxes. Click Next, and then click Finish.</li> <li>Start Internet Explorer. On the File menu, click Open, and then click to select the Open as Web Folder check box.</li> <li>In the Open box, type the Web address for the Virtual Directory site that you just created and that contains the files that you want to delete. For example, type http:// /, and then click OK. Do not go to the ftproot or another folder where the reserved name may have been placed. The folder will appear in the browser window.</li> <li>Delete any suspicious files or folders. To delete a file or folder, right-click the file or folder, and then click Delete. If your ftp server requires authentication to access the server, an authentication dialog box appears. You must have administrative credentials to delete folders or files.</li></ol> </li></ul>

Keywords: kbprb KB811176

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.