<?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 Silas Aosige on Medium]]></title>
        <description><![CDATA[Stories by Silas Aosige on Medium]]></description>
        <link>https://medium.com/@aosige47?source=rss-52ec85224c2e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Q-iSRbj3OWLeT0gs</url>
            <title>Stories by Silas Aosige on Medium</title>
            <link>https://medium.com/@aosige47?source=rss-52ec85224c2e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:07:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aosige47/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[Building an AI-Powered Image Analyzer using AWS Lambda and Rekognition]]></title>
            <link>https://medium.com/@aosige47/building-an-ai-powered-image-analyzer-using-aws-lambda-and-rekognition-9904f62a217c?source=rss-52ec85224c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9904f62a217c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Silas Aosige]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 16:38:59 GMT</pubDate>
            <atom:updated>2025-11-23T16:38:59.326Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In the world of cloud computing, “Serverless” is more than just a buzzword; it’s a way to build scalable applications without managing infrastructure. Recently, I decided to dive deeper into the AWS ecosystem by building a project that combines storage, compute, database, and Artificial Intelligence services.</p><p>In this article, I will walk you through how I built a <strong>Serverless Image Sentiment Analyzer</strong>. The goal of this project was to upload an image to an S3 bucket, trigger a Lambda function to analyze the image using Amazon Rekognition, and store the sentiment results (emotions like Happy, Sad, Confused) in a DynamoDB table.</p><h3>The Architecture</h3><p>Before we look at the code, here is the high-level flow of the application:</p><ol><li><strong>S3 Bucket:</strong> Acts as the trigger. When an image is uploaded here, the process begins.</li><li><strong>AWS Lambda:</strong> The compute layer. It runs a Python script using the Boto3 library.</li><li><strong>Amazon Rekognition:</strong> The AI service that actually “looks” at the image to detect faces and emotions.</li><li><strong>DynamoDB:</strong> The NoSQL database where we store the analysis results.</li><li><strong>AWS IAM:</strong> Manages the permissions so these services can talk to each other securely.</li></ol><h3>Setting Up the Environment</h3><p>The first step involved setting up the necessary AWS resources. I needed a place to store the images and a table to hold the data.</p><ul><li><strong>S3 Bucket:</strong> Created to hold the raw images.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nwjoOQjRUDvoX03XNUTYRg.png" /></figure><pre>aws s3 mb s3://serverlessimageanalyzer</pre><ul><li><strong>DynamoDB Table:</strong> Created with a primary key (ImageName) to index our results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*7FFdg8858SbtNkcElp0Qyg.png" /></figure><pre>aws dynamodb create-table <br>    --table-name ImageMetadata <br>    --attribute-definitions AttributeName=image_id,AttributeType=S <br>    --key-schema AttributeName=image_id,KeyType=HASH <br>    --billing-mode PAY_PER_REQUEST</pre><h3>Configuring Security with IAM</h3><p>Created a file named trust-policy.json to allow Lambda to assume this role as a best practice when services interact with each other.</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;Service&quot;: &quot;lambda.amazonaws.com&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}</pre><p>Afterwards this file was attached to the role ServerlessAI_Role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*PxL-7zflL2b_37ZAeTBAcg.png" /></figure><pre>aws iam create-role <br>    --role-name ServerlessAI_Role <br>    --assume-role-policy-document file://trust-policy.json</pre><p>Then the necessary permissions were given to the role created to allow lambda the least privilege needed to interact with the various services required for the analyzer to work</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*7Xr1Ncri5MOJn91hsGMRIg.png" /></figure><pre>aws iam attach-role-policy --role-name ServerlessAI_Role --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess<br>aws iam attach-role-policy --role-name ServerlessAI_Role --policy-arn arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess<br>aws iam attach-role-policy --role-name ServerlessAI_Role --policy-arn arn:aws:iam::aws:policy/AmazonRekognitionReadOnlyAccess<br>aws iam attach-role-policy --role-name ServerlessAI_Role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole</pre><h3>The Logic (AWS Lambda &amp; Python)</h3><p>This is the core of the project. I used AWS Lambda to run the logic without provisioning a server.</p><p>The Python script uses the boto3 library to interact with Rekognition. Below is the logic used to detect faces:</p><pre>import json<br>import boto3<br>import urllib.parse<br>from decimal import Decimal<br><br># Initialize clients<br>s3 = boto3.client(&#39;s3&#39;)<br>rekognition = boto3.client(&#39;rekognition&#39;)<br>dynamodb = boto3.resource(&#39;dynamodb&#39;)<br>table = dynamodb.Table(&#39;ImageMetadata&#39;)<br><br>def lambda_handler(event, context):<br>    try:<br>        # 1. Get the Bucket Name and File Name from the S3 Event<br>        bucket_name = event[&#39;Records&#39;][0][&#39;s3&#39;][&#39;bucket&#39;][&#39;name&#39;]<br>        key = urllib.parse.unquote_plus(event[&#39;Records&#39;][0][&#39;s3&#39;][&#39;object&#39;][&#39;key&#39;])<br>        <br>        print(f&quot;Processing image: {key} from bucket: {bucket_name}&quot;)<br><br>        # 2. Call Rekognition to Detect Labels (What is in the image?)<br>        label_response = rekognition.detect_labels(<br>            Image={&#39;S3Object&#39;: {&#39;Bucket&#39;: bucket_name, &#39;Name&#39;: key}},<br>            MaxLabels=5,<br>            MinConfidence=75<br>        )<br>        <br>        # Extract top 5 labels<br>        detected_labels = [label[&#39;Name&#39;] for label in label_response[&#39;Labels&#39;]]<br>        <br>        # 3. Call Rekognition to Detect Faces (For Sentiment/Emotion)<br>        face_response = rekognition.detect_faces(<br>            Image={&#39;S3Object&#39;: {&#39;Bucket&#39;: bucket_name, &#39;Name&#39;: key}},<br>            Attributes=[&#39;ALL&#39;]<br>        )<br>        <br>        # Extract emotions if a face is detected<br>        emotions = []<br>        if face_response[&#39;FaceDetails&#39;]:<br>            # Get the primary emotion of the first face detected<br>            for emotion in face_response[&#39;FaceDetails&#39;][0][&#39;Emotions&#39;]:<br>                if emotion[&#39;Confidence&#39;] &gt; 50:<br>                    emotions.append(emotion[&#39;Type&#39;])<br>        <br>        # 4. Prepare data for DynamoDB<br>        item = {<br>            &#39;image_id&#39;: key,<br>            &#39;bucket&#39;: bucket_name,<br>            &#39;labels&#39;: detected_labels,<br>            &#39;emotions&#39;: emotions,<br>            &#39;face_count&#39;: len(face_response[&#39;FaceDetails&#39;]),<br>            &#39;timestamp&#39;: str(context.aws_request_id) # Using Request ID as a simplified timestamp<br>        }<br><br>        # 5. Write to DynamoDB<br>        table.put_item(Item=item)<br>        <br>        return {<br>            &#39;statusCode&#39;: 200,<br>            &#39;body&#39;: json.dumps(f&quot;Successfully processed {key}&quot;)<br>        }<br>        <br>    except Exception as e:<br>        print(e)<br>        return {<br>            &#39;statusCode&#39;: 500,<br>            &#39;body&#39;: json.dumps(&quot;Error processing image&quot;)<br>        }</pre><p>The above was zipped and uploaded to lambda to serve as the compute function using:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*UGvoBe3DLZu-VYoXIvP9Cg.png" /></figure><pre>aws lambda create-function <br>    --function-name AnalyzeImage <br>    --runtime python3.9 <br>    --role arn:aws:iam::YOUR_ACCOUNT_ID:role/ServerlessAI_Role <br>    --handler lambda_function.lambda_handler <br>    --zip-file fileb://function.zip <br>    --timeout 10</pre><p>And to handle invocation permissions, the code below was used to allow the created bucket invoke the lambda function when an image is uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*FNuMHf8JEVC3IJyI4FiE9A.png" /></figure><pre>aws lambda add-permission <br>    --function-name AnalyzeImage <br>    --statement-id s3-trigger <br>    --action &quot;lambda:InvokeFunction&quot; <br>    --principal s3.amazonaws.com <br>    --source-arn &quot;arn:aws:s3:::serverlessimageanalyzer&quot; <br>    --source-account YOUR_ACCOUNT_ID</pre><p>Finally a configuration file for notifications was added for the event s3:ObjectCreated:* and pointed to the Lambda function’s ARN.</p><pre> {<br>    &quot;LambdaFunctionConfigurations&quot;: [<br>        {<br>            &quot;LambdaFunctionArn&quot;: &quot;arn:aws:lambda:us-east-1:YOUR_ACCOUNT_ID:function:AnalyzeImage&quot;,<br>            &quot;Events&quot;: [&quot;s3:ObjectCreated:*&quot;]<br>        }<br>    ]<br>}</pre><pre>aws s3api put-bucket-notification-configuration <br>    --bucket severlessimageanalyzer<br>    --notification-configuration file://notification.json</pre><h3>Proof of Concept(PoC)</h3><p>For proof of concept, I uploaded two different images catimage.jpeg and dogimage.jpeg</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*gp9UDit_tQ5wUBaI6inDGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*7tQJ4NqgikExHU3OuwPhnQ.jpeg" /><figcaption>catimage.jpeg</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*cyNcQE3jz7MSFQM1AgCsTg.png" /></figure><pre>aws s3 cp test.jpg s3://serverlessimageanalyzer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*cQiTuD_BGG8oJ7n8GysUSQ.jpeg" /><figcaption>dog image.jpeg</figcaption></figure><p>After which the DynamoDB table was scanned using:</p><pre>aws dynamodb scan --table-name ImageMetadata</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*W-e2I4TrLqmFJYFdwzFe0g.png" /><figcaption>Metadata for catimage.jpeg</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*sZlXjs_iCio6Vw7YNqteew.png" /><figcaption>Metadata for dog image</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FyVqEt_ONE1Rgzjq8fRd0w.png" /><figcaption>Both images in the aws management console — dynamodb items</figcaption></figure><blockquote><a href="https://docs.aws.amazon.com/cli/latest/">AWS CLI Command Reference — AWS CLI 2.32.3 Command Reference</a></blockquote><p>Note: Refer to the above link for further details on each command</p><h3>Conclusion</h3><p>Building this project gave me hands-on experience with how AWS services integrate. It moved beyond simple storage or compute and into the realm of AI integration.This architecture can easily be expanded. For example, we could add <strong>SNS (Simple Notification Service)</strong> to email an administrator if a “Sad” face is detected or use <strong>API Gateway</strong> to create a frontend for uploading images.</p><p>It was deployed entirely on the free tier and cost $0. Also, it runs only when an image is uploaded and costs <strong>$0</strong> when idle demonstrating the efficiency of serverless architectures in diverse workloads.</p><p>Thanks for reading! If you have any questions about the code or the setup, feel free to leave a comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9904f62a217c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WAZUH Setup and Configuration on Endpoints]]></title>
            <link>https://medium.com/@aosige47/wazuh-setup-and-configuration-on-endpoints-b1a63c994a63?source=rss-52ec85224c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1a63c994a63</guid>
            <category><![CDATA[wazuh]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security-operation-center]]></category>
            <dc:creator><![CDATA[Silas Aosige]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 11:40:23 GMT</pubDate>
            <atom:updated>2025-11-12T11:40:23.702Z</atom:updated>
            <content:encoded><![CDATA[<p>Setting up Wazuh can seem so simple yet it can come with its challenges. I encountered a few in my attempt as well and so I’m making this guide with the hope that you can avoid the same mistakes I made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*2gpFXeDik2vFNQZqvRW6fg.png" /></figure><p>Start by navigating to File and Clicking on New Virtual Machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*MK3FRjsOOtN013WuS06nfw.png" /></figure><p>Select Typical for a quick easy installation process</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*JUhfRqXZ_KVrGcVtEWv9ZQ.png" /></figure><p>Choose the ISO image for your Ubuntu installation and give the virtual machine a name of your choice</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*WIlg_sdPJ-VoqIzxTFFqOw.png" /></figure><p>Assign a disk size. I found that 40GB of storage worked for me. I encountered issues when I used 20GB. The recommended minimum size from the Wazuh documentation is 50GB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*Tda2065YQ6VKD2h6-q3LiA.png" /></figure><p>Configure Memory and Processors. 8GB of memory and 4 processor should be sufficient for basic use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*UW8yzQT0O4HHS6c5jJTHRQ.png" /></figure><p>Once you’re done with the configuration click on Finish and launch the VM or tick the checkbox below as seen in the image to launch the VM immediately after closing the Wizard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*_sy0FT1waW3gqS1v4Zm-_w.png" /></figure><p>After the VM boots up, follow the installation wizard to install Ubuntu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*DKLImCHG0HS_Fuf-g2mhtg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*7QQDT3DakuNXvIVtxN43MQ.png" /></figure><p>Click on Install Now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*jhcfmt5QlcDIo4P4xURciw.png" /></figure><p>Choose your location</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*8zcVEIUq96-K2RK0ifN-6Q.png" /></figure><p>Type in the required details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*PdXDQd0HZxbrEf3YFgtZog.png" /></figure><p>Wait for the installation process to be completed after which the VM will be rebooted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*2z74MJBT-1bJG-l4cW-UtA.png" /></figure><p>When the VM completes its reboot and you login, install the curl package with sudo apt install curl. This next step is very important. Use sudo apt update and sudo apt upgrade to view and upgrade all your packages before proceeding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*sVxzzVLEjS4-kCGXXCncvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*S34YICjqXocGp81uAMhmiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*LjI_1InsG6NMDt2EIW-uYA.png" /></figure><p>Then use “curl -sO <a href="https://packages.wazuh.com/4.12/wazuh-install.sh">https://packages.wazuh.com/4.12/wazuh-install.sh</a> &amp;&amp; sudo bash ./wazuh-install.sh -a” to install and run the wazuh installation assistant. It will automatically install the components of wazuh; Wazuh manager, indexer, server and dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*wmaKFBKTMzLNwKXwW0ZMVQ.png" /></figure><p>When the installation is complete, credentials will be provided for a first time login for the wazuh dashboard along with the IP required to access the Wazuh dashboard. The default IP is on localhost(<a href="https://127.0.0.1/">https://127.0.0.1</a>).</p><p>To change this to your preferred IP, preferably the IP of your virtual machine, use “systemctl stop wazuh-dashboard” to stop the service. Then, use “nano /etc/wazuh-dashboard/opensearch_dashboards.yml” to edit the config file for the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*4bFA6_T21gekovxWBjavqg.png" /></figure><p>Replace the server.host IP with your preferred IP. The type “systemctl start wazuh-dashboard” to restart the dashboard</p><p>Note: To get the IP of your VM, you can type “ip addr”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*SXmubjtWN8q4jpep2r0iuA.png" /></figure><p>You can then visit the Wazuh dashboard using <a href="https://ip_address/">https://IP_ADDRESS</a> on your web browser. Login with the credentials from before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*mLRi8q8VRl-eDu1WlRd9Ew.png" /></figure><p>This is the Wazuh dashboard after logging in.</p><p>After successfully installing Wazuh, the wazuh agent should be installed on devices of interest in order to be monitored. The following describes the process for both Linux and Window devices</p><p>Windows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*SP43GkG_rQX9SmOGYhLVEw.png" /></figure><p>Download and install the wazuh agent for windows using <a href="https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-windows.html">Installing Wazuh agents on Windows endpoints — Wazuh agent</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*s-V1B2Y4qtvmLOgojYvw2Q.png" /></figure><p>When the installation is complete, input the Wazuh manager IP and click Save. After that, make sure Wazuh is running , click on Manage and select Start to startup the wazuh agent. After sometime the Authentication key will be automatically configured</p><p>Linux</p><p>For linux based systems, its fairly straightforward.</p><p>Input the following commands in the same order;</p><p>· ‘’curl -s <a href="https://packages.wazuh.com/key/GPG-KEY-WAZUH">https://packages.wazuh.com/key/GPG-KEY-WAZUH</a> | gpg — no-default-keyring — keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg — import &amp;&amp; chmod 644 /usr/share/keyrings/wazuh.gpg’’ to install the GPG key.</p><p>· ‘’echo “deb [signed-by=/usr/share/keyrings/wazuh.gpg] <a href="https://packages.wazuh.com/4.x/apt/">https://packages.wazuh.com/4.x/apt/</a> stable main” | tee -a /etc/apt/sources.list.d/wazuh.list’’ to add the repository</p><p>· ‘’apt-get update’’ to update the package information</p><p>Then use ‘WAZUH_MANAGER=”Wazuh_IP_ADDRESS” apt-get install wazuh-agent’ to complete the installation.</p><p>Type systemctl daemon-reload, systemctl enable wazuh-agent and systemctl start wazuh-agent to configure wazuh agent to startup when the machine is powered on</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*MP4FNq4Jrt2ouYOnnJn6Xw.png" /></figure><p>When properly done, you will be able to see your endpoints on your wazuh dashboard</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1a63c994a63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pentesting an Active Directory Homelab]]></title>
            <link>https://medium.com/@aosige47/pentesting-an-active-directory-homelab-d256639319fb?source=rss-52ec85224c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d256639319fb</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[active-directory]]></category>
            <dc:creator><![CDATA[Silas Aosige]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 11:26:10 GMT</pubDate>
            <atom:updated>2025-11-12T11:26:10.080Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article I’ll walk you through a compact, reproducible lab: a Domain Controller, two Windows workstations and a Kali attacker. This environment was made intentionally vulnerable to demonstrate how easy it is for attackers to gain access to our systems when our security is not at its A-game. It&#39;s a lengthy one but I hope you find it interesting.</p><p><strong>The Setup</strong></p><ul><li>Windows Server 2022</li><li>Windows 10–2 PCs</li><li>Kali Linux</li></ul><p>All deployed on VMWare Workstation Pro.</p><h3><strong>Setting Up Windows Server</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PJmTcUGwJtxMF5WQLuGwhQ.png" /></figure><ul><li>Start off by creating a new Virtual Machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eCXff4zufPQUY2D08peq_g.png" /></figure><ul><li>Select the iso file or install operating system later</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtRnz4_HT1BFBpZ3d5gwTw.png" /></figure><ul><li>Select Microsoft Windows as the guest OS and the preferred version</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HRarfuu-Hsin30SOQEBx6w.png" /></figure><ul><li>Name your Virtual Machine.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzDrJtDH_cCGkvd2aN9VuQ.png" /></figure><ul><li>Specify your preferred max disk size</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2ej14cAyJMx3BGHRZxzFQ.png" /></figure><ul><li>Configure your memory and processor settings</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vM1GrxsPlsVA8mHQL1jvog.png" /></figure><ul><li>Finalize your settings after configuring your Memory and Processors</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AhRd8eVm7f3hh44BHtLj5Q.png" /></figure><ul><li>After launching the VM, choose your preferred language on the first page of the installation wizard</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q2D6j3hr6Ltu8vZGvARNBw.png" /></figure><ul><li>Select your preferred Operating System (In this case, Windows Server 2022(Desktop Experience))</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WnfN-c6tLEqBJV7S-cVRYQ.png" /></figure><ul><li>Accept the license agreement</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHTqXuudATtIvpQ810zOcw.png" /></figure><ul><li>Select Custom Install</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIpGU3vmVw3lp2X02EoyBA.png" /></figure><ul><li>Format the Partition to create these 3 new Partitions (Optional)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-hE5Muexr9Hi7kjwOcygw.png" /></figure><ul><li>Wait for the installation to be complete</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9NhzTZ0OUwhm8cLIgW_GYA.png" /></figure><ul><li>After rebooting, configure a password for the built in administrator account which is Pa$$w0rd in this case</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdFrmp11IPHObDthtIacZw.png" /></figure><ul><li>After logging in, the Server Manager loads up. We can now setup Active Directory from here</li></ul><blockquote>To install Active Directory, click on Manage on this page and select ‘Add Roles and Features’</blockquote><p><strong>Setting up the Active Domain Services</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SEv0pwO6WUzCwvzYgl7hqA.png" /></figure><ul><li>Click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0S8TWUuZ_jr5gNG8K3Op0g.png" /></figure><ul><li>Leave on default and click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogUo5sfAvF_yIlUS0vfUpQ.png" /></figure><ul><li>Click the checkbox next to ‘Active Directory Domain Services’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bZmNMIeUhijpiyKNTemiEQ.png" /></figure><ul><li>Click ‘Add Features’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ad4iT6JYNqEskECXVwCB-Q.png" /></figure><ul><li>Tick ‘Restart the destination server automatically if required’ and click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*npE3A3aI49UPDLi6XDQf9g.png" /></figure><ul><li>Allow the installation to be completed and click ‘Promote this server to a domain controller’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QebAPkeBxNAvta-VgqZ2qQ.png" /></figure><ul><li>Select ‘Add a new forest’ and key in the Root domain name, then click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cD7VT116Lyjoref4Er0RBA.png" /></figure><ul><li>Leave everything on default and key in your password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L-WKoLoi-GwLvkx-vWv5Hw.png" /></figure><ul><li>Wait for the wizard to verify your NetBIOS name and click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_AuT23qfgWoyi_QXIvIag.png" /></figure><ul><li>The wizard will check if everything is in order, once you have a green checkmark with the message ‘All prerequisite checks passed successfully’, Click on Install</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dve9qWoMQAd3k0AUcNi3vQ.png" /></figure><ul><li>After a successful installation, the system reboots automatically</li></ul><h3><strong>Setting up the Active Directory Certificate Services</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogUo5sfAvF_yIlUS0vfUpQ.png" /></figure><blockquote>To install Active Directory Certificate Services, click on Manage on this page and select ‘Add Roles and Features’ and click on Next till you get to the page below</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*bUrG7Inx5Ytz-yGaMVka3A.png" /></figure><ul><li>Click on ’Add Features’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*VK9WoDK1ekPCEe4iqHeSbQ.png" /></figure><ul><li>Tick Certificate Authority and Click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*pLLpm6pUOR-5j8PxNl0Zwg.png" /></figure><blockquote>After installation, click on the flag with the yellow caution sign beside it and click ’Configure Active Directory Certificate Services’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*AEyqbPh3zQf6jIhgND8rWA.png" /></figure><ul><li>Tick Certification Authority</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*L8GW5xTGj9bCztODXfeaKQ.png" /></figure><ul><li>Select ’Enterprise CA’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*YSUy4hV06koRkOvILnT2JQ.png" /></figure><ul><li>Select ’Root CA’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*CsixA2kS0smqTeXastr-Tg.png" /></figure><ul><li>Select ’Create a new private key’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*jYHl27R4aeiP9s27rod3gA.png" /></figure><ul><li>Leave on default and click Next or configure your preferred cryptography options</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*RrSz0A161W3wAAQE6HXNKQ.png" /></figure><ul><li>The wizard will configure a default name then click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*A71wKIn2ivTyuNttTwmhaQ.png" /></figure><ul><li>Specify a validity period. Click Next and complete the configuration.</li></ul><h3><strong>Setting Up Users and Computers</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*4gvJTK99oJ2p-z0tP1vusQ.png" /></figure><ul><li>After setting up Active Directory, there are no users or computers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*6IRD1JzlPl6nQS8o6shjig.png" /></figure><ul><li>Users were created and computers were later added to the domain</li></ul><blockquote>User details are as follows:</blockquote><blockquote>username: user 1, password: Password1,</blockquote><blockquote>username: user 2, password: Password2,</blockquote><blockquote>username: SQL Service (service account), password: Password3,</blockquote><blockquote>username: Dom Admeen, password: P@$$w0rd, (Administrator 2)</blockquote><blockquote>username: Administrator, password: Pa$$w0rd</blockquote><blockquote>Note: Aside the obviously terrible passwords, a description which reveals the password has been added to the SQL Service to simulate a bad practice of writing or keeping your password in an easy place to find.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*1F9DVgCwpU_lL2uqCyWVlg.png" /></figure><ul><li>After adding the users, SQL Service being a service account had its SPN (Service Principal Name) added to the domain controller</li></ul><p>Configuring a Group Policy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*z4isTorMy_ub1fTXX7q91A.png" /></figure><ul><li>A Group Policy to Disable Defender Antivirus for simulation purposes was also done. First open the Group Policy Management Window -&gt; right click on the domain controller and click ‘Create a GPO in this domain, and Link it here…’ . It was appropriately named</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*oFgqJNO_beScXb6M-ZOs8A.png" /></figure><ul><li>Right click on the policy and click ‘Edit’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*ZhFgWfywPdJ1Zg4E5I09eg.png" /></figure><ul><li>Navigate to Computer Configuration -&gt; Administrative Templates -&gt; Windows Components -&gt; Microsoft Defender Antivirus.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*a68PPNIBuvd_tKLhZt9-Rw.png" /></figure><ul><li>Select ‘Enabled’ and click OK</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*VodPJbZblATN3OHos2mWNA.png" /></figure><ul><li>Right click and select Yes on Enforced.</li></ul><h3><strong>Configuring the Domain Controller as the DNS Server</strong></h3><blockquote>Note: To keep this short, refer to <a href="https://iritt.medium.com/setting-up-a-windows-10-on-vmware-for-your-cybersecurity-lab-524438f7617d">Setting Up a Windows 10 on VMware for Your Cybersecurity Home Lab | by IritT | Medium</a> and <a href="https://iritt.medium.com/setting-up-kali-linux-on-vmware-for-your-cybersecurity-lab-f00ba8b29fa9">Setting Up Kali Linux on VMware for Your Cybersecurity Home Lab | by IritT | Medium</a> to setup the Windows 10 and Kali Linux Machines.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*1H5XJY8LcHI_llwaejwXew.png" /></figure><ul><li>We setup the Domain Controller to serve as the DNS (Domain Name Server) in this environment since the victim machines are going to be joined to it.</li></ul><h3><strong>Joining the Windows 10 Machines to the Domain Controller</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*EXibYupFmdIUBbSxd4hi3g.png" /></figure><ul><li>Navigate to Accounts -&gt; Access work or school from Settings and click Connect. Select Join a Domain</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*Jhq6dTOXTz_qotw9ibLQvA.png" /></figure><ul><li>Enter the Domain Name</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*T15fFYyVzSzAbvezgilFeQ.png" /></figure><ul><li>Select the account type and key in the username. Click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*W8J-0xry4EclODJXYzlBbA.png" /></figure><ul><li>Restart after successfully joining the domain.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*rb2oWoiWqfe9I-U4aZ3QNA.png" /></figure><ul><li>After successfully joining the 2 windows 10 machines to the domain, they are now visible in the computer&#39;s directory on the Windows Server.</li></ul><p>Creating a Shared Folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HEwyhtkI-rRPI92K_pyrsw.png" /></figure><ul><li>Navigate to Files and Storage Services on the Windows Server</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w46qJRNb6YoPZAWRmgHIJg.png" /></figure><ul><li>Select Shares. Click on Tasks and Select ‘New Share’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*LLgKQDQb0-bXR5vxjMquww.png" /></figure><ul><li>Choose your preferred share profile (in this case SMB Share — Quick)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*M8FSUBG-_9mIAQUUQzPOPA.png" /></figure><ul><li>Select the location</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*qMz6SjbHi_lIzHrJdq_AUg.png" /></figure><ul><li>Key in the Share name and click Next</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*xNsb3X0jUJafrpFROoQ-cw.png" /></figure><ul><li>Click create after configuring ‘Other Settings’ and ‘Permissions’</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*zCPlm3cJIRvQjZ2y4XJfvQ.png" /></figure><ul><li>To make this share folder visible in File Explorer across all computers in the domain. Navigate to ‘This PC’ in File Explorer and click on ‘Map Network Drive’. File and Printer Sharing must be enabled in ‘Advanced Network Setting -&gt; Advanced Sharing Settings’. Select the desired drive letter and select the folder created earlier. Click Finish.</li></ul><h3><strong>Simulating Active Directory Attacks</strong></h3><blockquote>All tools used to simulate these attacks were installed using pimpmykali from <a href="https://github.com/Dewalt-arch/pimpmykali">https://github.com/Dewalt-arch/pimpmykali</a></blockquote><h4>LLMNR (Link Local Multicast Name Resolution)</h4><blockquote>Tools Used: Responder, Hashcat</blockquote><p>LLMNR is used to identify hosts when DNS fails to do so. Was previously NBT-NS. Responder intercepts incoming request and replies with a poisoned answer to obtain a hash. It is executed using the command below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*aLJ0kDVvr8lguFVBlqYwpw.png" /></figure><pre> sudo responder -I eth0 -dPv  </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*2YSy-2OaBqSe3n_1llXXNQ.png" /></figure><ul><li>Once on the same network as the windows 10 targets, it finds the DHCP server.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*zoObW0TUpQ0-XA2jeIbFgw.png" /></figure><ul><li>After some time running responder, a request is intercepted and a hash is returned from user 1’s machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*8Gisaf87LECChkW9mMuuOA.png" /></figure><ul><li>Alternatively, a login scenario to a file share was initiated from user 1’s computer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*n4ZeBRuAAVywaEqKOHYMJw.png" /></figure><ul><li>The result was the same however the difference is the source as this is SMB and the previous one was Proxy-Auth</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*75WAzRAfwXukgFBhPfbFTw.png" /></figure><ul><li>After obtaining the hash, a password cracking tool, in this case hashcat was used to crack the hash using hashcat -m 5600 filename wordlist . where filename in this case is llmnrhash.txt which contains the hash obtained earlier and wordlist is /usr/share/wordlists/rockyou.txt which is a commonly used wordlist containing common passwords used</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*zul8b94tKM1zmL3e1qVtDw.png" /></figure><ul><li>After running hashcat, the password being Password1 is obtained in 1 second.</li></ul><h4><strong>SMBRelay</strong></h4><blockquote>Tools used, impacket-ntlmrelayx, responder</blockquote><p>Involves relaying hashes from responder to specific machines to gain access in the event the hashes can’t be cracked. Two conditions must be met for this to work;</p><ul><li>SMB signing must be disabled or not enforced</li><li>Relayed credentials must be admin (local admin) on machine for greater value</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*xHoICHqRYDKS2lPNNNC0IA.png" /></figure><ul><li>To simplify things, a list of targets was made in a file relaytargets.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*A64nTGCAGa_SLlgS3WUabQ.png" /></figure><pre> nmap --script=smb2-security-mode.nse -p445 relaytargets.txt -Pn </pre><p>The script above checks to determine if message signing for SMB is enabled. In this case it is not hence satisfies the 1st condition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*r-T-KohV_AONZyWWQXkDTg.png" /></figure><ul><li>Also for this to work, HTTP and SMB have to be disabled in responder. This is done using the command below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*A-Q1IDGh2ZXT92EJrDdjgA.png" /></figure><pre>sudo mousepad /etc/responder/Responder.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*NbCczRZuQgWRm16gWcNTmg.png" /></figure><ul><li>Both Responder and impacket-ntlmrelayx should be running simultaneously</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*oWc4zH6fG6hDpWNPRJK_fA.png" /></figure><pre> sudo ntlmrelayx.py -tf targets.txt -smb2support </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*unPDafr41Rp8m82g9BrbbA.png" /></figure><ul><li>Both of them continue to run for some time till there’s some activity on the network</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUewVovalS3DrhpBpNJcyQ.png" /></figure><ul><li>To speed things up, a similar scenario as in the previous attack was simulated and this resulted in some SAM (Security Account Manager) hashes being dumped.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XEzBWL8vfqsMwy5hRXv0w.png" /></figure><ul><li>Alternatively, the command below allows you to establish an interactive shell after a successful attack</li></ul><pre> sudo ntlmrelayx.py -tf targets.txt -smb2support -i</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DabYi2XjhuOVhdWpuI_law.png" /></figure><ul><li>Once successful, we’re able to listen on a provided port on localhost to interact with the machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*zmCYxZBV4bZmPpgG2fkmVw.png" /></figure><ul><li>Just like that, we have access to user 1’s files</li></ul><p><strong>IPv6 Attacks</strong></p><blockquote>Tools used: impacket-ntlmrelayx, mitm6</blockquote><p>An attacker positions himself as a DNS to forward IPv6 traffic since its usually not handled by any service on most computers. Its possible to gain access to the domain controller via LDAP or SMB. When an event occurs on the victim machine like signing in, we can get the NTLM hash and do an LDAP relay onto the Domain Controller</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDPaOqFI25AAmG9oFqqMHQ.png" /></figure><ul><li>The command below is run to setup the attacker&#39;s machine as the IPv6 DNS. Both mitm6 and impacket-ntlmrelayx must be run simultaneously.</li></ul><pre><br>sudo mitm6 -d controller.local </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*CEj7f0QevBIJ15xrF4Fppg.png" /></figure><ul><li>Once ntlmrelayx intercepts and authenticates against ldaps, its able to dump information about the entire domain as seen below in a specified folder, in this case lootme. In the process of dumping the information, a user is created in the domain with enterprise domain admin privileges.</li></ul><pre>impacket-ntlmrelayx.py -6 -t ldaps://192.168.12.137 -wh fakewpad.controller.local -l lootme</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKjm2LpkD6TT6KubW4QGRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjxWJskX5fDtGVego58IYg.png" /></figure><ul><li>All the information dumped in the attack</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*gnJyB2IIhJPDQkYPrna76w.png" /></figure><ul><li>The enterprise domain admin created in the attack</li></ul><p><strong>PSExec Via MetaSploit</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GAyGNN3lkeGlr_rq1dzOZw.png" /></figure><ul><li>For the purpose of simulating this, windows defender was disabled on user 1’s PC.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nq0O5rBOPjovIXSim5i2sg.png" /></figure><ul><li>msfconsole to open metasploit and search for psexec</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GeR4kcC_GyGkTYj6MJhBjw.png" /></figure><ul><li>windows/smb/psexec i.e number 24 on the list was used. smbuser, smbpass, smbdomain and rhosts were set as u1, Password1, CONTROLLER.local and 192.168.12.137 respectively</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2iS2d88zLMr76s10KHYEWg.png" /></figure><ul><li>After running it, a meterpreter session was obtained</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*EkPG5g7R_8E7vJwjfmsy4Q.png" /></figure><ul><li>From here a shell can be opened</li></ul><p>Alternatively use psexec, smbexec and wmiexecto establish a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L8p1tYn8VEiMcV3nqFpvBg.png" /><figcaption>psexec</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bkNef-s1-oRs38ukErkdVg.png" /><figcaption>smbexec</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wywe59yFj2TdsWYV2pn14Q.png" /><figcaption>wmiexec</figcaption></figure><p><strong>Crackmapexec</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8dahCGQsOxyZJA_q82Xqsw.png" /></figure><pre>crackmapexec smb 192.168.12.0/24 -u u1 -d Controller.local -p Password1</pre><p><strong>Secretsdump</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJGrFP3YFNsZyLg0GkdWng.png" /></figure><p>Makes use of the cracked password from before to dump SAM hashes, cached domain login information and LSA secrets</p><pre>impacket-secretsdump CONTROLLER/u1:Password1@192.168.12.137</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqLay7ZbkryDP7w_vgRR9A.png" /></figure><pre>impacket-secretsdump CONTROLLER/u1:Password1@192.168.12.138</pre><p><strong>Pass-the-Hash</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*C_jCfgY2ovWpqLWzNH2CHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*KCTIxoQWuz9qt6Q4E7sMFQ.png" /></figure><ul><li>This uses the enterprise domain account created during the earlier attack to dump domain credentials and get NTDS.dit secrets.</li></ul><pre>sudo secretsdump.py CONTROLLER/pBsbDaKmxb:@192.168.12.136</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*ze0fyJcyKSFkvvm_-SzsgA.png" /></figure><ul><li>The hashes obtained from the secrets dumped in the previous attack can be used to pass around the hash to compromise machines in the domain where the user has been signed in as seen above.</li></ul><pre>crackmapexec smb 192.168.12.0/24 -u administrator -H hash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*IYJQaBGSh-nxv8WVjjiYuQ.png" /></figure><ul><li>This can be used <strong>to obtain a password hash for user accounts that have an SPN, in this case the SQL Service we created earlier. </strong>We obtain a Kerberos hash from this.</li></ul><pre>impacket-GetUserSPNs controller.local/u1:Password1 -dc-ip 192.168.12.136 -request</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*3W2TxYNO0sJj4c67mz7oQQ.png" /></figure><ul><li>The Kerberos hash obtained previously was then put in a krbt.txt file and cracked using the rockyou wordlist with hashcat</li></ul><pre>hashcat -m 13100 krbt.txt /usr/share/wordlists/rockyou.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*4JaCT9kH3K4ch66w3g7EBA.png" /></figure><ul><li>The password obtained after 3 seconds is Password4</li></ul><p><strong>Token Impersonation</strong></p><blockquote>Tools used: Metasploit</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*l9HycMuVeHCex8CPObBC8A.png" /></figure><ul><li>Like before, we use psexec with the same parameters and establish a meterpreter shell. Then we useload incognito to perform the token impersonation attack</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*ONDnYSucEqSU3PfEVg7EqA.png" /></figure><ul><li>List tokens available</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*DgqlhpkZg46Bl9gAnoVvhQ.png" /></figure><ul><li>Use impersonate_token [token] to impersonate a user</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*wgxTa3KYqFNsZKgy6f3c9A.png" /></figure><ul><li>Can also use load kiwi to make use of mimikatz commands on victim machine</li></ul><p><strong>BloodHound and Plumhound</strong></p><blockquote>Bloodhound comes with pimpmykali hence, to run it ,I used bloodhound-setup on the first run to setup the neo4j console and bloodhound itself. They work hand in hand.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ep6GDMftzZKGTbsvPDO2Dw.png" /><figcaption>neo4j console</figcaption></figure><ul><li>After running bloodhound-setup , we setup our neo4j at localhost:7474 . a change of password is required before proceeding</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wGVy4hAU7R5mmwX7E7F9Q.png" /></figure><ul><li>using the command below, we retrieve data that can be used to map out the domain.</li></ul><pre>sudo bloodhound-python -d CONTROLLER.local -u u1 -p Password1 -ns 192.168.12.136 -c all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iruYvozfomd2544eyGHWwQ.png" /><figcaption>Files produced after running the command above</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XTPqN_351_-IQEykGrAa9w.png" /></figure><ul><li>Afterwards, we ingest the data retrieved by bloodhound-pythonto enumerate the domain at localhost:8080 on the bloodhound GUI.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9ibOJlNQQmG5PKBYUydWg.png" /></figure><ul><li>We’re now able to view more information about each and every component discovered in the domain</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HboW2HYXYDcNRWgnkf6Y1Q.png" /></figure><ul><li>Pathways can be observed to determine the best ways to pivot or laterally move through the domain to compromise high value targets</li></ul><blockquote>Plumhound works in tandem with bloodhound hence, bloodhound and neo4j are both required to be runnung with data ingested for it to function</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uLHJXJr8gC9FRrOBkits-w.png" /></figure><p>Using the command below, we are able to leverage on bloodhound to retrieve reports pertaining to the target domain in a tabular format as well as cypher queries which can be used in the bloodhound GUI.</p><pre>python3 Plumhound.py -x tasks/default.tasks -p neo4j1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8vmsj2q7NwGFbZSfMDEhDw.png" /></figure><ul><li>Plumhound produces these reports</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gPjpvQkvw-9_CD9Ed2Ma0Q.png" /><figcaption>A typical Plumhound report</figcaption></figure><p>This brings an end to my article. There are more attacks such as zerologon and others i have yet to discover and i hope to write an article on those as well in the near future. I am still learning and open to correction on anything reported in this article. You can hit me up on LinkedIn for any discussions. Thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d256639319fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Elasticsearch, Logstash, Kibana(ELK) and Filebeat to Ingest Logs for Data Visualisation]]></title>
            <link>https://medium.com/@aosige47/using-elasticsearch-logstash-kibana-elk-and-filebeat-to-ingest-logs-for-data-visualisation-a0b3cea1e822?source=rss-52ec85224c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0b3cea1e822</guid>
            <category><![CDATA[logstash]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[elk-stack]]></category>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Silas Aosige]]></dc:creator>
            <pubDate>Thu, 14 Aug 2025 11:45:42 GMT</pubDate>
            <atom:updated>2025-08-14T11:45:42.688Z</atom:updated>
            <content:encoded><![CDATA[<p>Tried my hands on installing and setting up an ELK stack and ended up coming across a lot of problems in the process. This guide streamlines and aggregates all the required steps to setup ELK for a typical use case of ingesting logs and visualising it on a dashboard.</p><p><strong>Prerequisites</strong></p><p>First of all ensure all your packages are up-to-date using “sudo apt upgrade”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*3XM8DEpycNSvFa791pLPSg.png" /></figure><p>· Import the Elasticsearch GPG key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*L6IKr-RREoWMiN_wazDhHg.png" /></figure><p>· Install the apt-transport-https package and then add the repository to the apt list using the command above. With this configuration done, all the tools in the elastic stack can be installed since they all come from the same repository and use the same GPG key.</p><p><strong>Installing Elasticsearch</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*AjD-XFJbLe2-NrAqndYERw.png" /></figure><p>· Install Elasticsearch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*Sr0AUeOgv9D5TRGHaLwR1w.png" /></figure><p>· After the installation is done, some credentials which will be used to log in to your Kibana dashboard will be outputted on to the screen along with some commands to use for various purposes such as password reset or generating enrolment tokens which we will be using later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*s90xq-tPDi2xqMHttduNzw.png" /></figure><p>· The command used verifies that Elasticsearch has been installed and is running . elastic: elastic:GXl-Ozpc8pJ-UraYuJGy represent username and password respectively. These are the credentials provided earlier after installing Elasticsearch.</p><p>Note: The passwords in the images are different because I reset the password.</p><p><strong>Installing Kibana</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*VdJUZxrQtQKKJSsV1S0kNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*Jp9EFJoZTdJLvpCDIQN-Aw.png" /></figure><p>· Install Kibana as seen above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*Jp9EFJoZTdJLvpCDIQN-Aw.png" /></figure><p>· Enable and start Kibana</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*uQBbHs2zv_Dj0kMIJTlvLw.png" /></figure><p>· Access the Kibana dashboard at localhost:5601 which is the default in the yml file. At this point an enrollment token which was generated upon installing Elasticsearch should be copied and pasted here. However if you’re unable to find it, you can generate one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*iby86z88EADprzBCx_uVmQ.png" /></figure><p>· Generate an enrollment token as seen above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*RYkGcmv5EuEkSIpsVgawFQ.png" /></figure><p>· Paste the enrollment token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*onngsz9ZZw4gz0IEjTko0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*AIS6pNDYtvrmpc16czZFcA.png" /></figure><p>· A verification code is required which can be retrieved as shown above. Click on Verify</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*SxYqZA8oKc_n62DYxlwxJw.png" /></figure><p>· Elastic will then complete the setup</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*YCLYNVhSmdyIUOW-lsUqQw.png" /></figure><p>You will then be greeted by the homepage.</p><p><strong>Installing Logstash</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*GTgVZPScFv1ebgZusqroyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*3nveNRzxGxmyfjMCxvbptg.png" /></figure><p>· Install Logstash as shown above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*IG592xjKpxQfE3tbO9CM-w.png" /></figure><p>· Enable and start Logstash</p><p>To make use of Logstash’s log parsing capabilities, I used the following config files which I put in /etc/logstash/conf.d directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*eCcoy09r8tk42mSb1cZX1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ZmeOReqU81WkIUZ0TbGD2w.png" /></figure><p>To ingest logs to be displayed via Kibana, Filebeat can be used.</p><p><strong>Installing Filebeat</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*CLJH5C0NmFX7rK-vNGPi7A.png" /></figure><p>· Install Filebeat as shown above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*DizvorpEBEEJsQDVrSE27Q.png" /></figure><p>· Navigate to “/etc/filebeat/” and edit the filebeat.yml with your preferred text editor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*IA16puPsIKHCyqlyB-PW8w.png" /></figure><p>· Since security features are enabled by default on Elasticsearch, the filebeat.yml has to be edited similarly to what is seen above to avoid access errors. The username and password are the same as what was obtained after install Elasticsearch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*sU7PzZklLsSN8ZJ-NXh7Rg.png" /></figure><p>· Your preferred modules need to be enabled in order to ingest the kind of logs you prefer depending on your system configurations. In this case, I enabled system as seen above to ingest system logs. The second command indicates the modules which have been enabled as well as the disabled ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*qUIroPBAbnWBMEA0vlfJFQ.png" /></figure><p>· Before proceeding, the filesets for your selected modules which are disabled by default must be enabled. At least one is required. The module files can be found at “/etc/filebeat/modules.d”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*0X2uijAkNp6XB2uXT5CIuA.png" /></figure><p>· Due to a bug, I found that only the above commands worked for me in enabling the filesets for the selected modules even after doing it manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*n8NxCQSToQ-Z0k7K9Bk1tg.png" /></figure><p>· Afterwards an index template has to be loaded into the Kibana dashboard. I went with a preexisting one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*hw9StX6Wp14352FZxoxaqg.png" /></figure><p>· Afterwards I loaded the Kibana dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*VTDRg9uJ-zRFzkQKd4EUzg.png" /></figure><p>· After visiting and refreshing the dashboard, logs populate the page.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0b3cea1e822" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up pfSense on VMWare WorkStation]]></title>
            <link>https://medium.com/@aosige47/setting-up-pfsense-on-vmware-workstation-d912b194c382?source=rss-52ec85224c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d912b194c382</guid>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[pfsense]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[firewall]]></category>
            <category><![CDATA[virtualization]]></category>
            <dc:creator><![CDATA[Silas Aosige]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 10:50:50 GMT</pubDate>
            <atom:updated>2025-08-08T10:50:50.534Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently decided to try setting up pfSense using virtualisation software to figure out its use cases however there was no specific documentation for setting it up on VMWare WorkStation. So I&#39;m making this writeup for any others who may find challenges with setting it up.</p><ul><li>Start by navigating to File and Clicking on New Virtual Machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*2gpFXeDik2vFNQZqvRW6fg.png" /></figure><ul><li>Select Typical for a quick easy installation process</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*MK3FRjsOOtN013WuS06nfw.png" /></figure><ul><li>Choose the ISO image for your pfSense installation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*JUhfRqXZ_KVrGcVtEWv9ZQ.png" /></figure><ul><li>Give the virtual machine a name of your choice</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*8iYdRZsctBriLkbBVv1v6w.png" /></figure><ul><li>Assign a disk size. 20GB or less is ok for most use cases</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*brQwXeMaKAwhVt4f8BDlAA.png" /></figure><ul><li>Configure Memory and Processors. 2GB of memory and 1 processor should be sufficient for most use cases</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*UW8yzQT0O4HHS6c5jJTHRQ.png" /></figure><ul><li>Click on Add and select Network Adapter. Then click Finish.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*MzFZA7vnznahwvgKWMtAoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*WLnl2wsalljeLOFLc0ANMA.png" /></figure><ul><li>With the addition of another network adapter, configure Network Adapter 1 to use NAT and Network Adapter 2 to use Host-only. pfSense requires both of them for normal operation as will be seen in the upcoming steps.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*EHPfu0B77Lrqu1lx3NFWgw.png" /></figure><ul><li>Once you’re done with the configuration click on Finish and launch the VM or tick the checkbox below as seen in the image to launch the VM immediately after closing the Wizard.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*fJTcjt5LHCrOzsy7Y8yXHw.png" /></figure><ul><li>Once the VM is booted up, you’ll be greeted with this launch page. Allow it to reboot.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*REkjK-n5M3SWZNDHE_WztQ.png" /></figure><ul><li>After rebooting, Accept the license agreement</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*JVe5_0KHBnTvcWPgkCOthw.png" /></figure><ul><li>Select Install and hit the enter key</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*PmDKVG-kEpCXORWnIsQVlg.png" /></figure><ul><li>Select Auto(ZFS) for a simple and straightforward installation process</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*zR9DjuVGxFJyNgRZ54hATQ.png" /></figure><ul><li>Leave everything as default and select Install to proceed. However you may make changes for these parameters according to your use case</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*3WwT3w3HYS10abguMMcBig.png" /></figure><ul><li>Choose stripe if you’re working with just a single disk and have no plans for redundancy configuration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*UKm2IRz-aZSpz_fM5vPgng.png" /></figure><ul><li>Use Space to select the disk and then select OK to proceed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*0vWYShn6XxX0ipaxjL0SaQ.png" /></figure><ul><li>Choose YES</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*fxRqi0tQSsbCC-sMDhR2ig.png" /></figure><ul><li>Wait for the extraction process to be completed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*YXhEXL5wPcnw8ovnu-rX3A.png" /></figure><ul><li>Select Reboot to complete the process</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*VZ2ARzrW5YPJJ5JuuYElEw.png" /></figure><ul><li>Wait for the booting process to be completed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*j3TbrvW1ZOirNDE_DB-gVA.png" /></figure><ul><li>When completed, you will be greeted by this dashboard</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*_3JgJ5qNjMxrgn0N_NWCuA.png" /></figure><ul><li>The WAN and LAN in this image correspond to the two previously configured network adapters from the previous steps. WAN is required by pfSense to reach the internet whereas LAN connects pfSense to other devices in an internal network. This IP address will be required to access the GUI of pfSense from other interconnected devices in the same LAN.</li><li>Choose 1 on the dashboard to assign the configured adapter interfaces to WAN and LAN. According to our previous configuration, em0 maps to network adapter 1 which we configured with NAT for network access and em1 maps to network adapter 2 which we configured with host only for our internal network.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*nK0XutO791JfPborQyx4SA.png" /></figure><ul><li>Select 2 from the dashboard to configure the IP address for the LAN. For this case, it was automatically assigned using DHCP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*uRa8TCeNlg3JITmOqWp0Gw.png" /></figure><ul><li>After the previous step, you can create a VM which must be on the same LAN or internal network to be able to access the pfSense GUI. Login with the default credentials; username:admin and password:pfsense</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*7DWEdtf7qqfQ9oiTwOH9Fg.png" /></figure><ul><li>When successfully logged in, change the default credentials</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*HZh1lZZrZrD9MeiEfsdvwA.png" /></figure><ul><li>When you check the pfSense VM, you’ll notice a message indicating that we’ve logged in from the machine with an IP of 192.168.1.100.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*B65oH2x_FgFxFGfWTTEQEQ.png" /></figure><p>This concludes the guide.</p><p>Sidenote:</p><p>To configure the IP addresses for the WAN and LAN to your preference, the following steps can be used.</p><ul><li>Navigate to Edit and select Virtual Network Editor</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*UWCxQkDweyNecQqDcuGJEA.png" /></figure><ul><li>Click on Change Settings</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*f3j-Nq9XzcrM2mvhHjHImg.png" /></figure><ul><li>Choose Add Network</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*EVkd6zaCyG5vcpzdbWi3Ug.png" /></figure><ul><li>Select a Network to add</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*RkE2ZLz8adGiipjPmfFpOw.png" /></figure><ul><li>After clicking OK, the details will automatically be filled in and Host-only will be the default. You can choose to edit the Subnet IP and Subnet according to your preferences.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*_ZVxWY0VcOisDzeHvY1PQw.png" /></figure><ul><li>Clicking on DHCP settings allows you to make further changes such as the address range for the network as well as the lease time. When you’re done click on OK. Then Click OK on the main Network Editor window to confirm.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*uPY8RmqU0aTImqr6JR9J6Q.png" /></figure><ul><li>In order to change the network to NAT, any other existing network with the Type NAT either has to be removed or changed to Host-only. This is because VMWare only accepts 1 network of type NAT. You can also opt to edit the preexisting NAT network to your specifications.</li><li>To use your preferred network configuration, select Custom and choose it from the dropdown menu when configuring your hardware for the pfSense setup.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*v90-_lBGl7BZ8UvUtIGJ5Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d912b194c382" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Serverless Image Resizer with AWS CLI: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@aosige47/building-a-serverless-image-resizer-with-aws-cli-a-step-by-step-guide-9ac07994776a?source=rss-52ec85224c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ac07994776a</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Silas Aosige]]></dc:creator>
            <pubDate>Sat, 28 Jun 2025 23:27:58 GMT</pubDate>
            <atom:updated>2025-06-28T23:27:58.625Z</atom:updated>
            <content:encoded><![CDATA[<p>Whiles preparing for my AWS Solutions Architect Certification, I often came across a scenario involving the serverless implementation of a photo resizer. So i decide to try my hands on it and this article is the result of my efforts.</p><p>The services involved in this project are</p><ul><li>AWS CLIv2</li><li>Amazon EC2 (Amazon Linux)</li><li>AWS Lambda</li><li>AWS S3</li><li>AWS IAM</li><li>AWS CloudWatch</li></ul><p>The main idea behind this project is to resize(change the dimensions of an image) an image uploaded in one S3 bucket and save the resized version in a different bucket. Lambda was used as the compute solution in this situation to provide a serverless solution where serverless means not having to deal with the provisioning of the infrastructure of your compute resource. All I had to do was just to provide my code to lambda and it would handle the rest.</p><p>IAM was used to provide the appropriate permissions using roles and policy in accordance with AWS best practices. CloudWatch served as the monitoring solution, providing logs for all invocations of the function which was used to infer whether the code was successfully implemented. The EC2 instance served as a platform for the installation and deployment of dependencies required by the function to run. Now we delve into the procedure I used to execute this project.</p><p>Before getting started, I had to install AWS CLI on my local machine. Since I did something similar in my previous project, you can check that out <a href="https://medium.com/@aosige47/node-js-app-deployment-on-aws-ec2-using-aws-cli-nginx-systemd-5a93d25f5adf">here</a>. It also includes the steps I followed for the configuration of my EC2 instance.</p><p>So after the configuration was done, i had to create my S3 buckets using the CLI. the commands I used were aws s3 mb s3://original-sized-image --region us-east-1 and aws s3 mb s3://new_resized-image --region us-east-1. Where mb here means make bucket. so the first bucket is the bucket which receives the original image and the second one stores the resized image.</p><p>In another Powershell CLI on my local machine, I SSH’ed into my EC2 instance to install the dependencies and proceed with the role configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3KWSCVbOQJpMkxWdHDg8A.png" /></figure><p>From here, i proceeded to create a directory which would contain my resizer python file as well as its dependencies which would later on be zipped and used to create my lambda function. the pillow library here provides the image processing capabilities required for this project, hence the command you see below installs it into the lambda_package folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*vYyWGDp7JJOipnf_pwHgEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*tdELjCFwpaslL7fb-KjGZw.png" /></figure><p>After that, i created my python function and saved it in the lambda_package folder. Boto3 is the AWS Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*0WfL67x88SkCWw9zS8TzkQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*JOFW3aOwv96DGPjQQzW7Xg.png" /></figure><p>*lambda_function.zip and function.zip are the same file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*frjR79Sz9S7eLGpw6Q6s_A.png" /></figure><p>With that done, i created a trust policy which gives lambda the required permissions in line with AWS best practices to interact with another service S3 in this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*WIM7iUnlrGZx27yOGpRlmA.png" /></figure><p>I then created the LambdaImageResizeRole and attached the previously created policy to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZUXVB0coKFnzMz3rv5CdQ.png" /></figure><p>Next was to provide the permissions needed to access the buckets we created. This permissions document details what is allowed. This includes Access and list objects in the original-sized-image S3 bucket, upload and manage ACLs for objects in the new-resized-image S3 bucket and create and manage log groups, streams, and events in CloudWatch Logs across all resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*eRAY59SSNQIgL8JfQMK4lg.png" /></figure><p>I then applied this permission policy to my IAM role after which I proceeded to also configure a notification for the source bucket to trigger the lambda function when a jpeg file is uploaded. the notification was then attached to the original-sized-image bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tdXQXEfW5VKlJxF-xKV8yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*IJUfSNVITQPXj3AfiLq61Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sxcf_6WFVFQU-CQGw7xzcQ.png" /></figure><p>Then I attached the AWSLambdaBasicExecutionRole to the LambdaImageResizerRole to provide Lambda with the basic permissions it needs to execute its task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2Ql3yzTFIxhhcNO3Au-ZQ.png" /></figure><p>After which i granted the S3 service permission to invoke the Lambda function from the original-sized-image bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OBFD_pqlwEysyH7B0MPlew.png" /></figure><p>I then created the lambda function and uploaded my zipped content along with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPWZpstnlcHIpxpkEh5-1g.png" /></figure><p>At this point, this is what it looked like in my Lambda Dashboard on my AWS Management Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfyhkovlciQYhMZT_HDcRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31OT_FKmKinKnIKlncTyiw.png" /></figure><ul><li>note: the suffix is .jpeg instead of .jpg</li></ul><p>I then decided to run a test from Lambda to ensure that the function was working properly and it was a success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wHfK0rHxDOPSrorTfWUdjg.png" /></figure><p>From here i decided to use the console to better illustrate the success of the project. These are the buckets i created earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6qvTnefsnO2JkGMRIeV1KQ.png" /></figure><p>I uploaded tiger.jpeg to the original-sized-image folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6QevuxGR7Iz-1aowKbqhA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugCa6uVTpRbLOA2H7T_ATg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2RorNW_KmqEnD8zJ58-k8A.png" /></figure><p>And in the new-resized-image bucket, a new file was created. As seen in the pictures, the size of the resized image is smaller than the original</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJWufZETcFBJyBUCv2tqHA.png" /></figure><p>Below is the metadata of the two files for comparison</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alwcjBPdeDHq5O1uK5dvVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hIbf3F8ljiDwyQMmgxulhQ.png" /></figure><p>And finally, the images themselves</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULPEp3DbUSyTCKqAIRxS5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gF8x6oehNOq6S0HQS02XWw.png" /></figure><p>the policy documents as well as the function for the resizer can be found <a href="https://github.com/silvaman47/ImageResizerProjectFiles.git">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ac07994776a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Node.js App Deployment on AWS EC2 Using AWS CLI, Nginx & PM2]]></title>
            <link>https://medium.com/@aosige47/node-js-app-deployment-on-aws-ec2-using-aws-cli-nginx-systemd-5a93d25f5adf?source=rss-52ec85224c2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a93d25f5adf</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[projects]]></category>
            <dc:creator><![CDATA[Silas Aosige]]></dc:creator>
            <pubDate>Sat, 28 Jun 2025 21:22:40 GMT</pubDate>
            <atom:updated>2025-06-29T13:01:22.289Z</atom:updated>
            <content:encoded><![CDATA[<p>This project demonstrates how I deployed a simple Node.js application on an AWS EC2 instance using the AWS CLI, and set it up with Nginx as a reverse proxy and pm2 for process management.</p><p>- AWS CLIv2</p><p>- Amazon EC2 (Amazon Linux)</p><p>- Node.js</p><p>-Nginx</p><p>- Pm2</p><p>📁 Project Structure</p><p>node-app/</p><p>├── server.js</p><p>├── package.json</p><p>├── .env</p><p>└── README.md</p><p>Before getting started, I had to install AWS CLI on my local machine. This would allow me to interact with AWS services via commands in a command line environment. In line with AWS best practices, I created an IAM User in my root account and assigned AdministratorAccess for this project as well as for future projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQnywhhdRzinVjpa-p_kug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Hoe1VuipGCMd3ZXkgRcug.png" /></figure><p>Afterwards, I generated secret credentials for my IAM User which consist of an aws access key id aws secret access key. These keys would later be used after installing AWS CLI for configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS12i1RAuW6KjrmV0hklrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjSboNBCYKAm8rk41svwgw.png" /></figure><p>To install AWS CLI, I referenced the documentation at ‘https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions&#39; and used the command ‘msiexec.exe /i <a href="https://awscli.amazonaws.com/AWSCLIV2.msi&#39;">https://awscli.amazonaws.com/AWSCLIV2.msi&#39;</a> in my windows powershell terminal to download the installer, after which i followed the prompts in the installation wizard to complete the installation. After closing and reopening windows powershell, I was able to use the command ‘aws configure’ to set my required parameters which consist of the aws access key id, aws secret access key, default region name and default output format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*QRD4NDxl00JSYrY4tw8caA.png" /></figure><p>Now having configured my AWS CLI, i proceeded to provision an EC2 instance. The instance would serve as the platform for configuration and deployment of my node.js application. To do this, a group security group first has to be created. This is done to provide instance level security,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmbH50HOPO21GVwmtIsREA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*an5216Nqy7nseqXPA8ltRQ.png" /></figure><p>meaning you decide from which ports and IP Address ranges traffic is allowed to enter and exit your EC2 instance.</p><p>After creating the security group, I configured the protocol, port and cidr block for the previously created security group. In this case, ports 22 for SSH, 80 for HTTP and 3000 for our test server are allowed for our EC2 instance. 0.0.0.0/0 here indicates that any IP address is able to send network traffic to the instance. It is not a recommended practice however for demonstration purposes, i configured it this way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pd-JjDNMW7qMFO50KP1AKw.png" /></figure><p>Finally, i generated a key pair to securely ssh into my EC2 instance. the options for the create-key-pair command include key-name being the name given to the key, query which filters the output of the response, region to ensure the key exists in the same region as the ec2 instance and the final two options produce the output as text which is encoded in ascii format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ka0og-4vt_tBArrKl5kRtQ.png" /></figure><p>With the prerequisites out of the way, I proceeded to launch my EC2 instance. As shown in the image, an image id is required to identify what type of virtual machine i aimed to launch, the instance type here being the kind of virtual machine i’m provisioning. In this case a t2.micro is enough to suit the needs of this project. It is a free tier eligible instance type and its for general purpose use cases. Count refers to the number of machines of this type i aim to provision, the key-name refers to the previously generated key pair that was generated. It is a best practice to always provision EC2 instances with a key pair for maximum security and finally the security group id of the security group created earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2S_O9NLC1Zy5_8ubn-MDfw.png" /></figure><p>To check the state of the instance, i.e. to determine whether I was now able to interact with the instance via SSH, I used the command aws ‘ec2 describe-instance-status — instance-id i-0121258e7fc8d5a6’ #replace id with your own instance id which can be found from the json output of the previously excecuted command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iGVaDoEiJSdFtcuxOTIelw.png" /></figure><p>Once it was ready, I SSH’ed into the instance using ssh -i “awscle.pem” ec2user@IPaddress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00vCtIOO4WHeenahTnRpEA.png" /></figure><p>Since my node.js app project folder was on my local machine, i used scp i.e. a file transfer utility to copy my app into my instance as shown below. The command used was ‘scp -i awscle.pem C:\Users\silas\Downloads\Compressed\node-app.zip ec2user@IPAddress :~’. The -i option is used to specify the key pair used to gain secure access to the instance followed by the path of the application folder on my local machine and the username, IP and location the file is to be sent to represented by the tilde(~)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJoJSazD68M7nSqP6aLyBA.png" /></figure><p>Upon receiving the file on my instance, i unzipped the contents as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*wpF3nem1PxiZ2RE4nnBelw.png" /></figure><p>Then i proceeded to install nodejs using ‘curl -sL <a href="https://rpm./">https://rpm.</a> nodesource. com/setup_18.x | sudo bash - sudo yum install -y nodejs’ and then npm using ‘npm install’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBz3Me_bPjTw03h5kdzcGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*dWZDQeZ6eKqxYyz8zrav6w.png" /></figure><p>By default, nodejs apps are popularly served through port 3000 on localhost hence why i opened port 3000 when creating the security group. After using the command ‘node server.js’,i tested to check whether the application could be reached on port 3000 using ‘http://EC2_PUBLIC_IP:3000&#39; and it was reachable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*UTnFtKOSvWeTzFOFom9sSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFRgVH3D3StQw9vFiKd0XQ.png" /></figure><p>After stopping the server, I decided to install PM2, a production process manager for Node.js applications which has some useful features such as background running, process monitoring, auto start on reboot, log management among others. it also keeps the app alive even if i log out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80nsBBuVKvU8Ebf4nBZ6NQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MOX9A5r7kZssli1SRhVarw.png" /></figure><p>From there i decided to setup a reverse proxy using nginx. With nginx configured in this manner, it would act as a middleman that serves the website on port 80 when its requested even though its running on port 3000.</p><p>I used ‘sudo amazon-linux-extras enable nginx1 sudo yum install -y nginx’ as seen below to install the nginx server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q-FHnOrqzEw3PpmqlR2tfw.png" /></figure><p>Then i used the commands ‘sudo systemctl start nginx’ and ‘sudo systemctl enable nginx’ to start the server which could now be reached from port 80 using ‘http://&lt;your-ec2-ip&gt;’ .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nHR_hqt4oU3mIMgTH-FezQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*TUGpDPecnPCelGn0tQkTtQ.png" /></figure><p>I then created a config file for my proxy server using ‘sudo nano /etc/nginx/conf.d/node-app.conf‘ and made the configurations seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*SNEXFoicEvBsXTSKYDtYeQ.png" /></figure><p>After testing the config with ‘sudo nginx -t’ and reloading the server with ‘sudo systemctl reload nginx‘, I was now able to reach the app using my EC2 public IP without exposing port 3000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*594gTsvvLrrmqWwgFUI3LA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFRgVH3D3StQw9vFiKd0XQ.png" /></figure><p>Disclaimer: Some images may have inconsistent IP addresses or key pair names. This is because i forgot to take some images before i ended the project. So i used a couple of images from a similar project.</p><p>Account ID is also redacted for security purposes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a93d25f5adf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>