Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 2015ss
  • 2016ss
  • 2016ws
  • 2017ss
  • 2017ws
  • 2018ws
  • 2019ss
  • 2019ws
  • 2020ws
  • 2021ws
  • 2022ws
  • MPeth-2022ws-patch-01682
12 results

Target

Select target project
  • pgerwinski/es
  • MPeth/es
2 results
Select Git revision
  • 2015ss
  • 2016ss
  • 2016ws
  • 2017ss
  • 2017ws
  • 2018ws
  • 2019ss
  • 2019ws
  • 2020ws
  • 2021ws
  • 2022ws
  • 2023ws
  • 2024ss
  • 2025ss
14 results
Show changes
Showing
with 1681 additions and 0 deletions
<html>
<h1>Ein Quadrocopter!</h1>
<img alt="Foto: Quadrocopter" src="quadrocopter.jpg"/>
</html>
Rechner-IP 10.128. 25.17 00001010.10000000.00011001.00010001
& Netzmaske & 255.255.252. 0 11111111.11111111.11111100.00000000
----------- ---------------- -----------------------------------
Netz-IP 10.128. 24. 0 00000010.10000000.00011000.00000000
SSH-Tunnel, um von "draußen" an den CVH zu kommen, 26.10.2022, 16:07:57
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wie können wir Hello-Zugriff von außen auf einen Rechner am CVH, Raum 2-52 ermöglichen?
$ ssh -C -R "*:23456:localhost:1234" root@lokagrupo
~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ ~~~~~~~~~
Kompression Port-Weiterleitung | Rechner, auf dem ich mich einlogge
|
`---- Benutzername auf dem Remote-Rechner
-R --> "Remote"
Auf dem Remote-Rechner (lokagrupo = 144.76.104.6) einen Port öffnen.
"*:23456:localhost:1234"
~~~~~
= Der Port, der geöffnet werden soll.
"*:23456:localhost:1234"
~~~~~~~~~~~~~~
= Was passieren soll, wenn sich jemand mit dem Port verbindet.
Hier: Wer "nc 144.76.104.6 23456" macht, kann mit einem Programm
sprechen, das auf dem Rechner "localhost" auf Port 1234 läuft
(hier: "localhost" = 192.168.124.173 im lokalen Netz
im Raum 2-52 des CVH).
Konkret: hier läuft:
while true; do nc -l -p 1234 -c ./hello-01; done
Dies ist ein Internet-Service, der auf Port 1234 ein
"Hello, world!" zur Verfügung stellt.
"*:23456:localhost:1234"
~
= Aus Sicherheitsgründen öffnet SSH den Port (hier: 23456) nur für Zugriff von
dem Rechner selbst, nicht von außen. Der "*" bedeutet: Auch für Zugriff von
außen öffnen.
(Die Firewall-Regeln und die SSH-Konfiguration des Rechners können dies u.U.
verhindern. Daher hier: "GatewayPorts yes" in der Datei /etc/ssh/sshd_config)
Wie können wir SSH-Zugriff von außen auf einen Rechner am CVH, Raum 2-52 ermöglichen?
$ ssh -C -R "*:23456:192.168.124.157:22" root@lokagrupo
Aufgabe:
Pause bis 16:45 Uhr. Bitte bis dahin auf dem Gast-Notebook einloggen und Spuren hinterlassen.
Ergebnis:
gast@netzlabor-4:~$ ls -lrt
insgesamt 16
-rw-r--r-- 1 gast gast 0 Okt 26 16:26 mmelchert-was-here
-rw-r--r-- 1 gast gast 0 Okt 26 16:27 pgerwinski-was-hacked
-rw-r--r-- 1 gast gast 0 Okt 26 16:27 bwildenhain-estis-ĉi-tie
drwxr-xr-x 2 gast gast 4096 Okt 26 16:28 thensel-is-here
-rw-r--r-- 1 gast gast 0 Okt 26 16:28 yalovac-was-here
-rwxr-xr-x 1 gast gast 310 Okt 26 16:29 recreation
-rw-r--r-- 1 gast gast 0 Okt 26 16:29 ferozalekozai-was-here
-rw-r--r-- 1 gast gast 10 Okt 26 16:29 denny-was-here
drwxr-xr-x 2 gast gast 4096 Okt 26 16:38 hboehne-was-here
gast@netzlabor-4:~$
Aufgabe:
Bieten Sie von außen einen Dienst an, den wir von diesem Raum aus nutzen können.
Hinweis: Nutzen Sie das Notebook für einen SSH-Tunnel.
Ergebnis 1:
cassini/home/peter> while true; do nc 192.168.124.157 6789; done
Hallo
Tobias hier
Hallo
Hallo?
Scheint zu funktionieren. :-)
JA!
Herzlichen Glückwunsch! :-) :-)
^C
^Z
[1]+ Angehalten nc 192.168.124.157 6789
cassini/home/peter> kill %1
[1]+ Exit 1 nc 192.168.124.157 6789
Ergebnis 2:
cassini/home/peter> nc 192.168.124.157 6789
Ist Hallo
da jemand?
Scheint zu funHHHdddddddgHallo
ktionieren.
Aber ich habe keine Shell. :-(-;
leider
Cool. B-)
Hier hat jemand es geschafft, die Aufgabe nativ unter Windows zu lösen.
Exakt
Ergebnis 3:
cassini/home/peter> nc 192.168.124.157 7891
Hallo???
Hallo!
:-)
^C
cassini/home/peter>
Ergebnis 4:
cassini/home/peter> nc 192.168.124.157 5678
Naaa? 8-)
Hacking in pogress..
Sehr sc20%
hön. 40%
60%
80%
Was passiert hier? ==8-O Hilfe!
90%
95%
99%
nasa wurde gehackt
^����B�.^H<^R
����B�.^H<�^H���N��^������������rxzҽ �T
cassini/home/peter>
#!/bin/bash
debug=true
if [ $# -gt 0 ]; then
$debug && echo "parameters = $@"
shift $(( $# - 1 ))
file_template="$1"
else
file_template=$(ls -rt *.c *.cpp *.sh *.py *.tex *.diff 2>/dev/null | tail -1)
fi
$debug && echo "file_template = $file_template"
file_extension=$(echo $file_template | sed -e 's/.*\.\(.*$\)/\1/')
file_base=$(echo $file_template | sed -e 's/\(.*\)\..*$/\1/')
$debug && echo "file_extension = $file_extension"
$debug && echo "file_base = $file_base"
file_number=$(echo $file_base | sed -e 's/^.*-\([0-9]*$\)/\1/')
file_stem=$(echo $file_base | sed -e 's/^\(.*\)-[0-9]*$/\1/')
$debug && echo "file_number = $file_number"
$debug && echo "file_number = $file_stem"
while [ -e "$file_stem-$file_number.$file_extension" -o -e "$file_stem-0$file_number.$file_extension" ]; do
# file_number=$((file_number + 1))
file_number=$(echo "$file_number + 1" | bc)
$debug && echo "file_number = $file_number"
done
new_file_name="$file_stem-$(printf "%02d" $file_number).$file_extension"
$debug && echo "new_file_name = $new_file_name" && read junk
cp -pi "$file_template" "$new_file_name"
#$EDITOR "$new_file_name"
/usr/bin/vim -X -c 'set sw=2' -c 'set expandtab' -c 'set ai' -c 'set nowrap' \
"$new_file_name"
clear
cat "$new_file_name"
File added
% es-20221102.pdf - Lecture Slides on Embedded Systems
% Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 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: VNC
\documentclass[10pt,t]{beamer}
\usepackage{pgslides}
\usepackage{rotating}
\usepackage{tikz}
\newcommand{\underconstruction}{%
\begin{picture}(0,0)
\put(9,0.9){\makebox(0,0)[b]{\includegraphics[width=1.5cm]{Zeichen_123.pdf}}}
\put(9,0.6){\makebox(0,0)[t]{\shortstack{Änderungen\\vorbehalten}}}
\end{picture}}
\title{Eingebettete Systeme}
\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski}
\date{2.\ November 2022}
\newcommand{\greyurl}[1]{\href{#1}{\color{gray}\nolinkurl{#1}}}
\newcommand{\ItwoC}{I\raisebox{0.5ex}{\footnotesize 2}C}
\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/es}}}%
\item[\textbf{2}] \textbf{Einführung in Unix}
\item[\textbf{3}] \textbf{TCP/IP in der Praxis}
\begin{itemize}
\color{medgreen}
\item [3.1] IP-Adressen
\item [3.2] MAC-Adressen
\item [3.3] TCP- und UDP-Ports
\item [3.4] TCP-Protokolle
\item [3.5] Routing
\item [3.6] Netzwerkanalyse
\item [3.7] SSH
\item [3.8] X11 \color{red}und VNC
\color{black}
\item[3.9] Programmierung
\end{itemize}
\item[\textbf{\dots}]
\end{itemize}
\strut\hfill \url{https://www.peter.gerwinski.de/download/net-2013ss.tar.gz}
% \vspace*{-1cm plus 1filll}
% \underconstruction
\end{frame}
\setcounter{section}{2}
\section{TCP/IP in der Praxis}
\setcounter{subsection}{4}
\subsection{Routing}
\begin{frame}[fragile]
\showsection
\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}
\showsection
\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}
\showsection
\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}
\subsection{X11 und VNC}
\begin{frame}
\showsection
\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
\pause
\bigskip
\item
VNC = Virtual Network Computing
\item
VNC-Server stellt Bildschirminhalt zur Verfügung
\begin{itemize}
\item entweder: eigener, virtueller X11-Server
\item oder: ruft Inhalt von anderem (X11-) Bildschirm ab
\end{itemize}
\item
VNC-Client ruft Bildschirminhalt ab und stellt ihn dar
\begin{itemize}
\item z.\,B.\ per X11
\item z.\,B.\ per Web-Interface: noVNC
\end{itemize}
\end{itemize}
\end{frame}
\end{document}
../common/logo-hochschule-bochum-cvh-text-v2.pdf
\ No newline at end of file
../common/logo-hochschule-bochum.pdf
\ No newline at end of file
../common/pgslides.sty
\ No newline at end of file
File added
20221102/vnc-01-vnc-cvh-und-prof-notebook.png

219 KiB

20221102/vnc-01-vnc-cvh.png

177 KiB

20221102/vnc-01-x11-und-vnc-protokolle.png

170 KiB

20221102/vnc-01-x11-und-vnc.png

164 KiB

20221102/vnc-01-x11.png

77.9 KiB

File added
This diff is collapsed.
#include <Wire.h>
void setup() {
Wire.begin(); // join i2c bus (address optional for master)
}
void loop() {
Wire.beginTransmission(0xcc);
Wire.write(255);
Wire.endTransmission();
// delay(500);
}
../common/I2C_data_transfer.pdf
\ No newline at end of file
../common/SPI_single_slave.pdf
\ No newline at end of file
../common/SPI_three_slaves.pdf
\ No newline at end of file