Awesome
Oh My Pentest Report Zsh Theme
ohmy-pentest-report.zsh-theme
is a customizable Oh My Zsh theme specifically designed for pentesters, offering a clean and efficient prompt to streamline daily tasks during audits and penetration testing. The theme includes real-time display of the date, time, IP address, current directory, and the result of the last executed command. The inclusion of date and time is particularly useful for reporting, allowing pentesters to clearly track when tests were executed, making it easier to document results. Additionally, the theme provides flexibility for manual or automatic IP configuration, custom symbols, custom command history logging, and other features tailored to enhance a pentester's workflow.
Features
- Optional Date and Time Display: Enable or disable the display of the current date and time in cyan for easy readability using
enabledate
anddisabledate
commands. - Dynamic IP Address: Optionally show the IP from a specific interface (e.g.,
tun0
), a manually set IP, or the public IP address.- Set IP manually or automatically using the
setip
function. - Toggle showing the IP with
enableip
anddisableip
commands.
- Set IP manually or automatically using the
- Command Execution Status:
- A white
❯
symbol indicates successful command execution. - A red
❯
symbol shows when the previous command failed. - If the user is
root
, the prompt shows#
in red.
- A white
- Current Directory: The prompt shows the current working directory within brackets in red and white.
- Two-Line Prompt Option: Customize the prompt to use a two-line format by editing the theme file, allowing the command input to appear on a new line.
- Custom Command History Logging:
- All executed commands are logged to
~/.pentest_history
in the formatDATE - IP - COMMAND
. - Logging occurs regardless of whether the date and IP are displayed in the prompt.
- Empty commands (e.g., pressing Enter on an empty line) or aborted commands (e.g., pressing
Ctrl+C
) are not logged.
- All executed commands are logged to
- Customizable Interface: Easily switch between displaying an IP from an interface, a manually set IP address, or the public IP.
Oh My Zsh Installation
- 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)"
Installation
- 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
- Reload your terminal:
source ~/.zshrc
Usage
By default, both the IP address and date/time display are disabled. You can enable them as needed using the provided commands.
Enable or Disable Date and Time in the Prompt
- Enable Date and Time Display:
enabledate
The prompt will now display the date and time in cyan.
- Disable Date and Time Display:
disabledate
The date and time will be removed from the prompt.
Enable or Disable IP Address in the Prompt
- Enable IP Display:
enableip
The prompt will now display the IP address.
- Disable IP Display:
disableip
The IP address will be removed from the prompt.
Set a Specific IP
To manually set an IP:
setip 192.168.1.100
Use an Interface to Get the IP
To get the IP address from a specific network interface:
setip eth0
Get the Public IP (Useful for Web Assessments or External Pentests)
You can display the public IP address, which is particularly useful for web assessments or external penetration testing:
setip public
The public IP will be refreshed automatically every 15 minutes.
Enable or Disable All
Enable IP and Date/Time in Prompt:
enableall
Disable IP and Date/Time in Prompt:
disableall
Custom Command History Logging
All executed commands are logged to ~/.pentest_history
in the format DATE - IP - COMMAND
, regardless of whether the date and IP are displayed in the prompt. This feature is particularly useful for reporting and keeping track of activities during a penetration test.
- Logging Details:
- The history file is automatically created in your home directory.
- Empty commands (e.g., pressing Enter on an empty line) or aborted commands (e.g., pressing
Ctrl+C
) are not logged. - The IP logged is based on your current configuration (manual IP, interface IP, or public IP).
- Example Entry:
28/10/23 16:38 - 192.168.1.100 - nmap -sV target.com
Customizing the Prompt to Two Lines
The theme allows you to switch to a two-line prompt format, where the command input appears on a new line below the prompt information.
- Enable Two-Line Prompt:
- Edit the theme file
ohmy-pentest-report.zsh-theme
and set thetwolines
variable totrue
:
- Edit the theme file
# Control to use a two-line prompt (disabled by default)
twolines=true # Set to true to enable two-line prompt
Note: There are no commands provided to toggle this setting. You need to edit the theme file manually to change it.
- Disable Two-Line Prompt:
- Set the
twolines
variable back tofalse
.
- Set the
Additional Customization
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
date
command in theget_datetime
function to change how the date and time are displayed. - Prompt Symbols: Customize
cmd_symbol_success
,cmd_symbol_fail
, andcmd_symbol_root
for different symbols or colors. - Colors: Change color codes within the prompt components to suit your preferences.
Screenshots
Here's an example of how the prompt looks:
Contributions
Contributions, issues, and feature requests are welcome! Feel free to check out the issues page if you want to contribute.