diff --git a/pkg/udpproxy/session.go b/pkg/udpproxy/session.go index 9121c58..9e31d10 100644 --- a/pkg/udpproxy/session.go +++ b/pkg/udpproxy/session.go @@ -64,7 +64,11 @@ func (s *session) proxyFrom(buf []byte) error { } if s.isRconResponsePacket(buf) { - log.Debugf("Response: %s", string(buf[10:])) + if s.isBadRconRequest(buf) { + log.Infof("Response: Bad rcon from %s", s.caddr.IP) + } else { + log.Debugf("Response: %s", string(buf[10:])) + } } return nil diff --git a/pkg/udpproxy/validator.go b/pkg/udpproxy/validator.go index 631a504..0ff8370 100644 --- a/pkg/udpproxy/validator.go +++ b/pkg/udpproxy/validator.go @@ -26,3 +26,7 @@ func (v *validator) isQueryResponsePacket(buf []byte) bool { func (v *validator) isValidResponsePacket(buf []byte) bool { return v.isRconResponsePacket(buf) || v.isQueryResponsePacket(buf) } + +func (v *validator) isBadRconRequest(buf []byte) bool { + return string(buf[10:18]) == "Bad rcon" +}