repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
aliases.zshShell231 lines11.9 KiBraw download
#!/usr/bin/env zsh
# ── aliases.zsh : eza listings, navigation, maintenance, pentest tool aliases ──
# Ported from ~/.zshrc (hash-toolkit aliases live with their fns in functions.zsh).

# ── eza listing family + navigation + system maintenance + date/time ──
# eza aliases with fallback
if command -v eza >/dev/null 2>&1; then
  # Basic listings
  alias ls='eza --icons --color=always --group-directories-first'
  alias ll='eza --long --header --icons --color=always --group-directories-first'
  alias la='eza --long --all --header --icons --color=always --group-directories-first'
  alias l='eza --oneline --icons'
  
  # Tree views
  alias lt='eza --tree --level=2 --icons'
  alias lt3='eza --tree --level=3 --icons'
  alias lt4='eza --tree --level=4 --icons'
  alias lta='eza --tree --level=2 --all --icons'
  alias ltf='eza --tree --icons'  # full tree (all levels)
  alias ltg='eza --tree --level=2 --icons --git'  # tree with git status
  alias tree='eza --tree --level=2 --icons'       # muscle-memory `tree` (no system tree installed)
  alias treea='eza --tree --level=2 --all --icons'
  
  # Grid & compact layouts
  alias lx='eza --icons --grid --group-directories-first'
  alias lxa='eza --all --icons --grid --group-directories-first'
  alias l1='eza --oneline --icons'
  alias l1a='eza --oneline --all --icons'
  alias lc1='eza --oneline --classify --icons'
  alias lcc='eza --across --icons'  # compact columns
  
  # Git integration
  alias lg='eza --long --header --icons --git --group-directories-first'
  alias lga='eza --long --all --header --icons --git --group-directories-first'
  alias lgi='eza --long --header --icons --git-ignore --group-directories-first'
  
  # Sorting options
  alias lm='eza --long --header --icons --sort=modified --group-directories-first'  # newest first
  alias lma='eza --long --all --header --icons --sort=modified --group-directories-first'
  alias lmo='eza --long --header --icons --sort=modified --reverse --group-directories-first'  # oldest first
  alias lz='eza --long --header --icons --sort=size --group-directories-first'  # largest first
  alias lza='eza --long --all --header --icons --sort=size --group-directories-first'
  alias lzr='eza --long --header --icons --sort=size --reverse --group-directories-first'  # smallest first
  alias le='eza --long --header --icons --sort=extension --group-directories-first'
  alias lea='eza --long --all --header --icons --sort=extension --group-directories-first'
  alias lk='eza --long --header --icons --sort=type --group-directories-first'  # by kind/type
  
  # Time & date info
  alias lc='eza --long --header --icons --created --group-directories-first'
  alias lac='eza --long --all --header --icons --created --group-directories-first'
  alias lmu='eza --long --header --icons --modified --accessed --group-directories-first'
  alias lmua='eza --long --all --header --icons --modified --accessed --group-directories-first'
  alias ltr='eza --long --header --icons --time-style=relative --group-directories-first'
  alias ltd='eza --long --header --icons --time-style=long-iso --group-directories-first'
  
  # Filtering & special views
  alias ld='eza --only-dirs --icons'
  alias lda='eza --only-dirs --all --icons'
  alias lf='eza --only-files --icons'
  alias lfa='eza --only-files --all --icons'
  alias ldot='eza -a --icons | grep "^\."'  # dotfiles only
  alias ll.='eza --long --header --icons -d .*'  # dotfiles detailed
  alias lbig='eza --long --header --icons --sort=size --reverse --group-directories-first | tail -20'  # 20 largest
  
  # Recursive & detailed
  alias lr='eza --long --recurse --level=2 --icons'
  alias lra='eza --long --all --recurse --level=2 --icons'
  alias lrr='eza --long --recurse --icons'  # fully recursive
  alias lp='eza --long --header --icons --octal-permissions --group-directories-first'  # full permissions
  alias lpa='eza --long --all --header --icons --octal-permissions --group-directories-first'
  alias lh='eza --long --header --icons --binary --group-directories-first'  # human readable sizes
  alias lha='eza --long --all --header --icons --binary --group-directories-first'
  alias lb='eza --long --header --icons --blocks --group-directories-first'  # show blocks
  alias lin='eza --long --header --icons --inode --group-directories-first'  # show inodes
  alias llink='eza --long --header --icons --group-directories-first -l'  # show symlink targets
  
  # Combined power aliases
  alias lsd='eza --long --header --icons --only-dirs --sort=size'  # detailed directories
  alias lall='eza --long --all --header --icons --git --extended --group-directories-first'  # everything
  alias ldisk='eza --long --all --header --icons --sort=size --reverse --total-size'  # disk usage view
  alias lrecent='eza --long --header --icons --sort=modified --reverse | head -20'  # most recent
  
  # Cheatsheet access — glow-rendered card (docs/EZA.md → ~/.config/cheats/eza.md)
  alias eza-help='cheat eza'
  alias lhelp='cheat eza'
  alias fzf-setup='cat ~/.fzf-setup-guide 2>/dev/null || echo "no ~/.fzf-setup-guide on this machine"'
else
  alias ls='ls -G'
  alias ll='ls -lhG'
  alias la='ls -lahG'
  echo "⚠️  Eza not found. Install with: brew install eza"
fi

# Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# Jump straight to the standard user dirs from anywhere
alias dl='cd ~/Downloads'
alias docs='cd ~/Documents'
alias vids='cd ~/Videos'
alias mus='cd ~/Music'
alias home='cd ~'

# Networking
# myip is defined as a full function in ~/.pentest.zsh (sets $LHOST, shows VPN/LAN IPs)
alias localip='ip route get 1.1.1.1 2>/dev/null | awk "{print \$7; exit}"'   # was: ipconfig getifaddr en0 (macOS)
alias ports='ss -tlnp'                       # was: lsof (not installed on Arch by default)
alias openports='ss -tuln'                   # was: netstat (deprecated net-tools on Arch)

# System maintenance
alias flushdns='sudo resolvectl flush-caches && echo "DNS flushed"'   # was: dscacheutil/mDNSResponder (macOS)
alias clearlogs='echo "Clearing user logs..." && journalctl --user --vacuum-time=1d >/dev/null 2>&1; rm -rf "${XDG_STATE_HOME:-$HOME/.local/state}"/*.log(N) 2>/dev/null; echo "✓ User logs cleared"'   # was: ~/Library/Logs (macOS)
alias checklogs='du -sh ~/Library/Logs/* 2>/dev/null | sort -hr'
alias emptytrash='rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}"/Trash/{files,info}/*(N) 2>/dev/null; echo "✓ Trash emptied"'   # was: ~/.Trash (macOS)
alias clearolddownloads='find ~/Downloads -type f -mtime +30 -delete 2>/dev/null && echo "✓ Old downloads cleared (30+ days)"'
alias bigdownloads='du -sh ~/Downloads/* 2>/dev/null | sort -hr | head -20'

# Cleanup combos
alias previewclean='echo "Cache files:" && find ~/Library/Caches -type f 2>/dev/null | wc -l && echo "Log files:" && find ~/Library/Logs -type f 2>/dev/null | wc -l && echo "Trash items:" && ls -A ~/.Trash 2>/dev/null | wc -l'
alias clearcache='echo "Clearing user cache..." && find "${XDG_CACHE_HOME:-$HOME/.cache}" -type f -delete 2>/dev/null; echo "✓ User cache cleared"'   # was: ~/Library/Caches (macOS)
alias clearappcache='echo "Clearing app caches..." && rm -rf ~/Library/Caches/com.apple.* 2>/dev/null && echo "✓ App caches cleared"'
alias quickclean='echo "🧹 Starting quick cleanup..." && clearcache && clearlogs && emptytrash && flushdns && echo "✅ Quick cleanup complete!"'
alias deepclean='echo "🧹 Starting deep cleanup..." && clearcache && clearbrowsers && clearlogs && clearolddownloads && emptytrash && flushdns && echo "✅ Deep cleanup complete!"'
alias saferestart='echo "Restarting to clear temp files..." && sudo shutdown -r now'

# Aliases ported from fish end

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='nvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch $(uname -m)"

# Set personal aliases, overriding those provided by Oh My Zsh libs,
# plugins, and themes. Aliases can be placed here, though Oh My Zsh
# users are encouraged to define aliases within a top-level file in
# the $ZSH_CUSTOM folder, with .zsh extension. Examples:
# - $ZSH_CUSTOM/aliases.zsh
# - $ZSH_CUSTOM/macos.zsh
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# Date/Time Aliases
alias now='date +"%Y-%m-%d %H:%M:%S"'      # Full date and time: 2025-11-05 15:42:57
alias today='date +"%Y-%m-%d"'             # Short date: 2025-11-05
alias time='date +"%H:%M:%S"'              # Just time: 15:42:57
alias datestamp='date +"%Y%m%d-%H%M%S"'    # Filename-safe: 20251105-154257
alias commithost='hostname'                 # Host used by the commit wrappers
if date --iso-8601=seconds >/dev/null 2>&1; then
  alias commitdate='date --iso-8601=seconds' # ISO 8601 with timezone (GNU date)
else
  alias commitdate='date +"%Y-%m-%dT%H:%M:%S%z"' # BSD/macOS date fallback
fi

# Commit wrappers (metadata is appended as Commit-Date/Commit-Host trailers).
alias gcm='git-commit'
alias gcma='git-commit --add'
alias gcmp='git-commit --push'


# ── other top-level aliases (pentest tools, integrations, misc) ──
# vsync: /Volumes is the macOS mount root. On Linux removable media mounts
# under /run/media/$USER — point this at the real mount when you plug it in.
# alias vsync='rsync -av /run/media/$USER/extremePro/DocumentsAndPersonal/ObsidianVaults/NetrunnerVault/ ~/Documents/NetrunnerVault/'
alias sf='source $SPIDERFOOT_HOME/spiderfoot-venv/bin/activate && python3 $SPIDERFOOT_HOME/sf.py -l 127.0.0.1:5001'
alias sf-open='xdg-open http://127.0.0.1:5001'   # was: open (macOS)
alias sf-kill='pkill -f "sf.py"'
alias sf-update='cd $SPIDERFOOT_HOME && git pull && source spiderfoot-venv/bin/activate && pip install -r requirements.txt --upgrade'
# evil-winrm: resolve via $PATH. The old absolute Homebrew gem pin shadowed
# any correctly-installed copy even after it was on $PATH.
# kerbrute: resolve via $PATH (Arch/AUR puts it in /usr/bin, go install in ~/go/bin).
alias ghidra="ghidraRun"
# wpscan: resolve via $PATH.
alias nxc="netexec"
alias cme="netexec"  # For muscle memory
alias nse-vuln="nmap -sV --script vuln"
alias nse-full="nmap -sV --script 'default or safe'"
alias quick-scan="nmap -sV -sC -O"
alias full-scan="nmap -sV -sC -O -p-"
alias dirb-common="gobuster dir -w $HOME/htb/wordlists/SecLists/Discovery/Web-Content/common.txt -t 50"
alias dirb-big="gobuster dir -w $HOME/htb/wordlists/SecLists/Discovery/Web-Content/big.txt -t 50"
alias ffuf-dir="ffuf -w $HOME/htb/wordlists/SecLists/Discovery/Web-Content/common.txt -u"
alias ferox-quick="feroxbuster -w $HOME/htb/wordlists/SecLists/Discovery/Web-Content/common.txt"
alias sub-enum="subfinder -d"
alias sub-amass="amass enum -d"
alias hash-crack="hashcat -m"
alias hash-id="hashid"
alias john-show="john --show"
alias sqli-simple="sqlmap -u"
alias sqli-crawl="sqlmap --crawl=2 --batch"
alias sqli-dbs="sqlmap --dbs --batch"
alias msf="msfconsole"
alias msfdb-init="msfdb init"
alias msfdb-start="msfdb start"
# bh-start: macOS .app bundle, no drop-in Linux equivalent (BloodHound CE
# runs via docker compose / AUR). Left unset rather than silently broken.
alias neo4j-start="neo4j start"
alias neo4j-stop="neo4j stop"
alias harvest="theharvester -d"
alias sherlock-search="sherlock"
alias amass-passive="amass enum -passive -d"
alias r2="radare2"
alias r2-analyze="radare2 -A"
alias b64-encode="base64"
alias b64-decode="base64 -d"
alias url-encode="python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.argv[1]))'"
alias url-decode="python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.argv[1]))'"
alias http-server="python3 -m http.server"
alias http-8000="python3 -m http.server 8000"
alias http-8080="python3 -m http.server 8080"
alias nc-listen="nc -lvnp"
alias rlwrap-nc="rlwrap nc -lvnp"
# ulockdisk: macOS .app on a /Volumes mount; nothing equivalent on Linux.
# cdic: iCloud Drive is macOS-only; no Linux path exists.
alias exitt="tmux kill-server"