added
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 08 Oct 2013 02:22:53 +0100
changeset 111 677179c76e35
parent 110 fefd78525434
child 112 0711775cb6b0
added
programs/C0-long.c
programs/C0.c
slides/slides03.pdf
slides/slides03.tex
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/programs/C0-long.c	Tue Oct 08 02:22:53 2013 +0100
@@ -0,0 +1,47 @@
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+  I used as environment the virtual machine provided here
+
+    http://www.cis.upenn.edu/~cis551/box.tar
+
+  This is Debian/Etch with Linux 2.6.18 with gcc 4.1.2 from 2008.
+ 
+  Some installation notes for this virtual machine under VMWare
+  are here
+
+    http://www.cis.upenn.edu/~cis551/project1.pdf
+
+  I run the virtial machine under MacOSX using the program 
+  VirtualBox available for free from 
+
+    https://www.virtualbox.org
+
+  The C-program I compiled the program with 
+
+    gcc -ggdb -fno-stack-protector -mpreferred-stack-boundary=2
+
+ */
+
+
+void foo (char *bar)
+{
+  float my_float = 10.5;    // in hex: \x41\x28\x00\x00
+  char  buffer[28];        
+
+  printf("my float value = %f\n", my_float);
+
+  strcpy(buffer, bar);  
+ 
+  printf("my float value = %f\n", my_float);
+}
+ 
+int main (int argc, char **argv)
+{
+  foo("my string is too long !!!!! ");                  // all is normal
+  foo("my string is too long !!!!! \x10\x10\xc0\x42");  // overwrites my_float
+  return 0;
+}
+
--- a/programs/C0.c	Mon Oct 07 17:45:12 2013 +0100
+++ b/programs/C0.c	Tue Oct 08 02:22:53 2013 +0100
@@ -2,30 +2,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-/*
-  I used as environment the virtual machine provided here
-
-    http://www.cis.upenn.edu/~cis551/box.tar
-
-  This is Debian/Etch with Linux 2.6.18 with gcc 4.1.2 from 2008.
- 
-  Some installation notes for this virtual machine under VMWare
-  are here
-
-    http://www.cis.upenn.edu/~cis551/project1.pdf
-
-  I run the virtial machine under MacOSX using the program 
-  VirtualBox available for free from 
-
-    https://www.virtualbox.org
-
-  The C-program I compiled the program with 
-
-    gcc -ggdb -fno-stack-protector -mpreferred-stack-boundary=2
-
- */
-
-
 void foo (char *bar)
 {
   float my_float = 10.5;    // in hex: \x41\x28\x00\x00
@@ -40,8 +16,8 @@
  
 int main (int argc, char **argv)
 {
-  foo("my string is too long !!!!! ");                  \\ all is normal
-  foo("my string is too long !!!!! \x10\x10\xc0\x42");  \\ overwrites my_float
+  foo("my string is too long !!!!! ");                  // all is normal
+  foo("my string is too long !!!!! \x10\x10\xc0\x42");  // overwrites my_float
   return 0;
 }
 
Binary file slides/slides03.pdf has changed
--- a/slides/slides03.tex	Mon Oct 07 17:45:12 2013 +0100
+++ b/slides/slides03.tex	Tue Oct 08 02:22:53 2013 +0100
@@ -25,8 +25,13 @@
 \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
 \definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
 
+\makeatletter
+\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
+\@empty\z@\@empty
+\makeatother
+
 \lstset{language=Java,
-	basicstyle=\ttfamily,
+	basicstyle=\consolas,
 	keywordstyle=\color{javapurple}\bfseries,
 	stringstyle=\color{javagreen},
 	commentstyle=\color{javagreen},
@@ -47,7 +52,7 @@
     private,protected,requires,return,sealed,%
     super,this,throw,trait,true,try,%
     type,val,var,while,with,yield},
-  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
+  otherkeywords={=>,<-,<\%,<:,>:,\#,@,->},
   sensitive=true,
   morecomment=[l]{//},
   morecomment=[n]{/*}{*/},
@@ -57,7 +62,7 @@
 }
 
 \lstset{language=Scala,
-	basicstyle=\ttfamily,
+	basicstyle=\consolas,
 	keywordstyle=\color{javapurple}\bfseries,
 	stringstyle=\color{javagreen},
 	commentstyle=\color{javagreen},
@@ -70,8 +75,9 @@
 	showspaces=false,
 	showstringspaces=false}
 
+
 % beamer stuff 
-\renewcommand{\slidecaption}{APP 02, King's College London, 2 October 2012}
+\renewcommand{\slidecaption}{APP 03, King's College London, 8 October 2013}
 
 
 \begin{document}
@@ -83,7 +89,7 @@
   \begin{tabular}{@ {}c@ {}}
   \\
   \LARGE Access Control and \\[-3mm] 
-  \LARGE Privacy Policies (2)\\[-6mm] 
+  \LARGE Privacy Policies (3)\\[-6mm] 
   \end{tabular}}\bigskip\bigskip\bigskip
 
   %\begin{center}
@@ -94,7 +100,7 @@
   \begin{center}
   \begin{tabular}{ll}
   Email:  & christian.urban at kcl.ac.uk\\
-  Of$\!$fice: & S1.27 (1st floor Strand Building)\\
+  Office: & S1.27 (1st floor Strand Building)\\
   Slides: & KEATS (also home work is there)
   \end{tabular}
   \end{center}
@@ -103,21 +109,6 @@
 \end{frame}}
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
-\begin{frame}[c]
-\frametitle{\begin{tabular}{c}Homework\end{tabular}}
-
-
-\ldots{} I have a question about the homework.\\[3mm] 
-Is it required to submit the homework before\\ 
-the next lecture?\\[5mm]
-
-Thank you!\\
-Anonymous
-  
-\end{frame}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \mode<presentation>{
@@ -126,7 +117,7 @@
 \begin{center}
 \begin{tabular}[t]{c}
 \includegraphics[scale=1.2]{pics/barrier.jpg}\\
-future lectures
+first lecture
 \end{tabular}\;\;\;
 \onslide<2>{
 \begin{tabular}[t]{c}
@@ -144,93 +135,11 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \mode<presentation>{
 \begin{frame}[c]
-\frametitle{\begin{tabular}{@ {}c@ {}}SmartWater\end{tabular}}
-
-\begin{textblock}{1}(1,3)
-\begin{tabular}{c}
-\includegraphics[scale=0.15]{pics/SmartWater}
-\end{tabular}
-\end{textblock}
-
-
-\begin{textblock}{8.5}(7,3)
-\begin{itemize}
-\item seems helpful for preventing cable theft\medskip
-\item wouldn't be helpful to make your property safe, because of possible abuse\medskip
-
-\item security is always a tradeoff
-\end{itemize}
-\end{textblock}
-
-\end{frame}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
-\begin{frame}[c]
-\frametitle{\begin{tabular}{@ {}c@ {}}Plain-text Passwords at IEEE\end{tabular}}
-
-\small\textcolor{gray}{On 25 September 2012, a report on a data breach at IEEE:}
-
-
-\begin{itemize}
-\item IEEE is a standards organisation (not-for-profit) 
-\item many standards in CS are by IEEE\medskip
-\item 100k plain-text passwords were recorded in logs
-\item the logs were openly accessible on their FTP server
-\end{itemize}\bigskip
-
-\begin{flushright}\small
-\textcolor{gray}{\url{http://ieeelog.com}}
-\end{flushright}
-
-\only<2>{
-\begin{textblock}{11}(3,2)
-\begin{tikzpicture}
-\draw (0,0) node[inner sep=2mm,fill=white, ultra thick, draw=red, rounded corners=2mm] 
-{\normalsize\color{darkgray}
-\begin{minipage}{7.5cm}\raggedright\small
-\includegraphics[scale=0.6]{pics/IEEElog.jpg}
-\end{minipage}};
-\end{tikzpicture}
-\end{textblock}}
-
-\end{frame}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
-\begin{frame}[c]
-\frametitle{\begin{tabular}{@ {}c@ {}}Virgin Mobile (USA)\end{tabular}}
-
-\begin{flushright}\small
-\textcolor{gray}{\url{http://arstechnica.com/security/2012/09/virgin-mobile-password-crack-risk/}}
-\end{flushright}
-
-\begin{itemize}
-\item for online accounts passwords must be 6 digits
-\item you must cycle through 1M combinations (online)\pause\bigskip
-
-\item he limited the attack on his own account to 1 guess per second, \alert{\bf and}
-\item wrote a script that cleared the cookie set after each guess\pause
-\item has been fixed now
-\end{itemize}
-
-
-
-\end{frame}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\mode<presentation>{
-\begin{frame}[c]
 \frametitle{\begin{tabular}{@ {}c@ {}}Smash the Stack for Fun \ldots\end{tabular}}
 
 \begin{itemize}
-\item ``smashing the stack attacks'' or ``buffer overflow attacks''
-\item one of the most popular attacks;\\ attack of the (last) decade\\ ($>$ 50\% of security incidents reported at CERT are related to buffer overflows)
+\item ``smashing the stack attacks'' or\\ ``buffer overflow attacks''\medskip
+\item one of the most popular attacks\\ ($>$ 50\% of security incidents reported at CERT are related to buffer overflows)
 \begin{flushright}\small
 \textcolor{gray}{\url{http://www.kb.cert.org/vuls}}
 \end{flushright}
@@ -241,7 +150,7 @@
 \end{center}\medskip
 
 \begin{flushright}
-\small\textcolor{gray}{\url{http://www.phrack.org}, Issue 49, Article 14}
+\small\textcolor{gray}{Issue 49, Article 14}
 \end{flushright} 
  
 \end{itemize}