Hackers exploit web applications using malicious scripts to access the server. In this paper, the authors detect various attacks using vulnerability scanner tools. The major attacks, such as Distributed Denial of Service (DDoS) attack and Structured Query Language (SQL) injection attack are scanned and prevented using prepared statement and IP Blocking methods. Application security is achieved using web vulnerability scanner, which scans all the scripts used inside the application for vulnerability injection scripts (Cross-site Request Forgery (CSRF) and SQL injection).