cheat-sheet.tex 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. \documentclass[11pt]{exam}
  2. \newcommand{\myname}{Vecna}
  3. \newcommand{\myemail}{vvecna@uwaterloo.ca}
  4. \newcommand{\myhwtype}{netsim}
  5. \newcommand{\myhwnum}{Cheat Sheet}
  6. \newcommand{\myclass}{SPARCS}
  7. \newcommand{\mylecture}{}
  8. \newcommand{\mysection}{2024}
  9. \date{2024 May 13}
  10. % Prefix for numedquestion's
  11. \newcommand{\questiontype}{Level}
  12. % Use this if your "written" questions are all under one section
  13. % For example, if the homework handout has Section 5: Written Questions
  14. % and all questions are 5.1, 5.2, 5.3, etc. set this to 5
  15. % Use for 0 no prefix. Redefine as needed per-question.
  16. \newcommand{\writtensection}{0}
  17. \usepackage{amsmath, amsfonts, amsthm, amssymb} % Some math symbols
  18. \usepackage{enumerate}
  19. \usepackage{enumitem}
  20. \usepackage{graphicx}
  21. \usepackage{hyperref}
  22. \usepackage[all]{xy}
  23. \usepackage{wrapfig}
  24. \usepackage{fancyvrb}
  25. \usepackage[T1]{fontenc}
  26. \usepackage{listings}
  27. \usepackage{centernot}
  28. \usepackage{mathtools}
  29. \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
  30. \DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor}
  31. \DeclarePairedDelimiter{\card}{\vert}{\vert}
  32. % Uncomment the following line to get Solarized-themed source listings
  33. % You will have had to already installed the solarized-light package
  34. % https://github.com/jez/latex-solarized
  35. %
  36. %\usepackage{solarized-light}
  37. \setlength{\parindent}{0pt}
  38. \setlength{\parskip}{5pt plus 1pt}
  39. \pagestyle{empty}
  40. \def\indented#1{\list{}{}\item[]}
  41. \let\indented=\endlist
  42. \newcounter{questionCounter}
  43. \newcounter{partCounter}[questionCounter]
  44. \newenvironment{namedquestion}[1][\arabic{questionCounter}]{%
  45. \addtocounter{questionCounter}{1}%
  46. \setcounter{partCounter}{0}%
  47. \vspace{.2in}%
  48. \noindent{\bf \questiontype \; \arabic{questionCounter}. #1}%
  49. \vspace{0.3em} \hrule \vspace{.1in}%
  50. }{}
  51. \newenvironment{numedquestion}[0]{%
  52. \stepcounter{questionCounter}%
  53. \vspace{.2in}%
  54. \ifx\writtensection\undefined
  55. \noindent{\bf \questiontype \; \arabic{questionCounter}. }%
  56. \else
  57. \if\writtensection0
  58. \noindent{\bf \questiontype \; \arabic{questionCounter}. }%
  59. \else
  60. \noindent{\bf \questiontype \; \writtensection.\arabic{questionCounter} }%
  61. \fi
  62. \vspace{0.3em} \hrule \vspace{.1in}%
  63. }{}
  64. \newenvironment{alphaparts}[0]{%
  65. \begin{enumerate}[label=\textbf{(\alph*)}]
  66. }{\end{enumerate}}
  67. \newenvironment{arabicparts}[0]{%
  68. \begin{enumerate}[label=\textbf{\arabic{questionCounter}.\arabic*})]
  69. }{\end{enumerate}}
  70. \newenvironment{questionpart}[0]{%
  71. \item
  72. }{}
  73. \newcommand{\answerbox}[1]{
  74. \begin{framed}
  75. \vspace{#1}
  76. \end{framed}}
  77. \pagestyle{head}
  78. \headrule
  79. \header{\textbf{\myclass\ \mylecture\mysection}}%
  80. {\textbf{\myname\ (\myemail)}}%
  81. {\textbf{\myhwtype\ \myhwnum}}
  82. \begin{document}
  83. \thispagestyle{plain}
  84. \begin{center}
  85. {\Large \myclass{} \myhwtype{} \myhwnum} \\
  86. \myname{} (\myemail{}) \\
  87. 2024 May 13
  88. \end{center}
  89. \begin{namedquestion}[Getting started]
  90. Purpose: Introduce netsim game
  91. \begin{enumerate}
  92. \item Click red restart button
  93. \item Click green pause button while packet is visible
  94. \item Click on any of the 4 computers
  95. \item Click on a packet (the purple circle)
  96. \item Press ``+'' button on the side to add packets
  97. \item Add a packet (no need to fill in the fields at this time)
  98. \item Press the new arrow button to send the packet
  99. \end{enumerate}
  100. \end{namedquestion}
  101. \begin{namedquestion}[Packet fields]
  102. Purpose: Introduce packet fields
  103. Send 1 packet with ``srcip: Alice'' and ``dstip: Bob''
  104. \end{namedquestion}
  105. \begin{namedquestion}[Ping]
  106. Purpose: Introduce ICMP (ping)
  107. Send 4 packets with ``srcip: Alice'', ``dstip: Google'', ``proto: ICMP'' (can use ``Repeat: 4'' instead of pressing send 4 times)
  108. \end{namedquestion}
  109. \begin{namedquestion}[Routing]
  110. Purpose: Same as ``Packet fields'' but with an internal view of how routers are the ones that contain addressing information to forward packets
  111. Send 1 packet with ``srcip: Bob'', ``dstip: Carol'' (``Sent from'' field can be Bob or anyone else)
  112. \end{namedquestion}
  113. \begin{namedquestion}[Modems]
  114. Purpose: Modems forward packets from computers within an internal network (home, with Alice and Bob) to computers outside the network (Google). Specifically, this activity is about how ping requests work with modems.
  115. Send 1 packet with ``srcip: Bob'', ``dstip: Carol'' (``Sent from'' field can be Bob or anyone else)
  116. \end{namedquestion}
  117. \newpage % Make each question stay on 1 page
  118. \begin{namedquestion}[Encryption]
  119. Purpose: Demonstrate a key exchange allowing Alice and Bob to send encrypted messages.
  120. \begin{enumerate}
  121. \item Alice sends 1 packet with ``srcip: Alice'', ``dstip: Bob'', ``proto: encryption'', ``type: keyrequest'', ``key: 12345''
  122. \item Alice receives a response packet with ``type: keyresponse'', ``key: 67890''
  123. \item Alice sends 1 packet with ``srcip: Alice'', ``dstip: Bob'', ``proto: encryption'', ``type: message'', ``key: 67890'' (where this key is the one Bob sent her)
  124. \end{enumerate}
  125. \end{namedquestion}
  126. \begin{namedquestion}[IP Spoofing]
  127. Purpose: The source IP in the header of a packet can be changed without being detected by the recipient of a packet. This is known as `spoofing' a packet.
  128. Alice sends 1 packet with ``srcip: Carol'', ``dstip: Bob''
  129. \end{namedquestion}
  130. \begin{namedquestion}[Stealing packets]
  131. Purpose: Spoofing can be used to get a link layer device (a switch) associate your hardware address (known as MAC address) with any network layer (IP) address that you send in the source address field. You can impersonate another user this way.
  132. Alice sends 1 packet with ``srcip: Carol'', ``dstip: Google'', but \textbf{timing is important!}
  133. \begin{enumerate}
  134. \item Carol sends a ping to Google
  135. \item Carol sends a second ping as Google sends a pong response to the first ping
  136. \item Alice must send the above packet \textbf{after Carol sends the second ping, before the Central Hub receives the second pong response from Google}
  137. \end{enumerate}
  138. \end{namedquestion}
  139. \begin{namedquestion}[Basic DoS]
  140. Purpose: To overwhelm a given server with packets such that it cannot respond to any more packets. This is known as a ``denial of service'' attack.
  141. Alice sends at least 30 packets with ``dstip: Google'' all at once (use Repeat)
  142. \end{namedquestion}
  143. \begin{namedquestion}[Distributed DoS]
  144. Purpose: The previous attack can be mitigated by blocking the IP of the computer that sends the large number of requests. This is known as IP-based blocking. In order to circumvent this attack, an attacker can control several ``Zombie'' computers, for instance, in a botnet and force them to send packets. The server cannot block a large number of IPs that belong to legitimate (but botnet-infected) users.
  145. Each zombie computer sends at least 55 packets with ``dstip: Google'' all at once (use Repeat)
  146. \end{namedquestion}
  147. \newpage
  148. \begin{namedquestion}[Smurf attack]
  149. Purpose: This is another attack to circumvent the DoS mitigation technique of IP-based blocking and is thus similar to the attack in activity 10. It differs from the attack in activity 10 in that it doesn't require control of the zombie machines in order to send packets from them. In other words, Bob, Carol, and Dave's machines behave in an expected manner to ICMP packets with the ``Broadcast'' IP and effectively, this leads them to behaving like zombies.
  150. Alice sends enough ($\approx 30$) packets with ``srcip: Google'', ``dstip: Broadcast'', ``proto: ICMP'' all at once (use Repeat)
  151. \end{namedquestion}
  152. \begin{namedquestion}[Mallory-in-the-middle]
  153. Purpose: To combine the IP spoofing skills to perform an attack that convinces both parties (Alice, Bob) who wish to communicate using public-key cryptography into thinking that they are talking to each other securely, whereas as an attacker (Mallory), you obtain the plaintext message.
  154. \begin{enumerate}
  155. \item Alice sends a packet with ``srcip: Alice'', ``dstip: Bob'', ``proto: encryption'', ``type: keyrequest'', ``key: 12345'' which Mallory intercepts
  156. \item Mallory (you) sends a packet with ``srcip: Alice'', ``dstip: Bob'', ``proto: encryption'', ``type: keyrequest'', \textbf{``key: 31337''} so Bob believes Alice's key is 31337
  157. \item Bob sends a packet with ``srcip: Bob'', ``dstip: Alice'', ``proto: encryption'', ``type: keyresponse'', ``key: 67890'' which Mallory intercepts
  158. \item Mallory (you) sends a packet with ``srcip: Bob'', ``dstip: Alice'', ``proto: encryption'', ``type: keyresponse'', \textbf{``key: 31337''} so Alice believes Bob's key is 31337
  159. \item Alice sends a packet with ``srcip: Alice'', ``dstip: Bob'', ``proto: encryption'', ``type: message'', ``key: 31337'' which Mallory intercepts and decrypts
  160. \item Mallory (you) sends a packet with ``srcip: Alice'', ``dstip: Bob'', ``proto: encryption'', ``type: message'', \textbf{``key: 67890''}, re-encrypted with Bob's key so Bob does not know the message was intercepted
  161. \end{enumerate}
  162. \end{namedquestion}
  163. \end{document}