This is a Bash plugin designed to simplify the process of ethical pentesting, particularly in the context of TryHackMe (and other) CTFs.
This plugin provides a convenient way to manage your LHOST (local host) and RHOST (remote host) environment variables, making them persistent across your bash shells.
Before using this plugin, please be aware of the following:
- I am NOT liable for any issues that may arise from using this repository.
- You are solely responsible for any consequences of using the code provided in this repository.
This script sets persistent environment variables for LHOST and RHOST, which are essential for ethical pentesting. These variables are stored in your .bashrc file, ensuring they are available in all your bash shells.
To begin using PentestonBash, follow these steps:
- Open a terminal as a regular user (or root user, if that's the user you normally use).
- Clone the repository and run the setup script:
git clone https://github.com/Doc0x1/PentestonBash.git
cd ./PentestonBash
chmod +x ./setup.sh
bash ./setup.sh
PentestonBash provides the following commands:
penteston
- Enables the feature and sets the RHOST and LHOST environment variables in your .bashrc file- --help - Displays helpful information for using the
penteston
command - --lhost - Specifies the local host IP address (usually your tun0 IP address when connected to TryHackMe's VPN)
- --rhost - Specifies the remote host IP address (the target machine for the TryHackMe Room you are doing)
- --help - Displays helpful information for using the
pentestoff
- Disables the feature and removes the RHOST and LHOST environment variables from your .bashrc file
To ensure the script is working properly, you can check the values of the RHOST and LHOST environment variables after running the penteston
command. If the outputs correspond to the values you entered when using the penteston
command, then the setup is successful. You can use the pentestoff
command at any time to turn off the Pentesting Environment.
Remember to use the pentestoff
command when you are done with the pentest. This command unsets the LHOST and RHOST variables and removes them from your .bashrc file.
We hope you find PentestonBash useful in your ethical pentesting endeavors. If you encounter any issues or have suggestions for improvement, please feel free to reach out. Happy pentesting!