Skip to content

Instantly share code, notes, and snippets.

@jhart-r7
Created August 13, 2014 19:03
Show Gist options
  • Save jhart-r7/bf3f9b87ec92c5faaac0 to your computer and use it in GitHub Desktop.
Save jhart-r7/bf3f9b87ec92c5faaac0 to your computer and use it in GitHub Desktop.
msfconsole aruba POC
```
diff --git a/Gemfile b/Gemfile
index a5a71b8..d12c70b 100755
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,6 @@
source 'https://rubygems.org'
+gem 'aruba'
# Need 3+ for ActiveSupport::Concern
gem 'activesupport', '>= 3.0.0', '< 4.0.0'
# Needed for some admin modules (cfme_manageiq_evm_pass_reset.rb)
diff --git a/Gemfile.lock b/Gemfile.lock
index 0ae4dcf..cd3fb3e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -13,14 +13,28 @@ GEM
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
arel (3.0.2)
+ aruba (0.6.0)
+ childprocess (>= 0.3.6)
+ cucumber (>= 1.1.1)
+ rspec-expectations (>= 2.7.0)
ast (2.0.0)
bcrypt (3.1.7)
builder (3.0.4)
+ childprocess (0.5.3)
+ ffi (~> 1.0, >= 1.0.11)
+ cucumber (1.2.1)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.3)
+ gherkin (~> 2.11.0)
+ json (>= 1.4.6)
database_cleaner (1.1.1)
diff-lcs (1.2.4)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
+ ffi (1.9.3)
fivemat (1.2.1)
+ gherkin (2.11.6)
+ json (>= 1.7.6)
i18n (0.6.5)
json (1.8.0)
metasploit_data_models (0.17.0)
@@ -79,6 +93,7 @@ PLATFORMS
DEPENDENCIES
activerecord (>= 3.0.0, < 4.0.0)
activesupport (>= 3.0.0, < 4.0.0)
+ aruba
bcrypt
database_cleaner
factory_girl (>= 4.1.0)
diff --git a/features/msfconsole.feature b/features/msfconsole.feature
new file mode 100644
index 0000000..bbf49bb
--- /dev/null
+++ b/features/msfconsole.feature
@@ -0,0 +1,21 @@
+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 exploits/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/
+
diff --git a/features/support/env.rb b/features/support/env.rb
new file mode 100644
index 0000000..290a604
--- /dev/null
+++ b/features/support/env.rb
@@ -0,0 +1,5 @@
+require 'aruba/cucumber'
+ENV['PATH'] = "#{File.expand_path(File.join(File.dirname(__FILE__), %w(.. ..)))}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
+Before do
+ @aruba_timeout_seconds = 60
+end
diff --git a/stty b/stty
new file mode 100755
index 0000000..039e4d0
--- /dev/null
+++ b/stty
@@ -0,0 +1,2 @@
+#!/bin/sh
+exit 0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment