Commit 4da0dd51 authored by Leonardo Galli's avatar Leonardo Galli
Browse files

Add some docs

parent 47f6a692
= CTF VM
This repository contains code to setup and configure Virtual Machines for playing CTFs.
Refer to the link:docs/Installation.asciidoc[Installation Instructions] for how to setup everything that is needed.
Refer to link:docs/Usage.asciidoc[Usage Guide] for how to use the VM.
\ No newline at end of file
= Installation Instructions
== Terminology
In the following, `host` will be used to refer to the machine you want to setup your Virtual Machine (i.e. where you do everything else).
`guest` will be used to refer to the operating system running inside your virtual machine.
== Prerequesites
There are a few prerequesites that need to be installed for the VM to be setup correctly.
You can find instructions on installing them below.
=== VirtualBox
VirtualBox is the default provider used to actually run the virtual machine itself.
The installation should be relatively self explanatory and you can find the latest download here: https://www.virtualbox.org/wiki/Downloads[VirtualBox Downloads]
Just select the download for your OS (e.g. Windows hosts) and run the installer.
=== Vagrant
Vagrant is the software used to configure the Virtual Machines.
The installation is very easy and you just have to download the installer found at https://www.vagrantup.com/downloads.html[Vagrant Download].
However, depending on your operating system, you might need to do some advanced configuration after installation.
==== Using Vagrant with the Windows Subsystem for Linux (WSL)
If you want to use vagrant through the WSL (the bash shell), you will have the follow the instructions provided by vagrant on their site: https://www.vagrantup.com/docs/other/wsl.html#windows-access[Vagrant WSL Instructions]
=== Ansible
Ansible is used to setup the Virtual Machine after it is booted by vagrant.
This includes installing any tools, changing configs, etc.
Installing ansible should be extremely simple, just run the following (on your host!):
[source,bash]
----
pip3 install ansible
----
**Note:** On some operating systems you probably need to run this as root / with sudo (`sudo pip3 install ansible`)
== Cloning the Repository
This part should be relatively straight forward, clone this repository to a place you will quickly find again (mostly with your terminal).
Easiest way to do this, is - inside e.g. your home directory - running either
[source,bash]
----
git clone git@gitlab.ethz.ch:vis/ctf/ctf-vm.git
----
- if you have your ssh key linked - or
[source,bash]
----
git clone https://gitlab.ethz.ch/vis/ctf/ctf-vm.git
----
- if you do not.
== Configuration
After cloning the repository, configuration should be very straightforward.
Open config.rb in your favourite text editor (it's just a ruby file).
All options should have some documentation, but more than likely you only want to change the following two or three:
=== Shared Folders
[source,ruby]
----
:shared_folders => {
# macOS
"/Users/leonardogalli/CTF/shared" => "/home/vagrant/CTF",
# linux
"/home/leonardogalli/CTF/shared" => "/home/vagrant/CTF2"
},
----
Here you can define folders that are shared between your Virtual Machine and the host.
It is advisable to create a folder (that you can easily reach from both your terminal and gui), where you will be keeping all CTF related stuff.
Furthermore, I recommend actually creating a subfolder for files that are shared between host and Virtual Machine.
This helps keeping other stuff you might want to have in your CTF folder from appearing in the Virtual Machine.
Like in the example above, you specify the path on your host on the left and the path on the Virtual Machine on the right.
Feel free to add as many paths as you like!
=== SSH Key
[source,ruby]
----
:ssh_key => "/Users/leonardogalli/.ssh/id_rsa.pub",
----
While vagrant will automagically ssh you into the Virtual Machine, you will have to be in the correct folder (inside this cloned repository) for that to work.
Thus, it is a good idea to add your ssh key to the Virtual Machine. This way, you should be able to ssh - without entering a password.
=== CPU and Memory
[source,ruby]
----
:num_cores => 2,
:num_mem => 2048,
----
Here you can set the amount of CPU cores and MBs of RAM allocated for the Virtual Machine.
Since the purpose of these Virtual Machines is to merely run small binaries, they don't require large amounts of RAM or many CPU cores.
== Booting the VM
After you are done configuring, run
[source,bash]
----
vagrant up 27
----
to boot up your first virtual machine.
Now you are ready to read link:docs/Usage.asciidoc[Usage Guide] for learning more about how to use the Virtual Machine and what to do if something should break.
\ No newline at end of file
......@@ -8,6 +8,7 @@
- python3
- python3-pip
- python3-dev
- python
- unzip
- libc6-dbg
- gdb
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment