slides/slides03.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Sun, 20 Sep 2015 22:09:58 +0100
changeset 381 036a762b02cf
parent 239 0db764174afb
child 391 a612dd3ddc81
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
     2
\usepackage{../slides}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
     3
\usepackage{../graphics}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
     4
\usepackage{../langs}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
     5
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
     6
\setmonofont[Scale=.88]{Consolas}
152
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 115
diff changeset
     7
\newfontfamily{\consolas}{Consolas}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
     9
\hfuzz=220pt 
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    10
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
% beamer stuff 
381
036a762b02cf updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 239
diff changeset
    12
\renewcommand{\slidecaption}{SEN 03, King's College London}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    18
\begin{frame}[t]
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\frametitle{%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
  \begin{tabular}{@ {}c@ {}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
  \\
381
036a762b02cf updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 239
diff changeset
    22
  \LARGE Security Engineering (3)\\[-3mm] 
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
  \end{tabular}}\bigskip\bigskip\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    25
  \normalsize
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
  \begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
  \begin{tabular}{ll}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
  Email:  & christian.urban at kcl.ac.uk\\
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    29
  Office: & S1.27 (1st floor Strand Building)\\
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
    30
  Slides: & KEATS (also home work is there)
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    34
\end{frame}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    35
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    37
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    38
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    39
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    40
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    41
\frametitle{\begin{tabular}{c}Network Applications:\\[-1mm] Privilege Separation\end{tabular}}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    42
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    43
\begin{center}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    44
  \begin{tikzpicture}[scale=1]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    45
  
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    46
  \draw[line width=1mm] (-.3, 0) rectangle (1.5,2);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    47
  \draw (4.7,1) node {Internet};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    48
  \draw (-2.7,1.7) node {\footnotesize Application};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    49
  \draw (0.6,1.7) node {\footnotesize Interface};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    50
  \draw (0.6,-0.4) node {\footnotesize \begin{tabular}{c}unprivileged\\[-1mm] process\end{tabular}};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    51
  \draw (-2.7,-0.4) node {\footnotesize \begin{tabular}{c}privileged\\[-1mm] process\end{tabular}};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    52
  
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    53
  \draw[line width=1mm] (-1.8, 0) rectangle (-3.6,2);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    54
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    55
  \draw[white] (1.7,1) node (X) {};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    56
  \draw[white] (3.7,1) node (Y) {};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    57
  \draw[red, <->, line width = 2mm] (X) -- (Y);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    58
 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    59
  \draw[red, <->, line width = 1mm] (-0.6,1) -- (-1.6,1);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    60
  \end{tikzpicture}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    61
\end{center}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    62
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    63
\begin{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    64
\item the idea is make the attack surface smaller and 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    65
mitigate the consequences of an attack
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    66
\item you need an OS that supports different roles (root vs.~users)
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    67
\end{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    68
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    69
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    70
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    71
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    72
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    73
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    74
\frametitle{Weaknesses of Unix AC}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    75
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    76
\begin{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    77
\item if you have too many roles (for example too finegrained AC), then
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    78
  hierarchy is too complex\medskip\\ \textcolor{gray}{you invite situations
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    79
    like\ldots let's be root}\bigskip
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    80
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    81
\item you can still abuse the system\ldots
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    82
\end{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    83
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    84
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    85
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    86
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    88
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    89
\frametitle{A ``Cron''-Attack}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    90
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    91
The idea is to trick a privileged person to do something on your
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    92
behalf:
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    93
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    94
\begin{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    95
\item root:\\\texttt{rm /tmp/*/*}\bigskip\bigskip\pause
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    96
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    97
\small
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    98
\begin{minipage}{1.1\textwidth}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
    99
\textcolor{gray}{the shell behind the scenes:}\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   100
\textcolor{gray}{\texttt{rm /tmp/dir$_1$/file$_1$ /tmp/dir$_1$/file$_2$ /tmp/dir$_2$/file$_1$ \ldots}}\bigskip\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   101
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   102
\textcolor{gray}{this takes time}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   103
\end{minipage}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   104
\end{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   105
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   106
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   107
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   108
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   109
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   110
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   111
\frametitle{A ``Cron''-Attack}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   112
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   113
\begin{enumerate}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   114
\item attacker \textcolor{gray}{(creates a fake passwd file)}\\ 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   115
\texttt{mkdir /tmp/a; cat > /tmp/a/passwd}\medskip
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   116
\item root \textcolor{gray}{(does the daily cleaning)}\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   117
\texttt{rm /tmp/*/*}\medskip\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   118
\hspace{2cm}\textcolor{gray}{records that \texttt{/tmp/a/passwd}}\\ 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   119
\hspace{2cm}\textcolor{gray}{should be deleted, but does not do it yet}\medskip\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   120
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   121
\item attacker \textcolor{gray}{(meanwhile deletes the fake passwd file, and establishes a link to 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   122
the real passwd file)}\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   123
\texttt{rm /tmp/a/passwd; rmdir /tmp/a;}\\\texttt{ln -s /etc /tmp/a}\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   124
\item root now deletes  the real passwd file
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   125
\end{enumerate}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   126
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   127
\only<2>{
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   128
\begin{textblock}{11}(2,5)
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   129
\begin{tikzpicture}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   130
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   131
{\normalsize\color{darkgray}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   132
\begin{minipage}{9.5cm}\raggedright
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   133
To prevent this kind of attack, you need additional
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   134
policies (don't do such operations as root).
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   135
\end{minipage}};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   136
\end{tikzpicture}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   137
\end{textblock}}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   138
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   139
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   140
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   141
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   142
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   143
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   144
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   145
\frametitle{\Large Buffer Overflow Attacks}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   146
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   147
\begin{center}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   148
\begin{columns}[b]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   149
\begin{column}{.4\textwidth}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   150
\centering
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   151
\includegraphics[scale=1.2]{../pics/barrier.jpg}\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   152
lectures so far
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   153
\end{column}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   154
\begin{column}<2>{.4\textwidth}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   155
\centering
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   156
\includegraphics[scale=0.32]{../pics/trainwreck.jpg}\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   157
today
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   158
\end{column}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   159
\end{columns}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   160
\end{center}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   161
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   162
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   163
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   164
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   165
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   166
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   167
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   168
\frametitle{Smash the Stack for Fun\ldots}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   169
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   170
\begin{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   171
\item {\bf Buffer Overflow Attacks} or\\ {\bf Smashing the Stack Attacks}\medskip
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   172
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   173
\item one of the most popular attacks, unfortunately\\ 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   174
($>$ 50\% of security incidents reported at CERT are related 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   175
to buffer overflows)
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   176
\begin{flushright}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   177
\small\url{http://www.kb.cert.org/vuls}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   178
\end{flushright}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   179
\medskip
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   180
\item made popular in an article from 1996 by Elias Levy
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   181
(also known as Aleph One):\\
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   182
\begin{center}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   183
{\bf ``Smashing The Stack For Fun and Profit''}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   184
\end{center}\medskip
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   185
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   186
\begin{flushright}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   187
\small\url{http://phrack.org/issues/49/14.html}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   188
\end{flushright} 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   189
 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   190
\end{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   191
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   192
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   193
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   194
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   195
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   196
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   197
\frametitle{A Long Printed ``Twice''}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   198
\mbox{}\\[-10mm]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   199
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   200
\footnotesize
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   201
\lstinputlisting[language=C,xleftmargin=4mm]{../progs/C0.c}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   202
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   203
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   204
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   205
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   206
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   207
\begin{frame}[c]
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   208
\frametitle{Printing Out Zombies}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   209
\mbox{}\\[-10mm]
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   210
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   211
\footnotesize
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   212
\lstinputlisting[language=C,xleftmargin=4mm]{../progs/C1.c}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   213
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   214
\end{frame}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   215
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   216
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   217
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   218
\begin{frame}[c]
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   219
\frametitle{A ``Login'' Function (1)}
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   220
\mbox{}\\[-10mm]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   221
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   222
\footnotesize
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   223
\lstinputlisting[language=C,xleftmargin=4mm]{../progs/C2a.c}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   224
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   225
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   226
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   227
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   228
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   229
\begin{frame}[c]
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   230
\frametitle{A ``Login'' Function (2)}
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   231
\mbox{}\\[-10mm]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   232
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   233
\footnotesize
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   234
\lstinputlisting[language=C,xleftmargin=-3mm]{../progs/C2b.c}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   235
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   236
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   237
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   238
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   239
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   240
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   241
\frametitle{What the Hell Is Going On?}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   242
216
38718062709a updated C2
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 211
diff changeset
   243
\begin{itemize}
38718062709a updated C2
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 211
diff changeset
   244
\item Let's start with a very simple program:
38718062709a updated C2
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 211
diff changeset
   245
\end{itemize}
38718062709a updated C2
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 211
diff changeset
   246
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   247
\lstinputlisting[language=C,xleftmargin=4mm]{../progs/example1.c}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   248
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   249
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   250
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   251
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   252
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   253
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   254
\frametitle{Memory}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   255
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   256
\begin{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   257
\item each process will get a chunk of memory that is organised as
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   258
follows:
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   259
\end{itemize}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   260
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   261
\begin{center}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   262
  \begin{tikzpicture}[scale=0.8]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   263
  %\draw[step=1cm] (-3,-3) grid (3,3);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   264
  \draw[line width=1mm] (-2, -3) rectangle (2,3);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   265
  \draw[line width=1mm] (-2,1) -- (2,1);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   266
  \draw[line width=1mm] (-2,-1) -- (2,-1);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   267
  \draw (0,2) node {\large\tt text};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   268
  \draw (0,0) node {\large\tt heap};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   269
  \draw (0,-2) node {\large\tt stack};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   270
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   271
  \draw (-2.7,3) node[anchor=north east] {\tt\begin{tabular}{@{}l@{}}lower\\ address\end{tabular}};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   272
  \draw (-2.7,-3) node[anchor=south east] {\tt\begin{tabular}{@{}l@{}}higher\\ address\end{tabular}};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   273
  \draw[->, line width=1mm] (-2.5,3) -- (-2.5,-3);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   274
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   275
  \draw (2.7,-2) node[anchor=west] {\tt grows};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   276
  \draw (2.7,-3) node[anchor=south west] {\tt\footnotesize older};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   277
  \draw (2.7,-1) node[anchor=north west] {\tt\footnotesize newer};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   278
  \draw[|->, line width=1mm] (2.5,-3) -- (2.5,-1);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   279
  \end{tikzpicture}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   280
\end{center}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   281
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   282
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   283
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   284
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   285
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   286
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   287
\frametitle{The Stack}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   288
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   289
\begin{textblock}{7}(1,1)
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   290
  \begin{tikzpicture}[scale=0.8]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   291
  %\draw[step=1cm] (-3,-1) grid (3,8);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   292
  \draw[gray!20,fill=gray!20] (-1, 0) rectangle (1,-1);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   293
  \draw[line width=1mm] (-1,-1.2) -- (-1,7.4);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   294
  \draw[line width=1mm] ( 1,-1.2) -- ( 1,7.4);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   295
  \draw (0,-1) node[anchor=south] {\tt main};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   296
  \draw[line width=1mm] (-1,0) -- (1,0);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   297
  \draw (0,0) node[anchor=south] {\tt arg$_3$=3};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   298
  \draw[line width=1mm] (-1,1) -- (1,1);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   299
  \draw (0,1) node[anchor=south] {\tt arg$_2$=2};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   300
  \draw[line width=1mm] (-1,2) -- (1,2);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   301
  \draw (0,2) node[anchor=south] {\tt arg$_1$=1};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   302
  \draw[line width=1mm] (-1,3) -- (1,3);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   303
  \draw (0,3.1) node[anchor=south] {\tt ret};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   304
  \draw[line width=1mm] (-1,4) -- (1,4);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   305
  \draw (0,4) node[anchor=south] {\small\tt last sp};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   306
  \draw[line width=1mm] (-1,5) -- (1,5);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   307
  \draw (0,5) node[anchor=south] {\tt buf$_1$};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   308
  \draw[line width=1mm] (-1,6) -- (1,6);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   309
  \draw (0,6) node[anchor=south] {\tt buf$_2$};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   310
  \draw[line width=1mm] (-1,7) -- (1,7);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   311
  \draw (2,6.1) node[anchor=south] {\code{$esp}};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   312
  \draw[<-,line width=0.5mm] (1.1,7) -- (2.5,7);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   313
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   314
  \draw[->,line width=0.5mm] (1,4.5) -- (1.8,4.5) -- (1.8, 0) -- (1.1,0); 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   315
  \draw[->,line width=0.5mm] (1,3.5) -- (2.5,3.5);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   316
  \draw (2.6,3.1) node[anchor=south west] {\tt back to main()};
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   317
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   318
  \draw[->,red,line width=2mm] (2.5,0.1) -- (4.2,0.1);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   319
\end{tikzpicture}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   320
\end{textblock}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   321
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   322
\begin{textblock}{7}(6.4,8)
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   323
\begin{bubble}[6.8cm]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   324
\footnotesize
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   325
\lstinputlisting[language=C,xleftmargin=5mm]{../progs/example1.c} 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   326
\end{bubble}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   327
\end{textblock}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   328
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   329
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   330
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   331
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   332
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   333
\begin{frame}[c]
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   334
\frametitle{Behind the Scenes}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   335
223
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   336
\only<2->{
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   337
\begin{textblock}{7}(1,1)
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   338
\begin{bubble}[6.8cm]
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   339
\footnotesize
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   340
\lstinputlisting[language=C,xleftmargin=5mm]{../progs/example1.c} 
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   341
\end{bubble}
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   342
\end{textblock}}
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   343
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   344
\only<2>{
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   345
\begin{textblock}{7}(5,8)
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   346
\footnotesize
226
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   347
\lstinputlisting[language={[x86masm]Assembler},morekeywords={movl},xleftmargin=5mm,numbers=none]{../progs/example1a.s} 
223
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   348
\end{textblock}}
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   349
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   350
\only<3>{
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   351
\begin{textblock}{7}(5,8)
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   352
\footnotesize
226
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   353
\lstinputlisting[language={[x86masm]Assembler},morekeywords={movl,movw},xleftmargin=5mm,numbers=none]{../progs/example1b.s} 
223
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   354
\end{textblock}}
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   355
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   356
\end{frame}
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   357
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   358
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   359
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   360
\begin{frame}[c]
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   361
\frametitle{Overwriting the Stack}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   362
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   363
\begin{textblock}{7}(1,2)
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   364
  \begin{tikzpicture}[scale=0.8]
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   365
  %\draw[step=1cm] (-3,-1) grid (3,8);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   366
  \draw[gray!20,fill=gray!20] (-1, 0) rectangle (1,-1);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   367
  \draw[line width=1mm] (-1,-1.2) -- (-1,6.4);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   368
  \draw[line width=1mm] ( 1,-1.2) -- ( 1,6.4);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   369
  \draw (0,-1) node[anchor=south] {\tt main};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   370
  \draw[line width=1mm] (-1,0) -- (1,0);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   371
  \draw (0,0) node[anchor=south] {\tt arg$_3$=3};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   372
  \draw[line width=1mm] (-1,1) -- (1,1);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   373
  \draw (0,1) node[anchor=south] {\tt arg$_2$=2};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   374
  \draw[line width=1mm] (-1,2) -- (1,2);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   375
  \draw (0,2) node[anchor=south] {\tt arg$_1$=1};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   376
  \draw[line width=1mm] (-1,3) -- (1,3);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   377
  \draw (0,3.1) node[anchor=south] {\tt ret};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   378
  \draw[line width=1mm] (-1,4) -- (1,4);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   379
  \draw (0,4) node[anchor=south] {\small\tt last sp};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   380
  \draw[line width=1mm] (-1,5) -- (1,5);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   381
  \draw (0,5) node[anchor=south] {\tt buf};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   382
  \draw[line width=1mm] (-1,6) -- (1,6);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   383
  \draw (2,5.1) node[anchor=south] {\code{$esp}};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   384
  \draw[<-,line width=0.5mm] (1.1,6) -- (2.5,6);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   385
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   386
  \draw[->,line width=0.5mm] (1,4.5) -- (1.8,4.5);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   387
  \draw (2.5,4.1) node[anchor=south] {\code{??}};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   388
  
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   389
  \draw[->,line width=0.5mm] (1,3.5) -- (2.5,3.5);
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   390
  \draw (2.6,3.1) node[anchor=south west] {\tt jump to \code{\\x080483f4}};
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   391
\end{tikzpicture}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   392
\end{textblock}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   393
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   394
\begin{textblock}{7}(1,13.5)
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   395
\code{char buf[8] = "AAAAAAAABBBB\\xf4\\x83\\x04\\x08\\x00"}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   396
\end{textblock}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   397
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   398
\end{frame}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   399
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   400
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   401
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   402
\begin{frame}[c]
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   403
\frametitle{Payloads}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   404
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   405
\begin{itemize}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   406
\item the idea is that you store some code in the buffer (the payload)
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   407
\item you then override the return address to execute this payload\medskip
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   408
\item normally you start a root-shell\pause
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   409
\item difficulty is to guess the right place where to ``jump''
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   410
\end{itemize}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   411
  
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   412
\end{frame}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   413
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   414
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   415
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
221
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   416
\begin{frame}[t]
239
0db764174afb updated home works
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 226
diff changeset
   417
\frametitle{Starting a Shell}
221
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   418
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   419
\small
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   420
\lstinputlisting[language=C,numbers=none,xleftmargin=-6mm]{../progs/o1.c}
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   421
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   422
\begin{textblock}{7}(5,7.5)
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   423
\begin{bubble}[7cm]
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   424
\lstinputlisting[language=C,numbers=none,xleftmargin=-0mm]{../progs/shell.c}
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   425
\end{bubble}
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   426
\end{textblock}
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   427
  
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   428
\end{frame}
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   429
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   430
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   431
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   432
\begin{frame}[c]
221
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   433
\frametitle{Avoiding \texttt{$\backslash$x00}}
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   434
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   435
\begin{itemize}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   436
\item another difficulty is that the code is not allowed to contain \texttt{$\backslash$x00}:
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   437
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   438
\begin{center}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   439
\texttt{xorl   \%eax, \%eax}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   440
\end{center}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   441
\end{itemize}\bigskip\bigskip
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   442
  
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   443
{\small
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   444
\lstinputlisting[language=C,numbers=none]{../progs/app5.c}}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   445
  
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   446
\end{frame}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   447
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   448
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   449
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   450
\begin{frame}[c]
221
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   451
\frametitle{Overflow.c}
222
81f9f0eb1180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 221
diff changeset
   452
\mbox{}\\[-10mm]
221
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   453
222
81f9f0eb1180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 221
diff changeset
   454
\small
81f9f0eb1180 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 221
diff changeset
   455
\lstinputlisting[language=C,xleftmargin=-4mm,numbers=none]{../progs/overflow.c}
221
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   456
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   457
  
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   458
\end{frame}
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   459
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   460
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   461
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   462
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ae6074cc446a updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 220
diff changeset
   463
\begin{frame}[c]
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   464
\frametitle{Variants}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   465
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   466
There are many variants:
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   467
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   468
\begin{itemize}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   469
\item return-to-lib-C attacks
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   470
\item heap-smashing attacks\\
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   471
\textcolor{gray}{\small(Slammer Worm in 2003 infected 90\% of vulnerable systems within 10 minutes)}\bigskip
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   472
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   473
\item ``zero-days-attacks'' (new unknown vulnerability)
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   474
\end{itemize}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   475
  
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   476
\end{frame}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   477
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   478
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   479
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   480
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   481
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   482
\begin{frame}[c]
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   483
\frametitle{Format String Vulnerability}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   484
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   485
\small
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   486
\texttt{string} is nowhere used:\bigskip
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   487
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   488
{\footnotesize\lstinputlisting[language=C]{../progs/C4.c}}\bigskip
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   489
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   490
this vulnerability can be used to read out the stack
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   491
  
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   492
\end{frame}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   493
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   494
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   495
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   496
\begin{frame}[c]
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   497
\frametitle{\begin{tabular}{c}Protections against\\ Buffer Overflow Attacks\end{tabular}}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   498
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   499
\begin{itemize}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   500
\item use safe library functions
226
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   501
\item stack canaries
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   502
\item ensure stack data is not executable (can be defeated)
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   503
\item address space randomisation (makes one-size-fits-all more difficult)
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   504
\item choice of programming language (one of the selling points of Java)
226
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   505
\end{itemize}
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   506
226
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   507
\only<2>{  
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   508
\begin{textblock}{7}(6,1)
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   509
  \begin{bubble}[5cm]
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   510
  \begin{tabular}{cp{2cm}}
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   511
  \begin{tikzpicture}[baseline=40mm,scale=0.8]
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   512
  %\draw[step=1cm] (-3,-1) grid (3,8);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   513
  \draw[gray!20,fill=gray!20] (-1, 0) rectangle (1,-1);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   514
  \draw[line width=1mm] (-1,-1.2) -- (-1,7.4);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   515
  \draw[line width=1mm] ( 1,-1.2) -- ( 1,7.4);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   516
  \draw (0,-1) node[anchor=south] {\tt main};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   517
  \draw[line width=1mm] (-1,0) -- (1,0);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   518
  \draw (0,0) node[anchor=south] {\tt arg$_3$=3};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   519
  \draw[line width=1mm] (-1,1) -- (1,1);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   520
  \draw (0,1) node[anchor=south] {\tt arg$_2$=2};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   521
  \draw[line width=1mm] (-1,2) -- (1,2);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   522
  \draw (0,2) node[anchor=south] {\tt arg$_1$=1};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   523
  \draw[line width=1mm] (-1,3) -- (1,3);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   524
  \draw (0,3.1) node[anchor=south] {\tt ret};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   525
  \draw[line width=1mm] (-1,4) -- (1,4);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   526
  \draw (0,4) node[anchor=south] {\small\tt last sp};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   527
  \draw[line width=1mm] (-1,5) -- (1,5);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   528
  \draw (0,5) node[anchor=south] {\tt\small\alert{\textbf{random}}};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   529
  \draw[line width=1mm] (-1,6) -- (1,6);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   530
  \draw (0,6) node[anchor=south] {\tt buf};
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   531
  \draw[line width=1mm] (-1,7) -- (1,7);
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   532
  \end{tikzpicture} &
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   533
  canary: a random value after the local variables
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   534
  \end{tabular}
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   535
\end{bubble}
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   536
\end{textblock}}
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   537
01fe5aba8781 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 223
diff changeset
   538
220
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   539
\end{frame}
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   540
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   541
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   542
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   543
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74772c30e0f4 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 216
diff changeset
   544
\begin{frame}[c]
204
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   545
\frametitle{\begin{tabular}{c}Network Applications:\\[-1mm] Privilege Separation\end{tabular}}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   546
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   547
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   548
\begin{center}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   549
  \begin{tikzpicture}[scale=1]
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   550
  
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   551
  \draw[line width=1mm] (-.3, 0) rectangle (1.5,2);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   552
  \draw (4.7,1) node {Internet};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   553
  \draw (-2.7,1.7) node {\footnotesize Application};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   554
  \draw (0.6,1.7) node {\footnotesize Interface};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   555
  \draw (0.6,-0.4) node {\footnotesize \begin{tabular}{c}unprivileged\\[-1mm] process\end{tabular}};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   556
  \draw (-2.7,-0.4) node {\footnotesize \begin{tabular}{c}privileged\\[-1mm] process\end{tabular}};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   557
  
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   558
  \draw[line width=1mm] (-1.8, 0) rectangle (-3.6,2);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   559
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   560
  \draw[white] (1.7,1) node (X) {};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   561
  \draw[white] (3.7,1) node (Y) {};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   562
  \draw[red, <->, line width = 2mm] (X) -- (Y);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   563
 
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   564
  \draw[red, <->, line width = 1mm] (-0.6,1) -- (-1.6,1);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   565
  \end{tikzpicture}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   566
\end{center}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   567
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   568
\begin{itemize}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   569
\item the idea is make the attack surface smaller and mitigate the
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   570
  consequences of an attack
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   571
\end{itemize}
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 206
diff changeset
   572
\end{frame}
114
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   573
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   574
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   575
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   576
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   577
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   578
\begin{frame}[c]
223
2bc8309203c8 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
   579
\frametitle{\begin{tabular}{@ {}c@ {}}Infamous Security Flaws\\[-1mm] in Unix\end{tabular}}
114
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   580
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   581
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   582
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   583
\item \texttt{lpr} unfortunately runs with root privileges; you had the option to delete files after printing \ldots\pause\pause
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   584
\item for debugging purposes (FreeBSD) Unix provides a ``core dump'', but allowed to follow links \ldots\pause
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   585
\item \texttt{mkdir foo} is owned by root\medskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   586
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   587
\texttt{-rwxr-xr-x  1 root  wheel /bin/mkdir}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   588
\end{center}\medskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   589
it first creates an i-node as root and then changes to ownership to the user's id\\ \textcolor{gray}{\small (race condition -- can be automated with a shell script)}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   590
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   591
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   592
\only<5->{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   593
\begin{textblock}{1}(3,7)
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   594
\begin{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   595
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   596
{\begin{minipage}{8cm}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   597
Only failure makes us experts.
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   598
	-- Theo de Raadt (OpenBSD, OpenSSH)
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   599
\end{minipage}};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   600
\end{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   601
\end{textblock}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   602
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   603
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   604
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   605
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   606
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   607
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   608
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   610
%%% Local Variables:  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   611
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   612
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   613
%%% End: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   614