OWASP Top 10 :Understanding Injection
What is injection? In injection, an attacker can send malicious data to a program. This data is then processed by the program in an unintended way, often leading to unauthorized access or damage. Common Types of Injection Attacks: 1. SQL Injection: Manipulating a website's database queries by entering malicious SQL commands, which can lead to unauthorized access or data changes. Example :(SQL) SQL query : SELECT * FROM users WHERE username = 'user' AND password = 'pass'; Malicious Input: ' OR '1'='1 Resulting Query: SELECT * FROM users WHERE username = '' OR '1'='1' AND password = ' '; Prevention : Use prepared statements (parameterized queries). Validate and sanitize user inputs. Use ORM frameworks. Least privilege for database accounts. 2. Command Injection: Injecting harmful commands into a system command or script, allowing attackers to execute arbitrary commands on the server. Example :(bash) basic command: p...