Skip to content

Commit

Permalink
Updated region and added tf wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
onetwopunch committed May 10, 2019
1 parent 0befaaa commit f6e3eec
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/nbdist/
/.nb-gradle/
/build/
.terraform/*
.terraform
terraform.tfstate
terraform.tfstate.backup
terraform.tfstate.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This application and exercises will take you through some of the OWASP top 10 Vu
2. `git clone git://github.com/ScaleSec/vulnado`
3. `cd vulnado`
4. `docker-compose up`
5. Open a browser and navigate to the client to make sure it's working: [http://localhost:1337](docker-compose up)
5. Open a browser and navigate to the client to make sure it's working: [http://localhost:1337](http://localhost:1337)
6. Then back in your terminal verify you have connection to your API server: `nc -vz localhost 8080`

## Architecture
Expand Down
4 changes: 3 additions & 1 deletion reverse_shell/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "aws_route_table" "r" {
resource "aws_subnet" "subnet" {
vpc_id = "${aws_vpc.main.id}"
cidr_block = "${var.subnet_cidr}"
availability_zone = "${var.region}a"
availability_zone = "${var.region}b"
map_public_ip_on_launch = true
tags = {
Name = "tmp_vulnado_rev_shell_subnet"
Expand Down Expand Up @@ -73,10 +73,12 @@ resource "aws_security_group" "sg" {

data "aws_ami" "amznlinux" {
most_recent = true
owners = ["amazon"]

filter {
name = "name"
values = ["amzn2-ami-hvm-2.0.20181114-x86_64-gp2"]

}
}

Expand Down
8 changes: 8 additions & 0 deletions reverse_shell/tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

TF_VAR_public_key=$(cat ~/.ssh/id_rsa.pub) terraform $@
echo
echo ===================
echo === SSH Command ===
echo ===================
echo ssh ec2-user@$(aws --region us-west-1 ec2 describe-instances --filters "Name=tag:Name,Values=VulnadoReverseShellReceiver" | jq -r '.Reservations[0].Instances[0]|.PublicIpAddress')
4 changes: 2 additions & 2 deletions reverse_shell/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "public_key" {
}

variable "region" {
default = "us-west-2"
default = "us-west-1"
}

variable "vpc_cidr" {
Expand All @@ -12,4 +12,4 @@ variable "vpc_cidr" {

variable "subnet_cidr" {
default = "10.42.0.0/24"
}
}

0 comments on commit f6e3eec

Please sign in to comment.