rex-powershell 0.1.97 → 0.1.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75fbdb9e740da4d78071180f1f8e0c4a47e51d5edeea71de0c405b142a9597e3
4
- data.tar.gz: e19b54cc5b2c39d82b90076212126a67d269462009ef730ff11cde6fbcf68a7a
3
+ metadata.gz: 466153fc97b728e6900e529dabcf7879566dcd6890f38761280bcacc8d26d997
4
+ data.tar.gz: 3a728db9d63ba9c82855a1a47ca3681da0df411025e416ce373092f4fa90af58
5
5
  SHA512:
6
- metadata.gz: 72a380c5e7996721cd8057b39f116185ba05be9ba8c4390ec97bb632838cd49323f7db1f4994f2fd6033649fe2d3d605352b81a7ade7181a047b7a96c4ff22e0
7
- data.tar.gz: 201ef95d5946fd001025c933c16e58027fffed420b325c08fbf84b4a0598abdc880c4a666078f611757194317f98e2bf1ba341dc8bfdadc5de6028e32298ae93
6
+ metadata.gz: 3a6bbfb03dd4ef23bc38901de697b2fb434917476197de73014e7890af56da47bec8bd2d0a9a3a9a0aefedbbdfc035c01e7fdb469469f1e904c4f91b4c311a92
7
+ data.tar.gz: b1f3fbd20e0f4fc0bb02c6a218d00c7b657a75e3a3e4715f618e959085ad8d75581282ae2834733e6703064e1fc58ac46192f010a333b22c74fbd5a0f2176b2d
checksums.yaml.gz.sig CHANGED
Binary file
data/cortex.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ info:
3
+ title: Rex Powershell
4
+ description: Rex library for dealing with Powershell Scripts
5
+ x-cortex-git:
6
+ github:
7
+ alias: r7org
8
+ repository: rapid7/rex-powershell
9
+ x-cortex-tag: rex-powershell
10
+ x-cortex-type: service
11
+ x-cortex-domain-parents:
12
+ - tag: metasploit
13
+ openapi: 3.0.1
14
+ servers:
15
+ - url: "/"
@@ -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.99"
4
4
  end
5
5
  end
data.tar.gz.sig CHANGED
@@ -1,2 +1,5 @@
1
- t��9)�/�%F�����J��<��l����,
2
- �c��c���.b��J�#7_�%�;�jt��Vb��'B����&>�gyP�|��˻�B68�4� �
1
+ Ǥ:�����F�a��e�Z׀j~����
2
+ 3���G7 \�n_;o0"pjd��خ ��GU��=��%�OpVndr11I��Өs5�������� ��+�U��,|>(%N���q��go��i.nH�r$N7�����;6`&��=pw�€VJm
3
+ �3(�먜�A�J,�`�}s�(|2�
4
+ ;��D��2�
5
+ e� *�ݕc�'7󧕃�O��%L��՘� �� .O'���f̋
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.99
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-10-04 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
@@ -182,6 +182,7 @@ files:
182
182
  - LICENSE
183
183
  - README.md
184
184
  - Rakefile
185
+ - cortex.yaml
185
186
  - data/templates/to_mem_dotnet.ps1.template
186
187
  - data/templates/to_mem_msil.ps1.template
187
188
  - data/templates/to_mem_old.ps1.template
@@ -219,8 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  - !ruby/object:Gem::Version
220
221
  version: '0'
221
222
  requirements: []
222
- rubyforge_project:
223
- rubygems_version: 2.7.10
223
+ rubygems_version: 3.1.4
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Rex Powershell Utilities
metadata.gz.sig CHANGED
Binary file