mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-08-28 23:26:18 +02:00
working on a first pass at cucumber for framework
This commit is contained in:
parent
fc65a45d94
commit
c82ba34f7c
7
Gemfile
7
Gemfile
@ -38,7 +38,12 @@ group :development, :test do
|
||||
gem 'rspec', '>= 2.12', '< 3.0.0'
|
||||
# Define `rake spec`. Must be in development AND test so that its available by default as a rake test when the
|
||||
# environment is development
|
||||
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
|
||||
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
|
||||
|
||||
gem 'cucumber'
|
||||
|
||||
gem 'aruba'
|
||||
|
||||
end
|
||||
|
||||
group :pcap do
|
||||
|
16
Gemfile.lock
16
Gemfile.lock
@ -45,9 +45,20 @@ GEM
|
||||
arel (3.0.3)
|
||||
arel-helpers (2.0.1)
|
||||
activerecord (>= 3.1.0, < 5)
|
||||
aruba (0.6.0)
|
||||
childprocess (>= 0.3.6)
|
||||
cucumber (>= 1.1.1)
|
||||
rspec-expectations (>= 2.7.0)
|
||||
bcrypt (3.1.7)
|
||||
builder (3.0.4)
|
||||
childprocess (0.5.3)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
coderay (1.1.0)
|
||||
cucumber (1.2.1)
|
||||
builder (>= 2.1.2)
|
||||
diff-lcs (>= 1.1.3)
|
||||
gherkin (~> 2.11.0)
|
||||
json (>= 1.4.6)
|
||||
diff-lcs (1.2.5)
|
||||
erubis (2.7.0)
|
||||
factory_girl (4.4.0)
|
||||
@ -55,7 +66,10 @@ GEM
|
||||
factory_girl_rails (4.4.1)
|
||||
factory_girl (~> 4.4.0)
|
||||
railties (>= 3.0.0)
|
||||
ffi (1.9.3)
|
||||
fivemat (1.2.1)
|
||||
gherkin (2.11.6)
|
||||
json (>= 1.7.6)
|
||||
hike (1.2.3)
|
||||
i18n (0.6.11)
|
||||
journey (1.0.4)
|
||||
@ -157,6 +171,8 @@ PLATFORMS
|
||||
|
||||
DEPENDENCIES
|
||||
activerecord (>= 3.0.0, < 4.0.0)
|
||||
aruba
|
||||
cucumber
|
||||
factory_girl (>= 4.1.0)
|
||||
factory_girl_rails
|
||||
fivemat (= 1.2.1)
|
||||
|
12
Rakefile
Normal file → Executable file
12
Rakefile
Normal file → Executable file
@ -9,3 +9,15 @@ require 'metasploit/framework/require'
|
||||
Metasploit::Framework::Require.optionally_active_record_railtie
|
||||
|
||||
Metasploit::Framework::Application.load_tasks
|
||||
|
||||
|
||||
begin
|
||||
require 'cucumber'
|
||||
require 'cucumber/rake/task'
|
||||
Cucumber::Rake::Task.new(:features) do |t|
|
||||
t.cucumber_opts = 'features --format pretty'
|
||||
end
|
||||
rescue LoadError
|
||||
puts "cucumber not in bundle, so can't set up feature tasks. " \
|
||||
"To run features ensure to install the development and test groups."
|
||||
end
|
20
features/msfconsole.feature
Normal file
20
features/msfconsole.feature
Normal file
@ -0,0 +1,20 @@
|
||||
Feature: test msfconsole
|
||||
|
||||
Scenario: This works
|
||||
When I run `msfconsole` interactively
|
||||
And I type "help"
|
||||
And I type "exit"
|
||||
Then the output should contain:
|
||||
"""
|
||||
Commands
|
||||
"""
|
||||
|
||||
Scenario: stuff
|
||||
When I run `msfconsole` interactively
|
||||
And I type "use exploit/windows/smb/ms08_067_netapi"
|
||||
And I type "set RHOST w2k3sp2-x86-u.vuln.lax.rapid7.com"
|
||||
And I type "set PAYLOAD windows/meterpreter/bind_tcp"
|
||||
And I type "run"
|
||||
And I type "exit"
|
||||
And I type "exit"
|
||||
Then the output should match /Meterpreter session \d+ opened/
|
11
features/support/env.rb
Normal file
11
features/support/env.rb
Normal file
@ -0,0 +1,11 @@
|
||||
require 'aruba/cucumber'
|
||||
paths = [
|
||||
File.expand_path(File.join(File.dirname(__FILE__))),
|
||||
File.expand_path(File.join(File.dirname(__FILE__), %w(.. ..))),
|
||||
ENV['PATH']
|
||||
]
|
||||
ENV['PATH'] = paths.join(File::PATH_SEPARATOR)
|
||||
#"#{File.expand_path(File.join(File.dirname(__FILE__)))}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
||||
Before do
|
||||
@aruba_timeout_seconds = 60
|
||||
end
|
2
features/support/stty
Executable file
2
features/support/stty
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user