File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
documentation/samples/modules/post Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ ##
2
+ # This file is part of the Metasploit Framework and may be subject to
3
+ # redistribution and commercial restrictions. Please see the Metasploit
4
+ # web site for more information on licensing and terms of use.
5
+ # http://metasploit.com/
6
+ ##
7
+
8
+ require 'msf/core'
9
+ require 'msf/core/post/common'
10
+
11
+ ###
12
+ #
13
+ # This post module sample shows how we can execute a command on the compromised machine
14
+ #
15
+ ###
16
+ class Metasploit4 < Msf ::Post
17
+
18
+ include Msf ::Post ::Common
19
+
20
+ def initialize ( info = { } )
21
+ super ( update_info ( info ,
22
+ 'Name' => 'Sample Post Module' ,
23
+ 'Description' => %q{Sample Post Module} ,
24
+ 'License' => MSF_LICENSE ,
25
+ 'Author' => [ 'sinn3r' ] ,
26
+ 'Platform' => [ 'win' ] ,
27
+ 'SessionTypes' => [ "shell" , "meterpreter" ]
28
+ ) )
29
+ end
30
+
31
+ #
32
+ # This post module runs a ipconfig command and returns the output
33
+ #
34
+ def run
35
+ print_status ( "Executing ipconfig on remote machine" )
36
+ o = cmd_exec ( "ipconfig" )
37
+ print_line ( o )
38
+ end
39
+
40
+ end
You can’t perform that action at this time.
0 commit comments