From 7138515904efca86c7f45e0590cb291edb64af16 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 8 Mar 2024 21:42:39 +0000 Subject: [PATCH] ensure we're only logging rcon (no query packets) --- pkg/udpproxy/session.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/udpproxy/session.go b/pkg/udpproxy/session.go index bcb9c53..9e5967c 100644 --- a/pkg/udpproxy/session.go +++ b/pkg/udpproxy/session.go @@ -64,8 +64,12 @@ func (s *Session) proxyTo(buf []byte) error { log.Println(err) return err } - parts := strings.Split(string(buf), " ") - log.Info("From [", s.caddr.IP, "] To [", s.serverConn.RemoteAddr().String(), "] Command: ", strings.Join(parts[2:], " ")) + + cmd := string(buf) + if cmd[:8] == "\xff\xff\xff\xffrcon" { + parts := strings.Split(cmd, " ") + log.Info("From [", s.caddr.IP, "] To [", s.serverConn.RemoteAddr().String(), "] Command: ", strings.Join(parts[2:], " ")) + } return nil }