rex-powershell 0.1.97 → 0.1.98

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75fbdb9e740da4d78071180f1f8e0c4a47e51d5edeea71de0c405b142a9597e3
4
- data.tar.gz: e19b54cc5b2c39d82b90076212126a67d269462009ef730ff11cde6fbcf68a7a
3
+ metadata.gz: 8ee9b7efcf1354be8d350fff79d6201a00190226945ec746e8f0310a31c1ffeb
4
+ data.tar.gz: 5715250b6743b6a1c48d9c0270155a7e841892ff8bbe1aa21fe30957f9f91e0c
5
5
  SHA512:
6
- metadata.gz: 72a380c5e7996721cd8057b39f116185ba05be9ba8c4390ec97bb632838cd49323f7db1f4994f2fd6033649fe2d3d605352b81a7ade7181a047b7a96c4ff22e0
7
- data.tar.gz: 201ef95d5946fd001025c933c16e58027fffed420b325c08fbf84b4a0598abdc880c4a666078f611757194317f98e2bf1ba341dc8bfdadc5de6028e32298ae93
6
+ metadata.gz: 9cf1ad34f336ab4a62b3982de8710578b68252de0cef6ed7b97d1e9b03e1320e543683c06a4d74f99424af3e7d988eee2cba290a5b015a372d10724791c9b5aa
7
+ data.tar.gz: 9b9e1ad0895957fa90eebb78891efeef90f16d3ecd9135b8ab19bc0342d05cb83a5c9e69bacc574110d5fbec415b6fda6f8e76a111c761689192e58c24f6dcca
checksums.yaml.gz.sig CHANGED
Binary file
@@ -172,6 +172,19 @@ module Powershell
172
172
  %Q^[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;^
173
173
  end
174
174
 
175
+ # Use the default system web proxy and credentials
176
+ #
177
+ # @return [String] Powershell code to use the default system web proxy and credentials
178
+ def self.proxy_aware
179
+ var = Rex::Text.rand_text_alpha(1)
180
+ cmd = "$#{var}=new-object net.webclient;"
181
+ cmd << "if([System.Net.WebProxy]::GetDefaultProxy().address -ne $null){"
182
+ cmd << "$#{var}.proxy=[Net.WebRequest]::GetSystemWebProxy();"
183
+ cmd << "$#{var}.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;"
184
+ cmd << "};"
185
+ cmd
186
+ end
187
+
175
188
  #
176
189
  # Use the default system web proxy and credentials to download a URL
177
190
  # as a string and execute the contents as PowerShell
@@ -181,14 +194,7 @@ module Powershell
181
194
  #
182
195
  # @return [String] PowerShell code to download a URL
183
196
  def self.proxy_aware_download_and_exec_string(urls, iex = true)
184
- var = Rex::Text.rand_text_alpha(1)
185
- cmd = "$#{var}=new-object net.webclient;"
186
- cmd << "if([System.Net.WebProxy]::GetDefaultProxy().address -ne $null){"
187
- cmd << "$#{var}.proxy=[Net.WebRequest]::GetSystemWebProxy();"
188
- cmd << "$#{var}.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;"
189
- cmd << "};"
190
- cmd << download_and_exec_string(urls, iex)
191
- cmd
197
+ "#{self.proxy_aware}#{download_and_exec_string(urls, iex)}"
192
198
  end
193
199
 
194
200
  def self.uglify_ps(script)
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Powershell
3
- VERSION = "0.1.97"
3
+ VERSION = "0.1.98"
4
4
  end
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-powershell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.97
4
+ version: 0.1.98
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2022-08-31 00:00:00.000000000 Z
96
+ date: 2023-06-12 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
@@ -219,8 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  requirements: []
222
- rubyforge_project:
223
- rubygems_version: 2.7.10
222
+ rubygems_version: 3.1.4
224
223
  signing_key:
225
224
  specification_version: 4
226
225
  summary: Rex Powershell Utilities
metadata.gz.sig CHANGED
Binary file