require 'ronin/generators/exploits/remote_udp' require 'ronin/exploits/remote_udp' require 'spec_helper' require 'generators/exploits/exploit_examples' require 'tmpdir' require 'fileutils' describe Generators::Exploits::RemoteUDP do before(:all) do @path = File.join(Dir.tmpdir,'generated_exploit.rb') Generators::Exploits::RemoteUDP.generate( { :helpers => ['buffer_overflow'], :controls => ['code_exec'], :default_port => 22 }, [@path] ) @exploit = Exploits::RemoteUDP.load_from(@path) end it_should_behave_like "an Exploit" it "should define a RemoteUDP exploit" do @exploit.class.should == Exploits::RemoteUDP 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