From e7fde3fcde2eb9cfd049b21e1edb16d8caec3e63 Mon Sep 17 00:00:00 2001 From: its-a-feature Date: Wed, 4 Mar 2026 17:44:44 -0600 Subject: [PATCH] adding burst reads to rpfwd --- CHANGELOG.MD | 6 ++++++ VERSION | 2 +- mythic-docker/src/rabbitmq/utils_proxy_traffic.go | 8 +++++++- mythic-docker/src/utils/config.go | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 80accebe..c10db633 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.4.25] - 2026-03-04 + +### Changed + +- Updated rpfwd to do burst proxy reads similar to socks + ## [3.4.24] - 2026-02-18 ### Changed diff --git a/VERSION b/VERSION index 9ad42ccc..78ffa477 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.4.24 \ No newline at end of file +3.4.25 \ No newline at end of file diff --git a/mythic-docker/src/rabbitmq/utils_proxy_traffic.go b/mythic-docker/src/rabbitmq/utils_proxy_traffic.go index 7baa0fb0..89b6c8ae 100644 --- a/mythic-docker/src/rabbitmq/utils_proxy_traffic.go +++ b/mythic-docker/src/rabbitmq/utils_proxy_traffic.go @@ -1695,11 +1695,17 @@ func (p *callbackPortUsage) handleRpfwdConnections(newConnection *acceptedConnec }(newConnection.conn) go func(conn net.Conn) { // function for reading from Mythic's connections to send to agents + lastReadSizes := []int{0, 0, 0} + tempBufSize := minAllocSize for { - buf := make([]byte, 4096) + tempBufSize = p.burstAdjustReadSize(lastReadSizes, tempBufSize) + buf := make([]byte, tempBufSize) //logging.LogDebug("looping to read from connection", "server_id", newConnection.ServerID) length, err := conn.Read(buf) if length > 0 { + lastReadSizes[0] = lastReadSizes[1] + lastReadSizes[1] = lastReadSizes[2] + lastReadSizes[2] = length //logging.LogDebug("Message received for chan %d: length %v\n", newConnection.ServerID, length) interceptProxyToAgentMessageChan <- interceptProxyToAgentMessage{ Message: proxyToAgentMessage{ diff --git a/mythic-docker/src/utils/config.go b/mythic-docker/src/utils/config.go index 16ec6909..549645ab 100644 --- a/mythic-docker/src/utils/config.go +++ b/mythic-docker/src/utils/config.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/viper" ) -const mythicServerVersion = "3.4.24" +const mythicServerVersion = "3.4.25" type Config struct { // server configuration