slides/slides03.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Mon, 06 Oct 2014 02:16:53 +0100
changeset 206 0105257429f3
parent 204 8fe0dc898c73
child 211 e6e160c7ea33
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 
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    12
\renewcommand{\slidecaption}{APP 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
  \\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
  \LARGE Access Control and \\[-3mm] 
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    23
  \LARGE Privacy Policies (3)\\[-6mm] 
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
  \end{tabular}}\bigskip\bigskip\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    26
  \normalsize
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
  \begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
  \begin{tabular}{ll}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
  Email:  & christian.urban at kcl.ac.uk\\
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    30
  Office: & S1.27 (1st floor Strand Building)\\
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
    31
  Slides: & KEATS (also home work is there)
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    35
\end{frame}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    36
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    38
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    39
\begin{frame}[c]
204
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    40
\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
    41
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    42
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    43
\begin{center}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    44
  \begin{tikzpicture}[scale=1]
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    45
  
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    46
  \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
    47
  \draw (4.7,1) node {Internet};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    48
  \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
    49
  \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
    50
  \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
    51
  \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
    52
  
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    53
  \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
    54
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    55
  \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
    56
  \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
    57
  \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
    58
 
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    59
  \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
    60
  \end{tikzpicture}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    61
\end{center}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    62
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    63
\begin{itemize}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    64
\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
    65
  consequences of an attack
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    66
\item you need an OS that supports different roles (root vs.~users)
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    67
\end{itemize}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    68
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    69
\end{frame}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    70
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    71
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    72
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    73
\begin{frame}[c]
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    74
\frametitle{Weaknesses of Unix AC}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    75
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    76
Not just restricted to Unix:
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    77
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    78
\begin{itemize}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    79
\item if you have too many roles (i.e.~too finegrained AC), then
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    80
  hierarchy is too complex\\ \textcolor{gray}{you invite situations
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    81
    like\ldots let's be root}\bigskip
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    82
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    83
\item you can still abuse the system\ldots
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    84
\end{itemize}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    85
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    86
\end{frame}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    88
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    89
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    90
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    91
\frametitle{A ``Cron''-Attack}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    92
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    93
The idea is to trick a privileged person to do something on your
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    94
behalf:
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    95
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    96
\begin{itemize}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    97
\item root:\\\texttt{rm /tmp/*/*}\bigskip\bigskip\pause
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
    98
204
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
    99
\small
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   100
\begin{minipage}{1.1\textwidth}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   101
\textcolor{gray}{the shell behind the scenes:}\\
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   102
\textcolor{gray}{\texttt{rm /tmp/dir$_1$/file$_1$ /tmp/dir$_1$/file$_2$ /tmp/dir$_2$/file$_1$ \ldots}}\bigskip\\
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   103
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   104
\textcolor{gray}{this takes time}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   105
\end{minipage}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   106
\end{itemize}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   107
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   108
\end{frame}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   109
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   110
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   111
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   112
\begin{frame}[c]
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   113
\frametitle{A ``Cron''-Attack}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   114
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   115
\begin{enumerate}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   116
\item attacker \textcolor{gray}{(creates a fake passwd file)}\\ 
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   117
\texttt{mkdir /tmp/a; cat > /tmp/a/passwd}\medskip
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   118
\item root \textcolor{gray}{(does the daily cleaning)}\\
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   119
\texttt{rm /tmp/*/*}\medskip\\
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   120
\hspace{2cm}\textcolor{gray}{\small records that \texttt{/tmp/a/passwd}}\\ 
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   121
\hspace{2cm}\textcolor{gray}{\small should be deleted, but does not do it yet}\medskip\\
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   123
\item attacker \textcolor{gray}{(meanwhile deletes the fake passwd file, and establishes a link to 
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   124
the real passwd file)}\\
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   125
\texttt{rm /tmp/a/passwd; rmdir /tmp/a;}\\\texttt{ln -s /etc /tmp/a}\\
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   126
\item root now deletes  the real passwd file
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   127
\end{enumerate}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   128
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   129
\only<2>{
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   130
\begin{textblock}{11}(2,5)
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   131
\begin{bubble}[8cm]
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   132
\normalsize To prevent this kind of attack, you need additional
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   133
policies (don't do such operations as root).
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   134
\end{bubble}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   135
\end{textblock}}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   136
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   137
\end{frame}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   138
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   139
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   140
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   141
\begin{frame}[c]
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   142
\frametitle{\Large Buffer Overflow Attacks}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   143
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   144
\begin{center}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   145
\begin{columns}[b]
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   146
\begin{column}{.4\textwidth}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   147
\centering
199
20af800ce736 updated pics
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 196
diff changeset
   148
\includegraphics[scale=1.2]{../pics/barrier.jpg}\\
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   149
lectures so far
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   150
\end{column}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   151
\begin{column}<2>{.4\textwidth}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   152
\centering
199
20af800ce736 updated pics
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 196
diff changeset
   153
\includegraphics[scale=0.32]{../pics/trainwreck.jpg}\\
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   154
today
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   155
\end{column}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   156
\end{columns}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   157
\end{center}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   158
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   159
\end{frame}
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   160
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   161
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   162
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   164
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   165
\frametitle{\begin{tabular}{c}Network Applications:\\[-1mm] Privilege Separation\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   166
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   167
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   168
  \begin{tikzpicture}[scale=1]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   169
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   170
  \draw[line width=1mm] (-.3, 0) rectangle (1.5,2);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   171
  \draw (4.7,1) node {Internet};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   172
  \draw (-2.7,1.7) node {\footnotesize Application};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   173
  \draw (0.6,1.7) node {\footnotesize Interface};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   174
  \draw (0.6,-0.4) node {\footnotesize \begin{tabular}{c}unprivileged\\[-1mm] process\end{tabular}};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   175
  \draw (-2.7,-0.4) node {\footnotesize \begin{tabular}{c}privileged\\[-1mm] process\end{tabular}};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   176
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   177
  \draw[line width=1mm] (-1.8, 0) rectangle (-3.6,2);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   178
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   179
  \draw[white] (1.7,1) node (X) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   180
  \draw[white] (3.7,1) node (Y) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   181
  \draw[red, <->, line width = 2mm] (X) -- (Y);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   182
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   183
  \draw[red, <->, line width = 1mm] (-0.6,1) -- (-1.6,1);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   184
  \end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   185
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   186
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   187
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   188
\item the idea is make the attack surface smaller and 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   189
mitigate the consequences of an attack
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   190
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   191
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   192
\end{frame}
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   193
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   194
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   195
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   196
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   197
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   198
\frametitle{Access Control in Unix}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   199
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   200
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   201
\item access control provided by the OS
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   202
\item authenticate principals (login)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   203
\item mediate access to files, ports, processes according to \alert{roles} (user ids)\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   204
\item roles get attached with privileges\bigskip\\%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   205
\hspace{8mm}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   206
\begin{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   207
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   208
{\begin{minipage}{8cm}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   209
\alert{The principle of least privilege:}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   210
programs should only have as much privilege as they need 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   211
\end{minipage}};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   212
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   213
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   214
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   215
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   216
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   217
114
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   218
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   219
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   220
\begin{frame}[t]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   221
\frametitle{Process Ownership}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   222
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   223
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   224
\item access control in Unix is very coarse
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   225
\end{itemize}\bigskip\bigskip\bigskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   226
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   227
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   228
\begin{tabular}{c}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   229
root\\
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   230
\hline
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   231
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   232
user$_1$ user$_2$ \ldots www, mail, lp
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   233
\end{tabular}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   234
\end{center}\bigskip\bigskip\bigskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   235
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   236
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   237
\textcolor{gray}{\small root has UID $=$ 0}\\\pause
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   238
\textcolor{gray}{\small you also have groups that can share access to a file}\\
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   239
\textcolor{gray}{\small but it is difficult to exclude access selectively}\\
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   240
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   241
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   242
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   243
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   244
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   245
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   246
\frametitle{Access Control in Unix (2)}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   247
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   248
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   249
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   250
\item privileges are specified by file access permissions (``everything is a file'') 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   251
\item there are 9 (plus 2) bits that specify the permissions of a file
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   252
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   253
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   254
\begin{tabular}{l}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   255
\texttt{\$ ls - la}\\
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   256
\texttt{-rwxrw-r-{}- \hspace{3mm} foo\_file.txt}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   257
\end{tabular}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   258
\end{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   259
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   260
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   261
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   262
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   263
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   264
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   265
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   266
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   267
\frametitle{Login Process}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   268
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   269
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   270
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   271
\item login processes run under UID $=$ 0\medskip 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   272
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   273
\texttt{ps -axl | grep login}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   274
\end{center}\medskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   275
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   276
\item after login, shells run under UID $=$ user (e.g.~501)\medskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   277
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   278
\texttt{id cu}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   279
\end{center}\medskip\pause
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   280
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   281
\item non-root users are not allowed to change the UID --- would break 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   282
access control
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   283
\item but needed for example for \texttt{passwd}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   284
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   285
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   286
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   287
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   288
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   289
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   290
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   291
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   292
\frametitle{Setuid and Setgid}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   293
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   294
The solution is that unix file permissions are 9 + \underline{2 Bits}:
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   295
\alert{Setuid} and \alert{Setgid} Bits
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   296
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   297
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   298
\item When a file with setuid is executed, the resulting process will assume the UID given to the owner of the file. 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   299
\item This enables users to create processes as root (or another user).\bigskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   300
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   301
\item Essential for changing passwords, for example.
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   302
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   303
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   304
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   305
\texttt{chmod 4755 fobar\_file}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   306
\end{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   307
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   308
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   309
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   310
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   311
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   312
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   313
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   314
\frametitle{\begin{tabular}{c}Privilege Separation in\\ OpenSSH\end{tabular}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   315
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   316
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   317
\begin{tikzpicture}[scale=1]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   318
  
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   319
  \draw[line width=1mm] (0, 1.1) rectangle (1.2,2);
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   320
  \draw (4.7,1) node {Internet};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   321
  \draw (0.6,1.7) node {\footnotesize Slave};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   322
  \draw[line width=1mm] (0, 0) rectangle (1.2,0.9);
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   323
  \draw (0.6,1.7) node {\footnotesize Slave};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   324
  \draw (0.6,0.6) node {\footnotesize Slave};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   325
  \draw (0.6,-0.5) node {\footnotesize \begin{tabular}{c}unprivileged\\[-1mm] processes\end{tabular}};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   326
  \draw (-2.7,-0.4) node {\footnotesize \begin{tabular}{c}privileged\\[-1mm] process\end{tabular}};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   327
  
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   328
  \draw[line width=1mm] (-1.8, 0) rectangle (-3.6,2);
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   329
  \draw (-2.9,1.7) node {\footnotesize Monitor};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   330
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   331
  \draw[white] (1.7,1) node (X) {};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   332
  \draw[white] (3.7,1) node (Y) {};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   333
  \draw[red, <->, line width = 2mm] (X) -- (Y);
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   334
 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   335
  \draw[red, <->, line width = 1mm] (-0.4,1.4) -- (-1.4,1.1);
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   336
  \draw[red, <->, line width = 1mm] (-0.4,0.6) -- (-1.4,0.9);
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   337
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   338
  \end{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   339
\end{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   340
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   341
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   342
\item pre-authorisation slave 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   343
\item post-authorisation\bigskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   344
\item 25\% codebase is privileged, 75\% is unprivileged
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   345
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   346
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   347
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   348
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   349
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   350
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   351
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   352
\frametitle{Network Applications}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   353
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   354
ideally network application in Unix should be designed as follows:
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   355
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   356
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   357
\item need two distinct processes
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   358
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   359
\item one that listens to the network; has no privilege
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   360
\item one that is privileged and listens to the latter only (but does not trust it)
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   361
 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   362
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   363
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   364
\item to implement this you need a parent process, which forks a child process
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   365
\item this child process drops privileges and listens to hostile data\medskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   366
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   367
\item after authentication the parent forks again and the new child becomes the user
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   368
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   369
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   370
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   371
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   372
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   373
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   374
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   375
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   376
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   377
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   378
\frametitle{\begin{tabular}{@ {}c@ {}}Famous Security Flaws\\[-1mm] in Unix\end{tabular}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   379
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   380
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   381
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   382
\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
   383
\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
   384
\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
   385
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   386
\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
   387
\end{center}\medskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   388
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
   389
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   390
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   391
\only<5->{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   392
\begin{textblock}{1}(3,7)
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   393
\begin{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   394
\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
   395
{\begin{minipage}{8cm}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   396
Only failure makes us experts.
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   397
	-- Theo de Raadt (OpenBSD, OpenSSH)
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   398
\end{minipage}};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   399
\end{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   400
\end{textblock}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   401
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   402
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   403
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   404
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   405
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   406
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   407
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   408
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   409
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   410
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   411
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   412
\frametitle{\begin{tabular}{@ {}c@ {}}A ``Cron''-Attack\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   413
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   414
\begin{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   415
\item attacker \textcolor{gray}{(creates a fake passwd file)}\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   416
\texttt{mkdir /tmp/a; cat > /tmp/a/passwd}\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   417
\item root \textcolor{gray}{(does the daily cleaning)}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   418
\texttt{rm /tmp/*/*}\medskip\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   419
\hspace{2cm}\textcolor{gray}{\small records that \texttt{/tmp/a/passwd}}\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   420
\hspace{2cm}\textcolor{gray}{\small should be deleted, but does not do it yet}\medskip\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   421
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   422
\item attacker \textcolor{gray}{(meanwhile deletes the fake passwd file, and establishes a link to 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   423
the real passwd file)}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   424
\texttt{rm /tmp/a/passwd; rmdir /tmp/a;}\\\texttt{ln -s /etc /tmp/a}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   425
\item root now deletes  the real passwd file
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   426
\end{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   427
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   428
\only<2>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   429
\begin{textblock}{11}(2,5)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   430
\begin{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   431
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   432
{\normalsize\color{darkgray}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   433
\begin{minipage}{9cm}\raggedright
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   434
To prevent this kind of attack, you need additional
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   435
policies (don't do such operations as root).
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   436
\end{minipage}};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   437
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   438
\end{textblock}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   439
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   440
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   441
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   442
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   443
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   444
\mode<presentation>{
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   445
\begin{frame}[c]
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   446
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   447
\begin{center}
199
20af800ce736 updated pics
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 196
diff changeset
   448
\includegraphics[scale=0.45]{../pics/trainwreck.jpg}\\
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   449
one general defence mechanism is\\\alert{\bf defence in depth}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   450
\end{center}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   451
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   452
  
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   453
\end{frame}}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   454
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   455
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   456
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   457
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   458
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   459
\frametitle{Smash the Stack for Fun\ldots}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   460
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   461
\begin{itemize}
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
   462
\item ``smashing the stack attacks'' or\\ ``buffer overflow attacks''\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
   463
\item one of the most popular attacks\\ ($>$ 50\% of security incidents reported at CERT are related to buffer overflows)
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   464
\begin{flushright}\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   465
\textcolor{gray}{\url{http://www.kb.cert.org/vuls}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   466
\end{flushright}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   467
\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   468
\item made popular in an article by Elias Levy\\ (also known as Aleph One):\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   469
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   470
{\bf ``Smashing The Stack For Fun and Profit''}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   471
\end{center}\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   472
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   473
\begin{flushright}
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
   474
\small\textcolor{gray}{Issue 49, Article 14}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   475
\end{flushright} 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   476
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   477
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   478
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   479
\end{frame}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   480
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   481
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   482
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   483
\begin{frame}[c]
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   484
\frametitle{A Float Printed ``Twice''}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   485
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   486
\footnotesize
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   487
\lstinputlisting[language=C]{../progs/C1.c}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   488
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   489
\end{frame}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   490
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   491
204
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   492
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   493
\begin{frame}[c]
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   494
\frametitle{Memory}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   495
204
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   496
\begin{itemize}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   497
\item each process will get a chunk of memory that is organised as
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   498
follows:
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   499
\end{itemize}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   500
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   501
\begin{center}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   502
  \begin{tikzpicture}[scale=0.8]
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   503
  %\draw[step=1cm] (-3,-3) grid (3,3);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   504
  \draw[line width=1mm] (-2, -3) rectangle (2,3);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   505
  \draw[line width=1mm] (-2,1) -- (2,1);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   506
  \draw[line width=1mm] (-2,-1) -- (2,-1);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   507
  \draw (0,2) node {\large\tt text};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   508
  \draw (0,0) node {\large\tt heap};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   509
  \draw (0,-2) node {\large\tt stack};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   510
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   511
  \draw (-2.7,3) node[anchor=north east] {\tt\begin{tabular}{@{}l@{}}lower\\ address\end{tabular}};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   512
  \draw (-2.7,-3) node[anchor=south east] {\tt\begin{tabular}{@{}l@{}}higher\\ address\end{tabular}};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   513
  \draw[->, line width=1mm] (-2.5,3) -- (-2.5,-3);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   514
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   515
  \draw (2.7,-2) node[anchor=west] {\tt grows};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   516
  \draw (2.7,-3) node[anchor=south west] {\tt\footnotesize older};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   517
  \draw (2.7,-1) node[anchor=north west] {\tt\footnotesize newer};
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   518
  \draw[|->, line width=1mm] (2.5,-3) -- (2.5,-1);
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   519
  \end{tikzpicture}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   520
\end{center}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   521
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   522
\end{frame}
8fe0dc898c73 added example1
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 199
diff changeset
   523
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   524
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   525
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   526
\begin{frame}[c]
206
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   527
\frametitle{The Stack}
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   528
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   529
\begin{textblock}{7}(1,1)
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   530
  \begin{tikzpicture}[scale=0.8]
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   531
  %\draw[step=1cm] (-3,-1) grid (3,8);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   532
  \draw[gray!20,fill=gray!20] (-1, 0) rectangle (1,-1);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   533
  \draw[line width=1mm] (-1,-1.2) -- (-1,7.4);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   534
  \draw[line width=1mm] ( 1,-1.2) -- ( 1,7.4);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   535
  \draw (0,-1) node[anchor=south] {\tt main};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   536
  \draw[line width=1mm] (-1,0) -- (1,0);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   537
  \draw (0,0) node[anchor=south] {\tt arg$_3$=3};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   538
  \draw[line width=1mm] (-1,1) -- (1,1);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   539
  \draw (0,1) node[anchor=south] {\tt arg$_2$=2};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   540
  \draw[line width=1mm] (-1,2) -- (1,2);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   541
  \draw (0,2) node[anchor=south] {\tt arg$_1$=1};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   542
  \draw[line width=1mm] (-1,3) -- (1,3);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   543
  \draw (0,3.1) node[anchor=south] {\tt ret};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   544
  \draw[line width=1mm] (-1,4) -- (1,4);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   545
  \draw (0,4) node[anchor=south] {\small\tt last sp};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   546
  \draw[line width=1mm] (-1,5) -- (1,5);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   547
  \draw (0,5) node[anchor=south] {\tt buf$_1$};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   548
  \draw[line width=1mm] (-1,6) -- (1,6);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   549
  \draw (0,6) node[anchor=south] {\tt buf$_2$};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   550
  \draw[line width=1mm] (-1,7) -- (1,7);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   551
  \draw (2,6.1) node[anchor=south] {\code{$esp}};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   552
  \draw[<-,line width=0.5mm] (1.1,7) -- (2.5,7);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   553
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   554
  \draw[->,line width=0.5mm] (1,4.5) -- (1.8,4.5) -- (1.8, 0) -- (1.1,0); 
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   555
  \draw[->,line width=0.5mm] (1,3.5) -- (2.5,3.5);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   556
  \draw (2.6,3.1) node[anchor=south west] {\tt back to main()};
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   557
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   558
  \draw[->,red,line width=2mm] (2.5,0.1) -- (4.2,0.1);
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   559
\end{tikzpicture}
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   560
\end{textblock}
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   561
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   562
\begin{textblock}{7}(6.4,8)
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   563
\begin{bubble}[6.8cm]
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   564
\footnotesize
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   565
\lstinputlisting[language=C,xleftmargin=5mm]{../progs/example1.c} 
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   566
\end{bubble}
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   567
\end{textblock}
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   568
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   569
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   570
\end{frame}
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   571
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   572
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   573
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   574
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   575
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   576
\frametitle{The Problem}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   577
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   578
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   579
\item The basic problem is that library routines in C look as follows:
206
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   580
\end{itemize}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   581
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   582
\begin{center}
206
0105257429f3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 204
diff changeset
   583
\small\lstinputlisting[language=C,numbers=none]{../progs/app5.c}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   584
\end{center}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   585
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   586
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   587
\end{frame}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   588
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   589
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   590
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   591
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   592
\frametitle{Variants}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   593
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   594
There are many variants:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   595
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   596
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   597
\item return-to-lib-C attacks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   598
\item heap-smashing attacks\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   599
\textcolor{gray}{\small(Slammer Worm in 2003 infected 90\% of vulnerable systems within 10 minutes)}\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   600
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   601
\item ``zero-days-attacks'' (new unknown vulnerability)
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   602
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   603
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   604
\end{frame}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   605
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   606
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   607
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   608
\begin{frame}[c]
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   610
\begin{center}
199
20af800ce736 updated pics
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 196
diff changeset
   611
\only<1>{\includegraphics[scale=0.9]{../pics/stack1}\;\;}
20af800ce736 updated pics
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 196
diff changeset
   612
\only<2>{\includegraphics[scale=0.9]{../pics/stack2}\;\;}
20af800ce736 updated pics
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 196
diff changeset
   613
\only<3>{\includegraphics[scale=0.9]{../pics/stack3}\;\;}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   614
\end{center}
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   615
    
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   616
\end{frame}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   617
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   618
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   619
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   620
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   621
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   622
{\small\lstinputlisting[language=C]{../progs/C2.c}}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   623
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   624
\end{frame}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   625
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   626
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   627
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   628
%\mode<presentation>{
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   629
%\begin{frame}[c]
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   630
%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   631
%\small
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   632
%A programmer might be careful, but still introduce vulnerabilities:\bigskip
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   633
%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   634
%{\lstset{language=Java}\footnotesize
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   635
%\texttt{\lstinputlisting{../progs/C2a.c}}}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   636
%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   637
% 
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   638
%\end{frame}}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   639
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   640
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   641
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   642
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   643
\frametitle{Payloads}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   644
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   645
\begin{itemize}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   646
\item the idea is you store some code to the buffer
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   647
\item you then override the return address to execute this payload\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   648
\item normally you start a root-shell\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   649
\item difficulty is to guess the right place where to ``jump''
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   650
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   651
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   652
\end{frame}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   653
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   654
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   655
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   656
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   657
\frametitle{Payloads (2)}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   658
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   659
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   660
\item another difficulty is that the code is not allowed to contain \texttt{$\backslash$x00}:
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   661
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   662
\begin{center}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   663
\texttt{xorl   \%eax, \%eax}
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   664
\end{center}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   665
\end{itemize}\bigskip\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   666
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   667
{\small
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   668
\lstinputlisting[language=C]{../progs/app5.c}}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   669
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   670
\end{frame}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   671
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   672
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   673
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   674
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   675
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   676
\frametitle{Format String Vulnerability}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   677
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   678
\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   679
\texttt{string} is nowhere used:\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   680
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   681
{\footnotesize\lstinputlisting[language=C]{../progs/C4.c}}\bigskip
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   682
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   683
this vulnerability can be used to read out the stack
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   684
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   685
\end{frame}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   686
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   687
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   688
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   689
\begin{frame}[c]
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   690
\frametitle{\begin{tabular}{c}Protections against\\ Buffer Overflow Attacks\end{tabular}}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   691
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   692
\begin{itemize}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   693
\item use safe library functions
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   694
\item stack caneries
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   695
\item ensure stack data is not executable (can be defeated)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   696
\item address space randomisation (makes one-size-fits-all more difficult)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   697
\item choice of programming language (one of the selling points of Java)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   698
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   699
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   700
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   701
\end{frame}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   702
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   703
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   704
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   705
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   706
\frametitle{Security Goals}
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   707
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   708
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   709
\item Prevent common vulnerabilities from occurring (e.g. buffer overflows)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   710
\item Recover from attacks (traceability and auditing of security-relevant actions)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   711
\item Monitoring (detect attacks)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   712
\item Privacy, confidentiality, anonymity (to protect secrets)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   713
\item Authenticity (needed for access control)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   714
\item Integrity (prevent unwanted modification or tampering)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   715
\item Availability and reliability (reduce the risk of DoS attacks)
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   716
\end{itemize}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   717
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   718
\end{frame}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   719
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   720
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   721
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   722
\begin{frame}[c]
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   723
\frametitle{Homework}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   724
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   725
\begin{itemize}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   726
\item Assume format string attacks allow you to read out the stack. What can you do
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   727
	with this information?\bigskip
31
Christian Urban <urbanc@in.tum.de>
parents: 30
diff changeset
   728
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   729
\item Assume you can crash a program remotely. Why is this a problem?
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   730
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   731
  
196
22f027da67ec updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 152
diff changeset
   732
\end{frame}
30
Christian Urban <urbanc@in.tum.de>
parents: 29
diff changeset
   733
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   734
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   735
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   736
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   737
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   738
%%% Local Variables:  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   739
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   740
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   741
%%% End: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   742