Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the smallest possible SQL injection attack character sequence?

Simple, a SQL injection attack in as few characters as possible. Note, I'm not trying to prevent SQL injection attacks by limiting inputs to a certain size, but rather am genuinely curious how many characters is needed to execute even the simplest attack.

For posterity sake, let's say the smallest table name is 4 characters, e.g., "user". Please factor that in.

like image 238
coderintherye Avatar asked Nov 23 '10 01:11

coderintherye


People also ask

What is the easiest SQL injection attack?

In-band SQLi (Classic SQLi) In-band SQL Injection is the most common and easy-to-exploit of SQL Injection attacks. In-band SQL Injection occurs when an attacker is able to use the same communication channel to both launch the attack and gather results.

What are the 3 classes of SQL injection attacks?

SQL injections typically fall under three categories: In-band SQLi (Classic), Inferential SQLi (Blind) and Out-of-band SQLi. You can classify SQL injections types based on the methods they use to access backend data and their damage potential.

What characters are used in SQL injection attacks?

Explanation. The single quote (') is the most common character used for SQL injection attacks.


2 Answers

1 Character is the smallest unit that you have control over. The question depends heavily on what you're doing. For instance, if you're dealing with an interface to delete your profile from a site, and you send '%' instead of your name:

"Delete from Users where name like '"+username+"'"

then setting your username to % will delete all the users.

like image 144
david Avatar answered Sep 22 '22 13:09

david


When injecting into a string literal:

';drop database;--
like image 27
SLaks Avatar answered Sep 22 '22 13:09

SLaks