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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/ruby_smb/client/negotiation.rb +7 -7
- data/lib/ruby_smb/gss/provider/ntlm.rb +4 -0
- data/lib/ruby_smb/version.rb +1 -1
- data/spec/lib/ruby_smb/client_spec.rb +11 -2
- data.tar.gz.sig +1 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5567054608b80da9be641c717d1d8b69e71452fb2fc67c2e390d9a6a34fb19d3
|
4
|
+
data.tar.gz: 0b439033b20bd578414e51d56d98ee4ccc4d44c60e6248bf0b8ad37a33b0fd6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
27
|
-
# it indicates that the server
|
28
|
-
#
|
29
|
-
# request to negotiate the actual SMB 2 Protocol revision to
|
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 ==
|
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('')
|
data/lib/ruby_smb/version.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
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
|