Files
th-analyzer/lib/colors.sh

124 lines
4.0 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# The Analyzer - Terminal Colors & UI
# Reset
export NC='\033[0m'
# Foreground
export BLACK='\033[0;30m'
export RED='\033[0;31m'
export GREEN='\033[0;32m'
export YELLOW='\033[0;33m'
export BLUE='\033[0;34m'
export MAGENTA='\033[0;35m'
export CYAN='\033[0;36m'
export WHITE='\033[0;37m'
export BOLD='\033[1m'
export DIM='\033[2m'
# Bright
export BRIGHT_RED='\033[0;91m'
export BRIGHT_GREEN='\033[0;92m'
export BRIGHT_YELLOW='\033[0;93m'
export BRIGHT_BLUE='\033[0;94m'
export BRIGHT_MAGENTA='\033[0;95m'
export BRIGHT_CYAN='\033[0;96m'
# Icons
export ICON_TARGET="🎯"
export ICON_SCAN="🔍"
export ICON_FIRE="🔥"
export ICON_FOUND="💥"
export ICON_SAFE="✅"
export ICON_WARN="⚠️"
export ICON_SKIP="⏭️"
export ICON_DONE="✨"
export ICON_BRAIN="🧠"
export ICON_REPORT="📄"
export ICON_ERROR="❌"
export ICON_INFO=""
export ICON_ARROW="➜"
export ICON_SQL="🗄️"
export ICON_XSS="💉"
export ICON_API="🔌"
export ICON_GEAR="⚙️"
# Print helpers
print_banner() {
TERM="${TERM:-xterm}" clear 2>/dev/null; true
echo -e "${BRIGHT_RED}"
echo '┌──────────────────────────────────────────────┐'
echo '│ │'
echo '│ ████████╗██╗ ██╗███████╗ │'
echo '│ ╚══██╔══╝██║ ██║██╔════╝ │'
echo '│ ██║ ███████║█████╗ │'
echo '│ ██║ ██╔══██║██╔══╝ │'
echo '│ ██║ ██║ ██║███████╗ │'
echo '│ ╚═╝ ╚═╝ ╚═╝╚══════╝ │'
echo '│ │'
echo '│ ╔══════════════════════════════════════╗ │'
echo '│ ║ AUTONOMOUS ANALYZER v1.0 ║ │'
echo '│ ╚══════════════════════════════════════╝ │'
echo '│ │'
echo '│ Authorized Bug Bounty Use Only │'
echo '│ Drjonesxxx / Indianaholmes │'
echo '└──────────────────────────────────────────────┘'
echo -e "${NC}"
}
print_step() {
echo -e "\n${CYAN}${ICON_GEAR} [${1}/${2}] ${3}${NC}"
echo -e "${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
}
print_sub() {
echo -e " ${ICON_ARROW} ${DIM}${1}${NC}"
}
print_ok() {
echo -e " ${GREEN}${ICON_SAFE} ${1}${NC}"
}
print_find() {
echo -e " ${BRIGHT_RED}${ICON_FOUND} ${BOLD}${1}${NC}"
if [ -n "${2:-}" ]; then echo -e " ${YELLOW} Details: ${2}${NC}"; fi
}
print_warn() {
echo -e " ${YELLOW}${ICON_WARN} ${1}${NC}"
}
print_skip() {
echo -e " ${DIM}${ICON_SKIP} ${1}${NC}"
}
print_error() {
echo -e " ${BRIGHT_RED}${ICON_ERROR} ${1}${NC}"
if [ -n "${2:-}" ]; then echo -e " ${RED} ${2}${NC}"; fi
}
print_info() {
echo -e " ${BRIGHT_BLUE}${ICON_INFO} ${1}${NC}"
}
print_brain() {
echo -e " ${MAGENTA}${ICON_BRAIN} ${1}${NC}"
}
spinner() {
local pid=$1
local msg=$2
local spin='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
local i=0
while kill -0 $pid 2>/dev/null; do
i=$(( (i+1) % ${#spin} ))
printf "\r ${CYAN}${spin:$i:1}${NC} ${msg} "
sleep 0.1
done
printf "\r ${GREEN}${ICON_DONE}${NC} ${msg} \n"
}
separator() {
echo -e "${DIM}──────────────────────────────────────────────${NC}"
}