Installing VECTR on GCP Ubuntu VM
VECTR is a well-known name in Purple
teams. It's a tool to ease purple team activities.
While trying to install VECTR in Google
Cloud Instance I faced a challenge that I think many of us have faced and given
up on the tool. The GitHub page being very silent, it was difficult to find the
way forward. After trying several things, finally, I have a way to install
VECTR.
I am trying to write the steps in a
section-wise manner. Feel free to skip into the section you need.
A. Setting up Google
Cloud Environment
Now as an example and ease of POC we
will install VECTR in Google Compute Engine.
- Create
a custom VPC with port 22,8839,443 allowed rule.
2. Provide firewall allow ingress rule
for P443, P3389. Also, allow rule for Port 22 access from "specified
service account".
3. Create a Compute Engine VM Instance
with Ubuntu 16.4 (You are free to take any other), choose E2 Medium with 4GB
ram. Don't forget to add 100 GB (requirement as per HECTR official guide)
balanced persistent disk.
Click on Management, security, disks, networking, sole tenancy,
and allocate the custom VPC with your ce-vm.
Now launch your Compute Engine VM. And take ssh access.
B. Installing
Dependency
We would require docker-ce,
docker-ce-cli, containerd.io, docker-compose, and unzip. These can be installed
via apt but be careful with docker-compose. If you have used apt to install
docker-compose then it would have grabbed a very old version with bugs. We will
come to that separately.
Let's
start installing dependencies one by one.
Run:
curl
-fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Then
run:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
Now apt is ready. Time to update apt.
sudo apt update
Now let's grab docker-ce,
docker-ce-cli, containerd.io and unzip. Run below commands one at a time.
sudo apt-get install docker-ce
sudo apt-get install docker-ce-cli
sudo apt-get install containerd.io
sudo apt-get install unzip
When the above is completed, run apt
update once again.
**Now we will be installing the latest
docker-compose.
Run below:
sudo curl -L
"https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname
-s)-$(uname -m)" -o /usr/local/bin/docker-compose
Allocate permissions to docker-compose
by:
sudo chmod +x
/usr/local/bin/docker-compose
Now verify docker-compose version:
docker-compose --version
Now as the version is satisfactory, we
will enable docker.
sudo systemctl enable docker
C. Installing VECTR
As per the official guide, we will
install VECTR in /opt/vectr directory
Let's create the directory and traverse
to that for further steps
mkdir -p /opt/vectr
cd /opt/vectr
Now let's pull VECTR and unzip it.
sudo wget
https://github.com/SecurityRiskAdvisors/VECTR/releases/download/ce-7.1.1/sra-vectr-runtime-7.1.1-ce.zip
-P /opt/vectr
sudo unzip
sra-vectr-runtime-7.1.1-ce.zip
If you are lazy enough to write sudo every
time then use sudo -s once and you no longer require sudo in all commands.
Now,
sudo vi .env
Change following values immediately,
other values you can change as per requirement.
VECTR_HOSTNAME
= 127.0.0.1
VECTR_DATA_KEY
= enter your decided key. remember the value
MONGO_INITDB_ROOT_PASSWORD
= enter your decided password.
Leave rest settings as of now.
Now run
sudo docker-compose up -d
It will do several things and will show
like this
Congratulations now you have VECTR up
and running.
Wait. How do you access the GUI now?
D. Configure remote
desktop for GUI
Install XRDP and XFCE4
sudo apt-get install xrdp
sudo apt-get install xfce4
sudo service xrdp restart
Now create a root password
sudo -s
passwd
Type
decided password twice
Done!
E. Access the GCP VM
GUI
Mac users install Windows remote
application from App Store. Windows users already have remote desktops.
Now find the external IP of your Google
Compute Engine VM Instance from the VM Instances list of the google cloud
consoles. Enter that IP and take remote. Enter user as root and enter the
password.
Now launch web browser.
Crashed?
No worries.
Open gcp ssh window and run
sudo apt update
sudo apt-get install firefox
Now launch Firefox and go to
https://127.0.0.1:8081
Initial Username: admin Password: 11_ThisIsTheFirstPassword_11
Happy purple teaming!
Comments
Post a Comment