Skip to content

Lasse-NP/VirtuNet

Repository files navigation

logo

VirtuNet Instructor

A Virtual Network Builder with GUI and CLI

Table of Contents

About the Project

Important

Keep in mind that you will also need clients to connect to the virtual network through the VirtuNet-Client sister-project.

VirtuNet is a complex virtual network builder that allows you to create virtual training/testing environments specifically for NMAP. This program is made specifically with NMAP in mind, which means that other network scanning tools haven't been tested properly.

The system gives you, the user, full control of: Where the server is set up, what virtual devices exist on the server, when the devices are visible, etc. This allows you to personally control and configure specific scenarios through virtual means. The program makes use of a variety of technologies to make convincing virtual devices, that would be able to hold up under scrutiny, such as:

  • MiniNet (Building Virtual Devices
  • Avahi mDNS (Broadcasting .local names)
  • Scapy (Rewriting packets to match OS Fingerprints)
  • Faker (Randomly generated names for each device) (Configurable)

If you have experience with MiniNet, you would know that each virtual MiniNet device is built into it's own Linux Network Namespace. This makes it tricky to expose them to external connections, such as potential clients. We therefore needed to carve out an area where BOTH MiniNet and Clients would be able to reach. Here we made use of OpenVPN to designate an area in the local network as the virtual network subnet.

Networking4

OpenVPN is especially suited for this situation, due to it's ability to accept an L2-Bridge connection through it's Tap-Interface. We now have a spot for a bridge to plug into our VPN Overlay, so we gather our MiniNet devices into an OVSwitch (L2-Bridge) which then plugs into the OpenVPN server through the Tap. We have now created a direct connection where packets can travel to and from the otherwise isolated virtual MiniNet devices.

Now any external clients connecting to the OpenVPN server on the local network, will now be able to see these MiniNet devices on the VPN, as if they exist on the VPN itself.

Screenshots

image image image image

Getting Started

First off, this is a Linux program, which means that Windows by default isn't supported. Secondly, while we have put in work to support multiple different Linux Distros, only a few have actually been tested as working. Therefore we advise you stick to the tested distros, unless you want to potentially have to manually install dependencies.

Supported Distros

Distro Status
Arch Linux (Manjaro & CachyOS) ✅ Tested and Working RECOMMENDED
Debian (Ubuntu) ✅ Tested and Working
Fedora ⚠️ Untested
OpenSuse ⚠️ Untested

Installation

Getting started with VirtuNet is straightforward. VirtuNet comes packaged with an Install script that will take care of the initial setup. However, you will need to install Python 3.13 before the installation will be able to take place.

If the install script fails to install certain dependencies, you will have to find and install them yourself.

# Fetch and Install Python3.13
# This varies by Distro, figure it out yourself.

# Open a terminal and pull the newest version:
git clone https://github.com/Lasse-NP/VirtuNet

# CD into the folder:
cd VirtuNet

# Run the install.sh script:
sudo chmod +x install.sh && ./install.sh

# Start the program:
sudo virtunet

Usage

VirtuNet allows for a variety of different virtual devices to be added to the network. You will be able to customize the structure of the network within the Session Settings page. VirtuNet even allows more granular customization by using the Custom Setup page, accessed through the Customize button. On this page you are allowed to change individual settings for each device, allowing full control to build devices outside of the standard templates.

image image

After having chosen an assortment of devices, you can now start the server, which in turn starts the virtual network. To allow clients to scan the virtual network, they first have to join the server. This is done by using the Windows Client from the VirtuNet-Client project. This is specifically made to work with this program and therefore allows for a simple join code connection flow. Therefore to connect clients to the server, all you have to do is give them the Join Code displayed, along with the IP and Port of the server.

image

After connecting the clients to the server, they will now be able to scan the devices on the virtual Network. To help manage and control the virtual Network, the program comes with a Control Panel page, that gives the ability to view statistics about each virtual device, along with buttons to toggle on and off the devices.

image image

The Control Panel has a few different buttons. The Trainees button redirects you back to the clients list. The Reset button resets the status of all devices back to online. The Reboot button tears down the virtual network and builds it back up again with the same structure, allowing for a quick network rebuild.

Dependencies

If the install.sh fails to automatically install the program, more manual means are necessary to complete the installation. Therefore we provide the list below of dependencies that VirtuNet requires to work:

  • Python 3.13
  • OpenVPN
  • OVSwitch (Openvswitch-switch + Openvswitch-testcontroller)
  • EasyRSA
  • MiniNet
  • AvahiDNS
  • Libnetfilter-queue
  • xcb-util-cursor
  • libcgroup
    • net-tools
    • iperf
  • build-essentials
    • gcc
    • makepkg

Other Dependencies might exist that have been added since this list was last updated. This list includes most, but maybe not all dependencies.

About

A Virtual Network Builder that quickly creates virtual testing/training network built with NMAP in mind.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors