// OnReadBridge handles writing data to the implant from the Covenant server and gets called // each time data is read from the Covenant server protected override void OnReadBridge(object sender, BridgeConnector.ReadBridgeArgs args) { // Parse the data from the server to determine which implant this data is for var parsed = this.BridgeProfile.ParseRead(args.Read); if (parsed != null) { // Retrieve the corresponding TcpClient based upon the parsed GUID TcpClient client = this.Clients[parsed.Guid]; // Write the data down to the correct implant TcpClient _ = Utilities.WriteStreamAsync(client.GetStream(), args.Read); } }
// OnReadBridge handles writing data to the implant from the Covenant server and gets called // each time data is read from the Covenant server protected override void OnReadBridge(object sender, BridgeConnector.ReadBridgeArgs args) { // Parse the data from the server to determine which implant this data is for var parsed = this.BridgeProfile.ParseRead(args.Read); if (parsed != null) { // Retrieve the corresponding QuicClient based upon the parsed GUID QuicStream client = this.Clients[parsed.Guid]; //QuicConnection client = this.Clients[parsed.Guid]; //QuicStream stream = client.CreateStream(QuickNet.Utilities.StreamType.ClientBidirectional); // Write the data down to the correct implant QuicClient _ = Utilities.WriteStreamAsync(client, args.Read); } }
/// <summary> /// The OnReadBridge function is called each time data is read from the Covenant server meant for an implant. /// C2Bridge developers should implement the logic to determine which implant this data is meant for and write /// this data to the implant. /// </summary> /// <param name="sender"> /// Sender is the object that called the OnReadBridge function. C2Bridge developers can safely ignore this parameter. /// </param> /// <param name="args">Args contains the data that should be written from the Covenant server to the implant.</param> protected abstract void OnReadBridge(object sender, BridgeConnector.ReadBridgeArgs args);