Sha256: f54e6b4f34d64ba76c62eb41578ccdb9cab58db713fe36bccbfeb9d5d433ed88

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require 'ronin/generators/exploits/remote_tcp'
require 'ronin/exploits/remote_tcp'

require 'spec_helper'
require 'generators/exploits/exploit_examples'

require 'tmpdir'
require 'fileutils'

describe Generators::Exploits::RemoteTCP do
  before(:all) do
    @path = File.join(Dir.tmpdir,'generated_exploit.rb')

    Generators::Exploits::RemoteTCP.generate(
      {
        :helpers => ['buffer_overflow'],
        :controls => ['code_exec'],
        :default_port => 22
      },
      [@path]
    )

    @exploit = Exploits::RemoteTCP.load_from(@path)
  end

  it_should_behave_like "an Exploit"

  it "should define a RemoteTCP exploit" do
    @exploit.class.should == Exploits::RemoteTCP
  end

  it "should define helpers to load" do
    @exploit.kind_of?(Exploits::Helpers::BufferOverflow).should == true
  end

  it "should define controlled behaviors" do
    @exploit.behaviors.should == [:code_exec]
  end

  it "should set the default_port property" do
    @exploit.default_port.should == 22
  end

  after(:all) do
    FileUtils.rm(@path)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-exploits-0.3.1 spec/generators/exploits/remote_tcp_spec.rb
ronin-exploits-0.3.0 spec/generators/exploits/remote_tcp_spec.rb