aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--synopsis.tex80
-rw-r--r--xss/comments.dbbin0 -> 8192 bytes
-rw-r--r--xss/index.php36
3 files changed, 105 insertions, 11 deletions
diff --git a/synopsis.tex b/synopsis.tex
index 0c8a520..e844895 100644
--- a/synopsis.tex
+++ b/synopsis.tex
@@ -612,7 +612,7 @@ continue studying it in the future.
\appendix
\section{SQL injection example}
-\subsection{HTML code}
+\subsection{index.html}
\begin{minted}{html}
<!DOCTYPE HTML>
<html>
@@ -642,7 +642,7 @@ input {
\end{minted}
\newpage
-\subsection{PHP code}
+\subsection{login.php}
\begin{minted}{php}
<?php
class MyDB extends SQLite3 {
@@ -651,27 +651,25 @@ input {
}
}
- if(isset($_POST['email'], $_POST['pass']))
- {
+ if (isset($_POST['email'], $_POST['pass'])) {
$email = $_POST['email'];
$pass = $_POST['pass'];
$db = new MyDB();
- $sql = 'SELECT * FROM Users WHERE email=\''.$email.
- '\' AND password=\''.$pass.'\'';