(Macintosh; Intel Mac OS X 10.14; rv:75.0) Gecko/20100101 Firefox/75.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: ja,en;q=0.7,en-US;q=0.3 Accept-Encoding: gzip, deflate Connection: close Upgrade-Insecure-Requests: 1...
* FROM users WHERE email = $email AND password = $password; SELECT * FROM users WHERE email = ‘[email protected]’ AND password = ‘password’ SELECT * FROM users WHERE email = ‘[email protected]’ -- AND password = $password; [email protected]&password=password [email protected]’ --&password=password ☠
'Accessories' AND released = 1; // SQL のシンタックスとしておかしいのでエラーになる SELECT * FROM products WHERE category = 'Accessories'' AND released = 1; // シングルクォーテーション 2つでSQLシンタックスとして正しい // クエリの内容は正常系と変わらないので、同じレスポンスが返る SELECT * FROM products WHERE category = 'Accessories''' AND released = 1;
SQL を想像してペイロードを考えよう - SELECT * FROM users WHERE name = $name AND pass = $pass - SELECT * FROM users WHERE name = 'administrator' OR '1'='1'-- AND pass=$pass
= :city AND gender = :gender'); $stmt->execute([':city' => $city, ':gender' => $gender]); OK $prepare = $pdo->prepare('SELECT * FROM users WHERE id = '. $id. ';'); $prepare->execute(); NG PHP