\textbf{Begin by reading through the entire lab PM}. Remember to regularly check the
course homepage to see if we updated the PM, as we continuously improve the lab.
%
%\section{Lab group}
%First, you need to find a partner to work with. All students are expected to
%work in groups of two. If this is not possible, please contact the lab
%assistant. When you have somebody to work with you will need to choose a
%username and password to use on the TopDog server. Each group of two
%will have an account, so you will need to choose a username and password for the
%group. Please note the following:
%\begin{enumerate}
% \item Your username (not password) is public and will be shown to to the
% entire university on the scoreboard (which is shown on monitors around
% the campus).
% \item We reserve the right to ban stupid and/or offensive usernames for any
% reason.
% \item Both of you will have the password, so choose a password you don't use
% anywhere else.
% \item The password storage in TopDog is hashed and salted, however do not
% use a password that you care about.
%\end{enumerate}
%Tip: Generate a random password
%and write it down on a note in your wallet, or use a password manager!
\section{User accounts}\label{sec:register}
If you are register to the course, you will automatically have an account. If you are not registered, you need to contact a \href{https://www.lith.liu.se/studievagledning?l=en\&sc=true}{study chancellor}.
Now go to
\href{http://snickerboa.it.liu.se}{http://snickerboa.it.liu.se} and click on "login via SAML" and login with your LiU-id. If you don't wish your LiU-id to show on the scoreboard, you can change to a name of your choosing (at first login, if you want to change it again you need to contact us). However, we reserve the right to ban stupid and/or offensive user names for any reason.
%register an account, see \cref{fig:login}. Note that the registration link is
%hidden and must be typed just like that. The registration screen is shown in
%\cref{fig:register}. Note that registration requires you to type in the correct
%\texttt{passcode}, which is found in Lisam. The passcode is to discourage people
%outside the course to do the lab and appear on the scoreboard. Please do not
\caption{The TopDog scoreboard from 2016. Note the medals on some of the usernames.}
\label{fig:scoreboard}
\caption{The TopDog scoreboard from 2016. Note the medals on some of the
usernames.\label{fig:scoreboard}}
\end{figure}
\end{landscape}
\section{List of lessons}
\section{List of Lessons}
The following lessons are available:
\begin{description}\label{sec:lessons}
\item[Broken Session Management]
...
...
@@ -281,7 +246,7 @@ The following lessons are available:
\item[Unvalidated Redirects and Forwards]
\end{description}
\section{List of assignments}\label{sec:list_of_ass}
\section{List of Assignments}\label{sec:list_of_ass}
Below are the required assignments (there are hidden hints!):
\begin{description}
\item[Session Management Challenge 1]
...
...
@@ -294,7 +259,8 @@ Below are the required assignments (there are hidden hints!):
\item[Session Management Challenge 3]
\item[SQL Injection 1]
\item[SQL Injection 2]
{\color{white}The server first checks if the query contains \emph{one} @ before processing it!}
{\color{white}The server first checks if the query contains \emph{one} @
before processing it!}
\item[Insecure Cryptographic Storage Challenge 1]
\item[Insecure Cryptographic Storage Challenge 2]
{\color{white}Here, \enquote{2d cipher} refers to the
...
...
@@ -308,79 +274,94 @@ Below are the required assignments (there are hidden hints!):
\item[Failure to Restrict URL Access 1]
\item[CSRF 1]
\item[Cross Site Scripting 2]
{\color{white}Now the XSS filter is getting more clever,
but it's not perfect. Check the source code of the HTML returned from
the server to see which commands are filtered and which are not. Use the
hints from the slides.}
{\color{white}Now the XSS filter is getting more clever, but it's not
perfect. Check the source code of the HTML returned from the server
to see which commands are filtered and which are not. Use the hints
from the slides.}
\item[Session Management Challenge 4]
{\color{white}Can you guess a Session ID? It should
{\color{white}Can you guess a Session ID\@? It should
be somewhat larger than 20.}
\item[Failure to Restrict URL Access 2]
\item[Cross Site Scripting 3]
\item[Insecure Cryptographic Storage Challenge 3]
{\color{white}There are a number of ways
to defeat the crypto and get the encryption key in this challenge. The
quickest way is to submit base64 encoded spaces.}
{\color{white}There are a number of ways to defeat the crypto and get
the encryption key in this challenge. The quickest way is to submit
base64 encoded spaces.}
\item[SQL Injection 3]
{\color{white}To complete this challenge, you must craft a second
statement to return Mary Martin's credit card number as the current
statement only returns the customerName attribute. Note that the UNION
statement isn't filtered!}
statement only returns the customerName attribute. Note that the
UNION statement isn't filtered!}
\item[Insecure Direct Object Reference Bank]
{\color{white}To complete this challenge you
must first register an account. The account must have a unique name. The
next step is to click the refresh balance button. Capture this request, and
replay it with different account numbers until you find one with cash. If
you are the first person to attempt this challenge, the account number 1
should have 10 million in it. You should be able to figure out the rest.
See \cref{sec:faq-bank} if there's not enough money anywhere!}
must first register an account. The account must have a unique name.
The next step is to click the refresh balance button. Capture this
request, and replay it with different account numbers until you find
one with cash. If you are the first person to attempt this
challenge, the account number 1 should have 10 million in it. You
should be able to figure out the rest. See \cref{sec:faq-bank} if
there's not enough money anywhere!}
\end{description}
\chapter{Contributing to the lab}
We think the CTF lab is a great way to teach, and want to encourage you to submit your ideas and feedback to us. Do visit our \href{https://gitlab.liu.se/topdog/ctf-lab-pm}{internal project page}, where you can help us out! This is the LiU GitLab server, and you can file an issue by clicking on the issues link shown in \cref{fig:issues}.
\begin{figure}
\centering
\includegraphics[width=.9\linewidth]{issues.png}
\caption{Click on Issues to file an issue report.}
\label{fig:issues}
\end{figure}
We think that this lab is a great way to teach important concepts in information
security, and want to encourage you to
submit your ideas and feedback to us. Do visit our
\href{https://gitlab.liu.se/topdog/ctf-lab-pm}{internal project page}, where you
can help us out! This is the LiU GitLab server, and there are several ways of
helping out.
\section{Submit a Bug Report}
If you run into a bug, you are encouraged either to contact us directly, or file
a bug report on \href{https://gitlab.liu.se/topdog/ctf-lab-pm}{gitlab}. Click
the link shown in \cref{fig:issues} and fill out the details. The more specific
you can be, the more you will be able to help us
out!
\section{Ideas for Enhancements}
You can file more than just bug reports! If you feel something is missing, or
something could be done better, you can also submit enhancement ideas.
\section{Fork It!}
Are you familiar with git? If yes, then you can contribute even more! Fork the
\href{https://gitlab.liu.se/topdog/ctf-lab-pm}{repository}, commit your own changes, and then send us a merge request
(sometimes called a pull request). If you need help, please see the
\caption{Click on Issues to file an issue report.\label{fig:issues}}
\end{figure}
\chapter{Frequently Asked Questions (FAQ)}
This section will be updated with frequently asked questions about the lab.
\section{I'm stuck, what should I do?}
First make sure you have read through the whole lab PM. Second, consult and discuss with a friend (this is the best way of getting new ideas). Lastly, use the assistances drop-in time slot (see \cref{sec:lab_organization}).
\section{I am Stuck, What Should I Do?}
First make sure you have read through the whole lab PM\@. Second, consult and
discuss with a friend (this is the best way of getting new ideas). Lastly, use
the assistances drop-in time slot (see \cref{sec:lab_organization}).
\section{There is something wrong with the server!}
\section{There is Something Wrong With the Server!}
First check that your Internet connection is working and that your attack proxy
isn't giving you problems. If the TopDog server is unavailable, or if there's some
\emph{technical} issue with it that has nothing to do with the lab itself, first
wait a few minutes. If it doesn't come back it might be an outage (planned or
unplanned). If we are doing some planned work on the server this will be posted
on Lisam.
isn't giving you problems. If the TopDog server is unavailable, or if there's
some \emph{technical} issue with it that has nothing to do with the lab itself,
first wait a few minutes. If it doesn't come back it might be an outage (planned
or unplanned). If we are doing some planned work on the server this will be
posted on Lisam.
If the server is still down and there's nothing on Lisam saying it's a planned
outage, the server might be down. Please send an e-mail to the lab assistant,
see \cref{sec:contact}.
%\section{How do I create a TopDog account?}
%
%
%See \cref{sec:register}.
\section{Can I get bonus points for the exam?}
\section{Can I Get Bonus Points For the Exam?}
The scoreboard and its points, bonus points, and medals is for fun only. They
have absolutely nothing to do with passing the lab or with the examination of
the course. The lab assistant can see how many assignments you have finished,
independently of the scoreboard.
\section{What happens if I can't go to the coaching session?}
\section{What Happens If I Can't Go to the Coaching Session?}
The coaching sessions are not a compulsory part of the course. If you can't
attend, there is no penalty. However, the sessions can be valuable as you have
the opportunity to get coaching and ask questions about the lab. Also, you must
...
...
@@ -394,8 +375,9 @@ Try your skills on the challenges! If this is still not enough, check out
\section{I don't get a result key, only \enquote{Key Should be here! Please
refresh the home page and try again! If that doesn't work, sign in and out
again!}}
This is a bug that sometimes happens. Contact us (\cref{sec:contact}) and we'll
help you.
This is a bug that sometimes happens. We \emph{hope} that this issue has now
been solved, but if it does happen, please contact us (\cref{sec:contact}) and
we'll help you.
\section{The result key in insecure crypto challenges isn't working!}
Make sure you check that you've got UPPERCASE/lowercase correctly. Some online
...
...
@@ -405,49 +387,26 @@ calculators will mess this up. Also make sure it handles spaces correctly.
money left}\label{sec:faq-bank}
It can happen that the total amount of money is too small to pass the lab. In
this case, contact us at \cref{sec:contact} and we'll fill up bank with some
more money to steal :)
more money to steal!
\section{I love computer security and I am looking for thesis work!}
Don't hesitate to contact us at the Information Coding Group\footnote{https://liu.se/en/organisation/liu/isy/icg}. Also, if you like crypto we
highly recommend the course TSIT03
Don't hesitate to contact us at the Information Coding
Group\footnote{https://liu.se/en/organisation/liu/isy/icg}. Also, if you like
crypto we highly recommend the course TSIT03
Cryptology\footnote{http://www.icg.isy.liu.se/courses/tsit03/} that is given in
HT1 every year.
\section*{About this document}
This lab memo is intended for students of the computer security courses \texttt{TSIT01} and
\texttt{TSIT02} at Linköping University.
\section*{Changelog}
\begin{description}
\item[2019] Adaption to the new registration procedure.
\item[2017] Revised for the 2017 course.
\item[2016] Initial version.
\end{description}
\section*{Acknowledgements}
This lab owes its existence to Anders Märak Leffler who brought this software to
my attention back in 2015. I also want to thank the OWASP Foundation and the
OWASP chapter in Gothenburg for help with getting started. Thanks to the LiU IT
department who was willing to set up and support a web application server that,
contrary to all common sense and in violation of
probably a dozen IT policies, contains all kinds of web vulnerabilities. Also
thanks to Niklas Johansson for helping me get all the lab details straight and,
of course, prof. Jan-Åke Larsson, who gave us the go-ahead to build what is
probably going to be a very interesting lab course.
\bigskip
\noindent
Linköping, November 2016\\
\emph{Jonathan Jogenfors}
\appendix
\chapter{Tools}\label{sec:tools}
Penetration testing requires you to have a large and diverse toolbox. In this
lab, you will mostly use online tools (that you'll have to find yourself) and
one offline tool: ZAP. The online tools can be things such as online
one offline tool: ZAP\@. The online tools can be things such as online
calculators, hex-to-dec-converters, decryption tools for cryptographic
algorithms etc. Use Google! Also, the slides from the lab preparation lecture
will be of use to you.
\section{Viewing the source code}
\section{Viewing the Source Code}
The first step in most web attacks is usually to look at the source code. This
will show you the raw HTML/CSS/JavaScript that builds up the page. For a quick
reference on what the HTML tags do, check out the W3 HTML
...
...
@@ -471,18 +430,16 @@ source code of TopDog itself and not the module.