BBC BASIC for Windows
General >> General Board >> FTP
http://bb4w.conforums.com/index.cgi?board=general&action=display&num=1297687995

FTP
Post by KenDown on Feb 14th, 2011, 11:53am

I've recently found a whole lot of stuff uploaded to one of my websites that I certainly didn't put there! I've deleted it, but that meant going through by hand and deleting each file individually.

It occurred to me that it would be great to have a program that would take a snapshot of the website and record all the filenames in a text file, then every so often I could run the program again and any files which are not in the text file are automatically deleted.

Unfortunately the excellent FTP routines found in the Wiki allow upload and download, but not delete. (I think there is another program that allows read, so I could discover the file names on the website.)

Does anyone know the relevant command/s for deleting files by FTP?
Re: FTP
Post by Acexbe on Feb 14th, 2011, 3:56pm

Hello KenDown,

If you look into the MSDN for WinInet, then you find a list of available functions.
The one you need is FtpDeleteFile, see at:
http://msdn.microsoft.com/en-us/library/aa384142(v=VS.85).aspx

Regards,

Manuel
Re: FTP
Post by Ken Down on Feb 14th, 2011, 9:04pm

Thanks, I'll play around with that tomorrow.
Re: FTP
Post by JonR on Feb 20th, 2011, 1:58pm

The immediate solution is to change your password as this should lock the attacker out of your account. Choose a good strong password and ensure you change it if your account is compromised again.
Re: FTP
Post by Ken Down on Feb 21st, 2011, 06:24am

Thanks. The password is "strong" and I really don't know how the blighters got in, but apparently it is an increasing problem, as my control panel has the option to "lock" your account so that it cannot be accessed, password or no, until and unless you unlock it.

As I regularly upload stuff, I'm afraid I leave it unlocked.
Re: FTP
Post by JonR on Feb 26th, 2011, 6:05pm

It's entirely possible that they guessed your strong password. Seriously though on I regularly see thousands of login attempts every day for a number of accounts on FTP servers. The first thing you should do if someone get in is change your password no matter how strong you think it is.
Re: FTP
Post by Ken Down on Feb 26th, 2011, 8:01pm

Thanks for the advice, Jon. I may well do so - and will definitely do so if the problem happens again.
Re: FTP
Post by KenDown on Oct 22nd, 2015, 07:06am

Just a note to Manuel,
Many thanks for your tip. I *finally* got round to investigating and now it works fine. I also needed the FtpRemoveDirectory call, but I was able to find that and the necessary information from the link you provided, so many thanks again.