Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/spec/lib/msf/base/sessions/mssql_spec.rb
Views: 11766
# frozen_string_literal: true12require 'spec_helper'3require 'rex/post/mssql'45RSpec.describe Msf::Sessions::MSSQL do6let(:client) { instance_double(Rex::Proto::MSSQL::Client) }7let(:opts) { { client: client, platform: Msf::Platform::Linux.realname, arch: ARCH_X86_64 } }8let(:console_class) { Rex::Post::MSSQL::Ui::Console }9let(:user_input) { instance_double(Rex::Ui::Text::Input::Readline) }10let(:user_output) { instance_double(Rex::Ui::Text::Output::Stdio) }11let(:name) { 'mssql' }12let(:log_source) { "session_#{name}" }13let(:type) { 'mssql' }14let(:description) { 'MSSQL' }15let(:can_cleanup_files) { false }16let(:address) { '192.0.2.1' }17let(:port) { 1433 }18let(:peer_info) { "#{address}:#{port}" }19let(:console) do20console = Rex::Post::MSSQL::Ui::Console.new(session)21console.disable_output = true22console23end24let(:envchange_result) { { type: 1, old: 'master', new: 'master' } }2526before(:each) do27allow(user_input).to receive(:intrinsic_shell?).and_return(true)28allow(user_input).to receive(:output=)29allow(client).to receive(:initial_info_for_envchange).with({ envchange: 1 }).and_return(envchange_result)30allow(client).to receive(:peerinfo).and_return(peer_info)31allow(client).to receive(:peerport).and_return(port)32allow(client).to receive(:peerhost).and_return(address)33end3435it_behaves_like 'client session'36end373839