From 74306b77c58fa1dd74a6162e7eeca9b93f121528 Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 30 Jan 2019 13:28:52 +0100 Subject: [PATCH 01/13] fix hardcoded device --- kali/make_kali-usb-stick_persistent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kali/make_kali-usb-stick_persistent b/kali/make_kali-usb-stick_persistent index f55ddd6..1f691a5 100755 --- a/kali/make_kali-usb-stick_persistent +++ b/kali/make_kali-usb-stick_persistent @@ -64,7 +64,7 @@ if blkid "${USBSTICK}"3 | grep -F persistence &> /dev/null ; then fi # add 3rd partition to the end of the usb stick -FREE="$( parted -m /dev/sdd print free | grep -F free | tail -n 1 )" +FREE="$( parted -m "${USBSTICK}" print free | grep -F free | tail -n 1 )" START="$( printf "${FREE}" | awk -F ":" '{ print $2; }' )" END="$( printf "${FREE}" | awk -F ":" '{ print $3; }' )" parted "${USBSTICK}" mkpart primary "${START}" "${END}" From 3ab5964e910ab24e84720da0051cfd7ac5651bec Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 30 Jan 2019 13:37:35 +0100 Subject: [PATCH 02/13] deactivate ipv6 --- kali/wireshark_with_no_ip | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kali/wireshark_with_no_ip b/kali/wireshark_with_no_ip index bb3b3e1..f8238fd 100755 --- a/kali/wireshark_with_no_ip +++ b/kali/wireshark_with_no_ip @@ -31,6 +31,9 @@ ip addr flush dev "${NIC}" ip route flush dev "${NIC}" echo > /etc/resolv.conf +# deactivate ipv6 +echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 + # configure nic without ip address and without arp ip addr add 0.0.0.0/32 dev "${NIC}" ip link set "${NIC}" arp off up From eaaa2094975f441bd42cac8d1d259dc7f97253df Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 30 Jan 2019 13:41:27 +0100 Subject: [PATCH 03/13] added link --- kali/wireshark_with_no_ip | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kali/wireshark_with_no_ip b/kali/wireshark_with_no_ip index f8238fd..3317ab4 100755 --- a/kali/wireshark_with_no_ip +++ b/kali/wireshark_with_no_ip @@ -6,9 +6,11 @@ # Description: Brings a nic up without an ip address and without arp and # starts wireshark really passive. # Author: Patrick Neumann (patrick@neumannsland.de) -# Platform: Kali Linux (tested: 2018.2) -# Version: 1.0 -# Date: 24.08.2018 +# Platform: Kali Linux (tested: 2018.4) +# Version: 1.01 +# Date: 30.01.2019 +# Link: +# https://vcs.neumannsland.de/casualscripter/shell-scripting/src/branch/master/kali/wireshark_with_no_ip # License: GPL3 # Warranty: This program is distributed WITHOUT ANY WARRANTY From 829341283e24c05618029e6f1c20754deabb077e Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 30 Jan 2019 13:43:33 +0100 Subject: [PATCH 04/13] added link --- kali/make_kali-usb-stick_persistent | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kali/make_kali-usb-stick_persistent b/kali/make_kali-usb-stick_persistent index 1f691a5..d0c7da4 100755 --- a/kali/make_kali-usb-stick_persistent +++ b/kali/make_kali-usb-stick_persistent @@ -6,10 +6,12 @@ # Description: Writes a kali.iso to an usb stick (optional) and # adds persistence to it step by step. # Author: Patrick Neumann (patrick@neumannsland.de) -# Platform: Kali Linux (tested: 2018.2) or +# Platform: Kali Linux (tested: 2018.4) or # Debian GNU/Linux (tested: 9.5) -# Version: 1.0 -# Date: 24.08.2018 +# Version: 1.01 +# Date: 30.01.2019 +# Link: +# https://vcs.neumannsland.de/casualscripter/shell-scripting/src/branch/master/kali/make_kali-usb-stick_persistent # License: GPL3 # Warranty: This program is distributed WITHOUT ANY WARRANTY From 2751bc79810dcfcec6681215725b63327d2d906a Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 30 Jan 2019 13:45:07 +0100 Subject: [PATCH 05/13] added link --- kali/airodump-script | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kali/airodump-script b/kali/airodump-script index 03c26bf..289278e 100755 --- a/kali/airodump-script +++ b/kali/airodump-script @@ -9,6 +9,8 @@ # Platform: Kali Linux (tested: 2018.2) # Version: 1.0 # Date: 24.08.2018 +# Link: +# https://vcs.neumannsland.de/casualscripter/shell-scripting/src/branch/master/kali/airodump-script # License: GPL3 # Warranty: This program is distributed WITHOUT ANY WARRANTY From 51f7fb94577c02aee30f94415d7673cbc5cbbf90 Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Tue, 12 Feb 2019 13:15:25 +0100 Subject: [PATCH 06/13] initial commit --- grep/generate_files_with_problematic_names | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 grep/generate_files_with_problematic_names diff --git a/grep/generate_files_with_problematic_names b/grep/generate_files_with_problematic_names new file mode 100644 index 0000000..070ae8e --- /dev/null +++ b/grep/generate_files_with_problematic_names @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Usage: ./generate_files_with_problematic_names +# or +# bash generate_files_with_problematic_names +# Description: (see scriptname!) +# Author: Patrick Neumann (patrick@neumannsland.de) +# Version: 1.0 +# Date: 27.02.2018 +# License: GPL3 +# Warranty: This program is distributed WITHOUT ANY WARRANTY +# Todo: Find and add more problems in filenames!? + +FWPN="files_with_problematic_names" + +mkdir "${FWPN}" +cd "${FWPN}" + +# fwpn = f(iles)w(ith)p(roblematic)n(ames) +# meier, meyer, mayer are mayr similar lastnames + +echo "fwpn:word:meier" > word.txt +echo "fwpn:underscore:meyer" > underscore_instead_of_space.txt +echo "fwpn:hidden:mayer" > .hidden.txt +echo "fwpn:two dots:mayr" > ..two_dots.txt +echo "fwpn:three dots:meier" > ...three_dots.txt +echo "fwpn:leading hyphen:meyer" > ./-leading_hyphen.txt +echo "fwpn:with star:mayer" > with_*.txt +echo "fwpn:with backslash:mayr" > "with_\.txt" +echo "fwpn:blank at the beginning:meier" > " blank.txt" +echo "fwpn:blank as separator:meyer" > "blank as separator.txt" +echo "fwpn:newline as separator:mayer" > "newline_as +separator.txt" +echo "fwpn:tabulator as separator:mayr" > tabulator_as$'\t'separator.txt +echo "fwpn:with questionmark:meier" > with_?.txt + +exit 0 \ No newline at end of file From 966215a19fa992896881e481c4f77b47753adb3f Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Tue, 12 Feb 2019 13:21:15 +0100 Subject: [PATCH 07/13] colon added reserved for NTFS alternate data stream (ADS). Not allowed under Windows but without problems in Unix/BSD/Linux! --- grep/generate_files_with_problematic_names | 1 + 1 file changed, 1 insertion(+) diff --git a/grep/generate_files_with_problematic_names b/grep/generate_files_with_problematic_names index 070ae8e..d31b58e 100644 --- a/grep/generate_files_with_problematic_names +++ b/grep/generate_files_with_problematic_names @@ -33,5 +33,6 @@ echo "fwpn:newline as separator:mayer" > "newline_as separator.txt" echo "fwpn:tabulator as separator:mayr" > tabulator_as$'\t'separator.txt echo "fwpn:with questionmark:meier" > with_?.txt +echo "fwpn:collon:meyer" > with_:.txt exit 0 \ No newline at end of file From 4e93beac4fbee822772edc69eb21c4fcb5796243 Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Tue, 12 Feb 2019 13:41:09 +0100 Subject: [PATCH 08/13] added some candidates for deeper testing --- grep/generate_files_with_problematic_names | 1 + 1 file changed, 1 insertion(+) diff --git a/grep/generate_files_with_problematic_names b/grep/generate_files_with_problematic_names index d31b58e..72061f5 100644 --- a/grep/generate_files_with_problematic_names +++ b/grep/generate_files_with_problematic_names @@ -10,6 +10,7 @@ # License: GPL3 # Warranty: This program is distributed WITHOUT ANY WARRANTY # Todo: Find and add more problems in filenames!? +# Possible candidates: < > , ; = [ ] " / | \ FWPN="files_with_problematic_names" From 9d14d36e058a9a960d4beab5ea46cd8e0993efff Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Tue, 12 Feb 2019 13:48:17 +0100 Subject: [PATCH 09/13] =?UTF-8?q?=E2=80=9Egrep/generate=5Ffiles=5Fwith=5Fp?= =?UTF-8?q?roblematic=5Fnames=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grep/generate_files_with_problematic_names | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grep/generate_files_with_problematic_names b/grep/generate_files_with_problematic_names index 72061f5..af0cf2a 100644 --- a/grep/generate_files_with_problematic_names +++ b/grep/generate_files_with_problematic_names @@ -34,6 +34,6 @@ echo "fwpn:newline as separator:mayer" > "newline_as separator.txt" echo "fwpn:tabulator as separator:mayr" > tabulator_as$'\t'separator.txt echo "fwpn:with questionmark:meier" > with_?.txt -echo "fwpn:collon:meyer" > with_:.txt +echo "fwpn:colon:meyer" > with_:.txt exit 0 \ No newline at end of file From d922e3d87969a7e9b7f6a256f6877154c83b538b Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Tue, 12 Feb 2019 14:02:24 +0100 Subject: [PATCH 10/13] fixed questionmark --- grep/generate_files_with_problematic_names | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grep/generate_files_with_problematic_names b/grep/generate_files_with_problematic_names index af0cf2a..adb2809 100644 --- a/grep/generate_files_with_problematic_names +++ b/grep/generate_files_with_problematic_names @@ -33,7 +33,7 @@ echo "fwpn:blank as separator:meyer" > "blank as separator.txt" echo "fwpn:newline as separator:mayer" > "newline_as separator.txt" echo "fwpn:tabulator as separator:mayr" > tabulator_as$'\t'separator.txt -echo "fwpn:with questionmark:meier" > with_?.txt +echo "fwpn:with questionmark:meier" > "with_?.txt" echo "fwpn:colon:meyer" > with_:.txt exit 0 \ No newline at end of file From 15e7eadf6a029cd34a7636d29480b86320dde815 Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 13 Feb 2019 10:35:29 +0100 Subject: [PATCH 11/13] initial commit --- grep/generate_compressed_files | 93 ++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 grep/generate_compressed_files diff --git a/grep/generate_compressed_files b/grep/generate_compressed_files new file mode 100644 index 0000000..5ba99bf --- /dev/null +++ b/grep/generate_compressed_files @@ -0,0 +1,93 @@ +#!/usr/bin/env bash + +# Usage: ./generate_compressed_files +# or +# bash generate_compressed_files +# Description: (see scriptname!) +# Author: Patrick Neumann (patrick@neumannsland.de) +# Version: 1.0 +# Date: 13.02.2019 +# License: GPL3 +# Warranty: This program is distributed WITHOUT ANY WARRANTY +# Todo: - + +# Notwendige Pakete +DEBS="gzip" +DEBS="${DEBS} bzip2" +DEBS="${DEBS} xz-utils" +DEBS="${DEBS} lzop" +DEBS="${DEBS} zip" +DEBS="${DEBS} unzip" +DEBS="${DEBS} rar" +DEBS="${DEBS} unrar" +DEBS="${DEBS} p7zip-full" + +echo "Checking dependencies..." +for deb in ${DEBS} ; do + if ! dpkg -s "${deb}" 2>&1 >/dev/null ; then + sudo apt install "${deb}" --assume-yes + fi +done + +# Zielverzeichnis +DIRECTORY="compressed_files" +FILE="file.txt" + +echo "Creating target directory..." +mkdir "${DIRECTORY}" +cd "${DIRECTORY}" + +# Testdatei +echo "Generating text file..." +cat < "${FILE}" +Eins +eins zwei +zWei +zwei drei +drEi +drei vier +vieR +vier eins +EOF + +# .txt -> .txt.gz +echo "Generating .gz file..." +gzip --keep "${FILE}" + +# Datei mit falscher Dateinamenserweiterung +echo "Generating file with wrong extension..." +cp "${FILE}".gz wrong_extension.txt.bz2 + +# .txt -> .txt.bz2 +echo "Generating .bz2 file..." +bzip2 --keep "${FILE}" + +# .txt -> .txt.xz +echo "Generating .xz file..." +xz --keep "${FILE}" +# .txt -> .txt.lzma +echo "Generating .lzma file..." +xz --keep --format=lzma "${FILE}" + +# .txt -> .txt.lzop +echo "Generating .lzop file..." +lzop --keep "${FILE}" + +# .txt -> .txt.zip +echo "Generating .zip file..." +zip --quiet "${FILE}".zip "${FILE}" + +# .txt -> .txt.rar +echo "Generating .rar file..." +rar a -inul "${FILE}".rar "${FILE}" + +# .txt -> .txt.7z +echo "Generating .7z file..." +7z a "${FILE}".7z "${FILE}" >/dev/null +# .txt -> .txt.lzma2 +echo "Generating .lzma2 file..." +7z a -m0=lzma2 "${FILE}".lzma2 "${FILE}" >/dev/null + +echo "Done." + +exit 0 \ No newline at end of file From 08478d868b0ce55f9ad3dc3df975c3b7ca1e231d Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 13 Feb 2019 11:21:13 +0100 Subject: [PATCH 12/13] added some output --- grep/generate_files_with_problematic_names | 45 +++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/grep/generate_files_with_problematic_names b/grep/generate_files_with_problematic_names index adb2809..5e27d55 100644 --- a/grep/generate_files_with_problematic_names +++ b/grep/generate_files_with_problematic_names @@ -12,28 +12,71 @@ # Todo: Find and add more problems in filenames!? # Possible candidates: < > , ; = [ ] " / | \ +# Zielverzeichnis FWPN="files_with_problematic_names" +echo "Creating target directory..." mkdir "${FWPN}" cd "${FWPN}" # fwpn = f(iles)w(ith)p(roblematic)n(ames) # meier, meyer, mayer are mayr similar lastnames +# regular file +echo "Creating regular file..." echo "fwpn:word:meier" > word.txt + +# regular file +echo "Creating file with underscore..." echo "fwpn:underscore:meyer" > underscore_instead_of_space.txt + +# hidden file +echo "Creating hidden file..." echo "fwpn:hidden:mayer" > .hidden.txt + +# leading .. +echo "Creating file with two leading dots..." echo "fwpn:two dots:mayr" > ..two_dots.txt + +# leading ... +echo "Creating file with three leading dots..." echo "fwpn:three dots:meier" > ...three_dots.txt + +# leading hyphen (-) +echo "Creating file with leading hyphen..." echo "fwpn:leading hyphen:meyer" > ./-leading_hyphen.txt + +# star (*) +echo "Creating file with star..." echo "fwpn:with star:mayer" > with_*.txt + +# backslash (\) +echo "Creating file with backslash..." echo "fwpn:with backslash:mayr" > "with_\.txt" + +# (leading) blank +echo "Creating file with leading blank..." echo "fwpn:blank at the beginning:meier" > " blank.txt" + +# blank (separator) +echo "Creating file with blank..." echo "fwpn:blank as separator:meyer" > "blank as separator.txt" + +# newline +echo "Creating file with newline..." echo "fwpn:newline as separator:mayer" > "newline_as separator.txt" -echo "fwpn:tabulator as separator:mayr" > tabulator_as$'\t'separator.txt + +# tabulator +echo "Creating file with tablulator..." +echo "fwpn:tabulator as separator:mayr" > tab_as$'\t'separator.txt + +# questionmark (?) +echo "Creating file with questionmark..." echo "fwpn:with questionmark:meier" > "with_?.txt" + +# colon (:) +echo "Creating file with colon..." echo "fwpn:colon:meyer" > with_:.txt exit 0 \ No newline at end of file From e28b3660f90370a8f082f2955082e72416075b2f Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Wed, 13 Feb 2019 15:03:38 +0100 Subject: [PATCH 13/13] added link and dir --- grep/generate_compressed_files | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/grep/generate_compressed_files b/grep/generate_compressed_files index 5ba99bf..898a233 100644 --- a/grep/generate_compressed_files +++ b/grep/generate_compressed_files @@ -88,6 +88,14 @@ echo "Generating .7z file..." echo "Generating .lzma2 file..." 7z a -m0=lzma2 "${FILE}".lzma2 "${FILE}" >/dev/null +# symbolic link +echo "Generating symbolic link..." +ln -s "${FILE}" "./symlink" + +echo "Generating directory..." +# directory +mkdir "./directory" + echo "Done." exit 0 \ No newline at end of file