| With the widely spread of the Internet, web application platform has become the communication center of the Internet. But at the same time, the threats to the web application are very serious. How to protect web applications'security is very important. The attacks to the web application, comparing with traditional network attacks, have many new features, such as using HTTP protocol to carry malicious data, which can not be detected by the firewall and intrusion detection system. So we must defense the attacks from the application layer.In this paper we study the origin and common threats of web application security firstly. Then we research and implement a protect module to protect web sites from SQL injection and tampering web page.To defend SQL injection, we analyze the characteristic of SQL injection and construct the regular expression for these attacks. Then we design a SQL injection attack filter module inside web server, which is based on the filter rules using regular expression. This module can defend common SQL Injections, which detectes the attacks before the HTTP requests handled by the system modules. With the IP limit mechanism, this module can protect web server from exhaustive attacks launched by hackers.To defend web page from tempering, we compare the common technologies of web page tamper-resistant, and implement a protect module using the event-triggering mechanism which is based on the Linux file system and loadable kernel module developing technology. This module can detect attacks when the files are being modified, which can break attacks immediately.The test results show that the modules can prevent SQL injection and page tempering attacks effectively, with very little influence to the web application platform. |