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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/rex/powershell/psh_methods.rb +14 -8
- data/lib/rex/powershell/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ee9b7efcf1354be8d350fff79d6201a00190226945ec746e8f0310a31c1ffeb
|
4
|
+
data.tar.gz: 5715250b6743b6a1c48d9c0270155a7e841892ff8bbe1aa21fe30957f9f91e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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)
|
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.
|
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:
|
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
|
-
|
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
|