From 0edfa96b92aaa8d0dfa20f36e5c00705dd90baea Mon Sep 17 00:00:00 2001 From: mkwcat Date: Thu, 1 Feb 2024 20:51:21 -0500 Subject: [PATCH] QR2: Fix wrong mutex used --- qr2/main.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/qr2/main.go b/qr2/main.go index 2383fcf..223ac53 100644 --- a/qr2/main.go +++ b/qr2/main.go @@ -120,9 +120,6 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) { case ClientMessageAckRequest: logging.Info(moduleName, "Command:", aurora.Yellow("CLIENT_MESSAGE_ACK")) - mutex.Lock() - defer mutex.Unlock() - // In case ClientExploitReply is lost, this can be checked as well // This would be sent either after the payload is downloaded, or the client is already patched session.ExploitReceived = true @@ -130,16 +127,15 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) { login.NeedsExploit = false } + session.MessageMutex.Lock() session.MessageAckWaker.Assert() + session.MessageMutex.Unlock() return case KeepAliveRequest: logging.Info(moduleName, "Command:", aurora.Yellow("KEEPALIVE")) conn.WriteTo(createResponseHeader(KeepAliveRequest, 0), addr) - mutex.Lock() - defer mutex.Unlock() - session.LastKeepAlive = time.Now().Unix() return @@ -155,9 +151,6 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) { case ClientExploitReply: logging.Info(moduleName, "Command:", aurora.Yellow("CLIENT_EXPLOIT_ACK")) - mutex.Lock() - defer mutex.Unlock() - session.ExploitReceived = true if login := session.Login; login != nil { login.NeedsExploit = false