Skip to content

Similar to my Zsh zpentest plugin, but for the Bash shell.

License

Notifications You must be signed in to change notification settings

Doc0x1/PentestonBash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PentestonBash

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.

Disclaimer

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.

What Does This Plugin Do?

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.

Getting Started

To begin using PentestonBash, follow these steps:

  1. Open a terminal as a regular user (or root user, if that's the user you normally use).
  2. 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

Commands and Usage

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)
  • pentestoff - Disables the feature and removes the RHOST and LHOST environment variables from your .bashrc file

Testing the Setup

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.

Important Note

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.

Final Words

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!

About

Similar to my Zsh zpentest plugin, but for the Bash shell.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages