Posts

Showing posts from July, 2024

OWASP Top 10 :Understanding Injection

Image
  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...

OWASP Top 10 :Understanding Cryptography

Image
  What is Cryptography?  Cryptography is a method of protecting information by transforming it into an unreadable format, called encryption so that only those with the correct key can read it. What is a Cryptographic Failure? Cryptographic failure occurs when the cryptographic methods used to protect data are not strong enough or are implemented incorrectly. Common Causes of Cryptographic Failures : 1. Weak Encryption Algorithms:  Using outdated or weak encryption methods that are easy for attackers to break. Example : Using the DES algorithm. 2. Poor Key Management:  Not properly generating, storing, or using encryption keys. Example : Hard-coding encryption keys in the application's source code where attackers can find them. 3. Insecure Transmission : Not encrypting data transmitted over the internet. Example : Sending sensitive information over HTTP instead of HTTPS. 4. Improper Implementation : Incorrectly using cryptographic functions or libraries...