About Me

My photo
Kolkata - Durgapur - Santiniketan - Sainthia, West Bengal, India
A competent professional of about 3 Years of Experience in the Web Application and Development Scenario. Currently associated with also a web development company; Kolkata as a Project Leader. A result-oriented Team Player with proven expertise in Analysis / Development / Research / Project & Process Management/ Client Servicing. Exceptional analysis and problem solving skills to cut across the organisational levels and accomplish project business goals of the Organisation. Myself, very hardworking, committed, focused, think logically, talented, sincere on my work, doesn't stop until achieves success.

Thursday, October 11, 2012

Know Your Enemy - PHP Security Best Practices For System Admin (Linux)

PHP based apps can face the different types of attacks. I have noticed the different types of attacks:

XSS - Cross-site scripting is a vulnerability in php web applications, which attackers may exploit to steal users' information. You can configure Apache and write more secure PHP scripts (validating all user input) to avoid xss attacks.

SQL injection - It is a vulnerability in the database layer of an php application. When user input is incorrectly filtered any SQL statements can be executed by the application. You can configure Apache and write secure code (validating and escaping all user input) to avoid SQL injection attacks. A common practice in PHP is to escape parameters using the function called mysql_real_escape_string() before sending the SQL query.
Spoofing

File uploads - It allows your visitor to place files (upload files) on your server. This can result into various security problems such as delete your files, delete database, get user details and much more. You can disable file uploads using php or write secure code (like validating user input and only allow image file type such as png or gif).

Including local and remote files - An attacker can open files from remote server and execute any PHP code. This allows them to upload file, delete file and install backdoors. You can configure php to disable remote file execution.

eval() - Evaluate a string as PHP code. This is often used by an attacker to hide their code and tools on the server itself. You can configure php to disable eval().

Sea-surf Attack (Cross-site request forgery - CSRF) - This attack forces an end user to execute unwanted actions on a web application in which he/she is currently authenticated. A successful CSRF exploit can compromise end user data and operation in case of normal user. If the targeted end user is the administrator account, this can compromise the entire web application.

No comments:

Post a Comment

Popular Posts