From fe2acd83325a45b7baa486a2427df5514c8f6578 Mon Sep 17 00:00:00 2001 From: guffre Date: Sun, 26 Feb 2023 18:10:48 -0600 Subject: [PATCH] Update server_transport_winhttp.c The response code from packet_transmit_http was hardcoded to always return ERROR_SUCCESS. This fix emulates how errors are debug-printed and returned from server_transport_tcp and server_transport_pipe. --- c/meterpreter/source/metsrv/server_transport_winhttp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c/meterpreter/source/metsrv/server_transport_winhttp.c b/c/meterpreter/source/metsrv/server_transport_winhttp.c index 6336e9ae..14f52062 100644 --- a/c/meterpreter/source/metsrv/server_transport_winhttp.c +++ b/c/meterpreter/source/metsrv/server_transport_winhttp.c @@ -292,6 +292,7 @@ static DWORD packet_transmit_http(Remote *remote, LPBYTE rawPacket, DWORD rawPac { DWORD result = ERROR_SUCCESS; HINTERNET hReq; + BOOL res; HttpTransportContext* ctx = (HttpTransportContext*)remote->transport->ctx; lock_acquire(remote->lock); @@ -305,8 +306,8 @@ static DWORD packet_transmit_http(Remote *remote, LPBYTE rawPacket, DWORD rawPac break; } - result = ctx->send_req(ctx, hReq, rawPacket, rawPacketLength); - if (!result) + res = ctx->send_req(ctx, hReq, rawPacket, rawPacketLength); + if (!res) { result = GetLastError(); break;