Skip to content

Latest commit

 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix VM for Cybersecurity

built with nix

A simple and ready-to-use flake template to create a cybersecurity-oriented virtual machine.

This was inspired by this post and my needs for quick cyber VM during CTF.

Important

For lightweight hacking environments without a VM, check out my Nix Cyber Templates repository.

Usage

First, clone the repository:

git clone https://github.com/leoraclet/nix-cyber-vm

Or use the flake template with:

nix flake init -t github:leoraclet/nix-cyber-vm

To start the VM, use:

nix run .#microvm
# OR
just run
  • USERNAME: test
  • PASSWORD: Same as USERNAME

You can clean the VM using:

just clean

Customization

You can fully customize this VM's configuration by adding modules and updating the configuration.nix file.

You can also set the user(name) and other global options in the options.nix file.

{ 
    # [...]
    config = {
      myConfig = {
        userName = lib.mkDefault "test";                # User
        stateVersion = lib.mkDefault "26.05";           # NixOS version
        sharedDirectory = lib.mkDefault "/home/leonne"; # Host directory to share
        hostUID = lib.mkDefault 1001;                   # Host user ID
      };
    };
  };
}

Warning

I recommend using the root user when working with this VM without a graphical interface. If you're using a graphical interface, you can use any other username you prefer. Some of this behavior is related to how the shared directory is mounted inside the VM.

Desktop

By default, this VM configuration includes the XFCE desktop environment. However, you can opt for an alternative desktop environment or remove the graphical environment entirely to access the VM only via the terminal.

Libraries

Powered by:

Resources

This repo is based on and inspired of :

About

Nix-flake based VM for cybersecurity and CTF, powered by microvm.nix

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages