- Overview
- Installation
- WWW Service
- FTP Service
- Exploit Scanners
- Summary
FTP Service
The File Transfer Protocol service is the most commonly used method of transferring large files across the Internet. Using the TCP/IP protocol, an FTP client makes a connection to an FTP host, which is also known as the FTP server. Once connected, the client can upload, download, and alter files on the FTP server as their permissions allow.
FTP is the transfer protocol of choice due to its ability to send files as binary. Other forms of data transfer, such as HTTP, can transfer large files. However, they transfer the file as ASCII, which can cause data corruption. Since this is such a popular tool, Microsoft included FTP in the Internet Information Services package.
To configure the FTP service, you will need to open the Internet Service Manager by clicking Start Control Panel Administrative Tools Internet Information Services. This will open a window similar to Figure 13.48.
The ISM, as previously discussed, is the control panel for the WWW and FTP services. In addition, it details the status of each of the services to keep administrators informed. In Figure 13.48, the FTP service is running on "All Unassigned" IP addresses at port 21. This is the typical default setup that you will see upon entering the ISM.
Figure 13.48 Internet Service ManagerFTP Sites.
Although other ports can be used, port 21 is the standard for the FTP service. Using a different port can provide a level of safety from random scanners, but it can also confuse clients attempting to connect with programs configured for the default port.
The following pages show you how to configure each of the FTP properties for maximum security.
Master FTP Site Properties
Control of the FTP service is layered. Just as in the WWW service, the FTP has a root folder that holds all the client sites. While there may be only one FTP site on the computer, the server can hold multiple sites for numerous clients or purposes. Each site may have its own properties and settings. However, to maintain the highest level of security, it is best to configure the root site at the highest security settings possible. Then, configure each individual site as needed.
The following describes how to configure the settings in each section to lock down the root site. Once we have covered the Master FTP Site Properties, we discuss the Default FTP Site Properties.
To access the Master FTP Site Properties sheet (Figure 13.49), right-click on FTP Sites and select Properties. Upon opening, you will see a window with three tabs: Security Accounts, Messages, and Home Directory.
Figure 13.49 Master FTP Site PropertiesSecurity Accounts sheet.
Security Accounts Sheet
Allow Anonymous Connections. This section is used to control the anonymous user settings. Depending on the purpose of the FTP server, you may want to disable anonymous connections. By enabling anonymous connections, you allow someone to connect to your FTP server with the user name "anonymous" and an email address as the password, which can be easily forged. This is why you must ensure that any such sites created are done so with read-only permissions.
In addition to allowing anonymous connections, you can enable the server to accept ONLY anonymous connections. The reason for this is to avoid a situation where a user's name can be sniffed from the network. Due to the nature of FTP data transfer (i.e., clear text), it is best to avoid having users connect to the server with a user name and password. By enabling Allow only anonymous connections, the FTP server will reject any clients who connect with user information. Ironically, any user who is rejected has already sent their information and is subject to having their user info captured.
To ensure the anonymous FTP logon matches the account created by the server during install, keep Allow IIS to control password checked.
FTP Site Operators. The FTP Site Operators are those accounts that are used to administer the account. This should always consist of local accounts, as the computer the service is running on should not be included in any domain. If, however, the server is part of a network, you can use local, global, or universal accounts.
Messages Sheet
Banner/Welcome/Exit/Maximum connections. This sheet, shown in Figure 13.50, defines the messages the client will see when connecting to and exiting from the server. You may wish to include a legal disclaimer at this entry point.
Figure 13.50 Master FTP Sites PropertiesMessages sheet.
Home Directory
FTP Site Directory. The FTP Site directory has three options you can select. However, by default the selection is secure. Log visits is the only box that should be checked. While enabling Read and Write may be acceptable for some situations, these should typically remain disabled. These options can be enabled at the Site level.
Directory Listing Style. The directory listing style is an option that is completely up to the Administrator. Since FTP originated within the UNIX operating system, some people are more comfortable with this style of listing than the MS-DOS style (Figure 13.51).
Figure 13.51 Master FTP Site PropertiesHome Directory sheet.
Default FTP Site Properties
Under the Master FTP Site folder you will find the specific FTP site information. You can create multiple sites for a host of users or purposes. If the Master FTP Sites configuration is correct, any new site should be locked down upon creation, with the exception of Read properties.
The following discusses in detail the sections and their respective settings for securing the FTP Server at the Site level.
FTP Site (Figure 13.52).
Figure 13.52 Default FTP Site PropertiesFTP Site sheet.
Identification. This section is used to configure several important options. The first item in this section is the FTP site description. If there is only one site, this option is not important. However, if the FTP server is destined to host multiple sites, careful and descriptive labeling is important.
The second option is available in case there are multiple IP addresses assigned to the server (e.g., an FTP site serving both the Internet and local network). In this case, it may be necessary to permit only one IP address access to the FTP site.
The final option in this section is the TCP port the FTP server will use as the control port. This is the port with which clients will establish their initial connection. If the site is to be available to the general public, port 21 is recommended. However, if the site is to be private, moving the port can help protect the server against port-scanning hackers.
Connection. In order to protect the FTP server against a Denial of Service (DoS) situation, it is important to configure the site to limit both the number of connections and the timeout for inactive sessions. The default settings are adequate. However, if you are under consistent attack, you may wish to tighten these settings.
Enable Logging (Figure 13.53). This contains one of the most important settings for FTP administrators. An FTP server's log file is like a diary. It contains the address and actions of every user who connects or attempts to connect. If a log file is available after a hacker gains access to the server, it is possible to trace the activities of the hacker and repair or replace the files that were damaged.
Figure 13.53 Extended Logging Properties.
By default, the settings for logging are correct, with the exception of the Log file location. If an experienced hacker gains access, the last thing she will delete or alter is the log file. If an FTP administrator hides the log file in an inconspicuous place, it makes it more difficult for the hacker to damage the logs. For this reason, we recommend the placement of the log file on another drive and, if possible, a different computer. To relocate the log file, click the Properties button and then click Browse to specify a new log file location.
In addition, the FTP server can be configured to capture supplementary information that can be useful when tracking traffic or troubleshooting a connection. This is also available in the log Properties, under the Extended Properties tab.
Current Sessions. The final section on this page is found by clicking the Current Session button. This opens a window, shown in Figure 13.54, that lets you view the current users, their IP address, and how long they have been connected. By monitoring this dialog box, you can keep track of the number of users and even disconnect someone if they are attempting multiple connections or if they are sharing accounts.
Figure 13.54 FTP User Session window.
Security Accounts
Allow Anonymous Connections. This section is used to control the anonymous user settings. Depending on the purpose of the FTP server, you may want to disable anonymous connections. However, you will typically allow anonymous connections. By doing so you allow someone to connect to your FTP server with the user name "Anonymous" and an email address as the password, which can be easily forged. This is why you must ensure that any sites created are done so with read-only permissions.
In addition to allowing anonymous connections, you can enable the server to accept ONLY anonymous connections. The reason for this is to avoid a situation where a user's name can be sniffed from the network. Due to the nature of FTP data transfer (i.e., clear text), it is best to avoid having users connect to the server with a user name and password. By enabling Allow only anonymous connections, the FTP server will reject any clients who connect with user information. Ironically, any user who is rejected has already sent their information and is subject to having their user info captured (Figure 13.55).
Figure 13.55 Default FTP Site PropertiesSecurity Accounts sheet.
To ensure the anonymous FTP logon matches the account created by the server during install, keep Allow IIS to control password checked.
FTP Site Operators. The FTP Site Operators are those accounts that are used to administer the account. This should always consist of local accounts, as the computer the service is running on should not be included in any domain. If, however, the server is part of a network, you can use local, global, or universal accounts.
Messages
Banner/Welcome/Exit/Maximum connections. This sheet defines the messages the client will see when connecting and exiting the server. To help protect your system against misuse, it is suggested that you put a security warning or guidance policy in the Welcome message (Figure 13.56).
Figure 13.56 Default FTP Site PropertiesMessages sheet.
When a user connects to the FTP server they will see a message similar to that in Figure 13.57.
Figure 13.57 Sample FTP Welcome message.
Home Directory (Figure 13.58).
Figure 13.58 Default FTP Site PropertiesHome Directory sheet.
Content Location. IIS includes a feature that enables a user to point any resource requests to a physical location on a remote computer. Using this feature can serve to protect a system by separating the requested resource from the FTP server. This prevents hackers from using folder-traversing vulnerabilities to gain access to the Internet system. However, this could allow one computer to access files on another computer.
FTP Site Directory. The FTP Site directory has three options you can select. However, by default the selection is secure. Log visits is the only box that should be checked. While enabling Read and Write may be acceptable for some situations, typically these should remain disabled. These options can be enabled at the Site level.
Directory Listing Style. The directory listing style is an option that is completely up to the Administrator. Since FTP originated within the UNIX operating system, some people are more comfortable with this style of listing than MS-DOS's style.
Virtual FTP Directories
IIS FTP server allows the use of virtual directories. This simulates a hierarchal directory structure for the client, but in reality allows the directories to be located anywhere on the local computer or remote computer on the network. This setup would be useful if an FTP server had to span a cluster of servers, or if the FTP folder was mapped to a user's personal computer.
To create a virtual directory:
Open the ISM.
Right-click on the Default FTP Site folder.
Select Properties New Virtual Directory (see Figure 13.59).
Figure 13.59 Starting the FTP Virtual Directory Creation Wizard.
Click Next at the Directory Creation Wizard welcome screen, shown in Figure 13.60.
Figure 13.60 Directory Creation Wizard welcome screen.
Enter an Alias name and click Next. See Figure 13.61.
Figure 13.61 Virtual Directory Creation Wizard.
Click Browse to point the wizard to the desired path/folder (Figure 13.62).
Figure 13.62 Virtual Directory Creation Wizard (FTP Site Content Directory)
Check either Read or Write as circumstances require. See Figure 13.63.
Figure 13.63 Virtual Directory Access Permission configuration.
CAUTION
You should not check both Read and Write. This allows a hacker to see what other people have placed in the directory and facilitates the unauthorized deletion or modification of previously uploaded files.
Click Next and then Finish to close the wizard.
Your new Virtual Directory is now set up. To view or modify the settings of the virtual directory, right-click the new directory and select Properties. This will open a window similar to Figure 13.64. From this window you can adjust the content location, local path, and directory permissions.
Figure 13.64 Virtual FTP Directory properties.