diff --git a/20231026/Zeichen_123.pdf b/20231026/Zeichen_123.pdf new file mode 120000 index 0000000000000000000000000000000000000000..fdbc897227df059cfda790a16555e6e417682116 --- /dev/null +++ b/20231026/Zeichen_123.pdf @@ -0,0 +1 @@ +../common/Zeichen_123.pdf \ No newline at end of file diff --git a/20231026/dbs-20231026.pdf b/20231026/dbs-20231026.pdf new file mode 100644 index 0000000000000000000000000000000000000000..edd4b63344f57b26d81b05b362b0d13fae1ec556 Binary files /dev/null and b/20231026/dbs-20231026.pdf differ diff --git a/20231026/dbs-20231026.tex b/20231026/dbs-20231026.tex new file mode 100644 index 0000000000000000000000000000000000000000..ddbf80bfe73da7bc9d72c31bae6996996448549f --- /dev/null +++ b/20231026/dbs-20231026.tex @@ -0,0 +1,959 @@ +% dbs-20221026.pdf - Lecture Slides on Databases and Information Security +% Copyright (C) 2023 Peter Gerwinski +% +% This document is free software: you can redistribute it and/or +% modify it either under the terms of the Creative Commons +% Attribution-ShareAlike 3.0 License, or under the terms of the +% GNU General Public License as published by the Free Software +% Foundation, either version 3 of the License, or (at your option) +% any later version. +% +% This document is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this document. If not, see <http://www.gnu.org/licenses/>. +% +% You should have received a copy of the Creative Commons +% Attribution-ShareAlike 3.0 Unported License along with this +% document. If not, see <http://creativecommons.org/licenses/>. + +% README: Unix-Kommandozeile: eine Programmiersprache + +\documentclass[10pt,t]{beamer} + +\usepackage{pgslides} +\usepackage{tikz} + +\newcommand{\vfilll}{\vspace{0pt plus 1filll}} + +\newcommand{\underconstruction}{% + \begin{picture}(0,0) + \put(11,1.2){\makebox(0,0)[b]{\includegraphics[width=1.5cm]{Zeichen_123.pdf}}} + \put(11,0.9){\makebox(0,0)[t]{\shortstack{Änderungen\\vorbehalten}}} + \end{picture}} + +\title{Datenbanken und Datensicherheit} +\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski} +\date{26.\ Oktober 2023} + +\begin{document} + +\maketitleframe + +\nosectionnonumber{\inserttitle} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/dbs}}}% + \item[\textbf{2}] \textbf{Kurzeinführung Unix} + \begin{itemize} + \item[2.1] Grundkonzepte + \item[2.2] Die Kommandozeile: Grundlagen + \color{medgreen} + \item[2.3] Dateisysteme + \item[2.4] Ein- und Ausgabeströme + \item[2.5] Pipes + \item[2.6] Verzweigungen und Schleifen + \end{itemize} + \item[\textbf{3}] \textbf{Kurzeinführung TCP/IP} + \begin{itemize} + \color{red} + \item[3.1] IP-Adressen + \item[3.2] MAC-Adressen + \item[3.3] TCP- und UDP-Ports + \item[\dots] + \end{itemize} + \vspace*{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + + \vfilll + \underconstruction + +\end{frame} + +\section{Kurzeinführung Unix} +\setcounter{subsection}{2} +\subsection{Dateisysteme} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + Dateien listen: \lstinline[style=cmd]{ls}\\ + langes Listenformat: \lstinline[style=cmd]{ls -l}\\ + rückwärts nach Zeit sortiert: \lstinline[style=cmd]{ls -lrt} + \item + Datei ausgeben: \lstinline[style=cmd]{cat hello.c} + \item + Datei anzeigen: \lstinline[style=cmd]{less hello.c} + \end{itemize} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Arbeitsverzeichnis anzeigen: \lstinline[style=cmd]{pwd}\\ + \item + Arbeitsverzeichnis wechseln: \lstinline[style=cmd]{cd script}\\ + (\emph{kein\/} Programm, sondern Shell-Befehl) + \item + übergeordnetes Verzeichnis: \lstinline[style=cmd]{cd ..} + \item + eigenes \newterm{Home-\/}Verzeichnis: \lstinline[style=cmd]{cd} + \item + Wurzelverzeichnis: \lstinline[style=cmd]{cd /} + \item + wieder zurück: \lstinline[style=cmd]{cd -} + \end{itemize} + +% \pause + \begin{lstlisting}[style=terminal] + cassini/home/peter/bo/2013ss/net/script> ¡cd /usr/bin¿ + cassini/usr/bin> ¡cd ../lib¿ + cassini/usr/lib> ¡cd¿ + cassini/home/peter> + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Dateien kopieren (\emph{copy\/}): \lstinline[style=cmd]{cp} + \item + Dateien verschieben/umbenennen (\emph{move\/}): \lstinline[style=cmd]{mv} + \item + Dateien löschen (\emph{remove\/}): \lstinline[style=cmd]{rm} + \end{itemize} + + \begin{lstlisting}[style=terminal,xleftmargin=-3pt] + cassini/home/peter> ¡cp -p foo/test.txt¿ + cp: missing destination file operand after `foo/test.txt' + Try `cp --help' for more information. + cassini/home/peter> ¡cp -p foo/test.txt .¿ + cassini/home/peter> ¡mv test.txt bla.txt¿ + cassini/home/peter> ¡cat bla.txt¿ + Dies ist ein Test. + cassini/home/peter> ¡rm bla.txt¿ + cassini/home/peter> + \end{lstlisting} + + \medskip + + Aktuelles Verzeichnis: \lstinline[style=cmd]{.} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \newterm{Zugriffsrechte} + \end{itemize} + + \begingroup +% \small + \begin{lstlisting}[style=terminal,gobble=6,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191009> ¡ls -l¿ + ... + -rw-r--r-- 1 peter peter 24523 Okt 8 21:47 es-20191009.tex + \end{lstlisting} + \endgroup + \begin{onlyenv}<2> + \begin{picture}(0,1) + \color{red} + \put(0.3,0){\tikz{\draw[-latex,red](0,0)--(0,1); + \draw[-latex,red](0,0)--(2.5,1);}} + \put(0,-0.1){\makebox(0,0)[tl]{Benutzer (u -- \emph{user\/}) darf lesen und schreiben}} + \end{picture} + \end{onlyenv} + \begin{onlyenv}<3> + \begin{picture}(0,1) + \color{red} + \put(0.84,0){\tikz{\draw[-latex,red](0,0)--(0,1); + \draw[-latex,red](0,0)--(3.2,1);}} + \put(0,-0.1){\makebox(0,0)[tl]{Gruppe (g -- \emph{group\/}) darf lesen}} + \end{picture} + \end{onlyenv} + \begin{onlyenv}<4> + \begin{picture}(0,1) + \color{red} + \put(1.47,0){\tikz{\draw[-latex,red](0,0)--(0,1);}} + \put(0,-0.1){\makebox(0,0)[tl]{alle anderen (o -- \emph{other\/}) dürfen lesen}} + \end{picture} + \end{onlyenv} + + \medskip + \pause[5] + \begin{itemize} + \item + Zugriffsrechte ändern:\\ + \lstinline[style=cmd]{chmod o-r es-20191009.tex} -- Lesezugriff entziehen\\ + \lstinline[style=cmd]{chmod g+w es-20191009.tex} -- Schreibzugriff gewähren\\ + \lstinline[style=cmd]{chmod 640 es-20191009.tex} -- + auf \lstinline[style=terminal]{-}% + \lstinline[style=terminal]{rw-}% + \lstinline[style=terminal]{r--}% + \lstinline[style=terminal]{---} setzen + \end{itemize} + \pause + \begin{picture}(0,0) + \color{red} + \put(7.22,0.50){\makebox(0,0)[tl]{% + \small + \begin{math}% + \underbrace{\rule{0.7em}{0pt}}_{\textstyle 6}% + \underbrace{\rule{0.7em}{0pt}}_{\textstyle 4}% + \underbrace{\rule{0.7em}{0pt}}_{\textstyle 0} + \end{math}}} + \end{picture} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \newterm{ausführbare\/} Dateien + \end{itemize} + + \begingroup +% \small + \begin{lstlisting}[style=terminal,gobble=6,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191002> ¡cat test2.txt¿ + ls -l + cassini/home/peter/bo/2019ws/es/20191002> ¡chmod +x test2.txt¿ + cassini/home/peter/bo/2019ws/es/20191002> ¡ls -l test2.txt¿ + -rwxr-xr-x 1 peter peter 6 Okt 2 13:43 test2.txt + cassini/home/peter/bo/2019ws/es/20191002> ¡./test2.txt¿ + insgesamt 4828 + lrwxrwxrwx 1 peter peter 18 Apr 13 2016 csa2.jpg -> ../common/csa2.jpg + -rw-r--r-- 1 peter peter 4619138 Okt 8 21:28 es-20191002.pdf + ... + \end{lstlisting} + \endgroup + +% \pause + \begin{itemize} + \item + ausführbare Textdateien: \newterm{Skripte} + +% \pause + \smallskip + hier: ausführbare Textdatei mit Shell-Befehlen\\ + (ohne spezielle Kennung): Shell-Skript + + \pause + \smallskip + Kennung: 1.\ Zeile enthält \lstinline[style=terminal]{#!} und den Interpreter,\\ + z.\,B.\ \lstinline[style=terminal]{#!/bin/bash}\\ + \end{itemize} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Datenträger in Verzeichnis \newterm{einhängen\/}: \lstinline[style=cmd]{mount} + \end{itemize} + + \begin{lstlisting}[style=terminal] + cassini/home/peter> ¡ls /media/usb1/¿ + cassini/home/peter> ¡mount /media/usb1¿ + cassini/home/peter> ¡ls /media/usb1/¿ + es-20191002.pdf hello.c hexapode KIS-Bericht.pdf + cassini/home/peter> ¡umount /media/usb1¿ + cassini/home/peter> ¡ls /media/usb1/¿ + cassini/home/peter> + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \newterm{Symbolische Verknüpfungen -- symbolic links} + + \smallskip + + Verweis auf die eigentliche Datei\\ + \textarrow\ Wenn man die Datei löscht, zeigt der Link ins Leere. + + \smallskip + + Verknüpfung anlegen: \lstinline[style=cmd]{ln -s datei link}\\ + (Richtung: wie bei \lstinline[style=cmd]{cp}) + + \smallskip + + Beispiel: \lstinline[style=cmd]{ln -s ../common/GNU-GPL-3 gpl.txt} + \pause + \medskip + \item + \newterm{Harte Verknüpfungen -- hard links} + + \smallskip + + Dieselben Daten auf dem Datenträger\\ + sind unter mehreren Namen verfügbar.\\ + \textarrow\ Wenn man einen löscht, sind die Daten noch da. + + \smallskip + + \begingroup + \begin{lstlisting}[style=terminal,gobble=10,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191002> ¡ls -l¿ + ... + -rw-r--r-- 1 peter peter 1202 Okt 2 13:35 shell-06.txt + drwxr-xr-x 2 peter peter 4096 Okt 2 13:16 test + \end{lstlisting} + \endgroup + \begin{picture}(0,0.5) + \color{red} + \put(2.31,0){\tikz{\draw[-latex,red](0,0)--(0,0.5);}} + \put(0,-0.1){\makebox(0,0)[tl]{Anzahl der ("`harten"') Links + auf diese Datei / dieses Verzeichnis}} + \end{picture} + \end{itemize} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{grep}: Dateien durchsuchen + \end{itemize} + \begin{lstlisting}[style=terminal,xleftmargin=-3pt] + cassini/home/peter/bo/2019ws/es/20191002> ¡grep gcc *.txt¿ + shell-03.txt: cassini/...> gcc -Wall -O hello.c -o hello + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{find}: Dateien anhand ihrer Eigenschaften suchen + \end{itemize} + +% \small + \begin{lstlisting}[style=terminal] + $ ¡find . -name "*.txt"¿ + ./shell-06.txt + ./shell-03.txt + ./shell-05.txt + ./test.txt + ./test/test.txt + ... + $ ¡find . -name "*.txt" -perm /u+x¿ + ./test2.txt + $ ¡find . -name "*.txt" -perm /u+x -exec ls -l {} \;¿ + -rwxr-xr-x 1 peter peter 6 Okt 2 13:43 ./test2.txt + \end{lstlisting} + +\end{frame} + +\subsection{Ein- und Ausgabeströme} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Standard-Ausgabe in Datei umleiten + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡echo "Dies ist ein Test." > test.txt¿ + $ ¡cat test.txt¿ + Dies ist ein Test. + \end{lstlisting} + + \pause + \smallskip + + \begin{itemize} + \item + Standard-Ausgabe an Datei anhängen + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡echo "Dies ist noch ein Test." >> test.txt¿ + $ ¡cat test.txt¿ + Dies ist ein Test. + Dies ist noch ein Test. + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Fehler-Ausgabe in Datei umleiten + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡cat gibtsnicht.txt > fehler.txt¿ + cat: gibtsnicht.txt: No such file or directory + $ ¡cat fehler.txt¿ + $ ¡cat gibtsnicht.txt 2> fehler.txt¿ + $ ¡cat fehler.txt¿ + cat: gibtsnicht.txt: No such file or directory + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + Standard-Eingabe aus Datei lesen + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡bc¿ + bc 1.06.95 + Copyright [...] 2006 Free Software Foundation, Inc. + This is free software with ABSOLUTELY NO WARRANTY. + For details type `warranty'. + ¡2 + 2¿ + 4 + $ ¡echo "2 + 2" > test.bc¿ + $ ¡bc < test.bc¿ + 4 + \end{lstlisting} + +\end{frame} + +\subsection{Pipes} + +\begin{frame}[fragile] + + \showsubsection + + Standard-Ausgabe von Programm A\\ + wird zu Standard-Eingabe von Programm B + + \smallskip + + \begin{lstlisting}[style=terminal] + $ ¡echo "2 + 2" | bc¿ + 4 + \end{lstlisting} + + \smallskip + + \textarrow\ sehr mächtiger "`Baukasten"' + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{sed}: \emph{stream editor}\\ + Suchen und Ersetzen (und noch viel mehr) + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡echo "Schlimmer geht nimmer." | sed -e 's/nim/im/g'¿ + Schlimmer geht immer. + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{grep}: Standard-Eingabe durchsuchen + \item + \lstinline[style=cmd]{$(...)}: Output in Kommandozeile übernehmen + \end{itemize} + \begin{lstlisting}[style=terminal] + $ ¡ls | grep slides¿ + pgslides.sty + $ ¡ls *.pdf | grep -v logo¿ + es-20191002.pdf + Zeichen_123.pdf + $ ¡ls -l $(ls *.pdf | grep -v logo)¿ + -rw-r--r-- 1 ... 4619138 Okt 8 21:28 es-20191002.pdf + lrwxrwxrwx 1 ... 25 Okt 3 2016 Zeichen_123.pdf -> ... + \end{lstlisting} + +\end{frame} + +\subsection{Verzweigungen und Schleifen} + +\begin{frame}[fragile] + + \showsubsection + + \begin{lstlisting}[style=terminal] + $ ¡if grep Blubb test.txt; then echo "gefunden"; \ + else echo "nicht gefunden"; fi¿ + nicht gefunden + $ ¡for x in foo bar baz; do echo $x; done¿ + foo + bar + baz + \end{lstlisting} + + \pause + \bigskip + + Beispiel: Datei mit einer \lstinline[style=cmd]{while}-Schleife zeilenweise lesen,\\ + Zeilennummen ergänzen und wieder ausgeben: + + \smallskip + + \begin{lstlisting}[style=terminal] + number=0 + cat test.txt \ + | while read line; do + number=$((number + 1)) + echo "Zeile $number: $line" + done + \end{lstlisting} + + \begin{itemize} + \item + \lstinline[style=cmd]{read}: Variable von Standardeingabe lesen + \item + \lstinline[style=cmd]{$((...))}: arithmetischen Ausdruck auswerten + \end{itemize} + +\end{frame} + +\begin{frame}[fragile] + + \textbf{Übungsaufgabe} + + \smallskip + + Schreiben Sie ein Shell-Skript,\\ + das aus einer selbst erstellten Textdatei (z.\,B.\ CSV) Daten extrahiert.\\ + Welche Daten, soll per Parameter angegeben werden. + +% \begin{itemize} +% \item +% Speichern Sie einen Satz Beispieldaten als CSV-Datei (Text). +% \item +% Schreiben Sie ein Shell-Skript, das die CSV-Datei liest, +% \item +% damit irgendetwas macht, z.\,B.\ zwei Spalten vertauscht, +% \item +% und das Ergebnis wieder als sinnvolle Datei abspeichert,\\ +% z.\,B.\ wieder als CSV-Datei, als HTML- oder \LaTeX-Datei, \dots +% \end{itemize} + + \medskip + + Beispiele: Siehe \file{../20231018.p0/dbs-20231018.txt} + + \medskip + + Hinweise: + \begin{itemize} + \item + Parameter in Shell-SKripten: + \lstinline[style=cmd]{$1}, \lstinline[style=cmd]{$2}, \dots + \item + \lstinline[style=cmd]{man cut} + \item + \lstinline[style=cmd]{man head} + \item + \lstinline[style=cmd]{man tail} + \item + Sie dürfen voraussetzen, daß in der Textdatei gespeicherte Strings\\ + bestimmte Zeichen (z.\,B.\ das Trennzeichen) nicht enthalten. + \end{itemize} + + \bigskip + + \textbf{Zusatzaufgabe} + + \smallskip + + Schreiben Sie dasselbe Programm noch einmal in einer beliebigen Sprache, + wobei die in der Textdatei gespeicherten Strings (nahezu) beliebige Zeichen + enthalten dürfen. + (Beispiel: Zwischen Anführungszeichen zählt auch das Trennzeichen + als Bestandteil des Strings.) + +\end{frame} + +\nosectionnonumber{\inserttitle} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/dbs}}}% + \item[\textbf{2}] \textbf{Kurzeinführung Unix} + \begin{itemize} + \item[2.1] Grundkonzepte + \item[2.2] Die Kommandozeile: Grundlagen + \color{medgreen} + \item[2.3] Dateisysteme + \item[2.4] Ein- und Ausgabeströme + \item[2.5] Pipes + \item[2.6] Verzweigungen und Schleifen + \end{itemize} + \item[\textbf{3}] \textbf{Kurzeinführung TCP/IP} + \begin{itemize} + \color{red} + \item[3.1] IP-Adressen + \item[3.2] MAC-Adressen + \item[3.3] TCP- und UDP-Ports + \item[\dots] + \end{itemize} + \vspace*{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + + \vfilll + \underconstruction + +\end{frame} + +\section{Kurzeinführung TCP/IP} + +\subsection{IP-Adressen} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item \lstinline[style=cmd]{ip addr} (Linux)\\ + \lstinline[style=cmd]{ifconfig} (Unix allgemein)\\ + \lstinline[style=cmd]{ipconfig} (MS Windows) + \item \lstinline[style=cmd]{ip addr add <Netz>} +% \\ +% Beispiel: +% \lstinline[style=cmd]{ip addr add 192.168.2.197/24}\\ +% \includegraphics[width=7cm]{../20171026/photo-20171026-142620.jpg} + \item \lstinline[style=cmd]{ip link} + \item \lstinline[style=cmd]{ping <IP-Adresse>} + \end{itemize} + + \medskip + + \begin{lstlisting}[style=terminal] + # ifconfig + lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + inet6 ::1 prefixlen 128 scopeid 0x10<host> + [...] + + wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 + inet 192.168.42.101 netmask 255.255.255.0 + broadcast 192.168.42.255 + ether be:3f:ca:aa:7e:51 txqueuelen 1000 (Ethernet) + [...] + \end{lstlisting} + +\end{frame} + +\begin{frame} + + \showsubsection + + IPv4-Adressen: + \begin{itemize} + \item + 32 Bit + \item + dezimal, 4 Gruppen zu je 8 Bit (0--255), durch Punkte getrennt + \end{itemize} + + \medskip + + IPv6-Adressen: + \begin{itemize} + \item + 128 Bit + \item + hexadezimal, 8 Gruppen zu je 4 Hex-Ziffern, durch Doppelpunkte getrennt + \item + Führende Nullen dürfen weggelassen werden. + \item + Zwei Dopppelpunkte bedeuten: Mit Nullen auffüllen. + \item + Literatur und Beispiel: \url{https://de.wikipedia.org/wiki/IPv6} + \end{itemize} + +\end{frame} + +\subsection{MAC-Adressen} + +\begin{frame} + + \showsubsection + + MAC = Media Access Control + + \smallskip + + MAC-Adresse = Hardware-Adresse = Ethernet-Adresse + + \begin{itemize} + \item \lstinline[style=cmd]{ip neig}\\ + \lstinline[style=cmd]{arp} + \end{itemize} + +\end{frame} + +\subsection{TCP- und UDP-Ports} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{nc <IP> <Port>}\\ + Verbindung zu Programm $\langle$Port$\rangle$ + auf Rechner $\langle$IP$\rangle$ aufnehmen + \item + \lstinline[style=cmd]{nc -l <Port>} + oder + \lstinline[style=cmd]{nc -p <Port> -l}\\ + auf eingehende Verbindungen warten ("`lauschen"') + \medskip + \item + TCP-Ports: Verbindungskonzept, Netzwerk prüft + \item + UDP-Ports: einzelne Pakete, Anwendung muß selbst prüfen + \item + ICMP: keine Ports, nur Rechner:\\ + Erreichbarkeit, Eigenschaften der Übertragung + \end{itemize} + + \medskip + + \begin{center} + \renewcommand{\arraystretch}{1.2} + \begin{tabular}{|l|}\hline + Anwendung: HTTP, SMTP, \dots \\\hline + Transport: TCP-/UDP-Ports, ICMP \\\hline + Internet: IP-Adresse \\\hline + Netzwerkzugang: Hardware-/MAC-Adresse \\\hline + \end{tabular} + \end{center} + +\end{frame} + +\subsection{TCP-Protokolle} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + \textbf{HTTP}\\ + \lstinline[style=cmd]{GET / HTTP/1.1}\\ + \lstinline[style=cmd]{Host: www.hs-bochum.de}\\ + (Leerzeile) +% \begin{onlyenv}<2> +% \par\medskip +% URL: Schema://Benutzer:Passwort@Rechner:port/Pfad?Query\#Fragment +% \end{onlyenv} + \begin{onlyenv}<2-> + \medskip + \item + \textbf{SMTP}\\ + \lstinline[style=cmd]{HELO cassini}\\ + \lstinline[style=cmd]{MAIL FROM: <example@example.com>}\\ + \lstinline[style=cmd]{RCPT TO: <beispiel@example.de>}\\ + (E-Mail-Header -- Teil der Nutzdaten)\\ + \lstinline[style=cmd]{From: Eddie Example <example@example.com>}\\ + \lstinline[style=cmd]{To: Bert Beispiel <beispiel@example.de>}\\ + \lstinline[style=cmd]{Subject: Hello, world!}\\ + (Leerzeile)\\ + \lstinline[style=cmd]{Hi, there!}\\ + \lstinline[style=cmd]{.} + \medskip + \item + Protokolle "`mal eben"' selbst schreiben: + \lstinline[style=cmd]{nc -c} oder \file{inetd} + \end{onlyenv} + \end{itemize} + +\end{frame} + +\subsection{Routing} + +\begin{frame}[fragile] + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{ip route} (Linux)\\ + \lstinline[style=cmd]{route} (MS-Windows, Unix)\\ + \lstinline[style=cmd]{netstat -nr} (MacOS) +% \\[\medskipamount] +% \includegraphics[width=11cm]{../20171026/photo-20171026-162455.jpg} + \end{itemize} + + \medskip + + \begin{lstlisting}[style=terminal] + # route -n + Kernel-IP-Routentabelle + Ziel Router Genmask [...] Iface + 0.0.0.0 192.168.42.1 0.0.0.0 [...] wlan0 + 169.254.0.0 0.0.0.0 255.255.0.0 [...] wlan0 + 192.168.42.0 0.0.0.0 255.255.255.0 [...] wlan0 + \end{lstlisting} + + \bigskip + + Netzmaske:\\ + Wenn nach Und-Verknüpfung mit IP-Adresse gleich, + \textarrow\ im gleichen Netz + + \medskip + + \lstinline[style=terminal]{255.255.240.0} ist dasselbe wie + \lstinline[style=terminal]{/20}\\ + (20 Bit sind 1; die restlichen 12 Bit sind 0) + +\end{frame} + +\subsection{Netzwerkanalyse} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{tcpdump} + \item + \lstinline[style=cmd]{wireshark} + \item + \lstinline[style=cmd]{ettercap} + \end{itemize} + +\end{frame} + +\subsection{SSH} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + \lstinline[style=cmd]{SSH <Rechner>} + \item + \lstinline[style=cmd]{-C}: Komprimierung + \item + \lstinline[style=cmd]{-L}: lokalen Port auf Remote-Port umleiten + \item + \lstinline[style=cmd]{-R}: Remote-Port auf lokalen Port umleiten + \end{itemize} + +\end{frame} + +\iffalse + +\subsection{X11} + +\begin{frame} + + \showsubsection + + \begin{itemize} + \item + Grafik-Bildschirm und Eingabegeräte über's Netz + \item + \lstinline[style=cmd]{DISPLAY}-Variable: X-Server: Rechner und Bildschirm + \item + \lstinline[style=cmd]{ssh -X}: X11-Forwarding + \end{itemize} + +\end{frame} + +\nosectionnonumber{\inserttitle} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/dbs}}}% + \item[\textbf{2}] \textbf{Kurzeinführung Unix} + \begin{itemize} + \item[2.1] Grundkonzepte + \item[2.2] Die Kommandozeile: Grundlagen + \item[2.3] Dateisysteme + \item[2.4] Ein- und Ausgabeströme + \item[2.5] Pipes + \item[2.6] Verzweigungen und Schleifen + \end{itemize} + \item[\textbf{3}] \textbf{Kurzeinführung TCP/IP} + \begin{itemize} + \color{medgreen} + \item[3.1] IP-Adressen + \item[3.2] MAC-Adressen + \item[3.3] TCP- und UDP-Ports + \item[\dots] + \end{itemize} + \vspace*{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + + \vfilll + \underconstruction + +\end{frame} + +\fi + +\end{document} diff --git a/20231026/logo-hochschule-bochum-cvh-text-v2.pdf b/20231026/logo-hochschule-bochum-cvh-text-v2.pdf new file mode 120000 index 0000000000000000000000000000000000000000..4aa99b8f81061aca6dcaf43eed2d9efef40555f8 --- /dev/null +++ b/20231026/logo-hochschule-bochum-cvh-text-v2.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum-cvh-text-v2.pdf \ No newline at end of file diff --git a/20231026/logo-hochschule-bochum.pdf b/20231026/logo-hochschule-bochum.pdf new file mode 120000 index 0000000000000000000000000000000000000000..b6b9491e370e499c9276918182cdb82cb311bcd1 --- /dev/null +++ b/20231026/logo-hochschule-bochum.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum.pdf \ No newline at end of file diff --git a/20231026/pgslides.sty b/20231026/pgslides.sty new file mode 120000 index 0000000000000000000000000000000000000000..5be1416f4216f076aa268901f52a15d775e43f64 --- /dev/null +++ b/20231026/pgslides.sty @@ -0,0 +1 @@ +../common/pgslides.sty \ No newline at end of file