From e778ae831bdc181a1980352ed3486df5dde61cde Mon Sep 17 00:00:00 2001 From: Anyon3 Date: Sat, 25 Jun 2016 21:51:43 +0800 Subject: [PATCH] Create generator.sh --- generator.sh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 generator.sh diff --git a/generator.sh b/generator.sh new file mode 100644 index 0000000..129d7e8 --- /dev/null +++ b/generator.sh @@ -0,0 +1,74 @@ +#!/bin/bash +# +# First shot, considering this as an alpha version +# +# Description : Tools menu generator for gtk based desktop, tested on xfce4 and mate-desktop +# +# Author : Dimitri Mader -> dimitri@linux.com +# Gnu / GPL v3 + + + for u in $( ls categories/ | sort ); do + + cntools=`wc -l < categories/$u`; + + if [[ "$u" == 'reversing ' ]] || [[ "$u" == 'disassembler' ]] || [[ "$u" == 'binary' ]] || [[ "$u" == 'code-audit' ]] || [[ "$u" == 'analysis' ]] || + [[ "$u" == 'debugger' ]] || [[ "$u" == 'decompiler' ]]; then + + namecat=`echo X-BlackArch-CodeAnalysis;`; + + elif [[ "$u" == 'cracker' ]] || [[ "$u" == 'crypto' ]]; then + + namecat=`echo X-BlackArch-Cracking;`; + + elif [[ "$u" == 'defensive' ]] || [[ "$u" == 'honeypot' ]]; then + + namecat=`echo X-BlackArch-Defensive;`; + + elif [[ "$u" == 'exploitation' ]] || [[ "$u" == 'automation' ]] || [[ "$u" == 'dos' ]]; then + + namecat=`echo X-BlackArch-Exploitation;`; + + elif [[ "$u" == 'anti-forensic' ]] || [[ "$u" == 'unpacker' ]] || [[ "$u" == 'forensic' ]] || [[ "$u" == 'packer' ]]; then + + namecat=`echo X-BlackArch-Forensic;`; + + elif [[ "$u" == 'malware' ]] || [[ "$u" == 'keylogger' ]] || [[ "$u" == 'backdoor' ]]; then + + namecat=`echo X-BlackArch-Malware;`; + + elif [[ "$u" == 'networking' ]] || [[ "$u" == 'proxy' ]] || [[ "$u" == 'spoofer' ]] || [[ "$u" == 'tunnel' ]] || [[ "$u" == 'spoof' ]]; then + + namecat=`echo X-BlackArch-Networking;`; + + elif [[ "$u" == 'bluetooth' ]] || [[ "$u" == 'nfc' ]] || [[ "$u" == 'wireless' ]]; then + + namecat=`echo X-BlackArch-Wireless;`; + + elif [[ "$u" == 'voip' ]] || [[ "$u" == 'mobile' ]]; then + + namecat=`echo X-BlackArch-Telephony;`; + + elif [[ "$u" == 'scanner' ]] || [[ "$u" == 'fuzzer' ]] || [[ "$u" == 'fingerprint' ]] || [[ "$u" == 'recon' ]]; then + + namecat=`echo X-BlackArch-Scanning;`; + + elif [[ "$u" == 'sniffer' ]]; then + + namecat=`echo X-BlackArch-Sniffing;`; + + else + + namecat=`echo X-BlackArch-Misc;`; + fi + +a=`cat categories/$u | sed 's/|/\n/g' | sed 's/http.*//' | sed '/^$/d' | sort -r | head -n $cntools`; + + for i in $a; do + + cat gendesk | sed -e 's/Name=.*/Name='$i'/' | sed -e 's/TryExec=.*/TryExec=\/usr\/bin\/'$i'/' | + sed 's/Exec=.*/Exec=sh -c '\''\/usr\/bin\/'$i' -Help;$SHELL'\''/' | + sed -e 's/Categories=.*/Categories='$namecat'/' > ba-$i.desktop + done + +done