My files and scripts for setting up my KaliVM how I like it.
- Download the zip archive of the files
- Extract the zip archive
- Execute stage 1 script
stage1.shby using this commandsudo bash ./stage1.sh - Execute stage 2 script
stage2.shby using this commandbash ./stage2.sh - Execute stage 3 script
stage3.shby using this commandbash ./stage3.sh - Execute stage 4 script
stage4.shby using this commandbash ./stage4.sh - Execute stage 5 script
stage5.shby using this commandbash ./stage5.sh - Add the aliases / additions and zsh plugins lines to the existing
.zshrcfile
NOTE See here to install the zsh plugins like syntax-highlighting with ohmyzsh: https://gist.github.com/n1snt/454b879b8f0b7995740ae04c5fb5b7df
ZSHRC Additions
# --------------
# Terminal Settings
# --------------
# Created by `pipx` on 2025-04-13 14:20:37
export PATH="$PATH:/home/nexxsys/.local/bin"
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
source /home/linuxbrew/.linuxbrew/share/powerlevel10k/powerlevel10k.zsh-theme
# --------------
# FZF Settings
# --------------
# Set up fzf key bindings and fuzzy completion
source <(fzf --zsh)
#export FZF_DEFAULT_OPTS="--height 60% --layout=reverse --border --preview 'batcat --color=always {}'"
# FZF default options (minimal, shared across all fzf operations)
export FZF_DEFAULT_OPTS="
--tmux 70%
--style=minimal
--height=80%
--layout=reverse
--info=inline
--border=rounded
--prompt='▶ '
--pointer='→'
--marker='♡'
"
# CTRL+R: Command history search (no preview needed)
export FZF_CTRL_R_OPTS="
--border-label=Command-History
--header='Search command history / CTRL-C or ESC: Quit'
--no-preview
"
# CTRL+T: File search with bat preview
export FZF_CTRL_T_OPTS="
--border-label=File-Search
--header='CTRL-D: Directories / CTRL-F: Files / CTRL-C or ESC: Quit'
--preview 'batcat --color=always --style=grid,numbers {}'
--preview-window 'down,60%,border-bottom,+{2}+3/3,~3'
--bind 'ctrl-d:change-prompt(Directories> )+reload(fd --type d --strip-cwd-prefix)'
--bind 'ctrl-f:change-prompt(Files> )+reload(fd --type f --strip-cwd-prefix)'
"
# ALT+C: Directory search with tree preview
export FZF_ALT_C_OPTS="
--border-label=Directory-Search
--header='Change directory / CTRL-C or ESC: Quit'
--preview 'lsd --tree --depth 2 --color=always {}'
--preview-window 'down,60%,border-bottom'
"
# --------------
# Aliases
# --------------
# Core Aliases
alias da='date "+%Y-%m-%d %A %T %Z"'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -iv'
alias mkdir='mkdir -p'
alias ping='ping -c 10'
alias less='less -R'
alias cls='clear'
alias apt-get='sudo apt-get'
alias psa="ps auxf"
alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
alias ..="cd ../"
alias ...="cd ../../"
alias ....="cd ../../../"
# File and Directory Management
# LS aliases - Requires LSD and Nerd Fonts installed for best experience
alias la='lsd -Alh' # show hidden files
alias ls='lsd -l --color=auto'
alias lr='lsd -lRh' # recursive ls
alias lt='lsd -ltrh' # sort by date
alias ll='lsd -alFh' # long listing format
alias lf="lsd -l | egrep -v '^d'" # files only
alias ldir="lsd -l | egrep '^d'" # directories only
alias l='lsd'
alias lsdtree='lsd --tree -d'
# Aliases for CTF Scripts
alias finish="source /opt/finish.sh"
alias save="source /opt/save.sh"
alias removecomments="source /opt/removecomments.sh"
# Scripting and Utilities
alias sysup="sudo NEEDRESTART_MODE=a apt update && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y"
alias xclip="xclip -selection c"
alias chmox="chmod"
alias pyserver='python3 -m http.server'
alias p="ps aux | grep "
alias topcpu="/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10"
# Count all files (recursively) in the current folder
alias countfiles="bash -c 'for t in files links directories; do echo \$(find . -type \${t:0:1} | wc -l) \$t; done 2> /dev/null'"
# Show current network connections to the server
# alias ipview="netstat -anpl | grep :80 | awk {'print \$5'} | cut -d ':' -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *\$//'"
# Show open ports
alias openports='netstat -nape --inet'
# Vulnerability Scanning with nmap https://scipag.github.io/vulscan/
# alias vulscanup="sudo bash /usr/share/nmap/scripts/vulscan/update.sh"
# alias to show the date
alias secsearch="find /usr/share/seclists -type f | fzf | xclip"
# review a file
alias review="fzf --preview 'bat --color=always {}'"
# scan directories with tree preview
alias dscan="find . -type d | fzf --preview='tree -C {}'"
# Miscellaneous
# The Fuck | https://github.com/nvbn/thefuck
eval $(thefuck --alias)
# You can use whatever you want as an alias, like for Mondays:
eval $(thefuck --alias FUCK)
# VPN Aliases
# alias thmvpn="sudo openvpn ~/thmvpn/Nexxsys.ovpn"
# alias htbvpn="sudo openvpn ~/vpns/lab_Nexxsys.ovpn"
alias htbacad="sudo openvpn ~/vpns/academy-regular.ovpn"
# alias htbstart="sudo openvpn ~/htbvpn/starting_point_Nexxsys.ovpn"
# --------------
# Functions
# --------------
function hex-encode()
{
echo "$@" | xxd -p
}
function hex-decode()
{
echo "$@" | xxd -p -r
}
function rot13()
{
echo "$@" | tr 'A-Za-z' 'N-ZA-Mn-za-m'
}
# --------------
# Powerlevel10k Configuration
# --------------
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh