ohmy-pentest-report.zsh-theme is a customizable Oh My Zsh theme for pentesters. It provides a clean, efficient prompt with real-time date, time, IP address, current directory, and command status ideal for audits and penetration testing. Features include manual/automatic IP configuration, custom symbols, command history logging, and more to enhance your workflow.
- Features
- Installation
- Usage
- Custom Command History Logging
- Default Two-Line Prompt
- Additional Customization
- Contributions
- Optional Date and Time Display: Enable or disable the current date and time in cyan using
enabledateanddisabledate. - Dynamic IP Address: Show the IP from a specific interface (e.g.,
tun0), a manually set IP, or the public IP address.- Set the IP manually or automatically with the
setipcommand. - Toggle IP display with
enableipanddisableip.
- Set the IP manually or automatically with the
- Command Execution Status:
- A white
❯symbol indicates success. - A red
❯symbol indicates failure. - For
root, the prompt shows#in yellow (also turns red on failure).
- A white
- Current Directory: Shows the working directory in brackets (red and white).
- Two-Line Prompt Option: Use a two-line prompt for better readability (enabled by default).
- Custom Command History Logging:
- Executed commands are logged to
~/.pentest_historyasDATE - IP - COMMAND. - Logging works regardless of prompt display settings.
- Only successful commands are logged; empty or aborted commands are ignored.
- Executed commands are logged to
- Flexible IP Source: Easily switch between interface IP, manual IP, or public IP.
- Git Branch & Status Display: Shows the current Git branch in parentheses when inside a repository.
- First, make sure you have ZSH installed:
sudo apt install zsh -y- You can set ZSH as the default shell with the following command:
chsh -s $(which zsh)- Once you have ZSH installed and set as the default shell, you can download Oh My Zsh with the following command:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"- Clone the repository into your custom themes directory:
git clone https://github.com/sikumy/ohmy-pentest-report/ $ZSH_CUSTOM/themes/ohmy-pentest-report
mv $ZSH_CUSTOM/themes/ohmy-pentest-report/ohmy-pentest-report.zsh-theme ~/.oh-my-zsh/themes/ohmy-pentest-report.zsh-theme- Set the theme in your
.zshrc:
sed -i 's/ZSH_THEME=".*"/ZSH_THEME="ohmy-pentest-report"/' ~/.zshrc- Add the following line to your
.zshrcbefore"source $ZSH/oh-my-zsh.sh"to fix/enable Git branch display in the prompt (why?).
zstyle ':omz:alpha:lib:git' async-prompt force- Reload your terminal:
exec $SHELLBy default, both the IP address and date/time display are disabled. You can enable them as needed using the provided commands.
- Enable Date and Time Display:
enabledate- Disable Date and Time Display:
disabledate- Enable IP Display:
enableip- Disable IP Display:
disableip- To manually set an IP:
setip 192.168.1.100- Use an Interface to get the IP
setip eth0- Get the Public IP (Useful for Web Assessments or External Pentests)
setip public # The public IP will be refreshed automatically every 1 minute.Enable IP and Date/Time in Prompt:
enableallDisable IP and Date/Time in Prompt:
disableallExecuted commands are logged to ~/.pentest_history in the format DATE - IP - COMMAND. This is useful for reporting and tracking activities during a penetration test.
- The history file is created automatically in your home directory.
- Empty or aborted commands (e.g., pressing
Ctrl+C) are ignored. - The IP logged matches your current configuration (manual, interface, or public).
- Example:
28/10/23 16:38 - 192.168.1.100 - nmap -sV target.com
By default, the prompt uses a two-line layout for better readability.
To switch to a single-line prompt, edit ohmy-pentest-report.zsh-theme and set:
two_lines=false # Control to use a two-line prompt (enabled by default)
You can further customize the prompt by editing the theme file and modifying variables such as the date format, symbol styles, and colors.
- Date Format: Modify the
datecommand in theget_datetimefunction to change how the date and time are displayed. - Prompt Symbols: Customize
cmd_symbol_success,cmd_symbol_fail, andcmd_symbol_rootfor different symbols or colors. - Colors: Change color codes within the prompt components to suit your preferences.
- Spacing: Some prompt variables include a trailing space to ensure proper spacing regardless of which elements are enabled.
- Prompt Layout: The prompt is built in the
construct_promptfunction. You can edit this function to change the order or add/remove elements as needed.
Contributions, issues, and feature requests are welcome! Feel free to check out the issues page if you want to contribute.
