Security virtual host configuration skills

Source: Internet
Author: User
Tags website injection web hosting

Injection, upload, and weak password vulnerabilities are everywhere. Cross-Site attacks, remote control, and so on are all too old. Some VM administrators simply put all the websites in the same directory for convenience or unfamiliar configuration, and then set the parent directory as the site root directory. In some cases, the directories of all sites are set to executable, writable, and changeable. For convenience, QQ is suspended on the server and BT is also installed. In addition, the Internet Guest account is added to the Administrators group! Khan ......! Ordinary users set their passwords to 6 pure numbers such as birthdays. This situation can be forgiven. After all, most of them are not dedicated to network research, it may take some time for Chinese citizens to improve their security awareness, but if they are network administrators, they will be confused. Network security issues have become increasingly prominent. Recently, no one claims that "hichina: I 've been here twice !". Such a well-known network service provider will inevitably escape! Website injection vulnerabilities are university intrusions that are frequently exposed in newspapers and magazines recently ...... In a word, the security status of most websites is worrying!

Here I will discuss the security virtual host configuration issues with my personal past experiences. The following uses the establishment of a site cert.ecjtu.jx.cn as an example to discuss the virtual host configuration issues with you.

1. Create a Windows User

Set a windows User Account cert for each website, delete the account User group, and add cert to the Guest User group. The password cannot be changed, and the password will never expire.

2. Set folder Permissions

1. Set non-site-related Directory Permissions

After Windows is installed, many directories and files can be viewed, viewed, run, or even modified by default by everyone. This poses a great risk to server security. Here are some of my personal experiences to mention some directories that are commonly used in intrusion.

C: \; D :\;......

C: \ perl

C: \ temp \

C: \ Mysql \

C: \ php \

C: \ autorun. inf

C: \ Documents ents and setting \

C: \ Documents ents and Settings \ All Users \ Start Menu \ Program \

C: \ Documents ents and Settings \ All Users \ Start Menu \ Program \ Start

C: \ Documents ents and Settings \ All Users \ Documents ents \

C: \ Documents ents and Settings \ All Users \ Application Data \ Symantec \

C: \ Documents ents and Settings \ All Users \ Application Data \ Symantec \ pcAnywhere

C: \ WINNT \ system32 \ config \

C: \ winnt \ system32 \ inetsrv \ data \

C: \ WINDOWS \ system32 \ inetsrv \ data \

C: \ Program Files \

C: \ Program Files \ Serv-U \

C: \ Program Files \ KV2004 \

C: \ Program Files \ Rising \ RAV

C: \ Program Files \ RealServer \

C: \ Program Files \ Microsoft SQL server \

C: \ Program Files \ Java Web Start \

  

The permissions of these directories or files should be appropriately restricted. For example, the permission to view, modify, and execute a Guests user is revoked. Due to the length of the article, I will only mention it here.

2. Set site-related directory permissions:

A. Set the root directory permission of the site: grant the newly created user cert to the corresponding site folder. Assume that D: \ cert is used to set the corresponding permissions: The Adiministrators Group is fully controlled; cert supports reading and running, listing folder directories, and reading, and revoking all other permissions.

B. Set updatable file permissions: After setting the permissions for the root directory folder of the site in step 2, the Guest user has no permission to modify any content in the site folder. This is obviously not enough for an updated site. In this case, you need to set the permissions for the files to be updated separately. Of course, this may be inconvenient for virtual host providers. The file content to be updated on the customer's site may be different. In this case, you can specify that a folder can be written or modified. For example, some web hosting providers require that the uploads in the site root directory is a web-ready upload folder, and the data or database is a database folder. In this way, the VM service provider can customize the permissions of these two folders for the customer. Of course, you can also create a program for the customer just like some virtual host providers that do better, so that the customer can set it by themselves. In this case, service providers may have to spend a lot of money and manpower.

3. Configure IIS

The basic configuration should be shared by everyone. Here are some special points or notes.

1. Master directory permission settings: You can set read here. Write, directory browsing, etc. The most important thing is directory browsing. Unless otherwise, it should be disabled. Otherwise, a lot of important information will be exposed. This will facilitate hacker intrusion. The rest will be retained by default.

2. Application configuration: in site properties, the home directory item also has a configuration option. Click to enter. You can see in the application ing option that there are many application ing by default. Delete all unnecessary and retained items. During the intrusion process, many programs may restrict the upload of files such as asp and php, but do not restrict files such as cer and asa. If the corresponding application ing is not deleted, you can change the suffix of asp to cer or asa for upload. The trojan will be parsed normally. This is often ignored by administrators. Add an application extension ing. You can select an executable file with the suffix. mdb. This is to prevent the user database with the suffix mdb from being downloaded.

3. Directory Security Settings: Select Directory Security in site properties, click anonymous access and authentication control, select Allow Anonymous Access, and click Edit. As shown in. Delete the Default User, browse and select the user set for the cert website, and enter the password. You can select to allow IIS to control the password. The purpose of this setting is to prevent cross-directory and cross-site browsing of trojans such as webmaster assistants and marine Trojans, and effectively prevent such cross-directory and cross-site intrusion.

4. writable directory execution permission settings: Disable the execution permission for all writable directories. Due to program vulnerabilities, webpage Trojans are currently very popular, most of which are uploaded on the web. The writable directory Trojan cannot be uploaded. If you disable the permission to run the writable directory, the uploaded Trojan cannot run normally. It can effectively prevent such forms of web intrusion.

5. Handle running errors: There are two methods. One is to disable error echo. IIS properties-main directory-configuration-application debugging-script error message, select to send a text error message to the customer. Second, customize the error page. In IIS properties-custom error information, double-click the custom error page in http Error information. The error ing attribute setting box is displayed. Message types include default values, URLs, and files, which can be customized as needed. In this way, some error information can be hidden, and the error display can be more friendly.

4. Configure FTP

Ftp is a required service for most VM providers. Most of your website files are uploaded using ftp. The most used ftp server is not Serv-U. Here are some points to explain.

  

1. The administrator password must be changed.

If attackers are familiar with Serv-U privilege escalation. These elevation tools use the default Administrator account and password of Serv-U. Because the Serv-U Administrator runs as a super administrator. If you haven't changed the administrator password, these tools will be easy to use. If you change the password, it is not that easy for these tools to run normally. The administrator password must be cracked first.

2. Change the installation directory permission

The default installation directory of Serv-U can be viewed or modified by everyone. If you choose to store user information in the ini file during installation, you can obtain all user information in ServUDaemon. ini. If Guests has the modification permission, hackers can establish users with super permissions. This is not a good thing. Therefore, after Serv-U is installed, you must modify the corresponding folder permissions to cancel the corresponding permissions of the Guests user.

V. command line operations

1 forbidden the guestsuser to execute com.exe:

We can use the following command to revoke the permission of gueststo execute com.exe.

Cacls C: \ WINNT \ system3 \ Cmd.exe/e/d guests.

2. Disable the Wscript. Shell component:

Wscript. Shell can call the system kernel to run basic dos commands. You can modify the registry and rename this component to prevent the dangers of such Trojans. HKEY_CLASSES_ROOT \ Wscript. Shell \ and HKEY_CLASSES_ROOT \ Wscript. Shell.1 \ are renamed as other names. Change the value of the two clsid items to the value of the HKEY_CLASSES_ROOT \ Wscript. Shell \ CLSID \ Project and the value of the HKEY_CLASSES_ROOT \ Wscript. Shell.1 \ CLSID \ project. You can also delete the two items.

3. Disable the Shell. Application component.

Shell. Application can also call the system kernel to run basic dos commands. You can modify the registry and rename this component to prevent the dangers of such Trojans. HKEY_CLASSES_ROOT \ Shell. Application \ and HKEY_CLASSES_ROOT \ Shell. Application.1 \ are renamed as other names. Change or delete the value of HKEY_CLASSES_ROOT \ Shell. Application \ CLSID \ Project HKEY_CLASSES_ROOT \ Shell. Application \ CLSID \ project. In addition, the Guest user is prohibited from using shell32.dll to prevent calling this component. Run the following command: cacls C: \ WINNT \ system32 \ shell32.dll/e/d guests.

4. FileSystemObject component

FileSystemObject can perform regular operations on files. You can modify the registry and rename this component to prevent the harm of such Trojans. The corresponding registry key is HKEY_CLASSES_ROOT \ scripting. FileSystemObject \. You can disable the use of guests or directly delete it. Considering that many uploads use this component, we do not recommend that you change or delete it for convenience.

5. telnet login prohibited

  

There is a login. cmd file in the C: \ WINNT \ system32 directory, which is opened in Notepad. Take another row at the end of the file and add exit to save the file. In this way, the user will automatically Exit immediately when logging on to telnet.

Note: The above modification to the registry takes effect only after the WEB Service is restarted.

Vi. Port Settings

  

The bottom of the port form is the door. If all the ports on our server are open, it means that many hackers can intrude into the server. Therefore, I personally think it is important to close unused ports. On the Control Panel-network and dial-up connections-local connections-properties-Internet Protocol (TCP/IP) properties, click Advanced to go to Advanced TCP/IP Settings and select options, select TCP/IP filtering in the optional settings to enable TCP/IP filtering. Add the required ports, such as 21 and 80, and disable all unused ports.

7. disable file sharing

File Sharing is enabled by default. We should cancel it. In the control panel-network and dial-up connections-local connections-properties, in the general options Option, cancel Microsoft Network File Sharing and print sharing. The minimum service principle is an important principle to ensure security. Disable unnecessary services. System services can be set in Control Panel> Administrative Tools> services.

8. disable unnecessary services

Services such as telnet and remote registry operations should be disabled. Install as few software as possible. This avoids some security issues caused by software vulnerabilities. Some network administrators install QQ on the server and use the server to hook up QQ. This is extremely incorrect.

9. Pay attention to the security dynamics and promptly update vulnerability patches

Updating vulnerability patches is very important for a network administrator. Patches can be updated to further ensure system security.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.