It looks like you're new here. If you want to get involved, click one of these buttons!
SELECT * FROM users WHERE id = '\" + UID + \"'\";
SELECT * FROM users WHERE id = '1';show tables--
SELECT * FROM users WHERE id = '1';drop table users--
<?php
if(isset($_GET['Submit'])){
// Retrieve data
$id = $_GET['id'];
$getid = \"SELECT first_name, last_name FROM users WHERE user_id = '$id'\";
$result = mysql_query($getid) or die('<pre>' . mysql_error() . '</pre>' );
$num = mysql_numrows($result);
$i = 0;
while ($i < $num) {
$first = mysql_result($result,$i,\"first_name\");
$last = mysql_result($result,$i,\"last_name\");
echo '<pre>';
echo 'ID: ' . $id . '<br>First name: ' . $first . '<br>Surname: ' . $last;
echo '</pre>';
$i++;
}
}
?>
\"SELECT first_name, last_name FROM users WHERE user_id = '$id'\";
ID: 1
First name: admin
Surname: admin
<?php
if (isset($_GET['Submit'])) {
// Retrieve data
$id = $_GET['id'];
$id = stripslashes($id);
$id = mysql_real_escape_string($id);
if (is_numeric($id)){
$getid = \"SELECT first_name, last_name FROM users WHERE user_id = '$id'\";
$result = mysql_query($getid) or die('<pre>' . mysql_error() . '</pre>' );
$num = mysql_numrows($result);
$i=0;
while ($i < $num) {
$first = mysql_result($result,$i,\"first_name\");
$last = mysql_result($result,$i,\"last_name\");
echo '<pre>';
echo 'ID: ' . $id . '<br>First name: ' . $first . '<br>Surname: ' . $last;
echo '</pre>';
$i++;
}
}
}
?>
mysql_real_escape_string();
stripslashes();
True, be sure to distinguish the difference between normal SQL queries you run as a db admin and the ones you inject into web forms, as they are slightly different.
Examples identify columns you can inject the command into,
The comment syntax /* / --
Nice article though :)
True, be sure to distinguish the difference between normal SQL queries you run as a db admin and the ones you inject into web forms, as they are slightly different.
Examples identify columns you can inject the command into,
The comment syntax /* / --
Nice article though :)
Yes it wasn't much of a "tutorial". I focused mainly on showing how SQL injection works and what happens with the SQL queries.
True, be sure to distinguish the difference between normal SQL queries you run as a db admin and the ones you inject into web forms, as they are slightly different.
Examples identify columns you can inject the command into,
The comment syntax /* / --
Nice article though :)
Yes it wasn't much of a "tutorial". I focused mainly on showing how SQL injection works and what happens with the SQL queries.
Its nice to see something different than the classic union all select 1,2,3 etc , theres hundreds of other ways to inject than that lol/.