Cyber Sec Ass2
Cyber Sec Ass2
CS22M111
Example I am trying to find the database structure what could be the table name.
Hypothesis : 1. table name is student?
2. It has studentId?
-- Error-Based
Result : Failed
-- Error-Based
Result : In above it shows the table name students is correct but the “studentId” is not in Students
schema we need to do more testing.
If the condition is true, the attacker observes a delay in the response for 10 seconds.
How It Works
Sending Payloads: The attacker sends a SQL query that includes a statement causing the
database to wait for a specified amount of time before responding.
Observing Response Time: The attacker observes how long it takes for the application to
respond.
Infer Information: If the application’s response is delayed as per the injected time delay, the
attacker can infer that their condition in the SQL statement is true.
In another table of students with username and password we can try this
Prevention
Use Prepared Statements: Employ parameterized queries to safely pass parameters to SQL
queries.
Implement ORM: Object-Relational Mapping like Hibernate can reduce the risk as it doesn’t
require writing raw SQL queries.
Conduct Regular Security Audits: Regularly test and scan your applications for SQL injection
vulnerabilities.