Sha256: 907e310c5f6fb03408533700415a92f6b1cb62537ffe69f8044a9dbe7db893fc

Contents?: true

Size: 718 Bytes

Versions: 13

Compression:

Stored size: 718 Bytes

Contents

#!/usr/bin/ruby

#
# This script is for testing the Protocol Negotiation in the library
# without any other parts.

require 'bundler/setup'
require 'ruby_smb'

def run_negotiation(address, smb1, smb2)
  # Create our socket and add it to the dispatcher
  sock = TCPSocket.new address, 445
  dispatcher = RubySMB::Dispatcher::Socket.new(sock)

  client = RubySMB::Client.new(dispatcher, smb1: smb1, smb2: smb2, username: 'msfadmin', password: 'msfadmin')
  client.negotiate
end

# Negotiate with both SMB1 and SMB2 enabled on the client
run_negotiation(ARGV[0], true, true)
# Negotiate with only SMB1 enabled
run_negotiation(ARGV[0], true, false)
# Negotiate with only SMB2 enabled
run_negotiation(ARGV[0], false, true)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby_smb-1.1.0 examples/negotiate.rb
ruby_smb-1.0.5 examples/negotiate.rb
ruby_smb-1.0.4 examples/negotiate.rb
ruby_smb-1.0.3 examples/negotiate.rb
ruby_smb-1.0.2 examples/negotiate.rb
ruby_smb-1.0.1 examples/negotiate.rb
ruby_smb-1.0.0 examples/negotiate.rb
ruby_smb-0.0.24 examples/negotiate.rb
ruby_smb-0.0.23 examples/negotiate.rb
ruby_smb-0.0.22 examples/negotiate.rb
ruby_smb-0.0.21 examples/negotiate.rb
ruby_smb-0.0.20 examples/negotiate.rb
ruby_smb-0.0.19 examples/negotiate.rb