ruby_smb 3.3.16 → 3.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ruby_smb/client/authentication.rb +3 -0
- data/lib/ruby_smb/client.rb +12 -0
- data/lib/ruby_smb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a184f6972edec8968cd3c69c2c4adb46f62f1ebd652c5b0013ba87d074f3cc8
|
|
4
|
+
data.tar.gz: e48dc3bf1a1a1771672ac7fbce126da175a596ce3fe4951f8b83e4aec2dcca50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb45e333f0167db6b3a8d9cacb398d10cc2f5f611d4696c98b76f4daa8b2b1ed9ab03c3e1de83d78114d92f25c6803774fd0204a91e509ad755d4ea891986620
|
|
7
|
+
data.tar.gz: 81e33299c43682283cd663128ac1a765fdc460e04d57468004965662439d4193f2c422de6f20754b4e77f99461ef317b0b373ffd6c4851b014d4504927d3e05f
|
|
@@ -31,6 +31,7 @@ module RubySMB
|
|
|
31
31
|
#
|
|
32
32
|
# @return [WindowsError::ErrorCode] the status code the server returned
|
|
33
33
|
def smb1_anonymous_auth
|
|
34
|
+
@mech_type = :anonymous
|
|
34
35
|
request = smb1_anonymous_auth_request
|
|
35
36
|
raw_response = send_recv(request)
|
|
36
37
|
response = smb1_anonymous_auth_response(raw_response)
|
|
@@ -73,6 +74,7 @@ module RubySMB
|
|
|
73
74
|
# Handles the SMB1 NTLMSSP 4-way handshake for Authentication and store
|
|
74
75
|
# information about the peer/server.
|
|
75
76
|
def smb1_authenticate
|
|
77
|
+
@mech_type = :ntlm
|
|
76
78
|
response = smb1_ntlmssp_negotiate
|
|
77
79
|
challenge_packet = smb1_ntlmssp_challenge_packet(response)
|
|
78
80
|
|
|
@@ -205,6 +207,7 @@ module RubySMB
|
|
|
205
207
|
# Handles the SMB2 NTLMSSP 4-way handshake for Authentication and store
|
|
206
208
|
# information about the peer/server.
|
|
207
209
|
def smb2_authenticate
|
|
210
|
+
@mech_type = :ntlm
|
|
208
211
|
response = smb2_ntlmssp_negotiate
|
|
209
212
|
challenge_packet = smb2_ntlmssp_challenge_packet(response)
|
|
210
213
|
if @dialect == '0x0311'
|
data/lib/ruby_smb/client.rb
CHANGED
|
@@ -517,6 +517,18 @@ module RubySMB
|
|
|
517
517
|
break
|
|
518
518
|
end unless version == 'SMB1'
|
|
519
519
|
|
|
520
|
+
# Handle STATUS_NETWORK_SESSION_EXPIRED. The 'net use' client upon receiving this error will automatically attempt
|
|
521
|
+
# to re-authenticate, which makes relaying ntlm authentication to multiple targets possible. This block ensures
|
|
522
|
+
# ruby_smb behaves in the same manner as 'net use'.
|
|
523
|
+
if smb2_header && smb2_header.nt_status == WindowsError::NTStatus::STATUS_NETWORK_SESSION_EXPIRED && !@mech_type.nil?
|
|
524
|
+
if @mech_type == :ntlm || @mech_type == :anonymous
|
|
525
|
+
session_setup(self.username, self.password, self.domain, local_workstation: self.local_workstation, ntlm_flags: NTLM::DEFAULT_CLIENT_FLAGS)
|
|
526
|
+
raw_response = send_recv(packet, encrypt: encrypt) # Retry the request after re-authentication
|
|
527
|
+
elsif @mech_type == :kerberos
|
|
528
|
+
raise RubySMB::Error::RubySMBError, 'WindowsError::NTStatus::STATUS_NETWORK_SESSION_EXPIRED received, but kerberos authentication is being used, so automatic re-authentication cannot be attempted.'
|
|
529
|
+
end
|
|
530
|
+
end
|
|
531
|
+
|
|
520
532
|
self.sequence_counter += 1 if signing_required && !session_key.empty?
|
|
521
533
|
# update the SMB2 message ID according to the received Credit Charged
|
|
522
534
|
self.smb2_message_id += smb2_header.credit_charge - 1 if smb2_header && self.server_supports_multi_credit
|
data/lib/ruby_smb/version.rb
CHANGED
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.3.
|
|
4
|
+
version: 3.3.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Metasploit Hackers
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
autorequire:
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date:
|
|
16
|
+
date: 2026-03-24 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: redcarpet
|