private async Task NegotiateSMB1ToSMB2Response(SMBPacket packet) { try { var header = new SMB2Header(new byte[] { 0x00, 0x00 }); var data = new SMB2NegotiateResponse(header.Build()).Build(); await Send(packet.Socket, data); } catch (Exception e) { await Controller.Log(Name, e.ToString()); } }
private async Task SendAccessDenied(SMBPacket packet) { try { var header = new SMB2Header( new byte[] { 0x01, 0x00 }, packet.MessageID, packet.CreditCharge, packet.Credits, new byte[] { 0xff, 0xfe, 0x00, 0x00 }, packet.SessionID, new byte[] { 0x22, 0x00, 0x00, 0xc0 } ); var data = new SMB2AccessDenied(header.Build()).Build(); await Send(packet.Socket, data); } catch (Exception e) { await Controller.Log(Name, e.ToString()); } }
private async Task NegotiateResponse(SMBPacket packet) { try { var header = new SMB2Header( new byte[] { 0x00, 0x00 }, packet.MessageID, packet.CreditCharge, packet.Credits, packet.ProcessID ); var data = new SMB2NegotiateResponse( header.Build(), new byte[] { 0x10, 0x02 }).Build(); await Send(packet.Socket, data); } catch (Exception e) { await Controller.Log(Name, e.ToString()); } }