<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Meer Hamza on Medium]]></title>
        <description><![CDATA[Stories by Meer Hamza on Medium]]></description>
        <link>https://medium.com/@meerhmza0?source=rss-a208def6e441------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9H4Xs8N9hOs6KIq1_ELSKg.jpeg</url>
            <title>Stories by Meer Hamza on Medium</title>
            <link>https://medium.com/@meerhmza0?source=rss-a208def6e441------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 23:53:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meerhmza0/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Phishing Email Attachment to Phantom Stealer]]></title>
            <link>https://medium.com/@meerhmza0/from-phishing-email-attachment-to-phantom-stealer-e2b6fe2daa02?source=rss-a208def6e441------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2b6fe2daa02</guid>
            <category><![CDATA[stealer]]></category>
            <category><![CDATA[phantom-stealer]]></category>
            <category><![CDATA[deobfuscation]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Meer Hamza]]></dc:creator>
            <pubDate>Sun, 22 Feb 2026 13:00:58 GMT</pubDate>
            <atom:updated>2026-02-22T13:00:58.056Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog is dedicated to malware investigation of VBS script which received as attachment within a spear phishing email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*JiemkxJs0K8fRbAkq_ZmNw.png" /><figcaption><strong>Execution Flow</strong></figcaption></figure><p>The script starts with random variable declaration and assignment which does not contribute anything to the malicious payload execution except that script contains a lot of comments which are obfuscated and are just there to confuse the analyst and make the investigation process slower.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U23B9zMs7R3IEBbu7JnV0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*ZD0AHHxTvn1q6uyhOF2dZA.png" /></figure><p>Most interesting function is “<em>Ugfdsffgfiffsging”. </em>That function called again and again with random obfuscated strings as function arguments. Which further being concatenated. There are further some random functions being performed within previously mentioned function which does not affect the strings being send as arguments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9SY9Ux9Y01o5eXomoBQdUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*kVQqp3k_FjeT3Z52SBhsmQ.png" /></figure><p>Another interesting thing the script is doing is checking if the hostname of device its being executed on contains any of following keywords and exit the script without execution.</p><p><strong>Keywords:</strong></p><ul><li>MAA1</li><li>LNP2</li><li>CAV</li><li>-PC</li></ul><p>These keywords are probably used to avoid some specific sandbox devices. On virustotal the script behavioral data was not present when I first investigated. which shows that the technique really worked to escape some specific sandbox environment. Although it executed well on recorded future public sandbox tria.ge.</p><p><a href="https://www.linkedin.com/posts/meer-hamza-0a1a3b1b4_virustotal-activity-7420119602317115393-0Ktp?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAADH8tbkBOzeg42COUi8C4i92o3OklsUTN2k">#virustotal | Meer Hamza</a></p><p>As of now the the behavioral data is present on virustotal based on scan that was performed 7 days ago. Probably, the hostnames get updated or not matching anymore.</p><p>After de-obfuscating the script it gives a big blob of base64 encoded PowerShell script which being decoded after replacing specific keyword like “h@” with character “d”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3AFLf5Li15xgag7pNISAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X2-4oiEED2LWKfFA6aeVyg.png" /></figure><p>The decoded PowerShell script try to fetch an image from either one of two domains hardcoded and extract the string between matching keywords “&lt;&lt;BASE64_START&gt;&gt;” and “&lt;&lt;BASE64_END&gt;&gt;”. The downloaded image contains a binary base64 encoded file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-agur9XGU4lkngkCWss9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*X8D-zVxz6AsAY8576zZ2eg.png" /></figure><p>After extracting the base64 string from JPG and decoding it. The script execute the decoded malicious DLL’s specific function with specific arguments required for proper execution of DLL including another domain whose characters are reverse. Which hosts contains another executable that most likely will be executed next by DLL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g3eLy3md9j2umciHNOO2rA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*5_jC67m8drHKgXcihJ_8PA.png" /></figure><p>After extracting and analyzing the DLL from image file. It was observed that DLL written in .NET (left image DIE tool result) and obfuscated by Smart Assembly obfuscator. Which can easily be obfuscated using de4dot.exe tool used for .NET obfuscation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*FHT1M0PihEOb6EKg3alHpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*b_WV5vutnN9pK4HAKTF3nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*V4rya_AqV2dYbGDOxU9XDQ.png" /></figure><p>By the time, I am investigating this DLL first URL is not in service anymore and second URL of firebase is still active. But the functions behavior is same but method and class names are different. Probably, because attacker is modifying the DLL slightly to avoid basic detection and using same hosting.</p><p>As we can see clearly now what the arguments are being used for. Attacker making a condition of “enablestartup” argument which is in our case is “2” and setting the persistence in one of the following registry keys with below details.</p><p>Registry keys:</p><ul><li>SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce</li><li>SOFTWARE\Microsoft\Windows\CurrentVersion\Run</li></ul><p>Registry value name: {random_10_characters}</p><p>Registry value: C:\Users\&lt;Username&gt;\AppData\ambve.vbs</p><p>Filename “ambve” was also provided within arguments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6dQWqpe4AJQcWzggP3G7KA.png" /></figure><p>Further the DLL make sure the current directory is not “C:\\Windows\\System32” or “C:\\Windows\\SysWOW64” then execute the PowerShell and kill below 3 processes.</p><ul><li>RegAsm.exe</li><li>Vbc.exe</li><li>MsBuild.exe</li></ul><p>Then it copy the VBS file to to Appdata directory if its not already present there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*zYZnfUCQrIOhWBxy1X8Bzg.png" /></figure><p>After that the DLL download the actual payload from url passed as argument to the DLL and replace “Dtre” with “/d” or “Dgtre” with “+” and inject the executable in RegAsm.exe process upon execution. The final payload is stored as “wrffite.bat” file at “C:\Users\&lt;Username&gt;\AppData\Local\Temp” path.</p><p>Further it checks every 60 seconds that if the RegAsm.exe is running or not and if there is error it will run previously mentioned VBS script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*BW8zeadF7yjzVOW4Bp8MWw.png" /></figure><p>The final payload is actually a phantom stealer. below are some IOCs found via quick static analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*7v_HIA-Ue9sGJOid--1Kjg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S6ZPDxMS_zHJz7QDBvSNwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FfukfehfMYUxhSxmZ_Vqzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*zxqxpeziJkcGQFvpQ_thgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*KzYHuMSsasZ2EFcNZZNjGA.png" /></figure><h3>IOCs:</h3><p><strong>Domains:</strong></p><ul><li>hxxps[://]www[.]phantomsoftwares[.]site/logo/phantom_discord[.]png</li><li>hxxps[://]wkhayejmtdnobpaoaeim[.]supabase[.]co/storage/v1/object/public/hfgfjjj/image[.]jpg?12711343</li><li>hxxps[://]firebasestorage[.]googleapis[.]com/v0/b/remasd-6c702[.]firebasestorage[.]app/o/image[.]jpg?alt=media&amp;token=20664d8b-9f51–4fc0–8439–3cca14ea7fc4</li><li>hxxps[://]fsm[.]s3[.]cubbit[.]eu/Ambro-Phantomupload[.]txt</li></ul><p><strong>Files:</strong></p><ul><li>AE774EEC9FC52E2D9A6C00401F0D18E2FB84CF5657091EA6A602F4A4E8099F57 — [image.jpg]</li><li>1DF8E1288BBB4410F5EA5C5742CF3FA111AF52C65652593DA1A15418D27D9019 — [DLL Downloaded]</li><li>921DCFB0E6E2149B472C369DE0FCC9DC983A0CFFEC32CEE1CA099EEA95EE5349 — [wrffite.bat]</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2b6fe2daa02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Analysis — Malicious JS in Cisco store to steal credit cards, credentials]]></title>
            <link>https://medium.com/@meerhmza0/malware-analysis-malicious-js-in-cisco-store-to-steal-credit-cards-credentials-6b0204dd6890?source=rss-a208def6e441------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b0204dd6890</guid>
            <dc:creator><![CDATA[Meer Hamza]]></dc:creator>
            <pubDate>Sat, 13 Dec 2025 21:47:31 GMT</pubDate>
            <atom:updated>2025-12-13T21:47:31.857Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware Analysis — Malicious JS in Cisco store to steal credit cards, credentials</h3><p>BleepingComputer has posted on September 4th, 2024 that hacker has injected the malicious JS code inside the Cisco store webpage to silently steal customer’s credit cards details and credentials.</p><p>Here I have made an attempt to de-obfuscate the JS code to understand how its working and what secrets are inside those obfuscated block of strings and code.</p><p>As per the BleepingComputer blog following code was injected into the Cisco store website and it is yet to be determined that how the javacsript landed on Cisco’s Store webpage but</p><blockquote>“BleepingComputer has been told by researchers who wish to remain anonymous that it appears to be a CosmicSting attack (CVE-2024–34102)”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CfVHydBY_d-_q4-eGzKq6Q.jpeg" /><figcaption><strong>Malicious JavaScript injected in the Cisco Store website</strong></figcaption></figure><p>In the above image the attacker tried to download another JS payload from a possible C2 domain. After assessing that URL another obfuscated JS payload has been found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8A4NAc3rk0yOQNXYIa8cQ.png" /><figcaption><strong>JS payload being fetched from attacker domain.</strong></figcaption></figure><p>After beautifying the code, it looks like as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4RgxSwwP_rDPYPrqcb54g.png" /><figcaption><strong>Beautified JS payload fetched from attacker domain.</strong></figcaption></figure><p>After declaring some global variables, there is a function named <strong>Zop</strong>. This function takes one argument and shuffles it up, join them back and return the resulted value. A possible deobfuscated function. The next line decodes a string and get its first 11 characters and store it in <strong>dvS </strong>variable. which is return a string value “constractor”.</p><p>So far I could figure it out “<strong><em>var YcL = Zop[dvS]” </em></strong>is assigning the constructor object of the function Zop. which means <strong>YcL </strong>should act like Zop function but as per my testing it does not. But luckily we dont need those to understand to deobfuscate the obfuscated code.</p><p>The first obfuscated string block stored in variable <strong>“Kik”. </strong>It was de-obfuscated to following chunk of code shown in below image. It utilize some arguments (JSON object) and perform some deofuscation process on them and return a value of “[Function (anonymous)]”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pbZGBuenXToQwor-NnDEkA.png" /><figcaption><strong>Arguments in deobfuscated function</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wScBPFDCf4fHT2hjjzjDIw.png" /><figcaption><strong>Value returned by de-obfuscated function</strong></figcaption></figure><p>Now lets move forward to the juicy part of the JS script. Lets de-obfuscate the second mysterious string block which appears to be another chunk of code stealing the sensitive informations and sending to back to attacker domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_4epj_zqrUiG2JDnVxcBg.png" /><figcaption><strong>De-obfuscated second big chunk of string</strong></figcaption></figure><p>After beautifying the de-obfucated code. It appears it contains group of functions to encrypt the data before sending it and we can also see some possible keys as well. The encryption used by the attacker is AES.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xnh8Y4my8SSW_3cgLEt50A.png" /><figcaption><strong>Encrypt and decrypt capabilities of JS code.</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_RSzeT3nslqHZcTIiZDtg.png" /><figcaption><strong>Encrypt and decrypt capabilities of JS code.</strong></figcaption></figure><p>There was another obfuscated string found which de-obfuscates to an array which conatins all the placeholder field/variable names and strings require to make the C2 function works without showing the actual values or IOCs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2e4t-Q-Ccg3Qy32LmNDgw.png" /><figcaption><strong>De-obfuscated array</strong></figcaption></figure><p>The following function get the require placeholders/fieldnames and specific values to initiate a POST request to the attacker domain on “hxxtps://app[.]rextensions[.]com/e/”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ghBfPwh9-yjcWFrmepAIg.png" /><figcaption><strong>Function that send data to hacker’s website.</strong></figcaption></figure><p>Following are the values of the array deobfuscated.</p><blockquote>field_pay<br>#authnetcim-cc-number<br>#authnetcim-cc-exp-month<br>#authnetcim-cc-exp-year<br>#authnetcim-cc-cid<br>undefined<br>location<br>test<br>checkout<br>:checked<br>is<br>#authnetcim<br>.payment-method._active button.action.primary.checkout:eq(0)<br>indexOf<br>className<br>click<br>change<br>forEach<br>addEventListener<br>add<br>classList<br>length<br>a<br>a2<br>n<br>cd<br>f<br>l<br>e<br>t<br>c<br>r<br>co<br>pc<br>host<br>nb<br>m<br>/<br>y<br>ps<br>userAgent<br>48ad02e382a04bf28291363e9172ca6559a8beb2<br>stringify<br>https://app.rextension.net/e/<br>main<br>guid<br>refer<br>POST<br>json<br>ajax<br>.billing-address-form input[name=’firstname’]<br>.billing-address-form input[name=’lastname’]<br>#customer-email<br>.billing-address-form input[name=’telephone’]<br>.billing-address-form input[name=’street[1]’]<br>.billing-address-form input[name=’street[0]’]<br>.billing-address-form select[name=’country_id’]<br>.billing-address-form input[name=’postcode’]<br>.billing-address-form input[name=’city’]<br>.billing-address-form input[name=’region’]<br>text<br>.billing-address-form select[name=’region_id’] option:selected<br>Magento_Checkout/js/model/quote<br>billingAddress<br>shippingAddress<br>firstname<br>lastname<br>email<br>telephone<br>city<br>regionCode<br>regionId<br>countryId<br>postcode<br>street</blockquote><p>From the look of it, attacker was trying to steal information related to billing address and payment card details including card number, CVV, and expiry date and sending it in a POST request to domain hxxps://app[.]rextension[.]net/e/.</p><p>That stolen information is sufficient to perform unaothorized transactions and steal money from users that use their credit cards on that Cisco Store website during the time of infection.</p><p><strong>IOCs:</strong></p><ul><li>hxxps://app[.]rextension[.]net/e/</li><li>hxxps://rextension.net/za/</li></ul><p><strong>References:</strong></p><ul><li><a href="https://www.bleepingcomputer.com/news/security/hackers-inject-malicious-js-in-cisco-store-to-steal-credit-cards-credentials/?s=08">https://www.bleepingcomputer.com/news/security/hackers-inject-malicious-js-in-cisco-store-to-steal-credit-cards-credentials/?s=08</a></li></ul><p><strong>Tools:</strong></p><ul><li><a href="https://www.programiz.com/javascript/online-compiler/">https://www.programiz.com/javascript/online-compiler/</a></li><li><a href="https://beautifier.io/">https://beautifier.io/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b0204dd6890" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is Submitting Links and URLs to Public Scanner Safe?]]></title>
            <link>https://medium.com/@meerhmza0/submitting-links-and-urls-to-public-scanner-41de1a538302?source=rss-a208def6e441------2</link>
            <guid isPermaLink="false">https://medium.com/p/41de1a538302</guid>
            <category><![CDATA[urlscan]]></category>
            <category><![CDATA[public-scanner]]></category>
            <category><![CDATA[security-risk]]></category>
            <category><![CDATA[url-analyzer]]></category>
            <category><![CDATA[url-analysis]]></category>
            <dc:creator><![CDATA[Meer Hamza]]></dc:creator>
            <pubDate>Sat, 10 Dec 2022 12:19:20 GMT</pubDate>
            <atom:updated>2022-12-10T12:34:59.760Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Guys!<br>Today I am going to discuss a security risk that I recently observed when an analyst was analyzing an AWS s3 pre-signed URL and he submitted it on urlscan.io for analysis.</p><p>urlscan.io is providing web-based sandbox services for URL scanning. It is doing its work very well and also it leaves the URL scan result public if you are using it for free, where one can easily search those results by signing up on urlscan.io. But the main issue resides where analysts without thinking simply submit the whole URL along with tokens, API keys, secrets, and in some cases, AWS s3 pre-signed URLs on urlscan.io.</p><blockquote><em>For the sake of </em><strong>ease and desmonstration</strong><em> I am only using </em><strong>urlscan.io</strong><em> but similar kind of results can be achieved by using any public scanner like </em><strong>Hybrid Analysis, VirusTotal</strong><em> etc that provide search function to view analysis reports/results.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ppf8YODW5UilSJHI9MNGpQ.jpeg" /></figure><h4>AWS S3 Pre-signed URLs:</h4><p>Let&#39;s start with the AWS s3 pre-signed URL. I got curious from the analyst’s activity that how many other analysts will also be doing the same. So, I came from work, signup on to urlscan.io, and start searching for AWS s3 pre-signed URLs and the results were surprising. Many people submitted signed s3 URLs to the urlscan.io with credentials.</p><blockquote><em>S3 bucket object owners can share objects with others by creating a </em><strong>pre-signed URL</strong><em>, using their own security credentials, to grant time-limited permission to download the objects.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BD362lPI3zSoewkCLd9PfA.png" /><figcaption>Stripe Invoices</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D2ZpgvsImY0PkeIMOUZ0-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*uKUNZmiEbf2TL1QxHCdTng.png" /></figure><p>In the above case, s3 pre-signed URL was still active and the file could be downloaded. Depending upon the data being shared It could lead to a disaster.</p><p>To avoid such situations always create the pre-signed URLs for a time limit as small as enough for downloading the object by the other person or destroy the pre-signed URL as soon as the intended person is done with downloading the object.</p><p>Second, analysts should not be submitting the URLs or Links directly to any public scanner. If you do use them remove confidential info like tokens, keys, etc. Prefer, using internal sandboxes like anomali or any other that your company offers.</p><h4>Password Reset Tokens:</h4><p>After that, I think let&#39;s look for the password reset URLs because usually companies block the emails that come from outside, and analysts have to analyze those before release. So, analysts probably will be submitting that onto the urlscan.io along with tokens and I was right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Eo10O-ANmxTS6l9rqX75g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wowlRWT-2kx4pbx1qwGnTw.png" /><figcaption>Password reset tokens search on urlscan.io</figcaption></figure><p>In the above search, I was looking for active reset tokens, unfortunately. I did not find any active tokens to demonstrate as those were old. But luckily urlscan.io take the picture of the website at the time of analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rq95D05lJwA4m-o_2F56MA.png" /></figure><p>As you can see, At the time this URL was submitted to the urlscan.io it was still active which means if you actively look for this kind of URL you will definitely find some and can set new passwords. No 0-day required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UTiORA30PQ8PD3VSbJ2-fA.png" /><figcaption>GoDaddy password reset URL</figcaption></figure><p>In the above image, someone submitted GoDaddy password reset URL. You can explore as much as you can like LastPass reset tokens, registrations tokens, etc. possibilities are endless.</p><p>One could say all these URLs are expired and it does not impose any threat but the point is these URLs are just not caught at right time by any person with malicious intent. Attackers can automate the process of newly submitted URLs via free API.</p><h4>Conclusion:</h4><p>Organizations should not allow the use of any public scanner (urlscan.io and hybrid analysis etc.) that leaves the data public and analysts should be very careful when submitting URLs or any other artifacts to such public scanners so that the artifact/URL is not containing any sensitive information.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41de1a538302" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Analysis — Injecting Macros via Remote Template]]></title>
            <link>https://medium.com/@meerhmza0/malware-analysis-injecting-macros-via-remote-template-3bff82aa4918?source=rss-a208def6e441------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bff82aa4918</guid>
            <category><![CDATA[document-templates]]></category>
            <category><![CDATA[remote-template-injection]]></category>
            <category><![CDATA[macro]]></category>
            <category><![CDATA[document-analysis]]></category>
            <category><![CDATA[vba-macros]]></category>
            <dc:creator><![CDATA[Meer Hamza]]></dc:creator>
            <pubDate>Mon, 09 May 2022 06:48:00 GMT</pubDate>
            <atom:updated>2022-05-09T06:48:00.519Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware Analysis — Injecting Macros via Remote Template</h3><p>As we know macros can be injected into microsoft office documents to perform different actions e.g Initial access, persistence, downloading malwares, and more apart from its legit usage. But macros can also be hidden and injected via templates into an innocent-looking word document and may deceive you to think that there are no macros in it while doing static analysis.</p><p>In this blog, I will not be covering traditional VBA or macros enabled document analysis but if you want to look into that stuff <a href="https://medium.com/u/6ab5377f1218">Muhammad Moiz Arshad</a> has already written a detailed blog on “<a href="https://medium.com/@m01z/dissecting-malicious-office-docs-a-quick-guide-3884732804e7"><em>Dissecting Malicious Office Docs: A Quick Guide</em></a>”.</p><h3>What are Macros ?</h3><p>Macros are actually code written in VBA (Visual Basic of Applications) language. That is embedded in microsoft office documents to automate different tasks and computational work. This feature is also abused by attackers and APT (Advanced Persistent Threat) groups to download and executed different commands and tools to achieve their malicious goals. VBA can be executed within office document via two different ways:</p><ul><li>Inject VBA/Macros directly via developer options</li><li>Inject VBA/Macros via templates</li></ul><p>we will discuss the<strong> Template Injection Technique</strong> here.</p><h3>How does Microsoft Word Template Injection works ?</h3><p>For template injection we first need to create the template with the following characteristics:</p><ul><li>Create a new empty document.</li><li>Inject macros/VBA code. (alt + F11)</li><li>Save the document as a Microsoft word template file with .dotm extension.</li></ul><p>All office document files are actually kind of zip files e.g docx, xlsx and pptx. One can change the extension to zip and unzip it or can directly open via tools like winrar or 7zip to extract files. Whenever we use prebuilt templates a file named ./word_rels/settings.xml.rels or ./word/_rels/settings.xml.rels is created within document files that contain the remote or local path to the template with extension <strong>.dotm</strong> that will be loaded upon opening the document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xvQzMnW-OChvki2e8Ofy9w.png" /><figcaption>settings.xml.rels</figcaption></figure><p>We can decompress the .docx file using 7zip and change the <strong><em>Target</em></strong> value in the <strong><em>settings.xml.rels</em></strong> file to load our desired template and again compressed it to .docx file.</p><blockquote>Remember Target does not need to be local it can be remote as well in that case we will see a URL in Target value e.g “target=https://domain.com/template.dotm”</blockquote><p>We have two files “legit.docx” and “malicious.dotm” (template file). As we will open the legit.docx it will load the template along with its macros and in result macros will get executed.</p><p>For complete detail and the weaponization process refer to this blog “<a href="https://www.ired.team/offensive-security/initial-access/phishing-with-ms-office/inject-macros-from-a-remote-dotm-template-docx-with-macros">Remote Template Injection</a>”.</p><h3>How to Analyze ?</h3><p>we can decompress the legit.docx file using 7zip and check thetemplate path or URL being loaded or downloaded in ./word_rels/settings.xml.rels or ./word/_rels/settings.xml.rels . OR we can use <strong>olevba </strong>tool from <a href="https://github.com/decalage2/oletools">oletools suite</a> to get the template URL or path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KcytRSMKb5nRvVxTii6NeA.png" /><figcaption>olevba result for legit.docx</figcaption></figure><p>Now the result only shows that a template is being injected into this document which is suspicious but we don’t know if it’s malicious or not. In the case of URL or IP (IP being used is very much suspicious), we may analyze those as well using different threat intel platforms.</p><p>We have to fetch or download the template whether it is local or remote for further analysis and run olevba against that template to see if it has macros embedded inside or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*JqdMYf5-eYqDL4CHBUqS9Q.png" /><figcaption>olevba result against malicious.dotm (template)</figcaption></figure><p>As we can see the vba code/macros embedded inside the template will get executed when we will open <strong>legit.docx. </strong>Now depending upon the VBA code we can analyze it further to find any IOCs or C2 or stage2 payloads being downloaded via macros.</p><h3><strong>Tools Used:</strong></h3><ul><li>7zip</li><li>olevba from oletools suite</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bff82aa4918" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[picoCTF — “Matryoshka doll” Hiding Data in Image within multipe layers]]></title>
            <link>https://medium.com/@meerhmza0/picoctf-matryoshka-doll-hiding-data-in-image-within-multipe-layers-5e864ca2318e?source=rss-a208def6e441------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e864ca2318e</guid>
            <category><![CDATA[matryoshka]]></category>
            <category><![CDATA[matryoshka-doll]]></category>
            <category><![CDATA[picoctf-2021]]></category>
            <category><![CDATA[picoctf]]></category>
            <dc:creator><![CDATA[Meer Hamza]]></dc:creator>
            <pubDate>Thu, 02 Dec 2021 03:57:33 GMT</pubDate>
            <atom:updated>2021-12-02T03:59:01.571Z</atom:updated>
            <content:encoded><![CDATA[<h3>picoCTF — “Matryoshka doll” Hidden Data in Image within multipe layers</h3><p>Steganography is the practice of concealing information within objects in such a way that it deceives the viewer as if there is no information hidden within the object.</p><h4>CTF Details:</h4><p>Matryoshka dolls are a set of wooden dolls of decreasing size placed one inside another. What’s the final one? <br>along with details an image file was provided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*eBsaECIylc9Zqv7Dw38qwg.png" /><figcaption>CTF_image_file</figcaption></figure><p>lets see whats we can find in the metadata. Metadata shows alot of unusual data values as binary data. Which could also be due to reason image being processed in adobe editing softwares.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*Be1GXPCQvQa1C_cF8uJ4kw.png" /><figcaption>Exiftool_result</figcaption></figure><p>Metadata is unusual but is there any file hidden within this image ? using foremost to find out and it resulted in a zip file. which contains an another image named “2_c.jpg” inside base_images folder. Yes !!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*8ESqCcxXxI1M6sfIoNABgg.png" /><figcaption>foremost_result</figcaption></figure><p>After opening the image “2_c.jpg” finds out thats the same image. what ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*yTCYdhpDV3y-CWUzXKht-A.png" /></figure><p>Again focusing on the details of CTF and got the point “Matryoshka dolls looks same but keep <strong><em>decreasing in size</em></strong> placed one inside another.” The size of first image was “594x1104”. Did second image decrease in size ? Yes !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*1gP8p8mIz3x6KG1-ocoiaQ.png" /><figcaption>2_c.jpg metadata</figcaption></figure><p>As second image has a decrease in size which means we are on the right track. Now all we need to keep repeating the same process untill we reach to the final file. Again using foremost to carv files from <strong>2_c.jpg</strong>.</p><p>After repeating the process 3 more times <strong>flag.txt</strong> file was extracted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*-b2rjkikeDqCrJxRfzGL4g.png" /></figure><blockquote>Keep Learning !!!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e864ca2318e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Digital Forensics — Investigating the lnk files]]></title>
            <link>https://medium.com/@meerhmza0/digital-forensics-investigating-the-lnk-files-bd52bf5a057?source=rss-a208def6e441------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd52bf5a057</guid>
            <category><![CDATA[lnk-file-artifacts]]></category>
            <category><![CDATA[lnk-files-analysis]]></category>
            <category><![CDATA[lnk-files]]></category>
            <category><![CDATA[forensisc-value-lnk-file]]></category>
            <category><![CDATA[reading-lnk-file]]></category>
            <dc:creator><![CDATA[Meer Hamza]]></dc:creator>
            <pubDate>Sat, 20 Nov 2021 04:52:08 GMT</pubDate>
            <atom:updated>2021-11-21T02:23:50.882Z</atom:updated>
            <content:encoded><![CDATA[<h3>Digital Forensics — Investigating lnk files</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*l6epwF4UZ3sqf0ZY7fPC7Q.jpeg" /></figure><p><strong>Lnk </strong>files are actually shortcut to an application or file and can be found in</p><p>→ User’s “Desktop” folder<br> [C:\Users\{ UserName }\Desktop]</p><p>→ User’s “Recent” folder<br>[ C:\Users\{UserName }\AppData\Roaming\Microsoft\Windows\Recent ]</p><p>There are two types of lnk files.<br> → System created<br> → User created</p><p>System created lnk files are created within the installation process of program. while user created lnk files are created by the user itself e.g shown in image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Q4qf-Pz-U5lhOSe3Tpk74A.png" /><figcaption>user_created_lnk_file</figcaption></figure><h4>Triage a system</h4><p>To prioritize the files and folders and achieving the investigation goal faster by narrowing down the investigation circle we will:<br> → Indentify “Recently” accessed files &amp; folders<br> → Use this information as starting point of search<br> → Know if external/removable media was connected to notable files</p><h4>File signature</h4><p>File signatures are important to recognize files while carving files from a memory dump. Following is the file signature for lnk files.<br> → L . . . [ look for the L ]<br> → 0x4c000000 [ Hex value ]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*cSzoV13gQ2qobA8uURo_rg.jpeg" /><figcaption>lnk_file_signature</figcaption></figure><h4>How and what information to extract ?</h4><p>Automated Tools extract all of necessary information for you but you can also find it in plaintext in hex tab of FTK imager after selecting a lnk file.</p><p>As lnk files hold the necessary information in plaintext all we need to know which information to extract.Well following information extracted from lnk files.<br> → Embeded MAC times<br> → Embeded linked file path<br> → Embeded volume names</p><p><strong>Embeded MAC times<br></strong>lnk files has embeded MAC times which is actually the created, modified and accessed time of the linked file not lnk file. As clear from the name created time is when the file first landed on the system either by downloading or being copied from another system, modified time is representing the time when linked file was modified and accessed time shows when file was accessed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*0iufmDAduY4HcinOrSDz7Q.png" /><figcaption>Embeded_Linked_file_times</figcaption></figure><p>That embeded time exist at offset 28. In above image first 8 bytes chunk is actually the create time &amp; date of the linked file. Similarly next 8 bytes represent the last modified time &amp; date and last highlighted 8 bytes show last accessed time &amp; date. when 8 bytes will be selected hex interpreter will show its value like its highlighted on left in above image.</p><p>There is another time in the properties tab of FTK imager which represents the created, modified and accessed time of lnk file itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*P-PGGAJ_KFTt3y884KYigQ.png" /><figcaption>lnk_file_times</figcaption></figure><p>lnk file accessed time will be updated when linked or lnk file will be accessed same will happen with modified time when linked or lnk file will be modified.</p><p><strong>Embeded file path<br></strong>Embeded file path shows the full path of linked file. All one has to do is just scroll down the content of lnk file and file path will be there in the plaintext just like shown in below image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*nr9dlHpNmQVVnX8-1q51Cg.png" /><figcaption>embeded_file_path</figcaption></figure><p><strong>Embeded volume names<br></strong>Embeded volume names actually shows either the linked file accessed or modified was on the system or any removable media. That volume name will appear just before the embeded file path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*XT9qNmxKpUHxGq9tMGS_Pw.png" /><figcaption>volume_name (credit:SDF)</figcaption></figure><h4>Forensics Value</h4><p>As we know how and what information to extract from the lnk files and next step is to investigate the lnk file artifacts. lnk file artifacts are mainly investigated to get the information about the programs that were accessed and modified on the affected system recently near the time of infection. While investigating lnk files one must be able to answer following questions.</p><p>→ When the file was accessed or modified recently ?<br> → Which files are from other partitions or from any removable media ?<br> → If linked file is deleted how long it remains on system ?<br> → Either any of the file linked to any malicious or suspicious file ?<br> → Either any of the lnk file contains any suspicious value in its embed file path ? e.g attackers can use the lnk file to download the malware by linking it to a crafted command.</p><h4>Tools</h4><p>→ Windows file analyzer [Free]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd52bf5a057" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Digital Forensics — Investigating Prefetch files]]></title>
            <link>https://medium.com/@meerhmza0/digital-forensics-investigating-prefetch-files-a26b187c3c0c?source=rss-a208def6e441------2</link>
            <guid isPermaLink="false">https://medium.com/p/a26b187c3c0c</guid>
            <category><![CDATA[prefetch-file-analysis]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[investigating-pf-files]]></category>
            <category><![CDATA[prefetch-files]]></category>
            <category><![CDATA[prefetch-investigation]]></category>
            <dc:creator><![CDATA[Meer Hamza]]></dc:creator>
            <pubDate>Thu, 18 Nov 2021 05:27:09 GMT</pubDate>
            <atom:updated>2021-11-20T04:10:03.834Z</atom:updated>
            <content:encoded><![CDATA[<h3>Digital Forensics — Investigating Prefetch files</h3><p>Prefetch files are created by windows with extension “.pf” when an application is run from a particular location for the very first time and located at “C:\windows\prefetch\*” .</p><p>Prefetch files contain the following information about the program that is run.<br> → Program path <br> → Run count<br> → Imported files (DLLs and other libraries)<br> → Created date, Accessed &amp; Modified Date<br> → Process name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdVCs9I04JNgPx1Xy1Qwkg.png" /><figcaption>WinPrefetchView_result</figcaption></figure><p>In the above image <a href="https://www.nirsoft.net/utils/win_prefetch_view.html">WinPrefetchView</a> tool is used to read the prefetch file. Where filename column contains the name of prefetch files , created time represents the time when file was first run, modified time shows the time when prefetch file was last modified, process name is the name process created for that program, run counter gives the count of program execution and proccess path is the full path of program that is executed. There is another section in WinPrefetchView which represents the files imported during program executation like DLLs and other libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W6PUZeHbfFMQRkYIFEqIKA.png" /><figcaption>Prefetch_imported_files</figcaption></figure><h4>Naming Syntax</h4><p>Prefetch files are created with the following syntax where program name is proceeding with a trailing hash which represents the path of program file and extension “.pf”.</p><p>program_name-Trailing_hash.pf | CMD.EXE-3DE31D4B.pf</p><blockquote>If same program will be moved to another location/directory/path and run again. It will create a new entry in prefetch folder with new unique trailing hash.</blockquote><h4>File Signatures</h4><p>File signatures are important to recognize files while carving files from a memory dump. Prefetch file signatures are different in windows 10 as compared to the previous versions of windows. Following are the file signatures for different OS versions of windows.</p><p>Windows 10 : MAM | SCCA<br>Windows 8 : SCCA<br>Windows Vista : SCCA<br>Windows XP &amp; 2003 : SCCA</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*sOFKScUfLOcLOTpxy5IuTw.png" /><figcaption>Prefetch_file_signature (windows 10)</figcaption></figure><p>Prefetch files are readable in windows 8, Vista , XP and 2003 because they are little obfuscated which can be deofuscated easily. While in windows 10 prefetch files are compressed which are not readable like in above image and has different signature. In this situation we use different tools to read the prefetch file and the information it holds.</p><h4>Registry Key</h4><p>Registry key for prefetch files is :<br><strong>[+]</strong> HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters</p><p>It only provides the information that either prefetch files are enabled or not. In Windows OS these are bydefault enabled so you will see “0x3” value set against “EnablePrefetcher”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*TTQBqNmnxB7Mc0U_MnT7sw.png" /></figure><h4>Forensics Value</h4><p>As we know how and what kind of information a prefetch file can provide. Now lets move towards the investigation part of prefetch files. Prefetch artifacts are mainly investigate to get the information about the programs that were executed on the affected system near the time of infection. We must atleast have anwsers to the following questions while analyzing the prefetch artifacts.</p><p>→ Either program was executed from other than its default location ? like cmd.exe executed from Temp folder.<br> → Either program that was executed still on the system or deleted ? How long it live on the system ? (prefetch files remains on system even executed file get deleted)<br>→ Which program user often used ? (by analyzing the run counts)<br>→ Which programs executed from other partition or suspicious location like temp folder which attackers often use to execute malicious programs ?<br>→ Either program imported any malicious DLL or other file ? what is it’s path ?</p><p>We can also create a beautiful timeline using the created , modified and accessed time to map the activities near infection time and narrow down the investigation circle. There are also some free tools like <a href="https://github.com/orlikoski/CDQR">CDQR </a>which do it for you</p><h4>Tools</h4><p>Following open source tools can be used for analyzing the prefetch artifacts:<br> → WinPrefetchView<br> → CDQR<br> → Windows-Prefetch-Parser<br> → FTK Imager<br> → RegRipper</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a26b187c3c0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>