<?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 dj4m on Medium]]></title>
        <description><![CDATA[Stories by dj4m on Medium]]></description>
        <link>https://medium.com/@dj4msec?source=rss-1d765f9633b4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XH-DqzFiCzHbnyTqrbvwVg.png</url>
            <title>Stories by dj4m on Medium</title>
            <link>https://medium.com/@dj4msec?source=rss-1d765f9633b4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:06:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dj4msec/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[SoSimple]]></title>
            <link>https://medium.com/@dj4msec/sosimple-4e1fca70cbb8?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e1fca70cbb8</guid>
            <category><![CDATA[sosimple]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[play]]></category>
            <category><![CDATA[offsec]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Sat, 20 Dec 2025 15:06:01 GMT</pubDate>
            <atom:updated>2025-12-20T15:06:01.208Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>This machine initial access is based on enumeration of wordpress and identifying a public exploit for deprecated plugin version this leads to initial shell access. with shell access the user can move laterally to second user by locating sensitive access file. from the second user sensitive permission can lead to access to third user and almost the same thing that lead eventually from this last user to root.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*01h6BS3F0wGwp9LZA-CJbQ.png" /></figure><h3>Enuemration</h3><p>Only SSH and HTTP services are present so let’s start looking at HTTP since SSH is rarely vulnerable</p><p>A quick look at the website shows only and image on the main page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N2bp3ra4j9t1MQOV1Czh_Q.png" /></figure><p>I will try to find any other page or directories on this website, to do that I will run a directory/file bruteforce</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*8em73ZEAP9ASL8-iRtIISg.png" /></figure><p>as Showing above I was able to identify a wordpress website, looking at it I also identified a user “admin”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*vruX7pnUm4EohPUITYRB8w.png" /></figure><p>Let’s run WPscan and see what we can find more</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*tdVDMfVqZ2cGRN3meoCy8Q.png" /></figure><p>this scan identified another user “max”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*Tx4kwf-cqygrPesg-dQD4w.png" /></figure><h3>Foothold</h3><p>With only usernames found I go for password bruteforce and starting with user “max” I use WPscan again to do the attack</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*-wsS0IfkV2raQcyDvFJxpA.png" /></figure><p>This leads to the user password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*grXNVlS4f6x17cskG-5MqQ.png" /></figure><h3>Initial Access</h3><p>Using the identified credentials for user “max” I can now login to wordpress so let’s see if we can elevate this to shell access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*Qy9U01bYxXegXb0WXdMp4A.png" /></figure><p>This did not show an obvious path to escalate since the user is not admin but looking back at WPscan results I see this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*vdQWCfjhgq6RsQsXDcSv3g.png" /></figure><p>which leads to this page showing a plugin that exists on the server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8guDdXoc-5CHhi-27z9-Q.png" /></figure><p>this pluging seems to be vulnerable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*AysBw_vI0EHQxGn5nufaug.png" /></figure><p>so I will try these exploits but again without success, so I fall back to the other WPscan finding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*Ljka8j_sYeKQZ6snJ5qIqg.png" /></figure><p>this plugin also have exploits on searchsploit which successfully worked to get rev shell after fixing the URL and attacker IP in the script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*-m7Rl1Vv5ZYI41qg2Aj3jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*xsj9gYujzHxDf7nekqrd_w.png" /></figure><p>from user www-data I was able to get local.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*unmCKH24shih6zJCCcoskQ.png" /></figure><h3>Privilege Escalation</h3><p>I was able to find the SSH id_rsa key for user max</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*1GcJanm9r3ySV2OGBomLqw.png" /></figure><p>this let me login with this user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*XnkgnSVXI56FNx6I1-rPGA.png" /></figure><p>now from this user I find steven can run service command with sudo so let’s see how this is exploitable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*xSiQRlKP5bO0zlm_73MwVg.png" /></figure><p>I can find that on GTFObins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*Y9Xs7pHmbxUaOs4TFyhtTg.png" /></figure><p>So with that I can move to user steven</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*KD4-WWkpify5mgzafsPwqA.png" /></figure><p>the executable that steven can run with sudo does not exist but steven have permission to write the parent directory so I can just create the script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*hdJDowGm_5hX4gsIFRmvoA.png" /></figure><p>doing just that I was able to get shell as root and get the last flag proof.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*T95tlNjA24GziJhjg8403g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e1fca70cbb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunter]]></title>
            <link>https://medium.com/@dj4msec/hunter-1877e0dfc29f?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1877e0dfc29f</guid>
            <category><![CDATA[time-based-enumeration]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[hack-smarter]]></category>
            <category><![CDATA[hunter]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Sun, 14 Dec 2025 13:02:21 GMT</pubDate>
            <atom:updated>2025-12-14T13:02:21.062Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>We start this machine with a list of usernames gathered in an assumed previous OSINT process. The goal is to identify the username that exists on the web app. (not shell access, the goal is just to find the user)</p><p>The pages identified o the web app are login/reset password pages but they did not show any useful feedback for identifying users. but the poor design of the app made it possible to identify the user based on response time(time based enumeration). to better understand this the attacker should have a good understanding of the execution path concept</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*UFCheY_RsDJMbL-JvzrSqw.png" /></figure><h3>Enumeration</h3><p>The machine description mentions that we need to identify the valid user for the web app as foothold</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*Qu2cXYI2377jO9Joo4kT6A.png" /></figure><p>Looking at the web app first thing I see is a login and a password reset pages, so I start by testing these pages behavior with random usernames to see if they show any feedback regarding the random username I use.</p><p>The login page did not show any feedback if the username exist or not or even regarding the login try it just stays on the same page without any feedback</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*fU7O_1GXy8XQmXNcsINDrQ.png" /></figure><p>The reset page showed a feedback message but this message does not give any indication if the username exists or not</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*mFGJgAKLvX6gezhSCoML5Q.png" /></figure><p>Before I go any further I will run a quick dir bruteforce to make sure I’m not missing any endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*fwE72PNw-hYPHqcB_7SpSg.png" /></figure><p>As showing above there is only the 2 endpoints that we saw before identified by the dir bruteforce attack.</p><p>This kind of push me towards what I was already thinking, a time based enumeration, even tho no obvious feedback is given by both pages, the web app can still give us some indication whether the username exist or not. Think of it this way, and lets consider the reset password page to make this easier to understand, when we submit a reset request the application checks if user exist, if the user exist it will generate and reset link and send it by email to user, but if the user does not exist it just skips all that. this should reflect in processing time of the request and eventually response time, if the app is poorly designed. same thing applies to login if the login process split the user validation into user validation then password validation(not both at same time). to verify this I will run a FUZZ attack with the username list from OSINT and analyse the responses timing to see if any take longer.</p><h3>Foothold</h3><p>First I copy the password reset post request from Burp and dump it in to a reset.req file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*JGitVAHc4ohOz8iTbjrD0Q.png" /></figure><p>then I pass that request to ffuf with the usernames file as wordlist and use burp as proxy to keep track of the requests</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*_JqSVurOsjZUMolaL_O5BQ.png" /></figure><p>And even before I check burp I can see that one request took much longer then the rest !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*61QQcIcxzl7dOjSI9VLv2Q.png" /></figure><p>also visible on burp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*P7MbzUv8zSr_LgK-1hLuDw.png" /></figure><p>well hi joey !</p><h3>Fix</h3><p>This enumeration path can be fixed simply by rendering the response page before processing the password reset request. an option would be the add the reset request to processing queue and sending the response, this way all HTTP responses would have similar timing as the execution path from HTTP request to HTTP response would be the same if the username exist or not. and there queue then can be processed in isolation from HTTP without any time reflection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1877e0dfc29f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loly]]></title>
            <link>https://medium.com/@dj4msec/loly-4095d48fdc28?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4095d48fdc28</guid>
            <category><![CDATA[loly]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[play]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[offsec]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 16:44:32 GMT</pubDate>
            <atom:updated>2025-11-27T16:44:32.875Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>This machine start by identifying a wordpress endpoint, enumerating users and bruteforcing the password, from there attacker can achieve shell access exploiting file upload feature. With access to the target the attacker can move to other system user and then get root access by identifying and exploiting kernel vulnerability.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*snWDg7L6L-Qukfh11lpOwA.png" /></figure><h3>Enumeration</h3><p>Nmap only shows a HTTP service on port 80 and looking at it It does not show much just the index page for nginx server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*3H2zvfjhUDL8lgKqGnGQuA.png" /></figure><p>If anything else is present it should be rendered on a separate path or vhost so I will start by a directory/file fuzzing to try and find that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*fjWrhdrwwWDQBRzdOTFYNg.png" /></figure><p>This leads to wordpress endpoint that does a redirect so let’s check that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*7YTKTNQs6mn5MrUPCDD5cQ.png" /></figure><p>No I have some content wot work with but the rendering is still broken, this usually happens when the referred files(CSS, javascript etc) are not properly loaded, the most common reason for that is that the page refer these files with a host name that our system does not know, and we can see that in the page source</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*lMABfab4fYC_znEvFNTY4A.png" /></figure><p>To fix that I just need to add loly.lc to my /etc/hosts file so the system can resolve the hostname to the target IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*cMpRgzxBfP8dGTjWoRX-xA.png" /></figure><p>Once that is done the wordpress website should render properly on the browser and any other tools for crowling should be able to do their job properly since the host is known now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*5bk6T7kX5DGuxosvUqHu7Q.png" /></figure><p>From the screenshot above I can identify user loly already the user who published the “Hello World!” post</p><p>I run wpscan to see if any thing interesting is identified but the only interesting path were authenticated attacks.</p><h3>Foothold</h3><p>Since interesting paths are authenticated I will try to bruteforce the identified user’s password, for wordpress I can use wpscan tool instead of hydra as it should be more adapted for wordpress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*ks7SY3632XVhuR3M97dHkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*W7fmRVefKMm-ebi_sPj21A.png" /></figure><p>so now I have access to this user and I can understand from the message indicated bellow that the user is wordpress administrator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*OAAe84jCsGazLfZoIA_FYQ.png" /></figure><h3>Initial Access</h3><p>As wordpress administrator the usual path is injeccting php either as web shell or reverse shell depending on what is available so let’s see what we can do here.</p><p>I was able to find a file upload feature under adrotate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y5WbFh3SU1tVrkpU2KkLMg.png" /></figure><p>This does not allow to upload php files but since it allows zip files it probably handle unzipping the uploaded zip so I can use that to upload a zipped PHP then access it as raw PHP file. Trying that I uploaded my web shell file after creating the zip archeive</p><p><a href="https://github.com/dj4msec/Pentest/blob/main/web_shell/webTerminal.php">Pentest/web_shell/webTerminal.php at main · dj4msec/Pentest</a></p><p>then I tried accessing under /banners which did not work at first but a quick search solved the problem the path was /wp-content/banners</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*djQc9PvC0xP8dU0FewKYHw.png" /></figure><p>Now I have a web shell where I can run commands on the system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lp9YBHpLvy_a7hllS0BOLw.png" /></figure><p>I leverage that to a rev shell, I like having a web shell as first step because I can always use it to trigger as many rev shells as I need</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0zk83SSX9cHpglcXM9-P1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*S99mmLRDcy6I0LrOhNCTUQ.png" /></figure><p>through the rev shell I upgrade through python to have a better shell then I just get local.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*2n-V4XGi3u3f3CJpb_6G2w.png" /></figure><h3>Privilege Escalation</h3><p>Looking through wordpress file I was able to find credentials in config file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*6pwTZ8YvJDIcY29EtYqUhA.png" /></figure><p>and checking /etc/passwd I could identify the user on the system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*1pG3uV2BJR20anBJYM9ZiQ.png" /></figure><p>Using that I was able to move to usr loly which was part of different groups</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*f18Ja-ulA-GPeU5bnU1eAg.png" /></figure><p>At this point manual enumeration did not lead anywhere so I fall back to linpeas which showed a bunch of paths</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_Z2jDdhnutnLXjfyBVVwQ.png" /></figure><p>I was able to use the first listed exploit to get root access and drop the proof.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*uwbmfLiuZoVYUphuBJhZHQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4095d48fdc28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JuiceShop — Score Board]]></title>
            <link>https://medium.com/@dj4msec/juiceshop-score-board-11e0df3618ed?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/11e0df3618ed</guid>
            <category><![CDATA[owasp-juice-shop]]></category>
            <category><![CDATA[juice-shop]]></category>
            <category><![CDATA[scoreboard]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 14:10:12 GMT</pubDate>
            <atom:updated>2025-11-26T14:10:12.671Z</atom:updated>
            <content:encoded><![CDATA[<h3>JuiceShop — Score Board</h3><h3>Context</h3><p>I have juiceshop running locally through docker and first step is to find the hidden score board</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*zBiWNerEkmXaH4KUI8VD1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*Fx-xSitc1CgH4MXH1eCcSw.png" /></figure><h3>Foothold</h3><p>First let’s check what frontend technology is used</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*0_rBZ86qRrSMLwJBo37F4g.png" /></figure><p>With angular or any javascript based tech the rendered frontend is a havoc of javascript files.</p><p>To be able to manage that I use go spider and katana to parse for URLs and use burpsuite to keep a history of all requests</p><h3>Enumeration</h3><p>First i run katana</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*2hdxdEdEPVF2pgZCGTUILw.png" /></figure><p>then I run gospider to make sure I am catching as much data as possible (gospider cannot resolve localhost so I go with the IP 127.0.0.1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*qSSyjYnYDThiTqDq2rnvsg.png" /></figure><p>now I use burpsuite to filter all the caught requests, just make sure to remove js files from the the excluded list ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZwgajDlY6i6IMaI8gBuLA.png" /></figure><p>this leave me with a few requests to look at.</p><p>I can see the /score-board endpoint but that was just rendering the index page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osdVMRkmpk_iBTyK7P83EQ.png" /></figure><p>so why is that endpoint there ? what is wrong with the url ?</p><p>I try to visit <a href="http://localhost:3000/#/score-board">http://localhost:3000/#/score-board</a> and that worked I found the scoreboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2zZI5ujyMzJxzgfWEyQIQ.png" /></figure><p>This means the app routing is using a custom logic that adds that /#/ part to URLs for proper parsing (for certain endpoints at least)</p><p>Note : running Katana and gospider might automatically solve a couple of other challeges but that can be reset by deleting the cookies + restarting docker</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11e0df3618ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My-CMSMS]]></title>
            <link>https://medium.com/@dj4msec/my-cmsms-581e2d8c23aa?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/581e2d8c23aa</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[play]]></category>
            <category><![CDATA[my-cmsms]]></category>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Tue, 25 Nov 2025 15:38:08 GMT</pubDate>
            <atom:updated>2025-11-25T15:38:08.142Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>This machine exposes root access to mysql database with dummy password, which leads to access to web app as admin. The admin can exploit an RCE on the web application leading to initial access.</p><p>With proper post enumeration attacker can move laterally to second user with exploitatbe sudo permission that leads to root access.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*kKcsCDGLbwlK145nr_LBow.png" /></figure><h3>Enumeration</h3><p>As soon as I saw the mysql_native_password plugin on mysql I had a feeling that mysql is misconfigured and not hardened anough as this is a depricated plugin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*YWA8EDWdsOrQ5AfCpkOC-g.png" /></figure><p>so I went straight to mysql and tried a basic password for root user that actually worked I was able to authenticate to mysql with root:root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*tf4I2f-k7dD2bI4RMcK1Zw.png" /></figure><p>the credentials root:root seems to be a common case for easy access because it is assumed that mysql would be configured to only accept root authentication coming from localhost but as we see here it is not the case.</p><p>So let’s see what we could find on the DB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I98dx85cpYcxxoI8yQmqKA.png" /></figure><p>I already have the username and hashed password for admin user of the web app, so let’s take a look at the web app to get some context</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xy9UlzIYrIEAIr-BdE_3RA.png" /></figure><p>Let’s see what URL are exposed in the page source, since we have admin credentials I focus on finding the admin URLs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*93o4N2u8qlKFmEU-w4T71w.png" /></figure><p>visiting the URL indicated redirects to the administrator login page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*8J1zOgkF1gpLo31dVFBk_g.png" /></figure><h3>Foothold</h3><p>At this point I have admin credentials with the hashed password and I found the admin login page so I tried to crack the password hash but that did not work :/</p><p>Not a problem since I have root access to database so I can just overwrite the existing password with my own generated hash and use that to gain access to the web app.</p><p>First i generate a password hash</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*1J5Fv_16_yQ1Nx1p07GkhQ.png" /></figure><p>the update the users table with this hash replacing the one I could not crack</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHZdQel6mufllDrsfPhrZA.png" /></figure><p>this did not work so I went digging the app cmsms source code to figure how the password is set and I was able to retrace the function setpassword in class User</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*pQQNiRmFBeUFP6xlGkFv8Q.png" /></figure><p>this shows that If preference is set the password for user is concatenated to a sitemask, in other words the hash in DB would be a and md5 hash for “sitemaskpassword” not just “password”</p><p>I went back to database to find the sitemask</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*GVE4KXbM_19cMrD6SdRWqw.png" /></figure><p>and now I can generate a proper password !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*zboRXz6StqMxVoO_jVqkSA.png" /></figure><p>I update the DB again to set this password for user admin and now I was able to login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*DBc_CXYSZB1H968hw3QZ4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrEvMuE34tJWkGFK3nyAVA.png" /></figure><p>Now I need to leverage that to a shell access to the target</p><h3>Initial Access</h3><p>Analyzing the different features on the admin side of the website I was able to find that user defined tags extension let me run php code server side so I used that to inject a php rev shell payload and use the run button to execute it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-zWDeIXgl6xhbZ5UgGShg.png" /></figure><p>this resulted in shell access as user www-data with access to local.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*NLqdZH-yOjST9LS7yKgWKg.png" /></figure><h3>Privilege Escalation</h3><p>Looking at SUID executables this files looks interesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*FILGv8MP7WlIi0pfZO_Q0g.png" /></figure><p>I could not exploit this file tho so I kept looking futher and I was ble to find some encoded secret here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*hP4-yn46ptNnEAu8vi1-Dw.png" /></figure><p>Different online tools can be used to identify the encryption</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*ken3C_E42erl4gEz-OW3Pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*g2o2LK5TR7oWnkmD-0MW6Q.png" /></figure><p>So I used that to access the user armour which had permission to run python as sudo without password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*vl__q0WZ7PjlpaeEL2qd0g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=581e2d8c23aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assertion101]]></title>
            <link>https://medium.com/@dj4msec/assertion101-bb1b79a8fd05?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb1b79a8fd05</guid>
            <category><![CDATA[play]]></category>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[assertion101]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 16:16:52 GMT</pubDate>
            <atom:updated>2025-11-23T16:16:52.241Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>Starting by enumerating the web service on the target machine, the attacker can identify a potential LFI attack vector, enumerating this feature the attacker can break the code. To achieve injection attacker should try to build a payload that fixed the code while using the input that initially breaks the syntax. Doing so leads to identifying and RCE injection that leads to shell user access on the target.</p><p>To achieve root access a SUID executable can be identified and easily exploited with a public POC available.</p><p>Lesson learned : to identify injection break the code, to achieve injection fix the code while using the payload that broke it.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*_-3gRruYEwcHLwXXzHW8jg.png" /></figure><h3>Enumeration</h3><p>We have a Fitness website on WEB service (port 80)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*QD82UxnGIeX8M3gE7vC8Rg.png" /></figure><p>hosted on Ubuntu apache server based on wappalyzer output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*kTB4NEzB-KE9tADCgRm81A.png" /></figure><p>I still need more information so I go with katana to have a look at URL existing on the web app</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*dAq2XN4fcCz5PK1bQSZRCw.png" /></figure><p>this showed me the app is PHP based and index.php file have a parameter “page” which can be used to load other pages -&gt; potential for injection that can lead to LFI (Local File Inclusion) and reading system files.</p><p>To make sure I am not missing anything now I go for a web bruteforce attack on the root URI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*mHzUuvjYpOisKeD_E9M5hA.png" /></figure><p>And then on the page parameter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*-_imUACfpT9LyB1Pl0BrnQ.png" /></figure><p>since the fuzzing on page parameter did not return any .php results it means that the logic in index.php is probably appending .php to the parameter input value so sending “page=about” make index.php load “about.php” if I can bypass that I could probably read other files not ending with .php (at least at the same directory)</p><h3>Foothold</h3><p>Trying to inject multipe payload I was able to see a different message when ijecting a single quote and just a dot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*gcZd18_Q-Gmfe6i9od6zoQ.png" /></figure><p>the output with “.” hints into a custom filter while the single quote does trigger an error, meaning that it’s breaking the code and if I can fix the break injecting something that means I could make this injection work, so I keep trying with payloads starting with single quote</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*eJ1i7edeg6gGbnx4LKV2QQ.png" /></figure><p>testing this I found that and|or do not break the syntax when surrounded by single quotes so I try using that to execute some PHP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*_J_Wm_mkNUDG31opzRSv6w.png" /></figure><p>As showing above this worke to run phpinfo() function in the index page !</p><p>Now I can try to get a hit back from this logic running a system command and a python http server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8P5i3npb5iA4JEGilvY8Eg.png" /></figure><p>I have confirmation that this is actually a straight RCE and I can use that to get reverse shell</p><h3>Initial Access</h3><p>With the identified RCE I just change my payload and start my listener to catch it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TaW2PEMUwdcV0DsK9QeOAw.png" /></figure><p>and I have local.txt flag like that</p><h3>Privilege Escalation</h3><p>Looking at SUID file I identify aria2c that is listed on GTFObins</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*wJBWMGTyywFQFFu_GGd22w.png" /></figure><p>I was able to use the file download method to overwrite the root user authorized keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*yTZrjoZx4OP7sYu6c7o5_Q.png" /></figure><p>I just had to run that twice to get it to write the proper file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*7O_e-y7iSxyJuhhYW6uBEQ.png" /></figure><p>and now I was able to ssh with my id_rsa file as root to the target and get proof.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*ZFhv3hbuai1QXY5eIRDiuA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb1b79a8fd05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NoName]]></title>
            <link>https://medium.com/@dj4msec/noname-e30b4a139ad9?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e30b4a139ad9</guid>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[noname]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[play]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 12:38:00 GMT</pubDate>
            <atom:updated>2025-11-14T12:38:00.908Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>This machine starts with good enumeration of Web applciation that leads to hidden endpoints, one of these endpoints is obviously executing a shell command trough for submission. Testing this last form submission leads to command injection (with a twist to bypass filter) and achieving shell access to the machine as user. From the user an exploitable SUID executable can be identified and leads to root access.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*7_TxoFTZGvYluJ-w_aTUqA.png" /></figure><h3>Foothold</h3><p>Only HTTP port 80 open so I start by looking there</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*3svRBjd44TN77bGEamXVIA.png" /></figure><p>I tried submitting a fake query and it was submitted to index.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*9KKfUOlVGTtgY1lB4F1z5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*twB-1soeOzFrVeF_ovb5yg.png" /></figure><p>Next I went with a ffuf scan to bruteforce any directories or files on the server, this lead me a 2 new pages, /admin and /superadmin.php</p><p>admin page only showed some pictures</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*_yftQWjvwIJ-qcFpy4QhgQ.png" /></figure><p>the more interesting part was superadmin.php page which had a form that can be used to execute ping command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*jsbMXAz9LRBLxky3SHnABA.png" /></figure><p>Also the hidden superadmin.php endpoint is also identifiable through steganography through admin page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*T2kmUXPHVRzS0LJcgEDhGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*FbY0J7HBtl30tqpHi-yUyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*5v4KXR6c6mvpr4wbMjs9Xw.png" /></figure><h3>Initial Access</h3><p>With access to superadmin page and the ping command executing in place I tried to identify a command execution and that worked with pipes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*Jhk-kr6hY5eoaM6VMxKu3w.png" /></figure><p>So now I had to find some way to exploit that to get access, I noticed some commands where not executing so I figured there was some kind of filter on the input, to understand the filter better I went on a printed the php code of the file superadmin.php.</p><p>The output was not visually intereseting but the page source showed the code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*lYUjva6fR7gqZ7j-_Gu8Mg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*x7Vs_t-lDriiVIkSjZFa-g.png" /></figure><p>now I can see the filter and figure the commands that i cannot use to bypass that and achieve a reverse shell I figured a method to bypass the filter, I could used pass my payload in base64 format and use piping to decode then execute the payload!</p><p>Using this workaround I was able to get reverse shell and get local.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*6Vjtvxpg9Z0gIgLNHkV6wA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*TE28Ebcov-MuEnkobo6RzA.png" /></figure><p>the payload decodes to this command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*ycSH8pWJyp4IPYlryrHA_Q.png" /></figure><h3>Privilege escalation</h3><p>To get Root I was able to identify SUID executable ‘find’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*i5uRv6mW1oTEG9J0ly_KWg.png" /></figure><p>the checking on</p><p><a href="https://gtfobins.github.io/gtfobins/find/#suid">find | GTFOBins</a></p><p>I found this SUID exploit that lead me directly to root and proof.txt falg</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*rt2gT6r4Ep0FY1ZGCeNL5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*eoKHG8Mf5fWZyqy7UuanLQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e30b4a139ad9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2024–48573]]></title>
            <link>https://medium.com/@dj4msec/cve-2024-48573-3e3cc8f25d8e?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e3cc8f25d8e</guid>
            <category><![CDATA[cve-2024-48573]]></category>
            <category><![CDATA[practice]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[offsec]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Sun, 09 Nov 2025 11:05:12 GMT</pubDate>
            <atom:updated>2025-11-09T11:05:12.339Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>This machine is hosting a vulnerable version of aquilaCMS with a public RCE exploit chaining a password reset vulnerability and a plugin upload vulnerability, thus the process is straight forward. but in this post I manually exploited the password reset just for practice and explaining, I skipped the manual exploit of plugin upload because that get into building the plugin which means more coding then actual security work.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*ZHmPUXbc-oN2kMNsJALBew.png" /></figure><h3>Foothold</h3><p>With only 2 ports open SSH(22) and HTTP(3010) it’s obvious to start with HTTP so I take a look at this website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*E_fqdTrMpZOdPx3Czry5mg.png" /></figure><p>nothing is showing but I can get some more details looking at wappalyzer extension on my browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*MYWsYlSTTsWdDa5nBVlZkg.png" /></figure><p>the website is running a Next.js application and using AquilaCMS and a MongoDB database on the backend. In the next part I will be manually exploiting the password reset but this is already done in the automated exploit available on searchsploit so you can unless you want to understand how that works you can just skip to Initial Access here.</p><p>the tricky part about javascript based frontend frameworks such as React, Next.js and Angular etc… is that the page source make it hard to see any links but Katana can overcome that and find links in the javascript files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*6xXvlPB-K0WE8YFQqj088g.png" /></figure><p>with a little sort I can make easier to look through the huge amount of urls found</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*TzgVBGMBS1mIjWtlrLfdGg.png" /></figure><p>I pass the list to httpx (httpx-toolkit on kali) to be able to filter working pages from those returning a HTTP 404 instead of looking at the whole list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*0I6KgeZ_C7n5PW-9L5rodQ.png" /></figure><p>Looking at the results I could see a few pattern</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*TP-IJfGWNcIj6zs9ETqY5Q.png" /></figure><p>not all pages have the same size but when I try those pages I quickly get redirected to 404 page, the account pages tho do put me on a login page that does not redirect so I will look there first</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*2NKrs717bh-2VrrW8fvTFg.png" /></figure><p>Trying to create an account results in unknown error, and the same thing for password reset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*7bjZz8tZMqZzcmoRZYbf8w.png" /></figure><p>then looking at the request in burp it seems the frontend is settign the host to localhost:3000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*ZwtOkn_1WUXOvwpPfLwifA.png" /></figure><p>I tried fixing that but still had the same problem, no response was getting back to me, I try the same request through curl and It worked so seeing that it was trying to make a PUT request in the Access-Control-Request-Method, I change the method to PUT in my curl command and now I have some result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*SgePV9ry8UKEwY9WgNxqrA.png" /></figure><p>comparing results with burp behavious it seems burp will still send the request to localhost:3000 even when I added rule to overwrite the Host header so it’s not just the Host header interfering it the actual URL, this was bit tricky but I was evetually able to configure burpsuite to redirect connection to locahost:3000 to targetIP:3010 by editing the proxy listener</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4OMhp1ofE4arGLa5TXF3Q.png" /></figure><p>with that I was able to register a new account even tho I still showed the password requirements error I assumed it was residual error that was not hidden after my first try with bad password, I can see the success message in burp even with that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q9SOvObyublargNt4A_SsA.png" /></figure><p>doing further enumeration this time I went for directory bruteforce under /api/v2/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*uSRns6Pkk00H0dzdm-5mSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*bSm8hAzsDSbdIDWx03yUVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*Q-jdk1jjILGsMLPNClRclA.png" /></figure><p>the only thing that stands out as different is the error 500 on user endpoint so back to burp, I make a GET request on the broser to /api/v2/user then move to repeater an turn it in a PUT request, the same thing can be done with curl as showed earlier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*Gn8UsuThyM7Bw_Tb-cdLqw.png" /></figure><p>the error is complaining that email is required so let’s provided it, at a first step I will provide some random value as the email</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*7Frki4rUXnfUjW91r0TZpg.png" /></figure><p>then providing the email i registered with earlier i have a different message</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*HNYLFnB32EOMQewg6DaCEg.png" /></figure><p>Fuzzing a little I found the email field takes regular expressions !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*i1uNDCECmIBHrdr_-21uCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*OyxCgnfRZVob3FXH9xSqOw.png" /></figure><p>with this I validate that I can use it to enumerate users, first I use it to find my own user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*6jtE9xKViXJegjQBK_ujYQ.png" /></figure><p>with this request I can go on and fuzz for other users emails, progressively FUZZ@.* then found1@FUZZ.* then found1@found2.FUZZ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*vRGUQ0T4K5w9xtjGBwa6FQ.png" /></figure><p>here I found the first part which means there is a user admin@something.somethingelse which should be an admin user, let’s find the rest of the email. the second part took two fussing runs with the list i used which made ‘offsec’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*0mCmHT7c8ZbgjuDIDRiYhA.png" /></figure><p>moving to the last part now, what I found is that almost anything would work here so admin@offsec.randomtext would actually go through returning a created HTTP 201 response but what I need here is the message I was getting earlier validating the user exists, instead I have created a bunch of new emails so this required a machine reset at this point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*i3NohcB4KUgnilVDl3L_Kw.png" /></figure><p>I have received some HTTP 409 which is what I need but they were returning because the list I am using have the same word in lower and uppercase so one was creating the user and the second was returning the user exists message, the good thing is that I could keep on this track, getting all the 409 from the fuzz then filter the results eliminating any words that are doubled in my list and showing once in the fuzz but i’ll go for reset then move to a a char list to validate the last part since it should be short like .com, .org or something similar</p><p>Doing this a letter per run I found the email admin@offsec.lab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*HxqdsMU-9bnsAymsL2cH0Q.png" /></figure><p>the last run did not return any 409 which means the fuzzing stops there</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*DgL4NF1Qzl6HcFLZss0GVw.png" /></figure><p>I then try a password rest with this email but I get an error “cannot send email” even tho I receive an error this the password reset request might have gone through, just the send email that happens prior to the reset is failing in this case</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*huYQ1qzskiMOwAqzvxzDHQ.png" /></figure><p>I remove the data from the request and send again to get the following response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*hYSxYyOtH5WOn8O-uRGnTQ.png" /></figure><p>this response means the endpoint can take a token instead of the email ! how does that work ?</p><p>doing some research I figure the most probable process would be :</p><ol><li>send password reset request with email -&gt; get email with single use token</li><li>send password reset request with token and password -&gt; reset the password for account associated with token</li></ol><p>Since I cannot get the token with there email error in place I need to find a way to bypass that. I know the site uses MongoDB so a NoSQL injection could work</p><p>reading here leads me to a working token validation bypass</p><p><a href="https://portswigger.net/web-security/nosql-injection">NoSQL injection</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*ZytDMTWCVpCZ6dVczBLlrA.png" /></figure><p>now I just add the password and the reset works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*P0JBZKdqfuIFyoFXezhgOA.png" /></figure><p>lets try to login with the new password. this did not work at first with the authentication path on the UI but it worked for admin specific login path</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*f2mXC7RdGjD00FySBfOP4g.png" /></figure><p>now I have the JWT token for admin account</p><h3>Initial Access</h3><p>I was able to find an aquilaCMS exploit with searchsploit that is worth trying</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*aJUgXFh7r_a2wmmtG7ZrQg.png" /></figure><p>with my listener open I was able to catch the reverse shell as root already and had access to proof.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*9JuzrWK5iNB9IRvOvaggCg.png" /></figure><p>this machine has only one flag for root so I am done here already.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e3cc8f25d8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SshControl]]></title>
            <link>https://medium.com/@dj4msec/sshcontrol-84d4fb0ed8eb?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/84d4fb0ed8eb</guid>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[sshcontrol]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[practice]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Sat, 08 Nov 2025 19:11:52 GMT</pubDate>
            <atom:updated>2025-11-08T19:11:52.159Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>This machine is all about REGEX from foothold to root, it starts by identifying a SQL injection that is exploited to get access to web application, from there a regex vulnerability will lead to password exfiltration. with the last mentioned password I was able to add my publis ssh key to the user’s authorized_keys getting ssh access to the target. then to get root I identified a vulnerable cronjob that does not properly validate input leading to command injection into the cron script resulting in reverse shell as root.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*6Zf2Zt5cUmDUrPO56Ioa5A.png" /></figure><h3>Foothold</h3><p>Port 3000 shows a web application for managing SSH keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*QQnxkmtkqbO8D9HnroBSoA.png" /></figure><p>Trying to login with a single quote in the username triggers an error different from the error when submitting a random username so there is potential SQL injection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*xLuowAyoUefIEVsRMsJiNw.png" /></figure><p>I will try to identify which database is running, since this is blind error based injection, all I can tell is if the command runs or triggers an error so if i run a bad command I get the error and I can use that to identify the databases. This should work because different databases have different function/methods to return version, I just need to establish a baseline to run my commands</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*sPGZYmK5YJjVtPdm5svSlA.png" /></figure><p>The payload above confirmed my baseline, since it did not return an error it means the command run successfully and from that I understand I can run valid SQL commands in this format</p><pre>&#39;;&lt;my sql command&gt;--</pre><p>then I can use the payloads from portswigger to identify the database</p><p><a href="https://portswigger.net/web-security/sql-injection/examining-the-database#querying-the-database-type-and-version">Examining the database in SQL injection attacks</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*oYABb6iHxs_0U_6EKnYQoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*ES6OfpqLwTgl67V30OnhIA.png" /></figure><p>Here the last screenshot did not show an error which means the database is postgresql.</p><p>Next I will identify table name and columns using the following payloads using the same method, querying a table name or column that does not exists returns an error</p><pre># To identify table name <br>&#39;;select * from users--<br><br># To identify column username<br>&#39;;select username from users--<br><br># To identify column password <br>&#39;;select password from users--<br># or <br>&#39;;select username,password from users--</pre><p>So now I know there is table users with columns username and password I move to user enumeration, for this I will use time based + conditional payload for the username</p><pre>&#39;;select pg_sleep(5) where exists (select * from users where username=&#39;FUZZ&#39;)--</pre><p>I pass this to ffuf and since I working username will trigger a 5 second sleep I grep with ‘duration: 5’ because ffuf show request duration in milliseconds so it will probably be in the 5050ds, I also use burp proxy this way even if my grep does not work because the request was a little longer and get processed in let’s say 6 sec I can still filter with burp and find the request that took longer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*_oD3X7HMd-BvTTlHufeyww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*ERTlpcmISPI-Uu8AAabZJw.png" /></figure><p>Username identified to ‘antwon’ all is left is the password, I can either use the same method, bruteforcing with wordlist, instead I will be using a smaller list here and build the password progressively using ‘like’ operation</p><pre>&#39;;select pg_sleep(5) where exists (select * from users where username=&#39;antwon&#39; and password like &#39;FUZZ%&#39;)--</pre><p>Here I found the fist char of the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QeIHHGzY9pWRFeS9RQ5mw.png" /></figure><p>I change my payload as following to get the second char and keep going</p><pre>&#39;;select pg_sleep(5) where exists (select * from users where username=&#39;antwon&#39; and password like &#39;fFUZZ%&#39;)--</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*enZoz1uMDk6mtfmcXPkWJw.png" /></figure><p>I can repeat this until I get the Full password, When I stop getting delays that means the password is complete. The password I was able to esfiltrate was hashed and is showing bellow.</p><pre>f46daca7eb795765f476243ee233a9c3fa03bd49e71121bb5aebad24a0b5d015</pre><p>I identified it as SHA-256 and used hashcat to crack it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*1pYj6RQP5Y4_r_-LKv1U-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*cuXfLoILu7BfK-5dxEPAdA.png" /></figure><p>The whole process for SQL injection can just be automate with SQLmap as showing bellow which will handle everything to drop all database and even crack the password for us</p><pre>sqlmap -r .login_req --threads 10  -dbms postgresql --batch -p username -D public -T users --dump</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*88C5SnsYr0Ck-MYxu19ytg.png" /></figure><p>So now with username and password exfiltrated from database I can login to the web application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*l5Bl2k7T_p-OBpv61kdViQ.png" /></figure><p>It seems I can use the check password function to identify the master password fuzzing with a wordlist, I make a request with burp the use it to run ffuf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p-JGZJ36F30QpnemtGr4gw.png" /></figure><p>Funny thing the password seems to validate when empty (the second valid ffuf submission is just creating a new parameter with &amp; and leaving the password empty this returning HTTP 200 also). Double check with burp confirms that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*lENRAcbNddcjCKoWqKrxgQ.png" /></figure><p>I thought the master password was empty at first but trying the create ssh login function with an empty password was not taking it so the password is not empty but validating with an empty string ! why ?!</p><p>It’s a comparison that validate for empty string, think of it this way, any string starts with an empty string so is it a regex comparison somehow?</p><p>I try fuzzing with a char list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQNuyhoFvIuGdtHRTS5PTw.png" /></figure><p>this returned a valid char! so yes, I have to build the password the same way I did with the password hash from database. Fuzzing one character at a time I validated the following password</p><pre>C000ntr0lM4st3rK3yyy</pre><h3>Initial Access</h3><p>I have the master password identified so I can submit a public ssh key, I generate a new one and submit the public key then used the private key to connect on SSH with user antwon. This lead to access to local.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*ueONas1uuIWMcUleW_o6Jg.png" /></figure><p>The public key I submitted was just appended to user antwon authorized_keys</p><h3>Privilege Escalation</h3><p>checking cronjobs I found an interesting one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*ePOtWL262rULi6T_Hd3Fvg.png" /></figure><p>and checking the json file being processed I can tell antwon have write permission over it as part of the group metausers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*CLTOQBmMl9HtAMbTgNilxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*ZxbM6xGWumWuBds169oNuw.png" /></figure><p>The problem with this script is that is_valid_code function only validates the first 4 characters of the code, so whatever comes after is not checked thus I could inject a command there ! just need to make sure not to break the eval command and use port 3000 (simple curl test with other port confirms they are blocked)</p><p>I setup my listener and edit the json file with the following payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*8wt09PLZBRp-Pqz5piBj0Q.png" /></figure><p>And my listener was able to catch the reverse shell as root and give me access to proof.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*IW1yV56aOEnGvvGbN5HHoA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84d4fb0ed8eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome]]></title>
            <link>https://medium.com/@dj4msec/welcome-01cfa819a444?source=rss-1d765f9633b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/01cfa819a444</guid>
            <category><![CDATA[hack-smarter]]></category>
            <category><![CDATA[welcome]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[esc1]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[dj4m]]></dc:creator>
            <pubDate>Fri, 07 Nov 2025 11:41:40 GMT</pubDate>
            <atom:updated>2025-11-07T11:41:40.612Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary</h3><p>This target is a DC that comes with an assumed breach scenario, with provided credentials I was able to get access to SMB service and drop some files. One of the files was protected with a password that is easily cracked with john.</p><p>Enumerating further I was able to get Domain users through LDAP with the provided user. Put that together with the leaked password I had lateral movement to a second user.</p><p>With the second user I was able to find path to service accounts using bloodhound, this included Certificate Authority account. with access to SVC_CA account I was able to identify ESC1 vulnerability which leads to access to Administrator.</p><h3>Nmap Scan</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*bVGx69c9eTIpWHi45FVZlw.png" /></figure><pre>└─$ cat .nmap_scan                                                        <br># Nmap 7.95 scan initiated Fri Nov  7 10:03:35 2025 as: /usr/lib/nmap/nmap --privileged -T4 -A -Pn -p- -v -oN .nmap_scan -iL .target<br>Nmap scan report for 10.0.27.244<br>Host is up (0.14s latency).<br>Not shown: 65516 filtered tcp ports (no-response)<br>PORT      STATE SERVICE       VERSION<br>53/tcp    open  domain        Simple DNS Plus<br>88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-11-07 09:12:22Z)<br>135/tcp   open  msrpc         Microsoft Windows RPC<br>139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn<br>389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: WELCOME.local0., Site: Default-First-Site-Name)<br>| ssl-cert: Subject: commonName=DC01.WELCOME.local<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:DC01.WELCOME.local<br>| Issuer: commonName=WELCOME-CA<br>| Public Key type: rsa<br>| Public Key bits: 2048<br>| Signature Algorithm: sha256WithRSAEncryption<br>| Not valid before: 2025-09-13T16:39:47<br>| Not valid after:  2026-09-13T16:39:47<br>| MD5:   2ded:dae3:3ecd:1cc4:58a7:dd02:4f41:2b6d<br>|_SHA-1: aa01:7b70:2f48:f3c8:4aa0:5357:aeb8:93e9:8cbd:53bc<br>|_ssl-date: 2025-11-07T09:14:00+00:00; 0s from scanner time.<br>445/tcp   open  microsoft-ds?<br>464/tcp   open  kpasswd5?<br>636/tcp   open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: WELCOME.local0., Site: Default-First-Site-Name)<br>|_ssl-date: 2025-11-07T09:14:00+00:00; 0s from scanner time.<br>| ssl-cert: Subject: commonName=DC01.WELCOME.local<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:DC01.WELCOME.local<br>| Issuer: commonName=WELCOME-CA<br>| Public Key type: rsa<br>| Public Key bits: 2048<br>| Signature Algorithm: sha256WithRSAEncryption<br>| Not valid before: 2025-09-13T16:39:47<br>| Not valid after:  2026-09-13T16:39:47<br>| MD5:   2ded:dae3:3ecd:1cc4:58a7:dd02:4f41:2b6d<br>|_SHA-1: aa01:7b70:2f48:f3c8:4aa0:5357:aeb8:93e9:8cbd:53bc<br>3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: WELCOME.local0., Site: Default-First-Site-Name)<br>| ssl-cert: Subject: commonName=DC01.WELCOME.local<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:DC01.WELCOME.local<br>| Issuer: commonName=WELCOME-CA<br>| Public Key type: rsa<br>| Public Key bits: 2048<br>| Signature Algorithm: sha256WithRSAEncryption<br>| Not valid before: 2025-09-13T16:39:47<br>| Not valid after:  2026-09-13T16:39:47<br>| MD5:   2ded:dae3:3ecd:1cc4:58a7:dd02:4f41:2b6d<br>|_SHA-1: aa01:7b70:2f48:f3c8:4aa0:5357:aeb8:93e9:8cbd:53bc<br>|_ssl-date: 2025-11-07T09:14:00+00:00; 0s from scanner time.<br>3269/tcp  open  ssl/ldap      Microsoft Windows Active Directory LDAP (Domain: WELCOME.local0., Site: Default-First-Site-Name)<br>| ssl-cert: Subject: commonName=DC01.WELCOME.local<br>| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:&lt;unsupported&gt;, DNS:DC01.WELCOME.local<br>| Issuer: commonName=WELCOME-CA<br>| Public Key type: rsa<br>| Public Key bits: 2048<br>| Signature Algorithm: sha256WithRSAEncryption<br>| Not valid before: 2025-09-13T16:39:47<br>| Not valid after:  2026-09-13T16:39:47<br>| MD5:   2ded:dae3:3ecd:1cc4:58a7:dd02:4f41:2b6d<br>|_SHA-1: aa01:7b70:2f48:f3c8:4aa0:5357:aeb8:93e9:8cbd:53bc<br>|_ssl-date: 2025-11-07T09:14:00+00:00; 0s from scanner time.<br>3389/tcp  open  ms-wbt-server Microsoft Terminal Services<br>| ssl-cert: Subject: commonName=DC01.WELCOME.local<br>| Issuer: commonName=DC01.WELCOME.local<br>| Public Key type: rsa<br>| Public Key bits: 2048<br>| Signature Algorithm: sha256WithRSAEncryption<br>| Not valid before: 2025-10-27T15:46:43<br>| Not valid after:  2026-04-28T15:46:43<br>| MD5:   242b:566d:674b:702d:f73e:cee4:a92d:6581<br>|_SHA-1: 848f:035b:09f0:1735:2bc9:40b7:0f02:bee2:82c0:da7a<br>| rdp-ntlm-info: <br>|   Target_Name: WELCOME<br>|   NetBIOS_Domain_Name: WELCOME<br>|   NetBIOS_Computer_Name: DC01<br>|   DNS_Domain_Name: WELCOME.local<br>|   DNS_Computer_Name: DC01.WELCOME.local<br>|   Product_Version: 10.0.20348<br>|_  System_Time: 2025-11-07T09:13:20+00:00<br>|_ssl-date: 2025-11-07T09:14:00+00:00; 0s from scanner time.<br>5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)<br>|_http-title: Not Found<br>|_http-server-header: Microsoft-HTTPAPI/2.0<br>9389/tcp  open  mc-nmf        .NET Message Framing<br>49664/tcp open  msrpc         Microsoft Windows RPC<br>49667/tcp open  msrpc         Microsoft Windows RPC<br>49676/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0<br>49679/tcp open  msrpc         Microsoft Windows RPC<br>49706/tcp open  msrpc         Microsoft Windows RPC<br>49722/tcp open  msrpc         Microsoft Windows RPC<br>Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port<br>OS fingerprint not ideal because: Missing a closed TCP port so results incomplete<br>No OS matches for host<br>Uptime guess: 0.008 days (since Fri Nov  7 10:02:17 2025)<br>Network Distance: 3 hops<br>TCP Sequence Prediction: Difficulty=259 (Good luck!)<br>IP ID Sequence Generation: Incremental<br>Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows<br><br>Host script results:<br>| smb2-security-mode: <br>|   3:1:1: <br>|_    Message signing enabled and required<br>| smb2-time: <br>|   date: 2025-11-07T09:13:22<br>|_  start_date: N/A<br><br>TRACEROUTE (using port 3389/tcp)<br>HOP RTT       ADDRESS<br>1   154.82 ms 10.200.0.1<br>2   ...<br>3   154.85 ms 10.0.27.244<br><br>Read data files from: /usr/share/nmap<br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br># Nmap done at Fri Nov  7 10:14:02 2025 -- 1 IP address (1 host up) scanned in 627.22 seconds</pre><p>from this scan I can see that the target is a DC (domain controller)</p><h3>Initial Access</h3><p>Initial access is achieved with assumed breach scenario, the credentials are provided in the lab</p><pre>e.hills : Il0vemyj0b2025!</pre><p>This Lab is different from the usual scenario where I start with gaining a foothold that lead to initial access, this is already done for us, so the focus is more on Lateral movement and Privilege Escalation as in an internal pentest</p><h3>Enumerarion</h3><p>Nmap showed too many services, 19 services exactly on the target which could have been confusing, but since I have credentials already the obvious initial step would be spraying those credentials on these services to get more information about the system.</p><p>first step I will drop the username and password into local files to use for the spray, this way I can build on theses files and widen my spray attacks going on by adding new found credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*q2Wraw6AqhZ08KYPr2ExVA.png" /></figure><p>Then I start the actual spraying,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W5qamjDVqBe6uY6KJTgUZA.png" /></figure><p>This initial spray valited the credentials are working on SMB, LDAP and RDP services, so let’s use that to find some information, starting with SMB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9xhpa5IcS5ggkGJpTOBSQ.png" /></figure><p>I then connect to the share and find some PDF file, I go on and drop all the files to my local machine for analysis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtBiyTQhQhR7tbKLTF6AuA.png" /></figure><p>I start with exiftools to check the files Metadata</p><pre>┌──(dj4m㉿kali)-[~/Desktop/HackSmarter]<br>└─$ exiftool Wel*<br>======== Welcome 2025 Holiday Schedule.pdf<br>ExifTool Version Number         : 13.25<br>File Name                       : Welcome 2025 Holiday Schedule.pdf<br>Directory                       : .<br>File Size                       : 85 kB<br>File Modification Date/Time     : 2025:11:07 10:34:29+01:00<br>File Access Date/Time           : 2025:11:07 10:34:28+01:00<br>File Inode Change Date/Time     : 2025:11:07 10:34:29+01:00<br>File Permissions                : -rw-r--r--<br>File Type                       : PDF<br>File Type Extension             : pdf<br>MIME Type                       : application/pdf<br>PDF Version                     : 1.7<br>Linearized                      : No<br>Page Count                      : 1<br>Language                        : en<br>Tagged PDF                      : Yes<br>XMP Toolkit                     : 3.1-701<br>Producer                        : Microsoft® Word for Microsoft 365<br>Creator                         : Noah Heroldt<br>Creator Tool                    : Microsoft® Word for Microsoft 365<br>Create Date                     : 2025:09:13 18:07:31-04:00<br>Modify Date                     : 2025:09:13 18:07:31-04:00<br>Document ID                     : uuid:2CD77113-48EA-4E60-ABE5-84C403C7D92A<br>Instance ID                     : uuid:2CD77113-48EA-4E60-ABE5-84C403C7D92A<br>Author                          : Noah Heroldt<br>======== Welcome Benefits.pdf<br>ExifTool Version Number         : 13.25<br>File Name                       : Welcome Benefits.pdf<br>Directory                       : .<br>File Size                       : 81 kB<br>File Modification Date/Time     : 2025:11:07 10:34:30+01:00<br>File Access Date/Time           : 2025:11:07 10:34:29+01:00<br>File Inode Change Date/Time     : 2025:11:07 10:34:30+01:00<br>File Permissions                : -rw-r--r--<br>File Type                       : PDF<br>File Type Extension             : pdf<br>MIME Type                       : application/pdf<br>PDF Version                     : 1.7<br>Linearized                      : No<br>Page Count                      : 1<br>Language                        : en<br>Tagged PDF                      : Yes<br>XMP Toolkit                     : 3.1-701<br>Producer                        : Microsoft® Word for Microsoft 365<br>Creator                         : Noah Heroldt<br>Creator Tool                    : Microsoft® Word for Microsoft 365<br>Create Date                     : 2025:09:13 18:08:17-04:00<br>Modify Date                     : 2025:09:13 18:08:17-04:00<br>Document ID                     : uuid:3D02A64E-0A7E-46C7-A120-0749E34D19B3<br>Instance ID                     : uuid:3D02A64E-0A7E-46C7-A120-0749E34D19B3<br>Author                          : Noah Heroldt<br>======== Welcome Handbook Excerpts.pdf<br>ExifTool Version Number         : 13.25<br>File Name                       : Welcome Handbook Excerpts.pdf<br>Directory                       : .<br>File Size                       : 83 kB<br>File Modification Date/Time     : 2025:11:07 10:34:30+01:00<br>File Access Date/Time           : 2025:11:07 10:34:30+01:00<br>File Inode Change Date/Time     : 2025:11:07 10:34:30+01:00<br>File Permissions                : -rw-r--r--<br>File Type                       : PDF<br>File Type Extension             : pdf<br>MIME Type                       : application/pdf<br>PDF Version                     : 1.7<br>Linearized                      : No<br>Page Count                      : 1<br>Language                        : en<br>Tagged PDF                      : Yes<br>XMP Toolkit                     : 3.1-701<br>Producer                        : Microsoft® Word for Microsoft 365<br>Creator                         : Noah Heroldt<br>Creator Tool                    : Microsoft® Word for Microsoft 365<br>Create Date                     : 2025:09:13 18:09:52-04:00<br>Modify Date                     : 2025:09:13 18:09:52-04:00<br>Document ID                     : uuid:00C57D5D-FCF0-4EB7-BC8A-CC4ACAFF25B6<br>Instance ID                     : uuid:00C57D5D-FCF0-4EB7-BC8A-CC4ACAFF25B6<br>Author                          : Noah Heroldt<br>======== Welcome Performance Review Guide.pdf<br>ExifTool Version Number         : 13.25<br>File Name                       : Welcome Performance Review Guide.pdf<br>Directory                       : .<br>File Size                       : 80 kB<br>File Modification Date/Time     : 2025:11:07 10:34:31+01:00<br>File Access Date/Time           : 2025:11:07 10:34:31+01:00<br>File Inode Change Date/Time     : 2025:11:07 10:34:31+01:00<br>File Permissions                : -rw-r--r--<br>File Type                       : PDF<br>File Type Extension             : pdf<br>MIME Type                       : application/pdf<br>PDF Version                     : 1.7<br>Linearized                      : No<br>Page Count                      : 1<br>Language                        : en<br>Tagged PDF                      : Yes<br>XMP Toolkit                     : 3.1-701<br>Producer                        : Microsoft® Word for Microsoft 365<br>Creator                         : Noah Heroldt<br>Creator Tool                    : Microsoft® Word for Microsoft 365<br>Create Date                     : 2025:09:13 18:11:07-04:00<br>Modify Date                     : 2025:09:13 18:11:07-04:00<br>Document ID                     : uuid:DFD00EED-C664-4C8C-81BB-9796A48A08AC<br>Instance ID                     : uuid:DFD00EED-C664-4C8C-81BB-9796A48A08AC<br>Author                          : Noah Heroldt<br>======== Welcome Start Guide.pdf<br>ExifTool Version Number         : 13.25<br>File Name                       : Welcome Start Guide.pdf<br>Directory                       : .<br>File Size                       : 90 kB<br>File Modification Date/Time     : 2025:11:07 10:34:32+01:00<br>File Access Date/Time           : 2025:11:07 10:34:32+01:00<br>File Inode Change Date/Time     : 2025:11:07 10:34:32+01:00<br>File Permissions                : -rw-r--r--<br>File Type                       : PDF<br>File Type Extension             : pdf<br>MIME Type                       : application/pdf<br>PDF Version                     : 1.7<br>Linearized                      : No<br>Encryption                      : Standard V4.4 (128-bit)<br>User Access                     : Print, Modify, Copy, Fill forms, Extract, Print high-res<br>Warning                         : Document is password protected (use Password option)<br>    5 image files read</pre><p>what I notice here is that all files are created by user ‘Noah Heroldt’ so I add that user to my names file following the same pattern from the already provided user and then I can see that only the last file ‘Welcome Start Guide.pdf’ is password protected so that file is probably more interesting then the rest, I start by cracking the password using pdf2john + john</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*F-Q_kBt0SF9AHDnM8WEfNQ.png" /></figure><p>now let’s check the content of the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Vk-CE5r4J0yO1ZkGIWStQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fwDWcYo_zP78N1RBNniDBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*6izPGjsuHR3lTKBJmGJTjw.png" /></figure><p>to summarize the finding, I have found the Default password for new accounts, the prefix for service accounts and 3 different potential user account names. I add the relevant user to my names list then do quick check of the other PDF file which did not show anything interesting at this time.</p><p>a new spray did not work with these new found usernames + default password which was somewhat expected as this password is supposed to work on new accounts or regular user accounts that forgot to reset it.</p><p>So I move my enumeration to LDAP service now and will go with enum4linux first (if this gives me more users on the target DC this might lead to a new spray attack that could work with the default password).</p><p>While enum4linux did not work I was able to use nxc again to get domain users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5q4QXqSXFOLFXWRwTUSEgQ.png" /></figure><h3>Lateral Movement</h3><p>I add found username to my names list and retry a spray which lead me a second user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KetiYddcJlms2kj0mZmFTg.png" /></figure><p>spraying all available services also leads me a shell access with this new user through winrm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*lMel2NAyCbZkY2mjeDTcQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*aj-LwZcrSbemaND6gnDJQw.png" /></figure><p>I connect to winrm with user ‘a.harris’ and get the user.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*F8zzxwJJTuChlHapAanBCg.png" /></figure><h3>Privilege Escalation</h3><p>My next step was to run a bloodhound scan and passign the generated ZIP file to bloodhound for analysis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rmx2NOrXyrWCmZhCYDDerA.png" /></figure><p>I added my owned users and then checked the ‘shortest path from owned users’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*w6dWAHnkXFFdvqIOdL1urw.png" /></figure><p>this shows that ‘a.harris’ as part of ‘HR’ group has ‘GenericAll’ permission on user ‘i.park’ who is part of ‘IT’ group and ‘Helpdesk’ group that can reset apssword of service accounts ‘svc_web’ and ‘svc_ca’.</p><p>I will try lateral movement to user i.park and run another bloodhound scan, bloodhound will help with that showing me the commands to use to achieve that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OiGbWRKSrQEPRsaX2OM0nQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*mLc0D3ULcqG6dn0BEOqV0w.png" /></figure><p>I was able to successfully change the user password so I can use this user to run the second bloodhound scan, just in case this can lead to a new path based on IT group, unfortunately this was not the case, so I am still on the initial path identified and bloodhound showed the same command I already used in first step to exploit ‘forceChangePassword’ on service users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*QRBdWpjDwqn25M2dVWkYLw.png" /></figure><p>and I can see now the new password works on the exploited users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*Ei4lqQ5nvfT6nU96yRxV2g.png" /></figure><p>I tried again bloodhound with these new users but this did not show any extra paths but since I now have svc_ca which should be Certificate Authority I can try with certipy-ad to sccan for vulnerable certificate templates</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*sol5jvdg9nea4VBT-UK_0Q.png" /></figure><p>and then checking the output file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*Cbu3veALyIGjekxt2pHPow.png" /></figure><p>So I can follow the steps here for the exploit</p><p><a href="https://github.com/ly4k/Certipy/wiki/06-%E2%80%90-Privilege-Escalation#esc1-enrollee-supplied-subject-for-client-authentication">06 ‐ Privilege Escalation</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*agXRNzWQSj26PeYhB2DrQQ.png" /></figure><p>the command above returned a pfx file that was next used to authenticate to target and retrieve the NTLM hash of user Administrator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*4LXes3PjnbGuZUFaIIjRzw.png" /></figure><p>I then just used this hash to connect to target with winrm as administrator and gettign the roof.txt flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*nY6aGtc5ckkapzOLFdtpCw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01cfa819a444" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>