ruby_smb 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 582c72fe6559ee4c40aa9e33f77c6644669848ae3452c11095f31fb0b0fce387
4
- data.tar.gz: 2791bfa79cb55e6ec6689782a747860287278bc42c38d6ecd03a66396efba200
3
+ metadata.gz: 5567054608b80da9be641c717d1d8b69e71452fb2fc67c2e390d9a6a34fb19d3
4
+ data.tar.gz: 0b439033b20bd578414e51d56d98ee4ccc4d44c60e6248bf0b8ad37a33b0fd6d
5
5
  SHA512:
6
- metadata.gz: ae54e45927264996fbaed098e38f38d179c0750aa4d82073910364bdc3cb2719c8ec89c9f432554ef44a752b9aef3e4f945b73357b4694c7faa52f7025582efc
7
- data.tar.gz: 0cf5036c07e48a2cb6a40bdb63e0ec18f0f20d7110af4938f3fc4067e77d99e084ac5cba0f255980b1b971f93985793cce8211f4496e9ffd6be0bc00ab5e2dd7
6
+ metadata.gz: 19ad76e3ed2e1902141aac772cd7908de06b402414b787e7f2371584e5cee6fc1cf82e9b80dce10ae0599082ee65a4dbd4f6c62a3c32bd3b154d47de25944b20
7
+ data.tar.gz: dd970aad2f91aec70671b7364438ee7df79908c552a6826aad99318e10fb63b6ebcad5929f131fa4284ff5531c189061a83f499203188ac919dc74e6007d422f
checksums.yaml.gz.sig CHANGED
Binary file
@@ -5,7 +5,7 @@ module RubySMB
5
5
  module Negotiation
6
6
  # Handles the entire SMB Multi-Protocol Negotiation from the
7
7
  # Client to the Server. It sets state on the client appropriate
8
- # to the protocol and capabilites negotiated during the exchange.
8
+ # to the protocol and capabilities negotiated during the exchange.
9
9
  # It also keeps track of the negotiated dialect.
10
10
  #
11
11
  # @return [void]
@@ -23,13 +23,13 @@ module RubySMB
23
23
  update_preauth_hash(response_packet)
24
24
  end
25
25
 
26
- # If the response contains the SMB2 wildcard revision number dialect;
27
- # it indicates that the server implements SMB 2.1 or future dialect
28
- # revisions and expects the client to send a subsequent SMB2 Negotiate
29
- # request to negotiate the actual SMB 2 Protocol revision to be used.
30
- # The wildcard revision number is sent only in response to a
26
+ # If the response contains an SMB2 dialect and the request was SMB1;
27
+ # it indicates that the server supports SMB2 and wants to upgrade the
28
+ # connection. The server expects the client to send a subsequent SMB2
29
+ # Negotiate request to negotiate the actual SMB 2 Protocol revision to
30
+ # be used. The wildcard revision number is sent only in response to a
31
31
  # multi-protocol negotiate request with the "SMB 2.???" dialect string.
32
- if @dialect == '0x02ff'
32
+ if request_packet.packet_smb_version == 'SMB1' && RubySMB::Dialect[@dialect]&.order == RubySMB::Dialect::ORDER_SMB2
33
33
  self.smb2_message_id += 1
34
34
  version = negotiate
35
35
  end
@@ -78,6 +78,10 @@ module RubySMB
78
78
  msg.flag |= NTLM::NEGOTIATE_FLAGS.fetch(flag)
79
79
  end
80
80
 
81
+ if type1_msg.flag & NTLM::NEGOTIATE_FLAGS[:EXTENDED_SECURITY] == NTLM::NEGOTIATE_FLAGS[:EXTENDED_SECURITY]
82
+ msg.flag |= NTLM::NEGOTIATE_FLAGS[:EXTENDED_SECURITY]
83
+ end
84
+
81
85
  @server_challenge = @provider.generate_server_challenge
82
86
  msg.challenge = @server_challenge.unpack1('Q<') # 64-bit unsigned, little endian (uint64_t)
83
87
  target_info = Net::NTLM::TargetInfo.new('')
@@ -1,3 +1,3 @@
1
1
  module RubySMB
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.1.1'.freeze
3
3
  end
@@ -1279,6 +1279,9 @@ RSpec.describe RubySMB::Client do
1279
1279
  end
1280
1280
 
1281
1281
  it 'calls the backing methods' do
1282
+ request_packet = double('Request packet')
1283
+ allow(client).to receive(:negotiate_request).and_return(request_packet)
1284
+ allow(request_packet).to receive(:packet_smb_version)
1282
1285
  expect(client).to receive(:negotiate_request)
1283
1286
  expect(client).to receive(:send_recv)
1284
1287
  expect(client).to receive(:negotiate_response)
@@ -1319,14 +1322,20 @@ RSpec.describe RubySMB::Client do
1319
1322
 
1320
1323
  it 'increments the message ID' do
1321
1324
  expect(client).to receive(:smb2_message_id=).with(1)
1325
+ expect(client).to receive(:negotiate_request).twice.and_call_original
1326
+ expect(client).to receive(:parse_negotiate_response).twice do
1327
+ client.smb1 = false
1328
+ end
1322
1329
  client.negotiate
1323
1330
  end
1324
1331
 
1325
1332
  it 're-negotiates' do
1326
- expect(client).to receive(:negotiate_request).twice
1333
+ expect(client).to receive(:negotiate_request).twice.and_call_original
1327
1334
  expect(client).to receive(:send_recv).twice
1328
1335
  expect(client).to receive(:negotiate_response).twice
1329
- expect(client).to receive(:parse_negotiate_response).twice
1336
+ expect(client).to receive(:parse_negotiate_response).twice do
1337
+ client.smb1 = false
1338
+ end
1330
1339
  client.negotiate
1331
1340
  end
1332
1341
  end
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ��,�xAD[N�FOr���}����l�C� N���6�M�#+�q��H͓(�ސ��Դ���Eݎ(��9�q�i!��fjfWVk�#�@��g�����O~�˫��1�w*��R�B�`HP�J�b�ppЂ���\i*&{Xh4@��q%$Iu�Ur���r�r�c����H4�&�r�D0ǔ�3���뫭�X��8�����x�E^+C�:N�כ�j�!�F��$ CS��/I�
2
- ��HW�0�ޟj
1
+ �:� ϝ��
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_smb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -97,7 +97,7 @@ cert_chain:
97
97
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
98
98
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
99
99
  -----END CERTIFICATE-----
100
- date: 2022-04-12 00:00:00.000000000 Z
100
+ date: 2022-04-21 00:00:00.000000000 Z
101
101
  dependencies:
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: redcarpet
metadata.gz.sig CHANGED
Binary file