Sha256: 8a85442bfdc093833eeba8905a41c7c62d900b6708fc8ddb406eb000dbd6c3a3

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

require 'ronin/generators/exploits/web'
require 'ronin/exploits/web'

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

require 'tmpdir'
require 'fileutils'

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

    Generators::Exploits::Web.generate(
      {
        :helpers => ['buffer_overflow'],
        :controls => ['code_exec'],
        :url_path => '/some/path',
        :url_query => 'var=1'
      },
      [@path]
    )

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

  it_should_behave_like "an Exploit"

  it "should define a Web exploit" do
    @exploit.class.should == Exploits::Web
  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 url_path property" do
    @exploit.url_path.should == '/some/path'
  end

  it "should set the url_query property" do
    @exploit.url_query.should == 'var=1'
  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/web_spec.rb
ronin-exploits-0.3.0 spec/generators/exploits/web_spec.rb