Sha256: 8b841034470847ae45d0cc46b876e713cf892b79dd6f9fd51acf513dd951b2f2

Contents?: true

Size: 719 Bytes

Versions: 11

Compression:

Stored size: 719 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

11 entries across 11 versions & 1 rubygems

Version Path
ruby_smb-0.0.18 examples/negotiate.rb
ruby_smb-0.0.17 examples/negotiate.rb
ruby_smb-0.0.16 examples/negotiate.rb
ruby_smb-0.0.15 examples/negotiate.rb
ruby_smb-0.0.14 examples/negotiate.rb
ruby_smb-0.0.13 examples/negotiate.rb
ruby_smb-0.0.12 examples/negotiate.rb
ruby_smb-0.0.11 examples/negotiate.rb
ruby_smb-0.0.10 examples/negotiate.rb
ruby_smb-0.0.9 examples/negotiate.rb
ruby_smb-0.0.8 examples/negotiate.rb