hackenv

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: ISC

README ¶

hackenv

Access your Kali Linux and Parrot Security instances with ease.

hackenv lets you comfortably manage your hacking environment from the terminal.

Build status  License 

🚀 Installation

The preferred way is to download the binary from the latest release.

Alternatively, install the required dependencies and build it yourself:

go install github.com/eikendev/hackenv/cmd/...@latest

🤘 Features

  • Support for Kali Linux and Parrot Security.
  • Create short-lived virtual machines within seconds.
  • Download the latest official live image conveniently.
  • Simple and intuitive command line interface.
  • Configure instant SSH access based on public-key authentication.
  • Set up a shared directory between host and guest.
  • Set the same keyboard layout in the guest as on the host.

📄 Usage

First, make sure you have the required dependencies installed. Also, you will need a bridge interface as described below. This can be as simple as running hackenv fix create-bridge (or ./bin/hackenv_createbridge).

Then, download an image using hackenv get. This will download a live image from the official mirrors. The download can take a while, so sit back and enjoy some tea.

âš  If you run SELinux, you must label the new image yourself. Check the section on file sharing for more information.

Next, run hackenv up to boot the virtual machine. Once this command is finished, the VM is running and fully configured. The VM will be short-lived (volatile), meaning any data and configuration stored outside the shared directory will be removed once the machine shuts down. This is by design and admittedly opinionated.

You can now start an SSH session with hackenv ssh or spin up a GUI with hackenv gui.

Note that by default, hackenv will operate with Kali Linux, and respectively download its image. If you want to operate with Parrot Security instead, specify hackenv --type=parrot, or check out the configuration.

File Sharing

hackenv will automatically set up a shared directory between the host and the virtual machine. On the host side the directory is ~/.local/share/hackenv/shared, while on the guest side it is located at /shared.

If SELinux denies access to the shared directory, you have to adjust the context of the directory. You can run hackenv fix apply-labels (or ./bin/hackenv_applylabels) if you are on Fedora or similar. The script will also relabel the downloaded images. If you add new files to the shared directory from outside, do not forget to label them as well.

Creating a Bridge Interface

hackenv uses a bridge so that you can reach the guest from the host for SSH, while the guest can access the Internet. You can create this bridge by running hackenv fix create-bridge (or ./bin/hackenv_createbridge). Note that this script will request privileges so it can create an interface.

Of course, please adapt the script to your specific needs. The interface is expected to have the name virbr0 by default, but this can be changed using command line flags.

⚙ Configuration

The tool currently does not support configuration via files. However, some options can be set using environment variables. Check out the help (--help) of a command to see what options support this.

For instance, to operate with Parrot Security by default, you can set $HACKENV_TYPE=parrot. If you work with both operating systems, then I recommend using shell aliases:

alias kali='hackenv --type=kali'
alias parrot='hackenv --type=parrot'

🥙 Dependencies

To build the binary yourself, you also need the development files of libvirt, usually called libvirt-dev or libvirt-devel.

💡 Alternatives

If you do not like this tool, the following options are worth checking out:

Directories ¶

Path Synopsis
cmd
hackenv
Package main provides the main function as a starting point of this tool.
Package main provides the main function as a starting point of this tool.
internal
banner
Package banner provides functionality related to the banner printed on start.
Package banner provides functionality related to the banner printed on start.
buildconfig
Package buildconfig contains variables that are set during compilation.
Package buildconfig contains variables that are set during compilation.
commands
Package commands contains functions that are exposed as dedicated commands of the tool.
Package commands contains functions that are exposed as dedicated commands of the tool.
constants
Package constants contains global constants.
Package constants contains global constants.
handling
Package handling provides convenience functions for cleaning up resources.
Package handling provides convenience functions for cleaning up resources.
host
Package host provides various utilities related to the host.
Package host provides various utilities related to the host.
images
Package images provides utilities to access image information and manage images.
Package images provides utilities to access image information and manage images.
libvirt
Package libvirt is an overlay to the actual libvirt library.
Package libvirt is an overlay to the actual libvirt library.
options
Package options defines the global options of this tool.
Package options defines the global options of this tool.
paths
Package paths provides convenience functions related to the file system.
Package paths provides convenience functions related to the file system.
scripts
Package scripts contains scripts that can be run from within the tool.
Package scripts contains scripts that can be run from within the tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL