mercredi 9 mars 2016

Je n'arrive pas à m'auto-hacker

Bonjour !

Je suis entrain de faire un site pour un projet personnel et par envie je voulais voir si je savais me hacker. Bref j'essaie, je n'y arrive pas et pourtant je n'ai fait aucune protection sur mon code.
Voilà mon code :
Code PHP:

                     $conn = new PDO("mysql:host=$servername;dbname=mydb"$username$password);
                        
$conn->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
                        
$req $conn->query("SELECT `Name` FROM `computers` WHERE `Classrooms_idClassroom` = "$_GET["room"]);
                        
                        while (
$data $req->fetch())
                        {
                            echo 
$data;
                            
                        } 

Donc dans l'url j'essaye de mettre un ' j'obtiens bien une erreur :
Code HTML:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1' in C:\xampp\htdocs\poool\computers.php:50 Stack trace: #0 C:\xampp\htdocs\poool\computers.php(50): PDO->query('SELECT `Name` F...') #1 {main} thrown in C:\xampp\htdocs\poool\computers.php on line 50
Donc qu'est ce que je suis censé mettre dans mon url pour me hacker? Merci !


from Hackademics : Forum de hacking – hackers white hat – cours de securite informatique, apprendre langage python, tutoriels de reverse engineering http://ift.tt/1RRDnIe
via IFTTT

Aucun commentaire:

Enregistrer un commentaire