<?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 thebee0x on Medium]]></title>
        <description><![CDATA[Stories by thebee0x on Medium]]></description>
        <link>https://medium.com/@besioo?source=rss-a4ad5a7f80de------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SEbNhFsKd2YBAf4R</url>
            <title>Stories by thebee0x on Medium</title>
            <link>https://medium.com/@besioo?source=rss-a4ad5a7f80de------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:23:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@besioo/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[Recon Methods To Expand Your Attack Service (Using SSL Certificates)]]></title>
            <link>https://medium.com/@besioo/recon-methods-to-expand-your-attack-service-using-ssl-certificates-87524179307e?source=rss-a4ad5a7f80de------2</link>
            <guid isPermaLink="false">https://medium.com/p/87524179307e</guid>
            <category><![CDATA[bugbounty-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[thebee0x]]></dc:creator>
            <pubDate>Sat, 30 Nov 2024 09:08:01 GMT</pubDate>
            <atom:updated>2024-11-30T12:16:01.847Z</atom:updated>
            <content:encoded><![CDATA[<h3>Recon Methods To Expand Your Attack Surface (Using SSL Certificates)</h3><h3>بِسْمِ اللَّـهِ الرَّحْمَـٰنِ الرَّحِيمِ</h3><h3>Intro</h3><p>In recon, a key focus is asset enumeration—collecting as many of a company’s assets as possible. The more assets you gather, the higher your chances of discovering potential vulnerabilities and bugs.</p><p>Subdomains are often the gateway to a company’s hidden assets. By thoroughly enumerating subdomains, you increase your chances of discovering valuable entry points and potential vulnerabilities.</p><h3>SSL Certificate</h3><p>SSL certificates secure communication by verifying a server’s identity and include fields like the <strong>Common Name (CN)</strong> and <strong>Subject Alternative Name (SAN)</strong>. The CN usually lists the primary domain, while the SAN can cover multiple domains or subdomains, sometimes using wildcards (e.g., *.example.com).</p><h3><strong>Using SSL Certificate Data to Find More Assets</strong></h3><p>After performing a normal subdomain enumeration process, I usually use some methods to expand my attack service.</p><h4><strong>Discover Wildcard Subdomains</strong></h4><p>A common method is to pass the discovered subdomains to a subdomain enumeration tool (such as Subfinder). While this may seem like a good idea, it can often be noisy, leading to unuseful results.</p><p>Another method I see as more effective is to use SSL certificate data for those subdomains to discover wildcards within this domain.</p><p><strong>First</strong>, you enumerate subdomains for <strong>comcast.com</strong> as an example with the following command:</p><pre>subfinder -d comcast.com -all -o comcast.com.subs</pre><p><strong>Second, </strong>Grab the SSL certificate data (SAN, CN) with the <strong>nuclei</strong> template <strong>ssl-dns-names.</strong></p><pre>cat comcast.com.subs | nuclei -id ssl-dns-names -o comcast.com.subs.ssl</pre><p>Now, We need to find a <strong>wildcard subdomains</strong> in the output:</p><pre>cat comcast.com.subs.ssl | cut -d &quot; &quot; -f 5 | sed &#39;s/\[//&#39; | sed &#39;s/\]//&#39; | tr &quot;,&quot; &quot;\n&quot;  | tr -d &quot;\&quot;&quot; | grep -I &quot;comcast.com$&quot; | grep &quot;*&quot;  | sort | uniq</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tfRAXaFHfyDCtIWM-pZcQ.png" /></figure><p>To broaden your search, you can treat patterns like *.xap.comcast.com as separate domains. Use subdomain enumeration tools or DNS fuzzing techniques to uncover additional related subdomains.</p><h4><strong>Bruteforce Virtualhosts Within IPs With Wildcard Common Name</strong></h4><p>To identify virtual hosts behind an IP with wildcard subdomains:</p><p><strong>First</strong>, translate all discovered subdomains to their corresponding IPs.</p><pre>cat comcast.com.subs | dnsx -a -resp-only | anew ips.txt</pre><p><strong>Then</strong>, extract SSL certificate data from these IPs, Focus on IPs that serve wildcard subdomains, as they are likely to host multiple virtual hosts.</p><pre>cat ips.txt | nuclei -id ssl-dns-names | anew ips.ssl.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1W1T2Yb-31qSsESM8VZJA.png" /></figure><p>Look for a wildcard pattern in the output, something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1TpJM777NbGXbAsm6knilQ.png" /></figure><p>Note that xfinity.com and comcat.com are within the scope.</p><p><strong>Finally</strong>, brute force the Host header using a list of potential domain names to uncover unique virtual hosts and configurations. This method can help expose hidden services or assets.</p><pre>ffuf -u https://162.150.57.78:443 -H &quot;Host: FUZZ.aws-np.identity.xfinity.com&quot; -w ~/wordlists/2m-subdomains.txt -mc all -c -ac</pre><p>Another source you can look for wildcard subdomains is <strong>crt.sh</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUpQA_YatTZ2-iALLp73lw.png" /></figure><p>Thanks For Reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87524179307e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[phpminiadmin.php LFI leads to FULL DB access]]></title>
            <link>https://medium.com/@besioo/phpminiadmin-php-lfi-leads-to-full-db-access-8f4054fb8f07?source=rss-a4ad5a7f80de------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f4054fb8f07</guid>
            <dc:creator><![CDATA[thebee0x]]></dc:creator>
            <pubDate>Tue, 14 May 2024 19:08:28 GMT</pubDate>
            <atom:updated>2024-07-12T07:08:39.431Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploiting DB Manager (phpminiadmin.php) To Get LFI</h3><h3>بِسْمِ اللَّـهِ الرَّحْمَـٰنِ الرَّحِيمِ</h3><h3>Intro</h3><p>Websites have different options to manage their DB through GUI, one of the most common options that PHP apps use is phpMyAdmin.</p><p>Our target was using another option, which is a single script called phpminiadmin.php.</p><h3>What is phpminiadmin.php?</h3><p><strong><em>phpminiadmin</em></strong> — an extremely lightweight alternative to heavy phpMyAdmin, a standalone PHP script for quick and easy access to MySQL databases via the web interface.</p><p>This is the Github repo for this script <a href="https://github.com/osalabs/phpminiadmin">https://github.com/osalabs/phpminiadmin</a></p><p>Also, there is a default projectdiscovery nuclei template to detect this script.</p><p><a href="https://github.com/projectdiscovery/nuclei-templates/blob/fc23e21aabb1f48b86b8dc8a444beeabe492a668/http/exposed-panels/phpminiadmin-panel.yaml#L4">nuclei-templates/http/exposed-panels/phpminiadmin-panel.yaml at fc23e21aabb1f48b86b8dc8a444beeabe492a668 · projectdiscovery/nuclei-templates</a></p><h3>Bug Story</h3><p>It was a Bugcrowd public target assuming it was <a href="http://test.com/">test.com</a>, this target has a subdomain called <a href="http://partner.test.com/">partner.test.com</a> that uses PHP technology.</p><p>I started to fuzz the subdomain for interesting files or directories I found a phpminiadmin.php script.</p><p>I started to take a look at this file via the browser and that is what I got</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M1co4zuwHpvnUz0xjFB4dQ.png" /></figure><p>For me, it seemed to be a file to connect to the DB, and what I found was interesting that there an advanced options that get me additional fields</p><p>It seems that there are two options to connect to the SQL server, The first is to connect to the server configured in the script and this requires a username and password, the second option is to connect to another SQL Server that you control.</p><p>Now, I want to test if the script will connect to whatever server host i provide, so I added Burp Collaborator in the MySQL host field and clicked the Apply button and I got an interaction to my collaborator.</p><p>What I will do now is set my public SQL server and try to connect from this script, so I started to search for public and free SQL service providers and i found this website</p><p><a href="http://freemysqlhosting.net/"><strong>freemysqlhosting.net</strong></a></p><p>Sign up at this website, set up your SQL server and you will get your SQL server info in your email</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oyGq9vc32QvI_ZA6czEriQ.png" /></figure><p>Now let’s make the script connect to our new SQL server and see i we can get access to this MySQL service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WwXmGCwy2WjiudEweb6sSg.png" /></figure><p>And now we are connected 🙂</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQxiRHr38sawPycWEAseWw.png" /></figure><h3>Now, It’s LFI Time</h3><p>MySQL can read or write files from the client and send them to server tables, so what we will do now is try to load the content of <strong><em>/etc/passwd</em></strong> into a table that we will call test</p><p>Note that you should create the table first.</p><pre>load data local infile &quot;/etc/passwd&quot; into table test FIELDS TERMINATED BY &#39;\\n&#39;;</pre><p>Then, get the content of the test table by running this query</p><pre>select * from test;</pre><p>I was able to load the content of the <strong><em>/etc/passwd</em></strong> file into the table test and read the content of the file</p><p>Now, it has a high impact but I was looking for more impact, so I tried to exploit the LFI to read the application source code, but if we want to read the application source code we first should identify the root path for the web application.</p><h3>DB access</h3><p>If you note in the previous image, you will see a link to a phpinfo page embedded in the phpminiadmin script, but you should be authenticated to access the PHP info.</p><p>I accessed the phpinfo and what I was looking for is the DOCUEMNT_ROOT variable which is the base web application directory, Sorry, I can’t share it with you because it&#39;s a target target-related info.</p><p>I tried to read the index.php file and it succeeded, so I was thinking of more sensitive files on the server that I can access.</p><p>Some of the output of my fuzzing was an <strong><em>/admin/</em></strong> directory that contains a config.php file within it, it is a very interesting file, as I did in <strong><em>/etc/passwd</em></strong>, I will add the content of <strong><em>admin/config.php</em></strong> to test table.</p><p>Running this SQli</p><pre>load data local infile &quot;DOCUEMNT_ROOT/admin/config.php&quot; into table test FIELDS TERMINATED BY &#39;\\n&#39;;</pre><p>And this was the content of config.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wfook0X-BkewUHGeT1GYGg.png" /></figure><p>The config.php file includes some other configuration files in the server, the very interesting one was <strong><em>config_prod.php</em></strong> which contains MySQL server credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9KWpKkXbTfCgmyVTz32ug.png" /></figure><p>It was not a public host, so I used the phpminiadmin again to connect but this time to the app SQL server and I got full DB access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1fOXHsTksmompgOeGRlcZQ.png" /></figure><p>It was a huge DB and contains very sensitive information 🙂</p><p>Thank you for reading and hope you learned something.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f4054fb8f07" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>