<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.ixheim.de/index.php?action=history&amp;feed=atom&amp;title=SQL_Injection_Datenabfrage</id>
	<title>SQL Injection Datenabfrage - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ixheim.de/index.php?action=history&amp;feed=atom&amp;title=SQL_Injection_Datenabfrage"/>
	<link rel="alternate" type="text/html" href="https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;action=history"/>
	<updated>2026-06-29T15:03:41Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Xinux Wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=49276&amp;oldid=prev</id>
		<title>Tina.messmann am 11. September 2023 um 11:41 Uhr</title>
		<link rel="alternate" type="text/html" href="https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=49276&amp;oldid=prev"/>
		<updated>2023-09-11T11:41:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 11. September 2023, 11:41 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot; &gt;Zeile 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     $search = $_POST['search'];&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     $search = $_POST['search'];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     $sql = &amp;quot;SELECT * FROM users WHERE username='$search'&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     $sql = &amp;quot;SELECT * FROM users WHERE username='$search'&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;$result = mysqli_query&lt;/del&gt;($link, $sql);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;mysqli_multi_query&lt;/ins&gt;($link, $sql);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Diese Eingabe bewirkt nun  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;Diese Eingabe bewirkt nun  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tina.messmann</name></author>
	</entry>
	<entry>
		<id>https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=25342&amp;oldid=prev</id>
		<title>Thomas.will: /* PHP Code unsicher */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=25342&amp;oldid=prev"/>
		<updated>2021-06-30T16:54:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;PHP Code unsicher&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 30. Juni 2021, 16:54 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot; &gt;Zeile 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;folgende Sql Abfrage&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;folgende Sql Abfrage&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*MariaDB [sql_injections]&amp;gt;  select * from users where username = &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt; or '1' = '1';                        &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*MariaDB [sql_injections]&amp;gt;  select * from users where username = &amp;lt;nowiki&amp;gt;' '&amp;lt;/nowiki&amp;gt; or '1' = '1';                        &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  +------+---------------+-------------+&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  +------+---------------+-------------+&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  | id   | username      | password    |&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  | id   | username      | password    |&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Thomas.will</name></author>
	</entry>
	<entry>
		<id>https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=24394&amp;oldid=prev</id>
		<title>Thomas.will: /* PHP Code unsicher */</title>
		<link rel="alternate" type="text/html" href="https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=24394&amp;oldid=prev"/>
		<updated>2021-06-17T11:59:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;PHP Code unsicher&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 17. Juni 2021, 11:59 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot; &gt;Zeile 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;folgende Sql Abfrage&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;folgende Sql Abfrage&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*MariaDB [sql_injections]&amp;gt;  select * from users where username = '' or '1' = '1';                        &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*MariaDB [sql_injections]&amp;gt;  select * from users where username = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;nowiki&amp;gt;&lt;/ins&gt;''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/nowiki&amp;gt; &lt;/ins&gt;or '1' = '1';                        &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  +------+---------------+-------------+&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  +------+---------------+-------------+&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  | id   | username      | password    |&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  | id   | username      | password    |&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Thomas.will</name></author>
	</entry>
	<entry>
		<id>https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=24155&amp;oldid=prev</id>
		<title>Thomas.will: Die Seite wurde neu angelegt: „ =Vorüberlegung= ==Verhaltensweise einer SQL Abfrage== ;Normale Abfrage *MariaDB [sql_injections]&gt;  select * from users where username = 'rudi.burkart';  +---…“</title>
		<link rel="alternate" type="text/html" href="https://wiki.ixheim.de/index.php?title=SQL_Injection_Datenabfrage&amp;diff=24155&amp;oldid=prev"/>
		<updated>2021-06-15T19:31:05Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „ =Vorüberlegung= ==Verhaltensweise einer SQL Abfrage== ;Normale Abfrage *MariaDB [sql_injections]&amp;gt;  select * from users where username = &amp;#039;rudi.burkart&amp;#039;;  +---…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
=Vorüberlegung=&lt;br /&gt;
==Verhaltensweise einer SQL Abfrage==&lt;br /&gt;
;Normale Abfrage&lt;br /&gt;
*MariaDB [sql_injections]&amp;gt;  select * from users where username = 'rudi.burkart';&lt;br /&gt;
 +------+--------------+----------+&lt;br /&gt;
 | id   | username     | password |&lt;br /&gt;
 +------+--------------+----------+&lt;br /&gt;
 |    2 | rudi.burkart | secret   |&lt;br /&gt;
 +------+--------------+----------+&lt;br /&gt;
 1 row in set (0.000 sec)&lt;br /&gt;
;Oder Verknüpfung&lt;br /&gt;
*MariaDB [sql_injections]&amp;gt;  select * from users where username = 'rudi.burkart' or username = 'hans.will';&lt;br /&gt;
 +------+--------------+----------+&lt;br /&gt;
 | id   | username     | password |&lt;br /&gt;
 +------+--------------+----------+&lt;br /&gt;
 |    2 | rudi.burkart | secret   |&lt;br /&gt;
 |    1 | hans.will    | geheim   |&lt;br /&gt;
 +------+--------------+----------+&lt;br /&gt;
 2 rows in set (0.000 sec)&lt;br /&gt;
=PHP Code unsicher=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    $search = $_POST['search'];&lt;br /&gt;
    $sql = &amp;quot;SELECT * FROM users WHERE username='$search'&amp;quot;;&lt;br /&gt;
    $result = mysqli_query($link, $sql);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
;Diese Eingabe bewirkt nun &lt;br /&gt;
&lt;br /&gt;
[[Datei:Sql-injection-2.png]]&lt;br /&gt;
&lt;br /&gt;
;folgende Sql Abfrage&lt;br /&gt;
&lt;br /&gt;
*MariaDB [sql_injections]&amp;gt;  select * from users where username = '' or '1' = '1';                       &lt;br /&gt;
 +------+---------------+-------------+&lt;br /&gt;
 | id   | username      | password    |&lt;br /&gt;
 +------+---------------+-------------+&lt;br /&gt;
 |    2 | rudi.burkart  | secret      |&lt;br /&gt;
 |    3 | erwin.lehmann | weisniemand |&lt;br /&gt;
 |    1 | hans.will     | geheim      |&lt;br /&gt;
 +------+---------------+-------------+&lt;br /&gt;
 3 rows in set (0.000 sec)&lt;br /&gt;
;Da '1' = '1&amp;quot; werden alle Datensätze angezeigt&lt;br /&gt;
&lt;br /&gt;
=Webfrontend=&lt;br /&gt;
[[Datei:Sql-injection-1.png]]&lt;br /&gt;
=PHP Code sicher=&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  $search = mysqli_real_escape_string($link, $_POST['search']);&lt;br /&gt;
  $sql = &amp;quot;SELECT * FROM users WHERE username='$search'&amp;quot;;&lt;br /&gt;
  $result = mysqli_query($link, $sql);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Das Sicherheitsproblem wird also dadurch verursacht, dass eine Benutzereingabe ungeprüft bzw. unverarbeitet weiter benutzt wird.&lt;br /&gt;
&lt;br /&gt;
Bei der sicheren Methode wird die Benutzereingabe nicht direkt übergeben.&lt;br /&gt;
&lt;br /&gt;
In diesem Beispiel wird eine php-Funktion benutzt, die dafür sorgt, dass Sonderzeichen entwertet werden&lt;br /&gt;
&lt;br /&gt;
So wird eine sicherere SQL Abfrage gebildet.&lt;br /&gt;
&lt;br /&gt;
Die an die Datenbank geschickte Abfrage sieht in diesem Fall so aus:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM users WHERE username='\'or\'1\'=\'1'&lt;br /&gt;
&lt;br /&gt;
Prinzipiell sollten alle Daten die von Außen kommen als unsicher angesehen werden und niemals ohne eine Prüfung und/oder Bearbeitung weiterverwendet werden.&lt;/div&gt;</summary>
		<author><name>Thomas.will</name></author>
	</entry>
</feed>