# aliases.zsh — pe shortcuts + quality-of-life aliases.
[ -n "${ZSH_VERSION:-}" ] || return 0
# --- pe nouns (matches the dispatcher) --------------------------------------
alias t='pe target'
alias f='pe flag'
alias c='pe cred'
alias h='pe host' # note: shadows any 'h'=history alias; see `pe cheat env`
alias n='pe note'
# --- common verb combos -----------------------------------------------------
alias tl='pe target ls'
alias tu='pe target use'
alias ts='pe status'
alias fl='pe flag ls'
alias cl='pe cred ls'
alias hl='pe host ls'
alias nl='pe note ls'
alias peb='pe backup'
alias box='htb-session'
alias htbvpn='pe vpn'
alias pedoctor='pe doctor'
# --- cheatsheets ------------------------------------------------------------
alias cheat='pe cheat'
alias cheatenv='pe cheat env'
# --- listing (prefer modern tools when present) -----------------------------
if command -v eza >/dev/null 2>&1; then
alias ls='eza --group-directories-first'
alias ll='eza -lh --group-directories-first --git'
alias la='eza -lah --group-directories-first --git'
alias lt='eza --tree --level=2'
else
alias ll='ls -lh'
alias la='ls -lah'
fi
# bat vs batcat (Debian renames the binary). Keep `cat` predictable for pipes.
command -v batcat >/dev/null 2>&1 && alias bat='batcat'
# fd vs fdfind
command -v fdfind >/dev/null 2>&1 && alias fd='fdfind'
# --- pentest quick helpers --------------------------------------------------
alias myip='ip -4 -br addr show 2>/dev/null | grep -v "127.0.0.1" || ifconfig'
alias tun='ip -4 -br addr show tun0 2>/dev/null | awk "{print \$3}" | cut -d/ -f1' # HTB VPN IP
alias ports='ss -tulpn 2>/dev/null || netstat -tulpn'
alias serve='python3 -m http.server' # quick file server
alias webserver='python3 -m http.server 80'
alias listening='ss -tlnp 2>/dev/null'
alias grep='grep --color=auto'
alias wordlists='cd -- "$PE_WORDLIST_ROOT"'