Assignment 5 finshed
All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 1m0s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Successful in 1m6s

This commit is contained in:
bmh04 2024-06-10 13:39:22 +02:00
parent 252bf43abf
commit 65ebf1a52c
Signed by: chronal
GPG key ID: 2534798AB6C297E0

View file

@ -22,6 +22,29 @@
\usepackage{etoolbox}
\usepackage{tikz}
\definecolor{keyword}{rgb}{0.0, 0.0, 1.0}
\definecolor{comment}{rgb}{0.5, 0.5, 0.5}
\definecolor{string}{rgb}{0.6, 0.1, 0.1}
\definecolor{background}{rgb}{0.95, 0.95, 0.95}
\lstset{
language=bash,
backgroundcolor=\color{background},
basicstyle=\ttfamily\small,
keywordstyle=\color{keyword}\bfseries,
commentstyle=\color{comment}\itshape,
stringstyle=\color{string},
tabsize=2,
showspaces=false,
showstringspaces=false,
frame=single,
numbers=left,
numberstyle=\tiny\color{gray},
breaklines=true,
captionpos=b,
escapeinside={(*@}{@*)},
}
\usetikzlibrary{shapes, arrows, calc, automata, arrows.meta, positioning,decorations.pathmorphing,backgrounds,decorations.markings,decorations.pathreplacing, graphs}
\usetikzlibrary{matrix,shapes,arrows,positioning,chains, calc}
\usetikzlibrary{arrows.meta,matrix,shapes,arrows,positioning,chains, calc}
@ -131,6 +154,7 @@ quit
Anschließend wird ein Breakpoint bei der Funktion secret gesetzt.
Dann wird das Programm mit dem Parameter gestartet und, wie in der Aufgabe gewollt, wird das Register eax an verschiedenen Stellen ausgelesen.
Der Ausgabewert der Funktion ist dann 17.
\\
\begin{lstlisting}[language=bash]
user@intro:~$ gdb -x commands
@ -184,7 +208,7 @@ eax 0x11 17
\begin{align*}
f(n) = 3n + 2
\end{align*}
\newpage
\item Das Programm liefert den Output
\begin{lstlisting}[language=bash]
user@intro:~$ readelf -S intro
@ -228,20 +252,27 @@ Section Headers:
[33] .symtab SYMTAB 00000000 0038a0 0004d0 10 34 51 4
[34] .strtab STRTAB 00000000 003d70 000271 00 0 0 1
[35] .shstrtab STRTAB 00000000 003fe1 000158 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
p (processor specific)
\end{lstlisting}
\item Die in dem Code angegebenen Labels können wie folgt eingeteilt werden:
\begin{enumerate}[<A>:]
\item .bss
\item .data
\item Stack
\item Stack
\item Stack
\item Die statisch initialisierte Variable wird in der Section .data gespeichert. \\
\textbf{Grund:}
"This section holds initialized data that contribute to the program\'s memory image. This section is of type SHT\_PROGBITS. The attribute types are SHF\_ALLOC and SHF\_WRITE."\footnote[1]{Manual page elf(5)}
\item Die statisch nicht initialisierte Variable wird in der Section .bss gespeichert. \\
\textbf{Grund:}
"This section holds uninitialized data that contributes to the program\'s memory image. By definition, the system initializes the data with zeros when the program begins to run. This section is of type SHT\_NOBITS. The attribute types are SHF\_ALLOC and SHF\_WRITE."\footnotemark[1]
\item Ausführbare Code wird in der Section .text gespeichert. \\
\textbf{Grund:}
"This section holds the "text", or executable instructions, of a program. This section is of type SHT\_PROGBITS. The attributes used are SHF\_ALLOC and SHF\_EXECINSTR."\footnotemark[1]
\item Lokale Variablen werden auf dem Stack gespeichert.
\item Lokale Variablen werden auf dem Stack gespeichert.
\end{enumerate}
\end{subexercises}