SQL Injection

Aus xinux.net
Zur Navigation springen Zur Suche springen

Vorüberlegung

Verhaltensweise einer SQL Abfrage

Normale Abfrage
  • MariaDB [sql_injections]> select * from users where username = 'rudi.burkart';
+------+--------------+----------+
| id   | username     | password |
+------+--------------+----------+
|    2 | rudi.burkart | secret   |
+------+--------------+----------+
1 row in set (0.000 sec)
Oder Verknüpfung
  • MariaDB [sql_injections]> select * from users where username = 'rudi.burkart' or username = 'hans.will';
+------+--------------+----------+
| id   | username     | password |
+------+--------------+----------+
|    2 | rudi.burkart | secret   |
|    1 | hans.will    | geheim   |
+------+--------------+----------+
2 rows in set (0.000 sec)

Sql-injection-1.png