Get your own Hacking VPS for free in 2022!!
Introduction
Konnichiwa guys, this is my first blog, so plz do tell me if I’m wrong!!!!
So let’s get started.
First of all why do we need a Virtual Private Server(VPS)?
Answer is very simple, persistence and portability.
Look, for pentesting and CTF it’s great to have a virtual or local hacking machine(Kali Linux,Parrot OS,etc.) but when it’s come to bug bounty, we do need some persistence like while we doing some recon or something, and we need to go somewhere immediately and you can’t leave your PC open for a time being. From my experience, if I want to do some small things in my virtual machine, it’s just time consuming to boot and you all know that the linux is slow in virtual machine and if we shutdown forcefully, it gives us the Busybox Initramfs error!
So for the bug bounty and small tasks I will preferred VPS instead of local machine.
Step 1 : Create a digital ocean account
If you don’t have a digital ocean account, create one immediately.
For the signup you will get a 100$ for the 2 months or if you are a student like me you can get the github education pack where you will get lots of cool things.
Step 2: Initialize the Kali Linux droplet in Digital Ocean
We have 3 ways to install kali linux in digital ocean.
1. Build your own ISO file
2. Initialize the Debian droplet and convert into kali linux
3. Upload your own ISO image
So, we will go with this way.
If you still want to try above method, feel free to try this and need some assistance feel free to text me 😁.
- Download the ISO image.
- Click on image in manage section.
- Click on custom tab and then upload image.
- Select the downloaded image and choose the nearest server to upload the file.
It will takes sometime depending on your broadband speed, so don’t forget to take your coffee break.
- yt/networkchuck
5. Click on more and start the droplet.
Note: Here I changed my image name. The image name will be same as filename.
6. Generate ssh keys
ssh-keygen
7. Create a config file for easier access to VPS
Make a file named config in .ssh folder.
Host <name_of_the_VPS>
User root
HostName <ip>
8. SSH into VPS
ssh <name_of_the_VPS>
Step 3: Enable RDP in Linux machine
Update the machine.
apt update && apt upgrade -y && apt dist-upgrade -y && apt full-upgrade -y
If the update is slow try this sources.list for Indian users.
deb https://kali.download/kali kali-rolling main contrib non-free
If the terminal is not responding back and your installation process is stopped, start the new session and kill the apt process and after that install the htop which is more handy.
top
PRESS c
COMMAND=apt
PRESS k
ENTER THE PID OF THE APT
PRESS 9 for sigkill
Then we are going to install all the necessary tools:
apt install kali-root-login desktop-base kali-desktop-xfce xrdp
Enable xrdp service to run at startup
update-rc.d xrdp enable
update-rc.d xrdp defualts
Then reboot the machine.
reboot
Start and Check if the xrdp is started or not
service xrdp start
ss -tulnp
Step 4: Restrict root login and enable xrdp on localhost only
First of all we need to create a uses for restricting the root login.
Creating an User and giving permission:
useradd -s /bin/zsh -rm USERNAME
-s The name of the users login shell
-r create system account
-m create home dirpasswd USERNAME
Then creating a group tsusers and adding the user into sudo and tsusers group
groupadd tsusers
usermod -aG sudo,tsusers USERNAME
-a appending the user to the group
-G new list of supplementary group
Disabling root login by editing /etc/xrdp/sesman.ini
AllowRootLogin=false
Enable xrdp to run only on localhost because we can access RDP session through the ssh.
Editing /etc/xrdp/xrdp.ini
port=tcp://.:3389
Step 5: Starting RDP session
First we have to make a tunnel through the ssh.
ssh example -L 3389:127.0.0.1:3389
Then open the RDP software in windows and add the ip:port and connect.
127.0.0.1:3389
Type the username and password that we are created earlier.
Connect with me through:
Twitter : https://twitter.com/0xkayo
Discord : 0xkayo#4006
Thank you for reading this !