You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/metasploit-framework.wiki/Loading-Test-Modules.md
+71-2Lines changed: 71 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,8 @@
1
-
By default test modules in Metasploit are not loaded when Metasploit starts. To load them, run `loadpath test/modules` after which you should see output similar to the following:
1
+
Metasploit offers inbuilt test modules which can be used for verifying Metasploit's post-exploitations work with currently opened sessions.
2
+
These modules are intended to be used by developers to test updates to ensure they don't break core functionality
3
+
and should not be used during normal operations. These modules also as part of the automated test suite within pull requests.
4
+
5
+
By default the test modules in Metasploit are not loaded when Metasploit starts. To load them, run `loadpath test/modules` after which you should see output similar to the following:
2
6
3
7
```msf
4
8
msf6 > loadpath test/modules
@@ -9,4 +13,69 @@ Loaded 38 modules:
9
13
msf6 >
10
14
```
11
15
12
-
These modules are intended to be used by developers to test updates to ensure they don't break core functionality and should not be used during normal operations. If you do happen to break the functionality of one of these modules, it is highly recommended that you look at what you are proposing within your PR and ensure that you are not accidentally breaking unintended functionality. If you do need to break certain functionality in order to add a given feature, and there is no other way to go around this, be sure to let one of the Metasploit team members know this so that appropriate updates can be made to these scripts and any associated code that may be updated by your change (assuming it is has been signed off and approved by the team).
16
+
The modules can be searched for:
17
+
18
+
```msf
19
+
msf6 > search post/test
20
+
21
+
Matching Modules
22
+
================
23
+
24
+
# Name Disclosure Date Rank Check Description
25
+
- ---- --------------- ---- ----- -----------
26
+
0 post/test/cmd_exec . normal No Meterpreter cmd_exec test
27
+
1 post/test/railgun . normal No Railgun API Tests
28
+
2 post/test/extapi . normal No Test Meterpreter ExtAPI Stuff
29
+
3 post/test/get_env . normal No Test Post::Common Get Envs
30
+
4 post/test/services . normal No Test Post::Windows::Services
31
+
5 post/test/all . normal No Test all applicable post modules
32
+
... etc etc ...
33
+
```
34
+
35
+
Example of running the test module against an opened session:
36
+
37
+
```
38
+
msf6 > use post/test/cmd_exec
39
+
msf6 post(test/cmd_exec) > run session=-1
40
+
...
41
+
[*] Testing complete in 2.04 seconds
42
+
[*] Passed: 6; Failed: 0; Skipped: 0
43
+
[*] Post module execution completed
44
+
```
45
+
46
+
The `post/test/all` module is an aggregate module that can be used to quickly run all of the applicable test modules
0 commit comments