slides/slides03.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Wed, 09 Oct 2013 15:51:03 +0100
changeset 115 c4008b31df8e
parent 114 3822d91a4639
child 152 0c62ec6dc691
permissions -rw-r--r--
added material
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}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
     2
\usepackage{beamerthemeplaincu}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
     3
%%\usepackage[T1]{fontenc}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage[latin1]{inputenc}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{mathpartir}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{ifthen}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{calc} 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{ulem}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usepackage{courier}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{listings}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{automata}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\usetikzlibrary{calc}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\usepackage{graphicx} 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
\definecolor{javared}{rgb}{0.6,0,0} % for strings
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    28
\makeatletter
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    29
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    30
\@empty\z@\@empty
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    31
\makeatother
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    32
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
\lstset{language=Java,
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    34
	basicstyle=\consolas,
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
	stringstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
	commentstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
	numbers=left,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
	numberstyle=\tiny\color{black},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
	stepnumber=1,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
	numbersep=10pt,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
	tabsize=2,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
	showspaces=false,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
	showstringspaces=false}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
\lstdefinelanguage{scala}{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  morekeywords={abstract,case,catch,class,def,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
    do,else,extends,false,final,finally,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
    for,if,implicit,import,match,mixin,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
    new,null,object,override,package,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
    private,protected,requires,return,sealed,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
    super,this,throw,trait,true,try,%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
    type,val,var,while,with,yield},
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    55
  otherkeywords={=>,<-,<\%,<:,>:,\#,@,->},
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  sensitive=true,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
  morecomment=[l]{//},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
  morecomment=[n]{/*}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  morestring=[b]",
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  morestring=[b]',
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
  morestring=[b]"""
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
\lstset{language=Scala,
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    65
	basicstyle=\consolas,
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
	keywordstyle=\color{javapurple}\bfseries,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
	stringstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
	commentstyle=\color{javagreen},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
	morecomment=[s][\color{javadocblue}]{/**}{*/},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
	numbers=left,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
	numberstyle=\tiny\color{black},
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
	stepnumber=1,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
	numbersep=10pt,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
	tabsize=2,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
	showspaces=false,
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
	showstringspaces=false}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    78
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
% beamer stuff 
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    80
\renewcommand{\slidecaption}{APP 03, King's College London, 8 October 2013}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
\begin{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
\begin{frame}<1>[t]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
\frametitle{%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
  \begin{tabular}{@ {}c@ {}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
  \\
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
  \LARGE Access Control and \\[-3mm] 
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    92
  \LARGE Privacy Policies (3)\\[-6mm] 
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  \end{tabular}}\bigskip\bigskip\bigskip
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  %\begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  %\includegraphics[scale=1.3]{pics/barrier.jpg}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  %\end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
\normalsize
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
  \begin{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
  \begin{tabular}{ll}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
  Email:  & christian.urban at kcl.ac.uk\\
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
   103
  Office: & S1.27 (1st floor Strand Building)\\
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   104
  Slides: & KEATS (also home work is there)
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   113
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
\begin{center}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   119
\begin{tabular}[t]{c}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   120
\includegraphics[scale=1.2]{pics/barrier.jpg}\\
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
   121
first lecture
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   122
\end{tabular}\;\;\;
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   123
\onslide<2>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   124
\begin{tabular}[t]{c}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   125
\includegraphics[scale=0.32]{pics/trainwreck.jpg}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   126
today
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   127
\end{tabular}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   128
}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   129
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   130
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   131
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   132
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   133
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   134
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   135
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   136
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   137
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   138
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   139
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   140
\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
   141
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   142
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   143
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   144
  \begin{tikzpicture}[scale=1]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   145
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   146
  \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
   147
  \draw (4.7,1) node {Internet};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   148
  \draw (-2.7,1.7) node {\footnotesize Application};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   149
  \draw (0.6,1.7) node {\footnotesize Interface};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   150
  \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
   151
  \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
   152
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   153
  \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
   154
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   155
  \draw[white] (1.7,1) node (X) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   156
  \draw[white] (3.7,1) node (Y) {};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   157
  \draw[red, <->, line width = 2mm] (X) -- (Y);
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   158
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   159
  \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
   160
  \end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   161
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   162
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   163
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   164
\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
   165
mitigate the consequences of an attack
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   166
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   167
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   168
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   169
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   170
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   171
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   172
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   173
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   174
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   175
\frametitle{Access Control in Unix}
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
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   178
\item access control provided by the OS
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   179
\item authenticate principals (login)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   180
\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
   181
\item roles get attached with privileges\bigskip\\%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   182
\hspace{8mm}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   183
\begin{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   184
\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
   185
{\begin{minipage}{8cm}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   186
\alert{The principle of least privilege:}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   187
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
   188
\end{minipage}};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   189
\end{tikzpicture}
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
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   192
\end{frame}}
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
114
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   195
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   196
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   197
\begin{frame}[t]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   198
\frametitle{Process Ownership}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   199
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   200
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   201
\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
   202
\end{itemize}\bigskip\bigskip\bigskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   203
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   204
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   205
\begin{tabular}{c}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   206
root\\
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   207
\hline
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   208
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   209
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
   210
\end{tabular}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   211
\end{center}\bigskip\bigskip\bigskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   212
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   213
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   214
\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
   215
\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
   216
\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
   217
\end{frame}}
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
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   220
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   221
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   222
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   223
\frametitle{Access Control in Unix (2)}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   224
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   225
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   226
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   227
\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
   228
\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
   229
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   230
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   231
\begin{tabular}{l}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   232
\texttt{\$ ls - la}\\
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   233
\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
   234
\end{tabular}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   235
\end{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   236
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   237
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   238
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   239
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   240
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
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   243
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   244
\frametitle{Login Process}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   245
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   246
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   247
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   248
\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
   249
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   250
\texttt{ps -axl | grep login}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   251
\end{center}\medskip
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
\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
   254
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   255
\texttt{id cu}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   256
\end{center}\medskip\pause
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   257
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   258
\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
   259
access control
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   260
\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
   261
\end{itemize}
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
\end{frame}}
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
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   266
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   267
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   268
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   269
\frametitle{Setuid and Setgid}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   270
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   271
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
   272
\alert{Setuid} and \alert{Setgid} Bits
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   273
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   274
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   275
\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
   276
\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
   277
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   278
\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
   279
\end{itemize}
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
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   282
\texttt{chmod 4755 fobar\_file}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   283
\end{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   284
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   285
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   286
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
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
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   290
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   291
\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
   292
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   293
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   294
\begin{tikzpicture}[scale=1]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   295
  
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   296
  \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
   297
  \draw (4.7,1) node {Internet};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   298
  \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
   299
  \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
   300
  \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
   301
  \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
   302
  \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
   303
  \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
   304
  
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   305
  \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
   306
  \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
   307
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   308
  \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
   309
  \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
   310
  \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
   311
 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   312
  \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
   313
  \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
   314
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   315
  \end{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   316
\end{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   317
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   318
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   319
\item pre-authorisation slave 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   320
\item post-authorisation\bigskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   321
\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
   322
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   323
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   324
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   325
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   326
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   327
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   328
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   329
\frametitle{Network Applications}
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
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
   332
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   333
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   334
\item need two distinct processes
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   335
\begin{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   336
\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
   337
\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
   338
 
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   339
\end{itemize}
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
\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
   342
\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
   343
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   344
\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
   345
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   346
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
\end{frame}}
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
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   351
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   352
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   353
\mode<presentation>{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   354
\begin{frame}[c]
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   355
\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
   356
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   357
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 \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
   360
\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
   361
\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
   362
\begin{center}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   363
\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
   364
\end{center}\medskip
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   365
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
   366
\end{itemize}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   367
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   368
\only<5->{
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   369
\begin{textblock}{1}(3,7)
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   370
\begin{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   371
\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
   372
{\begin{minipage}{8cm}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   373
Only failure makes us experts.
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   374
	-- Theo de Raadt (OpenBSD, OpenSSH)
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   375
\end{minipage}};
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   376
\end{tikzpicture}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   377
\end{textblock}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   378
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
\end{frame}}
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   382
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   383
3822d91a4639 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 113
diff changeset
   384
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   385
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   386
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   387
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   388
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   389
\frametitle{\begin{tabular}{@ {}c@ {}}A ``Cron''-Attack\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   390
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   391
\begin{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   392
\item attacker \textcolor{gray}{(creates a fake passwd file)}\\ 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   393
\texttt{mkdir /tmp/a; cat > /tmp/a/passwd}\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   394
\item root \textcolor{gray}{(does the daily cleaning)}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   395
\texttt{rm /tmp/*/*}\medskip\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   396
\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
   397
\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
   398
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   399
\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
   400
the real passwd file)}\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   401
\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
   402
\item root now deletes  the real passwd file
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   403
\end{enumerate}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   404
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   405
\only<2>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   406
\begin{textblock}{11}(2,5)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   407
\begin{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   408
\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
   409
{\normalsize\color{darkgray}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   410
\begin{minipage}{9cm}\raggedright
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   411
To prevent this kind of attack, you need additional
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   412
policies (don't do such operations as root).
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   413
\end{minipage}};
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   414
\end{tikzpicture}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   415
\end{textblock}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   416
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   417
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   418
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   419
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   420
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   421
\mode<presentation>{
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   422
\begin{frame}[c]
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   423
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   424
\begin{center}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   425
\includegraphics[scale=0.45]{pics/trainwreck.jpg}\\
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   426
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
   427
\end{center}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   428
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   429
  
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   430
\end{frame}}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   431
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
113
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   432
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 112
diff changeset
   433
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   434
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   435
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   436
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   437
\frametitle{\begin{tabular}{@ {}c@ {}}Smash the Stack for Fun \ldots\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   438
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   439
\begin{itemize}
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
   440
\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
   441
\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
   442
\begin{flushright}\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   443
\textcolor{gray}{\url{http://www.kb.cert.org/vuls}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   444
\end{flushright}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   445
\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   446
\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
   447
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   448
{\bf ``Smashing The Stack For Fun and Profit''}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   449
\end{center}\medskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   450
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   451
\begin{flushright}
111
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
   452
\small\textcolor{gray}{Issue 49, Article 14}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   453
\end{flushright} 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   454
 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   455
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   456
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
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   459
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   462
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   463
\begin{frame}[c]
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   464
\frametitle{A Float Printed ``Twice''}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   465
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   466
{\lstset{language=Java}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   467
\footnotesize
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   468
\lstinputlisting{../progs/C1.c}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   469
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   470
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   471
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   472
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   473
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   474
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   475
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   476
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   477
\begin{frame}[c]
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   478
\frametitle{\begin{tabular}{c}The Problem\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   479
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   480
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   481
\item The basic problem is that library routines in C look as follows:
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   482
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   483
\begin{center}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   484
{\lstset{language=Java}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   485
\footnotesize
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   486
\lstinputlisting{../progs/app5.c}}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   487
\end{center}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   488
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   489
\item the resulting problems are often remotely exploitable 
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   490
\item can be used to circumvents all access control\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   491
(for grooming botnets for further attacks)
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   492
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   493
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   494
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   495
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   496
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   497
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   498
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   499
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   500
\frametitle{\begin{tabular}{c}Variants\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   501
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   502
There are many variants:
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   503
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   504
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   505
\item return-to-lib-C attacks
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   506
\item heap-smashing attacks\\
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   507
\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
   508
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   509
\item ``zero-days-attacks'' (new unknown vulnerability)
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   510
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   511
  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   512
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   513
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   514
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   515
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   516
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   517
\begin{frame}[c]
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   518
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   519
\begin{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   520
\only<1>{\includegraphics[scale=0.9]{pics/stack1}\;\;}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   521
\only<2>{\includegraphics[scale=0.9]{pics/stack2}\;\;}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   522
\only<3>{\includegraphics[scale=0.9]{pics/stack3}\;\;}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   523
\end{center}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   524
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   525
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   526
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   527
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   528
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   529
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   530
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   531
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   532
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   533
{\lstset{language=Java}\fontsize{8}{10}\selectfont%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   534
\texttt{\lstinputlisting{../progs/C2.c}}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   535
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   536
  
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   537
\end{frame}}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   538
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   539
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   540
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   541
%\mode<presentation>{
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   542
%\begin{frame}[c]
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   543
%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   544
%\small
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   545
%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
   546
%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   547
%{\lstset{language=Java}\footnotesize
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   548
%\texttt{\lstinputlisting{../progs/C2a.c}}}
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   549
%
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   550
% 
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   551
%\end{frame}}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   552
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   553
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   554
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   555
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   556
\begin{frame}[c]
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   557
\frametitle{\begin{tabular}{c}Payloads\end{tabular}}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   558
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   559
\begin{itemize}
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   560
\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
   561
\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
   562
\item normally you start a root-shell\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   563
\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
   564
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   565
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   566
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   567
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   568
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   569
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   570
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   571
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   572
\frametitle{\begin{tabular}{c}Payloads (2)\end{tabular}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   573
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   574
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   575
\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
   576
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   577
\begin{center}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   578
\texttt{xorl   \%eax, \%eax}
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   579
\end{center}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   580
\end{itemize}\bigskip\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   581
  
112
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 111
diff changeset
   582
{\lstset{language=Java}\small
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   583
\texttt{\lstinputlisting{../progs/app5.c}}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   584
  
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   585
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   586
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   587
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   588
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   589
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   590
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   591
\begin{frame}[c]
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   592
\frametitle{\begin{tabular}{c}Format String Vulnerability\end{tabular}}
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
\small
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   595
\texttt{string} is nowhere used:\bigskip
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   596
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   597
{\lstset{language=Java}\footnotesize
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   598
\texttt{\lstinputlisting{../progs/C4.c}}}\bigskip
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   599
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   600
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
   601
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   602
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   603
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   604
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   605
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   606
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   607
\begin{frame}[c]
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   608
\frametitle{\begin{tabular}{c}Protections against\\ Buffer Overflow Attacks\end{tabular}}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   609
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   610
\begin{itemize}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   611
\item use safe library functions
115
c4008b31df8e added material
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 114
diff changeset
   612
\item stack caneries
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   613
\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
   614
\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
   615
\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
   616
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   617
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   618
  
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   619
\end{frame}}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   620
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   621
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   622
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   623
\mode<presentation>{
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   624
\begin{frame}[c]
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   625
\frametitle{\begin{tabular}{c}Security Goals\end{tabular}}
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   626
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   627
\begin{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   628
\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
   629
\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
   630
\item Monitoring (detect attacks)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   631
\item Privacy, confidentiality, anonymity (to protect secrets)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   632
\item Authenticity (needed for access control)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   633
\item Integrity (prevent unwanted modification or tampering)\pause
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   634
\item Availability and reliability (reduce the risk of DoS attacks)
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   635
\end{itemize}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   636
  
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   637
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   638
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   639
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   640
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   641
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   642
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   643
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   644
\begin{frame}[c]
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   645
\frametitle{\begin{tabular}{c}Homework\end{tabular}}
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   646
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   647
\begin{itemize}
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   648
\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
   649
	with this information?\bigskip
31
Christian Urban <urbanc@in.tum.de>
parents: 30
diff changeset
   650
105
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   651
\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
   652
\end{itemize}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 90
diff changeset
   653
  
30
Christian Urban <urbanc@in.tum.de>
parents: 29
diff changeset
   654
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 29
diff changeset
   655
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
29
Christian Urban <urbanc@in.tum.de>
parents: 28
diff changeset
   656
28
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   657
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   658
\end{document}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   659
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   660
%%% Local Variables:  
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   661
%%% mode: latex
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   662
%%% TeX-master: t
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   663
%%% End: 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   664