Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Illegal file names on a Windows 2000 server

Posted on 2003-01-02
Medium Priority
Last Modified: 2012-06-08
I have a 2K server that was left wide open for ftp.  It has now been 'hacked' and I have about 9GB space that has disappeared to files with illegal names for the files and directories.  They appear to be Mac file names.  I've tried a couple of utilites to rename the files so that I can delete them.  There must be a better way.  I once knew the dos del command that would let me delete files with a space at the end or beginning of a file or diretory name.  Any ideas?
Question by:dpreynolds
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

kaliki earned 150 total points
ID: 7658988
i recently had this happen...ugh.  if you have information in your ftp directory you want to keep you'll need to move it to another folder.  stop the ftp site.  from the command line use the RD /S /Q command. the /S deletes all subfolders and the /Q supresses the OK prompts. RD /? will give you the full proper syntax.  you'll need to delete the entire root folder because you can't "see" the corrupt folder.  after it's deleted recreate the folder, copy all your saved ftp data back and apply some security.  
LVL 44

Expert Comment

ID: 7659150
Try this open a command window and do this

Open a CMD.EXE window.
CD to the top of the mess.
Use: DIR /X /A   to see the SHORT FILE NAMES of the files and directories there.
Use a combination of CD, RD, and DEL and the SHORT FILES names reported with DIR /X to delete your way to the bottom and then back up the tree removing the files on the way down and the directories on the way up.
Most likely there is NOT a protection issue here so you shouldn't need worry about ownership or file protections.

How to Remove Files with Reserved Names in Windows

The Crazy One

Expert Comment

ID: 7659191
you can work your way back using the commands from crazyone however if your FTP directory is like mine was (full of directories with no names, symbols and some credits to the author totally about 25+ sub directories) it will be painfully time consuming.  crazyone is absolutely correct about file ownership and protection.

Author Comment

ID: 7665165
Good suggestion.  I actually did not get to try to solution although it should have worked.  I was able to delete the files by connecting to the server with a Mac client and the files could just be deleted.  

Expert Comment

ID: 8006397
We had a couple of servers that were left open to anonymous users with write permissions enabled for the ftp server. People took advantage of the open state of the IIS boxes and imediately started to fill the drives with gigs and gigs of data, ranging from .mp3s to full length ripped dvds.  The directory structure was confounding, with ascii characters, blank directories, system reserved naming, and just plain ugly hierarchy. It took me a few days of research to finally find an easy solution of deleting these files which could not be dealt with any conventional form of file removal. I tried everything - even the Microsoft solution did not work for me (suprize!).

After reading this thread (and several others) I had an Idea, tried it, and poof - all the files and directories are gone! No need for the tedious cd, ren, dir /x stuff that was so frustrating - and did not work.

Here's what I did:

Stopped the IIS services
Copied the APPS\POSIX directory from the Windows 2000 Resource Kit CD to the server
renamed c:\inetpub\ftproot to c:\inetpub\crap
moved the c:\inetpub\crap directory into the POSIX directory
Opened a command prompt and executed:
C:\POSIX\rm -r crap

POOF!!! In an instant (well, not really, it deleted over 30 Gb of data) everything was gone in that hideous directory!

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question