Breaking News

Tuesday, 15 September 2020

VPS-Docker-For-Pentest - Create A VPS On Google Cloud Platform Or Digital Ocean Easily With The Docker For Pentest

 VPS-Docker-For-Pentest - Create A VPS On Google Cloud Platform Or Digital Ocean Easily With The Docker For Pentest


Create a VPS on Google Cloud Platform or Digital Ocean easily with the docker for pentest included to launch the assessment to the target.

Requirements

  • Terraform installed
  • Ansible installed
  • SSH private and public keys
  • Google Cloud Platform or Digital Ocean account.


Usage

1.- Clone the repository


2.- Credentials


For Google Cloud Platform

  • Create a new project.
  • Create service account with "Compute Admin" role and download a key in json format in credentials folder.
  • Rename the key to pentest.json
  • Enable "Compute Engine API" for the project.


For Digital Ocean

  • Create a Personal access tokens with write permission and copy it. See Tutorial


SSH Private and Public keys

  • Inside credentials folder run ssh-keygen -t rsa -f pentest in the terminal. Empty passphrase is ok.
  • It creates two files: private and public key.


3.- Terraform

Google Cloud Platform

  • Enter to gcp folder and modify the next value:
    • In main.tf file change the project value with your project-id.
  • Run the next commands:
# Initialize terraform provider
$ terraform init
Terraform has been successfully initialized!

# Create the resources
$ terraform apply -auto-approve
Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
Outputs:
external_ip = x.x.x.x
  • Copy the external_ip value

Note: The instance type and the region used are: n1-standard-1 and us-central1. You can change the values on server.tf and main.tf
Demo


Digital Ocean

  • Enter to digital-ocean folder
  • With the personal access token copied run export TF_VAR_do_token="Personal_Access_Token_Here"
  • Run the next commands:
# Initialize terraform provider
$ terraform init
Terraform has been successfully initialized!

# Create the resources
$ terraform apply -auto-approve
Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
Outputs:
external_ip = x.x.x.x
  • Copy the external_ip value

Note: The droplet type and the region used are: s-2vcpu-4gb and nyc3. You can change the values on server.tf and variables.tf
Demo


4.- Ansible

  • Enter to ansible folder
  • In hosts.yaml change the x.x.x.x by external_ip value copied.
  • Run the next command:
$ ansible-playbook playbook.yaml
TASK [Configuration finished] *******************************************************
ok: [x.x.x.x] => {
"msg": "System configured correctly."
}

Demo


5.- Access to VPS

  • In gcp or digital-ocean folder run the next command. Change x.x.x.x by external_ip value copied.
# Access to VPS
$ ssh [email protected] -i ../credentials/pentest

Demo


6.- Destroy the VPS

  • In gcp or digital-ocean folder run the next command.
# Destroy the resource
$ terraform destroy -auto-approve

Note: For Digital Ocean, if you dont have a default VPC created in the region used it shows an error to destroy the VPC but no problem, it will destroy the others resources.



Related Posts:

  • 300+ Powerful Termux Hacking Tools For Hackers Hacking made easy with termux android app, nowadays there are so many Pentesters, Security Researchers And Hackers are using termux android app to perform some pentesting stuff.If you're looking for Best hacking to… Read More
  • How To Install Kali Linux On Android (Step-By-Step Guide) What's up guys, today Techncyber brought the ultimate guide to install Kali Linux on any Android Smartphone,As You Know Kali Linux is the Most popular Linux Distribution Used For Pentesting, and it is widely used by Sec… Read More
  • How To Hack Someones Phone Remotely Everyone wants to be a hacker, while some people have no idea about what Hacking is, still, they want to hack and be a hacker without understanding the Core Principles behind Hacking, all they expect in one click as the… Read More
  • How To Hack WhatsApp Using TermuxHello guys, most of you're requested, so in this post am going to explain how you can use Termux to hack WhatsApp, let's see, can we really hack someone's WhatsApp account using Termux?The fact is using SS7 in Termux is not p… Read More
  • Ultimate Guide To : Ethical Hacking With Termux Hi there , Now You can use Almost all Useful Hacking Tools, Scripts on Your Android MobileThere are several apps and Hacking Tools are available For Android Mobile and therefore We can Install Kali Linux On Our And… Read More

0 comments:

Post a Comment

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();
'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();