Sha256: c02230d76cfabe1b6cbccb82760b71ef5885209c35760c5698c50044c40f4d86

Contents?: true

Size: 914 Bytes

Versions: 2

Compression:

Stored size: 914 Bytes

Contents

require 'ronin/generators/exploits/remote'
require 'ronin/exploits/remote'

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

require 'tmpdir'
require 'fileutils'

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

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

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

  it_should_behave_like "an Exploit"

  it "should define a Remote exploit" do
    @exploit.class.should == Exploits::Remote
  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

  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_spec.rb
ronin-exploits-0.3.0 spec/generators/exploits/remote_spec.rb