Restructure repository: organize tools by purpose, create what search tool

- Move single-file tools to tools/ organized by category (security, forensics, data, etc.)
- Move multi-file projects to projects/ (go-tools, puzzlebox, timesketch, rust-tools)
- Move system scripts to scripts/ (proxy, display, setup, windows)
- Organize config files in config/ (shell, visidata, applications)
- Move experimental tools to archive/experimental
- Create 'what' fuzzy search tool with progressive enhancement (ollama->fzf->grep)
- Add initial metadata database for intelligent tool discovery
- Preserve git history using 'git mv' commands
This commit is contained in:
tobias
2025-08-24 19:50:00 +02:00
parent 9518290544
commit 619b0bc432
124 changed files with 1063 additions and 0 deletions

32
tools/network/fritzshark.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/sh
# Stolen from Hippie2000 and modified by Jackfritt ;)
# Stolen from Jackfritt and modified by Chaosmaster :-P
ipddr="fritz.box"
unset dumpfile
unset passwd
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ ! $1 ]; then
echo "Usage: $0 <PASSWORD> [<DUMPFILE>] [<IP>]"
exit 1
fi
[ $1 ] && passwd=$1
[ $2 ] && dumpfile="-w $2"
[ $3 ] && ipaddr=$3
# Challenge abholen
ChallengeXML=`wget -O - "http://$ipddr/cgi-bin/webcm?getpage=../html/login_sid.xml" 2>/dev/null| grep Challenge`
Challenge=`echo $ChallengeXML | awk '{match($0,/>[^<>]+</); print substr($0,RSTART+1,RLENGTH-2)}'`
# login aufbauen und hashen
CPSTR="$Challenge-$passwd"
MD5=`echo -n $CPSTR | iconv -f ISO8859-1 -t UTF-16LE | md5sum -b | awk '{print substr($0,1,32)}'`
RESPONSE="$Challenge-$MD5"
POSTDATA="login:command/response=$RESPONSE&getpage=../html/de/menus/menu2.html"
# login senden und SID herausfischen
SID=`wget -O - --post-data="$POSTDATA" "http://$ipddr/cgi-bin/webcm" 2>/dev/null| grep "name=\"sid\"" | head -1 | awk '{match($0,/value="[^"]+"/); print substr($0,RSTART+7,RLENGTH-8)}'`
# Internet Capture
wget -O - "http://$ipddr/cgi-bin/capture_notimeout?ifaceorminor=3-17 \
&snaplen=1600&capture=Start&sid=$SID" 2>/dev/null | \
wireshark -k $dumpfile -i -

30
tools/network/fritzshark2.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
IP="fritz.box"
echo -n Password:
read -s Passwd
# Challenge abholen
Challenge=`wget -O - "http://$IP/login_sid.lua" 2>/dev/null | sed 's/.*<Challenge>\(.*\)<\/Challenge>.*/\1/'`
# login aufbauen und hashen
CPSTR="$Challenge-$Passwd"
MD5=`echo -n $CPSTR | iconv -f ISO8859-1 -t UTF-16LE | md5sum -b | awk '{print substr($0,1,32)}'`
RESPONSE="$Challenge-$MD5"
POSTDATA="?username=&response=$RESPONSE"
# login senden und SID herausfischen
SID=`wget -O - --post-data="$POSTDATA" "http://$IP/login_sid.lua" 2>/dev/null | sed 's/.*<SID>\(.*\)<\/SID>.*/\1/'`
# Internet Capture
#Schnittstelle 1(Internet)=3-17
#wget -O - "http://$IP/cgi-bin/capture_notimeout?ifaceorminor=3-17 \
#alle Schnittstellen =3-0
#wget -O - "http://$IP/cgi-bin/capture_notimeout?ifaceorminor=3-0 \
#&snaplen=1600&capture=Start&sid=$SID" 2>/dev/null | \
#tshark -i - -S -l -N nmtC
#wget -O - "http://$IP/cgi-bin/capture_notimeout?ifaceorminor=3-0 \
#Externe Schnittstelle
#wget -O - "http://$IP/cgi-bin/capture_notimeout?ifaceorminor=3-17 \
#Lokal LAN
#wget -O - "http://$IP/cgi-bin/capture_notimeout?ifaceorminor=1-eth0&snaplen=1600&capture=Start&sid=$SID" 2>/dev/null | tshark -i - -S -l -N nmtC
wget -O - "http://$IP/cgi-bin/capture_notimeout?ifaceorminor=1-eth0&snaplen=1600&capture=Start&sid=$SID" 2>/dev/null | tcpdump -r - -w /tmp/trace -W 48 -G 1800 -C 100 -K -n

13
tools/network/get_ntp.py Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import ntplib
import sys
from time import ctime
c = ntplib.NTPClient()
try:
response = c.request(sys.argv[1])
print(ctime(response.tx_time))
except ntplib.NTPException as e:
print(f"ERROR during NTP request: {e}")
print("Usage: ntp-client.py <hostname>")
sys.exit(-1)

15
tools/network/get_stp.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
interface=${1}
one_stp=$(timeout -k 10 10 tcpdump -vvv -c1 stp -i ${interface} 2>/dev/null)
root_id=$(echo "$one_stp" | grep -Po "(?<=root-id )[^,]*")
bridge_id=$(echo "$one_stp" | grep -Po "(?<=bridge-id )[^,]*" | cut -f1 -d. )
port_id=$(echo "$one_stp" | grep -Po "(?<=bridge-id )[^,]*" | cut -f2 -d. )
echo "connected over $bridge_id at $port_id to $root_id"
echo $one_stp
if [[ $root_id == "80a3.00:1d:71:b9:f0:80" ]]; then
echo "iassc detected"
fi
#bridge-id c0a3.d0:c7:89:94:b4:00.8009
#bridge-id c0a3.d0:c7:89:94:b4:00.8009

147
tools/network/ipgrep Executable file
View File

@@ -0,0 +1,147 @@
#!/bin/bash
# Greps IPs and MACs
# author : Tobias Kessels
# date : 26.01.2015
#grep Perl Regexpattern for MAC and IP
IP_PATTERN="(((25[0-5])|(2[0-4][0-9])|(1?\d?\d))\.){3}((25[0-5])|(2[0-4][0-9])|(1?\d?\d))"
MACID_PATTERN="(([a-fA-F0-9]{2}[:-]){5}[a-fA-F0-9]{2})|([a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4})"
#sort parameters to sort IPs correctly
IP_SORT=" -t. -k1,1n -k2,2n -k3,3n -k4,4n"
#SWITCHES & DEFAULTS
SORT=0
UNIQ=0
MAC=0
PINGABLE=0
RESOLVE=0
FILE=""
PATTERN=${IP_PATTERN}
SORT_PATTERN=${IP_SORT}
#prints usage help and exits
usage () {
echo "ipgrep [-u] [-s] [-m]"
echo ""
echo " ipgrep greps IPs or MACs from any output or file "
echo " -s sort Output"
echo " -u only show uniq IPs/MACs (implies -s)"
echo " -p only show 'pingable' entries (MACs still beta)"
echo " -r show additional information"
echo " -m grep MAC-IDs instead of IPs"
exit 1;
}
#process commandline switches
while getopts :husmrpf: FLAG; do
case $FLAG in
u) UNIQ=1 ;;
s) SORT=1 ;;
m) MAC=1 ;;
p) PINGABLE=1 ;;
r) RESOLVE=1 ;;
f) FILE=$OPTARG ;;
h) usage ;;
\?) echo "whats that: $OPTARG"
usage ;;
esac
done
#clear all Arguments so that 'cat $@' wont get any switches
shift $#
if [[ MAC -eq 1 ]]; then
PATTERN=${MACID_PATTERN}
SORT_PATTERN=""
fi
if [[ PINGABLE -eq 1 ]]; then
SORT=1
UNIQ=1
fi
filtery() {
if [[ $MAC -eq 1 ]]; then
cat "$@" | grep -Po "${MACID_PATTERN}"
else
cat "$@" | grep -Po "${IP_PATTERN}"
fi
}
sorty() {
if [[ $SORT -eq 1 ]] || [[ $UNIQ -eq 1 ]]
then
if [[ MAC -eq 1 ]]; then
SORT_PATTERN=""
else
SORT_PATTERN="${IP_SORT}"
fi
if [[ UNIQ -eq 1 ]]; then
cat "$@" | sort $SORT_PATTERN -u
else
cat "$@" | sort $SORT_PATTERN
fi
else
cat "$@"
fi
}
pingy() {
if [[ PINGABLE -eq 1 ]]; then
if [[ MAC -eq 1 ]]; then
(for i in $(cat "$@")
do
(if (arping -c 1 -w 5000000 $i 2>/dev/null 1>/dev/null)
then
echo $i
fi)&
done) | sorty
else
(for i in $(cat "$@")
do
(if (ping -c1 -w1 $i >/dev/null)
then
echo $i
fi)&
done) | sorty
fi
else
cat "$@"
fi
}
resolve(){
if [[ RESOLVE -eq 1 ]]; then
if [[ MAC -eq 1 ]]; then
(for i in $(cat "$@")
do
(if (arping -q -c 1 -w 5000000 $i 2>/dev/null 1>/dev/null)
then
arping -c1 $i
fi)&
done) | sorty
else
(for i in $(cat "$@")
do
(
name=$(host $i | grep -Po "(?<=pointer ).*")
echo "$i $name"
)&
done) | cat
fi
else
cat "$@"
fi
}
set -e
#execute command
if [ "$FILE" == "" ]; then
cat "$@" | filtery | sorty | pingy | resolve
else
cat $FILE | filtery | sorty | pingy | resolve
fi