diff --git a/.gitignore b/.gitignore index e45721d..9f49af2 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ /*.pdf /assets/dot/*.pdf _minted-presentation/ +_minted-bof/ +_minted-linux_intro/ -!presentation.pdf +!bof.pdf +!linux_intro.pdf !assets/*.pdf diff --git a/Makefile b/Makefile index f06ccef..2444b32 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # use bash so process substutution is available SHELL = bash -SRC = presentation.tex +SRC = bof.tex linux_intro.tex TARGET = $(SRC:%.tex=%.pdf) .PHONY: build @@ -15,9 +15,17 @@ install: build %.pdf: %.tex latexmk $< +# .PHONY: watch +# watch: +# latexmk -pvc $(SRC) + .PHONY: watch -watch: - latexmk -pvc $(SRC) +watch_intro: + latexmk -pvc linux_intro.tex + +.PHONY: watch +watch_bof: + latexmk -pvc bof.tex .PHONY: lint lint: @@ -34,3 +42,5 @@ clean: clean_tex clean_tex: latexmk -C rm -rf ./_minted-presentation/ + rm -rf ./_minted-bof/ + rm -rf ./_minted-linux_intro/ diff --git a/assets/logic/.gitignore b/assets/bof/logic/.gitignore similarity index 100% rename from assets/logic/.gitignore rename to assets/bof/logic/.gitignore diff --git a/assets/logic/Makefile b/assets/bof/logic/Makefile similarity index 100% rename from assets/logic/Makefile rename to assets/bof/logic/Makefile diff --git a/assets/logic/logic.c b/assets/bof/logic/logic.c similarity index 100% rename from assets/logic/logic.c rename to assets/bof/logic/logic.c diff --git a/assets/logic/solution.md b/assets/bof/logic/solution.md similarity index 100% rename from assets/logic/solution.md rename to assets/bof/logic/solution.md diff --git a/assets/picoctf/buffer_overflow_1/.gitignore b/assets/bof/picoctf/buffer_overflow_1/.gitignore similarity index 100% rename from assets/picoctf/buffer_overflow_1/.gitignore rename to assets/bof/picoctf/buffer_overflow_1/.gitignore diff --git a/assets/picoctf/buffer_overflow_1/payload.sh b/assets/bof/picoctf/buffer_overflow_1/payload.sh similarity index 100% rename from assets/picoctf/buffer_overflow_1/payload.sh rename to assets/bof/picoctf/buffer_overflow_1/payload.sh diff --git a/assets/picoctf/buffer_overflow_1/solution.md b/assets/bof/picoctf/buffer_overflow_1/solution.md similarity index 100% rename from assets/picoctf/buffer_overflow_1/solution.md rename to assets/bof/picoctf/buffer_overflow_1/solution.md diff --git a/assets/picoctf/buffer_overflow_1/vuln b/assets/bof/picoctf/buffer_overflow_1/vuln similarity index 100% rename from assets/picoctf/buffer_overflow_1/vuln rename to assets/bof/picoctf/buffer_overflow_1/vuln diff --git a/assets/picoctf/buffer_overflow_1/vuln.c b/assets/bof/picoctf/buffer_overflow_1/vuln.c similarity index 100% rename from assets/picoctf/buffer_overflow_1/vuln.c rename to assets/bof/picoctf/buffer_overflow_1/vuln.c diff --git a/assets/stack.png b/assets/bof/stack.png similarity index 100% rename from assets/stack.png rename to assets/bof/stack.png diff --git a/assets/stack_overflow.png b/assets/bof/stack_overflow.png similarity index 100% rename from assets/stack_overflow.png rename to assets/bof/stack_overflow.png diff --git a/assets/vuln.c b/assets/bof/vuln.c similarity index 100% rename from assets/vuln.c rename to assets/bof/vuln.c diff --git a/assets/linux_intro/cat.png b/assets/linux_intro/cat.png new file mode 100644 index 0000000..c08da60 Binary files /dev/null and b/assets/linux_intro/cat.png differ diff --git a/assets/linux_intro/curl.png b/assets/linux_intro/curl.png new file mode 100644 index 0000000..c138ab2 Binary files /dev/null and b/assets/linux_intro/curl.png differ diff --git a/assets/linux_intro/dig.png b/assets/linux_intro/dig.png new file mode 100644 index 0000000..0851ce0 Binary files /dev/null and b/assets/linux_intro/dig.png differ diff --git a/assets/linux_intro/grep00.png b/assets/linux_intro/grep00.png new file mode 100644 index 0000000..6eb6cd7 Binary files /dev/null and b/assets/linux_intro/grep00.png differ diff --git a/assets/linux_intro/grep01.png b/assets/linux_intro/grep01.png new file mode 100644 index 0000000..2e5dc7d Binary files /dev/null and b/assets/linux_intro/grep01.png differ diff --git a/assets/linux_intro/id.png b/assets/linux_intro/id.png new file mode 100644 index 0000000..95f79c4 Binary files /dev/null and b/assets/linux_intro/id.png differ diff --git a/assets/linux_intro/man.png b/assets/linux_intro/man.png new file mode 100644 index 0000000..6af579a Binary files /dev/null and b/assets/linux_intro/man.png differ diff --git a/assets/linux_intro/nmap.png b/assets/linux_intro/nmap.png new file mode 100644 index 0000000..df2527b Binary files /dev/null and b/assets/linux_intro/nmap.png differ diff --git a/assets/linux_intro/redirect_pipe.png b/assets/linux_intro/redirect_pipe.png new file mode 100644 index 0000000..80545d1 Binary files /dev/null and b/assets/linux_intro/redirect_pipe.png differ diff --git a/assets/linux_intro/strings.png b/assets/linux_intro/strings.png new file mode 100644 index 0000000..a673e78 Binary files /dev/null and b/assets/linux_intro/strings.png differ diff --git a/assets/linux_intro/temp_file.png b/assets/linux_intro/temp_file.png new file mode 100644 index 0000000..40d69c3 Binary files /dev/null and b/assets/linux_intro/temp_file.png differ diff --git a/assets/linux_intro/w.png b/assets/linux_intro/w.png new file mode 100644 index 0000000..67ccc63 Binary files /dev/null and b/assets/linux_intro/w.png differ diff --git a/assets/linux_intro/wget.png b/assets/linux_intro/wget.png new file mode 100644 index 0000000..4948b7b Binary files /dev/null and b/assets/linux_intro/wget.png differ diff --git a/assets/linux_intro/xxd.png b/assets/linux_intro/xxd.png new file mode 100644 index 0000000..5977f48 Binary files /dev/null and b/assets/linux_intro/xxd.png differ diff --git a/presentation.pdf b/bof.pdf similarity index 82% rename from presentation.pdf rename to bof.pdf index 86e518b..45b221a 100644 Binary files a/presentation.pdf and b/bof.pdf differ diff --git a/presentation.tex b/bof.tex similarity index 97% rename from presentation.tex rename to bof.tex index becadd3..850e318 100644 --- a/presentation.tex +++ b/bof.tex @@ -37,11 +37,11 @@ % custom commands \input{commands} -\graphicspath{{assets/}} +\graphicspath{{assets/bof/}} \useDepartmentLogo -\AtBeginSsection[] +\AtBeginSection[] {% \begin{frame} \frametitle{Inhalt} @@ -108,11 +108,11 @@ \section{Beispiel} \begin{frame} - \inputminted[firstline=4,lastline=13]{c}{assets/logic/logic.c} + \inputminted[firstline=4,lastline=13]{c}{assets/bof/logic/logic.c} \end{frame} % \begin{frame} -% \inputminted[firstline=3,lastline=7]{c}{assets/vuln.c} +% \inputminted[firstline=3,lastline=7]{c}{assets/bof/vuln.c} % \end{frame} \section{Stack Layout, Execution Flow} diff --git a/linux_intro.pdf b/linux_intro.pdf new file mode 100644 index 0000000..010e2c2 Binary files /dev/null and b/linux_intro.pdf differ diff --git a/linux_intro.tex b/linux_intro.tex new file mode 100644 index 0000000..2011bf8 --- /dev/null +++ b/linux_intro.tex @@ -0,0 +1,220 @@ +\documentclass[aspectratio=169,16pt]{beamer} + +\usetheme[department=FakIM,pageNumbers]{OTHR} + +% document language and hyphenation +\usepackage[ngerman]{babel} +% \usepackage[utf8]{luainputenc} +% \usepackage{filecontents} +\usepackage{subfigure} + +% code listings +\usepackage{listings} +\usepackage{minted} + +\usepackage{enumerate} +\usepackage{calc} + +\usepackage[plain]{fancyref} + +% math stuff +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{mathtools} + +\usepackage{chronology} + +\usepackage[backend=biber,style=alphabetic]{biblatex} +\addbibresource{bibliography.bib} +% \bibliographystyle{amsalpha} + +% acronyms +\usepackage{acro} +% \acsetup{single,make-links=true} +\acsetup{make-links=true} +\input{acronyms} + +% custom commands +\input{commands} + +\graphicspath{{assets/linux_intro/}} + +\useDepartmentLogo + +\AtBeginSection[] +{% + \begin{frame} + \frametitle{Inhalt} + \tableofcontents[ + currentsection, + hideothersubsections, + sectionstyle=show/hide, + subsectionstyle=show/shaded/hide, + ] + \end{frame} + \addtocounter{framenumber}{-1}% If you don't want them to affect the slide number +} + +\begin{document} +\newcommand{\genemail}[1]{\href{mailto:#1}{\textless\nolinkurl{#1}\textgreater}} +\title{Linux Einführung} + +\author{Magdalena Reif \inst{1} \and Valentin Brandl \inst{2}} + +\institute{Fakultät Informatik und Mathematik \and \inst{1} \genemail{magdalena.reif@st.oth-regensburg.de} \and \inst{2} \genemail{mail@vbrandl.net}} + +\date{\today} + +% Angepasstes Titelformat definieren (verwendet bewusst nicht die +% Beamer-Infrastruktur, um einfache Anpassungen zu zeigen) +% \newcommand{\fillme}{\vskip0pt plus 1filll} +% \newenvironment{references}{\begin{tiny}\begin{flushleft}}% +% {\end{flushleft}\end{tiny}\vspace*{\fill}} +% \defbeamertemplate*{title page}{customized}[1][] +% { +% \vspace*{1em}\usebeamerfont{title}\textbf{\inserttitle}\bigskip\par + +% \begin{scriptsize} +% \insertauthor\bigskip\par +% \textit{\insertinstitute}\\\insertdate +% \end{scriptsize} + +% % \fillme\begin{references} +% % \(^{1}\){\color{gray}{GPG/PGP-ID \href{http://pgp.mit.edu/pks/lookup?op=vindex&search=0xD22BCBB9E835336F}{E835336F}, +% % Fingerprint: A62E FFFC 4029 7339 357B D04D D22B CBB9 E835 336F.}}\\ +% % \(^{2}\){\color{gray}{GPG/PGP-ID \href{http://keys.gnupg.net/pks/lookup?op=get&search=0xF16F252398356E1E}{98356E1E}, +% % Fingerprint: 5920 9407 AB5C 8B28 3C7B 4F02 F16F 2523 9835 6E1E.}} +% % \end{references} +% } + +\maketitle + +\frame{% + \frametitle{Inhalt} + \tableofcontents[ + sectionstyle=show/show, + subsectionstyle=hide/hide, + ] +} + +\section{Unix Stuff} + +\begin{frame} + \frametitle{Aktueller Benutzer - \emph{id}} + \includegraphics[width=\textwidth]{id.png} +\end{frame} + +\begin{frame} + \frametitle{Aktuell aktive Benutzer - \emph{w}} + \includegraphics[width=\textwidth]{w.png} +\end{frame} + +\begin{frame} + \frametitle{\emph{man}, where is my car} + \includegraphics[width=\textwidth]{man.png} +\end{frame} + +\section{Dateien Analysieren} + +\begin{frame} + \frametitle{Dateiinhalt einsehen} + \begin{description} + \item[\emph{cat}] Für Textdateien + \item[\emph{xxd}] Für Binärdateien + \end{description} +\end{frame} + +\begin{frame} + \frametitle{Dateiinhalt einsehen - \emph{cat}} + \includegraphics[width=.7\textwidth]{cat.png} +\end{frame} + +\begin{frame} + \frametitle{Dateiinhalt einsehen - \emph{xxd}} + \includegraphics[width=\textwidth]{xxd.png} +\end{frame} + +\begin{frame} +\frametitle{In Dateien Suchen: \emph{grep}} + \begin{itemize} + \item \mintinline{bash}{grep regex datainame} + \item \mintinline{bash}{grep --ignore-case regex datainame} + \item \mintinline{bash}{grep -F kein-regex datainame} + \end{itemize} +\end{frame} + +\begin{frame} +\frametitle{In Dateien Suchen: \emph{grep}} + \centering + \begin{tabular}{@{}c@{}} + \begin{tabular}{c} + \includegraphics[width=.4\linewidth]{grep00.png} \\ %\small (a) + \end{tabular} %\qquad + \begin{tabular}{c} + \includegraphics[width=.5\linewidth]{grep01.png} \\ %\small (b) + \end{tabular} \\ + % Some main caption for the above figures. + \end{tabular} + +\end{frame} + +\begin{frame} +\frametitle{Ausgaben Umleiten und Wiederverwenden} +\begin{itemize} + \item Ausgabe in Datei umleiten: \mintinline{bash}{>} + \item Verketten durch pipes: \mintinline{bash}{|} + \item Ausgabe von \mintinline{bash}{cmdA} als temporäre Datei für \mintinline{bash}{cmdB}: \mintinline{bash}{cmdB <(cmdA)} +\end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Ausgaben Umleiten und Wiederverwenden} + \includegraphics[width=\linewidth]{redirect_pipe.png} +\end{frame} + +\begin{frame} + \frametitle{Ausgabe als temporäre Datei} + \includegraphics[width=\textwidth]{temp_file.png} +\end{frame} + + +\begin{frame} + \frametitle{Strings in Binärdateien finden - \emph{strings}} + \includegraphics[width=\textwidth]{strings.png} +\end{frame} + + + +\section{Networking} + +\begin{frame} + \frametitle{Dateien Herunterladen - \emph{wget}} + \includegraphics[width=\textwidth]{wget.png} +\end{frame} + +\begin{frame} + \frametitle{Dateien Herunterladen - \emph{curl}} + \includegraphics[width=\textwidth]{curl.png} +\end{frame} + +\begin{frame} + \frametitle{Portscan - \emph{nmap}} + \includegraphics[width=\textwidth]{nmap.png} +\end{frame} + +\begin{frame} + \frametitle{DNS Lookups - \emph{dig}} + \includegraphics[width=.9\textwidth]{dig.png} +\end{frame} + +\appendix +% \nocite{*} +\section*{Quellen} +\begin{frame}[allowframebreaks] + \frametitle{Quellen} + + \printbibliography[heading=none]{} +\end{frame} + +\end{document} +% vim: set filetype=tex ts=2 sw=2 tw=0 et spell : diff --git a/unix_intro.md b/unix_intro.md new file mode 100644 index 0000000..084780c --- /dev/null +++ b/unix_intro.md @@ -0,0 +1,56 @@ +filesystem + navigation: + + * ls + * cd + * pwd + * rm + * touch + * mkdir + +prozesse: + + * htop + * ps + +unix stuff: + + * whoami + * pipes und redirects > < | + * man + + +dateien "analysieren" + + * cat + * grep + * strings + + +networking + + * wget + * nmap + * dig + + * nano + * hexdump/xxd + * objdump + + +networking: + + * nmap + * dig + * netcat + * curl/wget + * ssh + + + + +tools: + + * debugger: r2/gdb/ghidra + * exiftool + * python/pwntools? +