Skip to content

Commit d6303f9

Browse files
authored
Merge pull request #5 from GrahamMThomas/MetasploitAdapter
Add the metasploit attack adapter and 2 example use cases
2 parents f5f4b88 + 04c4701 commit d6303f9

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
When /^"metasploit" is installed$/ do
2+
ensure_cli_installed("msfconsole")
3+
end
4+
5+
When /^I launch (?:a|an) "metasploit" attack with:$/ do |command|
6+
if command.include? "exit"
7+
run_with_profile command
8+
else
9+
run_with_profile command + " exit;"
10+
end
11+
end
12+
13+
When /^I launch (?:a|an) "metasploit" vulnerability check with:$/ do |command|
14+
if !(command.include? "check")
15+
command += "check;"
16+
end
17+
if !(command.include? "exit")
18+
command += "exit;"
19+
end
20+
run_with_profile command
21+
end
22+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@slow
2+
3+
Feature: Test a UDP sweep
4+
Background:
5+
Given "metasploit" is installed
6+
And the following profile:
7+
| name | value |
8+
| RHOSTS | localhost |
9+
10+
Scenario: Attempt a UDP sweep with msfconsole
11+
12+
13+
When I launch a "metasploit" attack with:
14+
"""
15+
msfconsole -x "use auxiliary/scanner/discovery/udp_sweep;set RHOSTS <RHOSTS>; exploit; exit"
16+
17+
"""
18+
19+
Then it should pass with:
20+
"""
21+
Auxiliary module execution completed
22+
"""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@slow
2+
3+
Feature: Test if RHOST is vulnerable to ms08_067 exploit
4+
Background:
5+
Given "metasploit" is installed
6+
And the following profile:
7+
| name | value |
8+
| RHOST | 192.168.1.218 |
9+
10+
Scenario: Check if RHOST is vulnerable
11+
12+
13+
When I launch a "metasploit" vulnerability check with:
14+
"""
15+
msfconsole -x "use exploit/windows/smb/ms08_067_netapi; set RHOST <RHOST>; check;"
16+
"""
17+
18+
Then it should pass with:
19+
"""
20+
The target is not exploitable.
21+
"""

0 commit comments

Comments
 (0)