So now we have the ability to manipulate php and SQL. So in this case I managed to do adefacement on this page by updating the database. Everyone that loads this page up will now viewmy image by using the <img src=> tag and I have managed to spread the #AntiSec movementfurther.There are many arguments that can be passed in XSS and this is it at its most simplest form. Themore advanced XSS techniques rely on running pre-written scripts from a server owned by you.Even sometimes telling the code to download files or directories from the root server. There istheoretically no limit to what XSS can do if you can pull it off properly.
SQL Injection
SQL Injection is a form of attack on websites that uses the power of SQL. SQL Is a databaselanguage that has the power to store and retrieve data very much like an excel spreadsheet.With SQLi we can pass many arguments into the code. So lets get started, this is the php code thatnormally runs a webpage:
<?php// DB connection here:$Host = 'localhost' ;$User = 'Romekiller' ;$Pass = 'Alric' ;$DB = 'Resistance_Anonymous' ;
mysql_connect($Host, $User, $Pass);mysql_select_db($DB);
// Start of php code:$Name = $_POST['login'] ;
$sql = "SELECT * FROM members WHERE FirstName=$Name";print(“<table border='1'><tr><td>Name</td><td>Email</td><td>Password [MD5]</td></tr>”);
while ($row = mysql_fetch_array($sql)){echo(“<tr><td>$row['FirstName'] . "</td><td>” . $row['EMAIL_ADDRESS'] . “</td><td>“ . $row[Password'] . “</td></tr>;}Print(“</table>”);?>