From 578ffafb8d4ee300471479169386aeb89033d213 Mon Sep 17 00:00:00 2001 From: Peter Gerwinski <peter.gerwinski@hs-bochum.de> Date: Mon, 20 Mar 2023 18:56:54 +0100 Subject: [PATCH] Weitere Beispiel-Dateien und Screenshots, 20.3.2023 --- 20230320/bc-1.txt | 10 ++++++++++ 20230320/bc-2.txt | 15 +++++++++++++++ 20230320/bc-3.txt | 10 ++++++++++ 20230320/bc.sh | 3 +++ 20230320/bc2.sh | 4 ++++ 20230320/if-1.txt | 8 ++++++++ 20230320/if-2.txt | 6 ++++++ 20230320/if-3.txt | 5 +++++ 20230320/loops-1.txt | 7 +++++++ 20230320/loops-2.txt | 5 +++++ 20230320/loops-3.txt | 11 +++++++++++ 20230320/loops-4.txt | 14 ++++++++++++++ 20230320/permissions-1.txt | 19 +++++++++++++++++++ 20230320/permissions-2.txt | 13 +++++++++++++ 20230320/permissions-3.txt | 4 ++++ 20230320/permissions-4.txt | 22 ++++++++++++++++++++++ 20230320/permissions-5.txt | 23 +++++++++++++++++++++++ 20230320/pipes-1.txt | 18 ++++++++++++++++++ 20230320/projekte.txt | 1 + 20230320/setuid-setgid-bits-1.txt | 13 +++++++++++++ 20230320/sticky-bit-1.txt | 7 +++++++ 20230320/test.sh | 2 ++ 20230320/test2.sh | 7 +++++++ 20230320/test3.sh | 3 +++ 24 files changed, 230 insertions(+) create mode 100644 20230320/bc-1.txt create mode 100644 20230320/bc-2.txt create mode 100644 20230320/bc-3.txt create mode 100755 20230320/bc.sh create mode 100755 20230320/bc2.sh create mode 100644 20230320/if-1.txt create mode 100644 20230320/if-2.txt create mode 100644 20230320/if-3.txt create mode 100644 20230320/loops-1.txt create mode 100644 20230320/loops-2.txt create mode 100644 20230320/loops-3.txt create mode 100644 20230320/loops-4.txt create mode 100644 20230320/permissions-1.txt create mode 100644 20230320/permissions-2.txt create mode 100644 20230320/permissions-3.txt create mode 100644 20230320/permissions-4.txt create mode 100644 20230320/permissions-5.txt create mode 100644 20230320/pipes-1.txt create mode 100644 20230320/projekte.txt create mode 100644 20230320/setuid-setgid-bits-1.txt create mode 100644 20230320/sticky-bit-1.txt create mode 100755 20230320/test.sh create mode 100755 20230320/test2.sh create mode 100755 20230320/test3.sh diff --git a/20230320/bc-1.txt b/20230320/bc-1.txt new file mode 100644 index 0000000..29328ea --- /dev/null +++ b/20230320/bc-1.txt @@ -0,0 +1,10 @@ +cassini/home/peter/bo/2023ss/bs/20230320> which bc +/usr/bin/bc +cassini/home/peter/bo/2023ss/bs/20230320> bc +bc 1.07.1 +Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. +This is free software with ABSOLUTELY NO WARRANTY. +For details type `warranty'. +2 + 2 +4 +quit diff --git a/20230320/bc-2.txt b/20230320/bc-2.txt new file mode 100644 index 0000000..16fb2c2 --- /dev/null +++ b/20230320/bc-2.txt @@ -0,0 +1,15 @@ +#!/usr/bin/bc + +2 + 2 +cassini/home/peter/bo/2023ss/bs/20230320> chmod +x bc.sh +cassini/home/peter/bo/2023ss/bs/20230320> ls -l bc.sh +-rwxr-xr-x 1 peter peter 21 Mär 20 18:04 bc.sh +cassini/home/peter/bo/2023ss/bs/20230320> ./bc.sh +bc 1.07.1 +Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. +This is free software with ABSOLUTELY NO WARRANTY. +For details type `warranty'. +4 +3 + 3 +6 +quit diff --git a/20230320/bc-3.txt b/20230320/bc-3.txt new file mode 100644 index 0000000..b5c354c --- /dev/null +++ b/20230320/bc-3.txt @@ -0,0 +1,10 @@ +#!/usr/bin/bc + +2 + 2 +quit +cassini/home/peter/bo/2023ss/bs/20230320> ./bc2.sh +bc 1.07.1 +Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. +This is free software with ABSOLUTELY NO WARRANTY. +For details type `warranty'. +4 diff --git a/20230320/bc.sh b/20230320/bc.sh new file mode 100755 index 0000000..824ea4e --- /dev/null +++ b/20230320/bc.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bc + +2 + 2 diff --git a/20230320/bc2.sh b/20230320/bc2.sh new file mode 100755 index 0000000..f1bff56 --- /dev/null +++ b/20230320/bc2.sh @@ -0,0 +1,4 @@ +#!/usr/bin/bc + +2 + 2 +quit diff --git a/20230320/if-1.txt b/20230320/if-1.txt new file mode 100644 index 0000000..e81f984 --- /dev/null +++ b/20230320/if-1.txt @@ -0,0 +1,8 @@ +cassini/home/peter/bo/2023ss/bs/20230320> grep Test test.txt +Dies ist ein Test. +cassini/home/peter/bo/2023ss/bs/20230320> echo $? +0 +cassini/home/peter/bo/2023ss/bs/20230320> grep Täst test.txt +cassini/home/peter/bo/2023ss/bs/20230320> echo $? +1 +cassini/home/peter/bo/2023ss/bs/20230320> diff --git a/20230320/if-2.txt b/20230320/if-2.txt new file mode 100644 index 0000000..e3b7e67 --- /dev/null +++ b/20230320/if-2.txt @@ -0,0 +1,6 @@ +cassini/home/peter/bo/2023ss/bs/20230320> if grep Test test.txt; then echo "gefunden"; else echo "nicht gefunden"; fi +Dies ist ein Test. +gefunden +cassini/home/peter/bo/2023ss/bs/20230320> if grep Täst test.txt; then echo "gefunden"; else echo "nicht gefunden"; fi +nicht gefunden +cassini/home/peter/bo/2023ss/bs/20230320> diff --git a/20230320/if-3.txt b/20230320/if-3.txt new file mode 100644 index 0000000..a107c65 --- /dev/null +++ b/20230320/if-3.txt @@ -0,0 +1,5 @@ +cassini/home/peter/bo/2023ss/bs/20230320> if grep -q Test test.txt; then echo "gefunden"; else echo "nicht gefunden"; fi +gefunden +cassini/home/peter/bo/2023ss/bs/20230320> if grep -q Täst test.txt; then echo "gefunden"; else echo "nicht gefunden"; fi +nicht gefunden +cassini/home/peter/bo/2023ss/bs/20230320> diff --git a/20230320/loops-1.txt b/20230320/loops-1.txt new file mode 100644 index 0000000..02c799f --- /dev/null +++ b/20230320/loops-1.txt @@ -0,0 +1,7 @@ +cassini/home/peter/bo/2023ss/bs/20230320> for x in *.pdf; do xpdf $x; done +cassini/home/peter/bo/2023ss/bs/20230320> for x in *.pdf; do echo $x; xpdf $x; done +bs-20230320.pdf +logo-hochschule-bochum-cvh-text.pdf +logo-hochschule-bochum.pdf +Operating_system_placement-de.pdf +unix-20230320.pdf diff --git a/20230320/loops-2.txt b/20230320/loops-2.txt new file mode 100644 index 0000000..f9cb815 --- /dev/null +++ b/20230320/loops-2.txt @@ -0,0 +1,5 @@ +cassini/home/peter/bo/2023ss/bs/20230320> for x in Anton Bertha Cäsar Dora; do echo "Hallo, $x!"; done +Hallo, Anton! +Hallo, Bertha! +Hallo, Cäsar! +Hallo, Dora! diff --git a/20230320/loops-3.txt b/20230320/loops-3.txt new file mode 100644 index 0000000..6a209ab --- /dev/null +++ b/20230320/loops-3.txt @@ -0,0 +1,11 @@ +cassini/home/peter/bo/2023ss/bs/20230320> for x in 1 2 3 4 5 6 7 8 9 10; do echo "$x * 7 = $(( x * 7 ))"; done +1 * 7 = 7 +2 * 7 = 14 +3 * 7 = 21 +4 * 7 = 28 +5 * 7 = 35 +6 * 7 = 42 +7 * 7 = 49 +8 * 7 = 56 +9 * 7 = 63 +10 * 7 = 70 diff --git a/20230320/loops-4.txt b/20230320/loops-4.txt new file mode 100644 index 0000000..61aada4 --- /dev/null +++ b/20230320/loops-4.txt @@ -0,0 +1,14 @@ +Das Unix-Programm "od" ist älter als die Bash, daher die Inkonsequenz: +https://de.wikipedia.org/wiki/Od_(Unix)#Geschichte + +cassini/home/peter/bo/2023ss/bs/20230320> od test.txt +0000000 064504 071545 064440 072163 062440 067151 052040 071545 +0000020 027164 000012 +0000023 +cassini/home/peter/bo/2023ss/bs/20230320> cat test.txt +Dies ist ein Test. +cassini/home/peter/bo/2023ss/bs/20230320> hexdump -C test.txt +00000000 44 69 65 73 20 69 73 74 20 65 69 6e 20 54 65 73 |Dies ist ein Tes| +00000010 74 2e 0a |t..| +00000013 +cassini/home/peter/bo/2023ss/bs/20230320> diff --git a/20230320/permissions-1.txt b/20230320/permissions-1.txt new file mode 100644 index 0000000..3ec4efb --- /dev/null +++ b/20230320/permissions-1.txt @@ -0,0 +1,19 @@ +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +-rw-r--r-- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> cat test.txt +Dies ist ein Test. +cassini/home/peter/bo/2023ss/bs/20230320> chmod -r test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +--w------- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> cat test.txt +cat: test.txt: Keine Berechtigung +cassini/home/peter/bo/2023ss/bs/20230320> chmod -w test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +---------- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> chmod +r test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +-r--r--r-- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> chmod u+w test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +-rw-r--r-- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> diff --git a/20230320/permissions-2.txt b/20230320/permissions-2.txt new file mode 100644 index 0000000..597972e --- /dev/null +++ b/20230320/permissions-2.txt @@ -0,0 +1,13 @@ +cassini/home/peter/bo/2023ss/bs/20230320> chmod 000 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +---------- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> chmod 640 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +-rw-r----- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> chmod 755 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +-rwxr-xr-x 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> chmod 644 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +-rw-r--r-- 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> diff --git a/20230320/permissions-3.txt b/20230320/permissions-3.txt new file mode 100644 index 0000000..c3a5007 --- /dev/null +++ b/20230320/permissions-3.txt @@ -0,0 +1,4 @@ +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.txt +-rwxr-xr-x 1 peter peter 19 Mär 20 16:41 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> ./test.txt +./test.txt: Zeile 1: Dies: Kommando nicht gefunden. diff --git a/20230320/permissions-4.txt b/20230320/permissions-4.txt new file mode 100644 index 0000000..f3f62a8 --- /dev/null +++ b/20230320/permissions-4.txt @@ -0,0 +1,22 @@ +cassini/home/peter/bo/2023ss/bs/20230320> cat test.sh +ls +echo "Hello, world!" +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.sh +-rw-r--r-- 1 peter peter 24 Mär 20 17:53 test.sh +cassini/home/peter/bo/2023ss/bs/20230320> ./test.sh +bash: ./test.sh: Keine Berechtigung +cassini/home/peter/bo/2023ss/bs/20230320> chmod 755 test.sh +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test.sh +-rwxr-xr-x 1 peter peter 24 Mär 20 17:53 test.sh +cassini/home/peter/bo/2023ss/bs/20230320> ./test.sh +bs-20230320.aux grep-1.txt hello-02.c test4.txt +bs-20230320.log grep-2.txt logo-hochschule-bochum-cvh-text.pdf test5.txt +bs-20230320.nav grep-3.txt logo-hochschule-bochum.pdf test6.txt +bs-20230320.out grep-4.txt Operating_system_placement-de.pdf test.sh +bs-20230320.pdf grep-5.txt permissions-1.txt test.txt +bs-20230320.snm grep-6.txt permissions-2.txt tmp.inputs +bs-20230320.tex grep-7.txt permissions-3.txt unix-20230320.pdf +bs-20230320.toc hello-01 pgslides.sty unix-20230320.tex +bs-20230320.txt hello-01.c test2.txt vic +foo hello-02 test3.txt wildcards-1.txt +Hello, world! diff --git a/20230320/permissions-5.txt b/20230320/permissions-5.txt new file mode 100644 index 0000000..371f946 --- /dev/null +++ b/20230320/permissions-5.txt @@ -0,0 +1,23 @@ +cassini/home/peter/bo/2023ss/bs/20230320> cat test2.sh +echo -n "Ihr Befehl: " +read cmd +$cmd +cassini/home/peter/bo/2023ss/bs/20230320> chmod 755 test2.sh +cassini/home/peter/bo/2023ss/bs/20230320> ls -l test2.sh +-rwxr-xr-x 1 peter peter 37 Mär 20 17:55 test2.sh +cassini/home/peter/bo/2023ss/bs/20230320> ./test2.sh +Ihr Befehl: ls +bs-20230320.aux grep-5.txt pgslides.sty +bs-20230320.log grep-6.txt test2.sh +bs-20230320.nav grep-7.txt test2.txt +bs-20230320.out hello-01 test3.txt +bs-20230320.pdf hello-01.c test4.txt +bs-20230320.snm hello-02 test5.txt +bs-20230320.tex hello-02.c test6.txt +bs-20230320.toc logo-hochschule-bochum-cvh-text.pdf test.sh +bs-20230320.txt logo-hochschule-bochum.pdf test.txt +foo Operating_system_placement-de.pdf tmp.inputs +grep-1.txt permissions-1.txt unix-20230320.pdf +grep-2.txt permissions-2.txt unix-20230320.tex +grep-3.txt permissions-3.txt vic +grep-4.txt permissions-4.txt wildcards-1.txt diff --git a/20230320/pipes-1.txt b/20230320/pipes-1.txt new file mode 100644 index 0000000..810c4b0 --- /dev/null +++ b/20230320/pipes-1.txt @@ -0,0 +1,18 @@ +cassini/home/peter/bo/2023ss/bs/20230320> ls -l /usr/bin | grep -v "root *root" +insgesamt 1485232 +-rwsr-sr-x 1 daemon daemon 55560 Jul 24 2018 at +-rwxr-sr-x 1 root tty 14736 Mai 4 2018 bsd-write +-rwxr-sr-x 1 root shadow 71816 Jul 27 2018 chage +-rwxr-sr-x 1 root crontab 43568 Okt 11 2019 crontab +-rwxr-sr-x 1 root mail 18944 Dez 3 2017 dotlockfile +-rwxr-xr-- 1 root wireshark 112888 Feb 8 19:46 dumpcap +-rwxr-sr-x 1 root utmp 14440 Jun 10 2021 Eterm +-rwxr-sr-x 1 root shadow 31000 Jul 27 2018 expiry +-rwxr-sr-x 1 root mail 18688 Jul 31 2022 lockfile +-rwxr-sr-x 1 root mlocate 39608 Nov 14 2018 mlocate +-rwxr-sr-x 1 root mail 14344 Apr 23 2022 mutt_dotlock +-rwsr-sr-x 1 root mail 97488 Jul 31 2022 procmail +-rwxr-sr-x 1 root ssh 321672 Jan 31 2020 ssh-agent +-rwxr-sr-x 1 root utmp 1411072 Mai 21 2021 urxvt +-rwxr-sr-x 1 root utmp 1415168 Mai 21 2021 urxvtd +-rwxr-sr-x 1 root tty 34896 Jan 10 2019 wall diff --git a/20230320/projekte.txt b/20230320/projekte.txt new file mode 100644 index 0000000..6896cfe --- /dev/null +++ b/20230320/projekte.txt @@ -0,0 +1 @@ +https://gitlab.cvh-server.de/hardwarenahe-it/projekte diff --git a/20230320/setuid-setgid-bits-1.txt b/20230320/setuid-setgid-bits-1.txt new file mode 100644 index 0000000..6e08632 --- /dev/null +++ b/20230320/setuid-setgid-bits-1.txt @@ -0,0 +1,13 @@ +cassini/home/peter/bo/2023ss/bs/20230320> ls -l /usr/bin/sudo +-rwsr-xr-x 1 root root 157192 Jan 16 21:03 /usr/bin/sudo +cassini/home/peter/bo/2023ss/bs/20230320> ls -l /home/enigma/ +insgesamt 8 +drwxr-xr-x 2 enigma enigma 4096 Mai 26 2018 Desktop +drwx------ 2 enigma enigma 4096 Aug 22 2018 Downloads +cassini/home/peter/bo/2023ss/bs/20230320> ls -l /home/enigma/Downloads/ +ls: Öffnen von Verzeichnis '/home/enigma/Downloads/' nicht möglich: Keine Berechtigung +cassini/home/peter/bo/2023ss/bs/20230320> sudo ls -l /home/enigma/Downloads/ +[sudo] Passwort für peter: +insgesamt 5592 +-rw-r--r-- 1 enigma enigma 2856917 Mai 30 2018 enigmail-2.0.6-sm+tb.xpi +-rw-r--r-- 1 enigma enigma 2866462 Aug 22 2018 enigmail-2.0.8-sm+tb.xpi diff --git a/20230320/sticky-bit-1.txt b/20230320/sticky-bit-1.txt new file mode 100644 index 0000000..3865a41 --- /dev/null +++ b/20230320/sticky-bit-1.txt @@ -0,0 +1,7 @@ +-rw-r--r-- 1 enigma enigma 17 Mär 20 18:46 test.txt +cassini/home/peter/bo/2023ss/bs/20230320> cat /tmp/test.txt +Hi! Hier Enigma! +cassini/home/peter/bo/2023ss/bs/20230320> rm /tmp/test.txt +rm: reguläre Datei (schreibgeschützt) '/tmp/test.txt' entfernen? y +rm: das Entfernen von '/tmp/test.txt' ist nicht möglich: Die Operation ist nicht erlaubt +cassini/home/peter/bo/2023ss/bs/20230320> diff --git a/20230320/test.sh b/20230320/test.sh new file mode 100755 index 0000000..b149a96 --- /dev/null +++ b/20230320/test.sh @@ -0,0 +1,2 @@ +ls +echo "Hello, world!" diff --git a/20230320/test2.sh b/20230320/test2.sh new file mode 100755 index 0000000..90ce620 --- /dev/null +++ b/20230320/test2.sh @@ -0,0 +1,7 @@ +echo -n "Ihr Befehl: " +read cmd +$cmd + +# So nicht programmieren! +# Dies ist eine Sicherheitslücke! +# Benutzer dürfen Code eingeben, der dann ausgeführt wird. diff --git a/20230320/test3.sh b/20230320/test3.sh new file mode 100755 index 0000000..e4842fa --- /dev/null +++ b/20230320/test3.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ls -- GitLab