Setting up VPS for Bug-bounty Automation.
Hey Guys!! How are you? I hope everyone is safe in Current Covid-19 Pandemic Situation. I am back with another Blog. Hope you will learn something new today.
In this Blog, I will talk about how you can get your own VPS and set it up to automate most recon over a VPS. When I first setup my VPS i faced many problems and errors in setting everything up. So, I decided to write this blog to help others.
Getting a VPS:
A VPS, or virtual private server, is a form of multi-tenant cloud hosting in which virtualized server resources are made available to an end user over the internet via a cloud or hosting provider.
You can get a VPS through many platforms like AWS, Google Cloud Platform, Digital Ocean etc. We will be using Digital Ocean for demonstration. Also, Digital Ocean offers $100 credit free for you as first time users, get yours here. Or click the below image.
Signup process is very easy. So, I wont explain it here. After signup we get a Dashboard, Click on Create on top right corner and then on Droplets as show below:
Now here we need to configure our VPS.
- Choose an Image: I will be creating Debian VPS, that’s the only I have tried before, you can check out one of Ubuntu, Fedora and others.
- Choose a plan, I will be leaving it to Basic and I will choose $10 plan which as 2GB / 1 CPU, 50 GB SSD disk, 1000 GB. You can decide to pick any plan, based on what you want, and based on the credit you have in your Digital ocean account.
- Add block storage: Just leave this to default.
- Choose a data center region: You can choose any data center near to your location or closer to your region. In my case, I choose Bangalore.
- VPC Network: You can leave this to default, but if your task requires you to enable Private Network Settings, you can always to this anytime, even when you’re done with the setup.
- Select additional options: You can decide what to do here, for me I prefer to enable IPv6 Option only, so I will have access to IPv4 and 6.
- Authentication: for authentication, I will be using a password, I find that easy, so you can enter any password you like into the Create root password box. Make sure its a password you can remember because that’s what you will be using to log in.
- How many droplets and Hostname: Here you can choose how many vps server you want to deploy.
- Finalize and create: Here the only thing I changed here was the Choose a host name, you always change it to anytime you like, its like customization of the terminal.
10. Now, It will take some time to Create VPS. Once its created the Name and IP address of VPS will be displayed on screen as shown in the image below:
Connecting to VPS using SSH:
- Open your Terminal or Command Prompt/Power-shell.
- Use this simple ssh command to connect to the VPS server : ssh root@your_droplet_ip_address e.g mine is ssh firstname.lastname@example.org.
- When you click enter, for the first time, you will be prompted to press yes to proceed for connection.
- The password requested is the password you typed when creating your droplets, if the password is correct then should see a welcome message and your terminal should look like image below:
Now, Once you are logged in you can use the VPS as root user or you can create user for your VPS. If you want to create new users you can refer here.
Installing Tools for Bug-bounty Recon:
Before installing any tools, Make sure to run upgrade Command and install some prerequisites like python, git and golang.
#update and upgrade repository:
sudo apt-get update
sudo apt-get upgrade#installing python3:
sudo apt-get install python3#installing git:
sudo apt-get install git#installing golang:
sudo apt-get install -y golang#Open the bashrc file to set gopath:
sudo nano ~/.bashrc#Paste the following lines at the end of bashrc file:
Now we can install various tools manually. But I prefer a script that automatically installs all the required tools for bugbounty like ffuf, nmap, dirsearch, subfinder etc.
- Nahamsec’s BBHT: There is a simple bash script created by Nahamsec. You can simply clone the repository and run the bash script to install all the required tools for bugbounty.
Installing Nahamsec’s BBHT:
git clone https://github.com/nahamsec/bbht.git
chmod +x install.sh
2. Project Bheem: It is a great project which was created by Harsh Bothra. Apart of installing the required tools , It has a automated scripts to fully automate recon for small, medium and large scope targets.
Installing Project Bheem:
git clone https://github.com/harsh-bothra/Bheem.git
chmod +x install.sh
Transfer Files to and from VPS using SCP:
Secure Copy (SCP) is a protocol based on SSH (Secure Shell) that provides secure file transfers between two computers. With SCP, you can quickly transfer files using the command line, which is often faster and easier than using a client with a graphical interface.
To Upload file to Server:
scp /path/to/local-file username@IP_ADDRESS:/remote/path/to/upload/
Suppose I want to upload a local file domain.txt to vps, The command will be:
scp /home/user/domains.txt email@example.com:/root/
To Download file from Server:
scp username@IP_ADDRESS:/path/to/remotefile /local/path/to/download
Suppose I want to download a domain.txt from vps to local machine, The command will be:
scp firstname.lastname@example.org:/root/domains.txt /home/user/
You can use the recursive option -r with SCP to copy the entire directory from one system to another.