rex-random_identifier 0.1.16 → 0.1.18

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: 8df21bef52b2606256edc78847b153c6ce2c80a1d3c27a10022b75f9045aa200
4
- data.tar.gz: f1e0077afa91714b3e36e9e7b77865749f259f6dd0e0df71105750b51272e3b7
3
+ metadata.gz: 615a0a02f3a8f12d617828ee1875a52c6aee60d81ce8a22268ee0dd405846eec
4
+ data.tar.gz: 55279a15cd3270f734fa402795581021a272492fd46e24234a9932448d139154
5
5
  SHA512:
6
- metadata.gz: 2d3558806ac016b5fbe052ecff87aeb2651441e4ba52cd8dfd6d2a868300d98e5817540143eb7fb0dee9afb3eee428b3cc26b7ac5f350eec1f1acdf7e1754027
7
- data.tar.gz: 442aeed7f51e32e3d729e2aca6ce4b6dd8ee73421ce113c0e9e7834dc716f57be1a43275502d16880c2dd56a69c8d8ac2dc9d8843f86ab6498a2ca038b40f410
6
+ metadata.gz: a2984829ed7d831d0322bf3680d1b96f0428604f66b25c4170e99d9ae87000c898bfa022c2f7478afa7364351c664c1019748a9293625b46bae7300fa3a99609
7
+ data.tar.gz: fc10df6eaa64992e75dab3c55cb8353545d7c57c56a316b37b0abdd9216c95e8c47729ad6900a7b39953c27358242f4dbb73e8c10e0f9615de21d176937da53f
@@ -127,13 +127,149 @@ class Rex::RandomIdentifier::Generator
127
127
  )
128
128
  )
129
129
 
130
+ PowershellOpts = DefaultOpts.merge(
131
+ forbidden: (
132
+ # PowerShell reserved words and language keywords
133
+ # https://docs.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-02
134
+ # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_reserved_words
135
+ %w[
136
+ assembly base begin break catch class command configuration continue data define do dynamicparam else elseif
137
+ end enum exit filter finally for foreach from function hidden if in inlinescript interface module namespace
138
+ parallel param private process public return sequence static switch throw trap try type until using var while
139
+ workflow bool byte char decimal double float int long object sbyte short string uint ulong ushort
140
+ ] +
141
+ # Common .NET type names used in PowerShell
142
+ # https://learn.microsoft.com/en-us/dotnet/api/system#classes
143
+ %w[
144
+ accessviolationexception activator aggregateexception appcontext appdomain appdomainsetup appdomainunloadedexception
145
+ applicationexception applicationid argumentexception argumentnullexception argumentoutofrangeexception
146
+ arithmeticexception array arraytypemismatchexception assemblyloadeventargs attribute attributeusageattribute
147
+ badimageformatexception bitconverter buffer cannotunloadappdomainexception charenumerator clscompliantattribute
148
+ console consolecanceleventargs contextboundobject contextmarshalexception contextstaticattribute convert
149
+ datamisalignedexception dbnull delegate dividebyzeroexception dllnotfoundexception duplicatewaitobjectexception
150
+ entrypointnotfoundexception enum environment eventargs exception executionengineexception fieldaccessexception
151
+ filestyleuriparser flagsattribute formatexception formattablestring ftpstyleuriparser gc genericheruriparser
152
+ gopherstyleuriparser httpstyleuriparser indexoutofrangeexception insufficientexecutionstackexception
153
+ insufficientmemoryexception invalidcastexception invalidoperationexception invalidprogramexception
154
+ invalidtimezoneexception lazy ldapstyleuriparser loaderoptimizationattribute localdatastoreslot
155
+ marshalbyrefobject math mathf memberaccessexception memoryextensions methodaccessexception missingfieldexception
156
+ missingmemberexception missingmethodexception mtathreadattribute multicastdelegate multicastnotsupportedexception
157
+ netpipestyleuriparser nettcpstyleuriparser newsstyleuriparser nonserializedattribute notfinitenumberexception
158
+ notimplementedexception notsupportedexception nullable nullreferenceexception object objectdisposedexception
159
+ obsoleteattribute operatingsystem operationcanceledexception outofmemoryexception overflowexception
160
+ paramarrayattribute platformnotsupportedexception progress random rankexception resolveeventargs
161
+ serializableattribute stackoverflowexception stathreadattribute string stringcomparer stringnormalizationextensions
162
+ systemexception threadstaticattribute timeoutexception timeprovider timezone timezoneinfo
163
+ timezonenotfoundexception tuple tupleextensions type typeaccessexception typeinitializationexception
164
+ typeloadexception typeunloadedexception unauthorizedaccessexception unhandledexceptioneventargs uri uribuilder
165
+ uriformatexception uriparser uritypeconverter valuetype version weakreference
166
+ array datetime hashtable psobject scriptblock timespan void xml
167
+ ] +
168
+ # Common .NET struct types used in PowerShell
169
+ # https://learn.microsoft.com/en-us/dotnet/api/system#structs
170
+ %w[
171
+ argiterator boolean byte char consolekey consolekeyinfo datetime datetimeoffset dayofweek decimal double
172
+ guid int16 int32 int64 intptr memory nullable range rune runtime sbyte single timeonly timespan
173
+ typedreference uint16 uint32 uint64 uintptr valuetuple void arithmeticexception argumentexception
174
+ argumentnullexception argumentoutofrangeexception badimageformatexception cannotunloadappdomainexception
175
+ contextmarshalexception datamisalignedexception dividebyzeroexception dllnotfoundexception
176
+ duplicatewaitobjectexception entrypointnotfoundexception executionengineexception fieldaccessexception
177
+ formatexception indexoutofrangeexception insufficientexecutionstackexception insufficientmemoryexception
178
+ invalidcastexception invalidoperationexception invalidprogramexception invalidtimezoneexception
179
+ memberaccessexception methodaccessexception missingfieldexception missingmemberexception
180
+ missingmethodexception multicastnotsupportedexception notfinitenumberexception notimplementedexception
181
+ notsupportedexception nullreferenceexception objectdisposedexception operationcanceledexception
182
+ outofmemoryexception overflowexception platformnotsupportedexception rankexception stackoverflowexception
183
+ systemexception timeoutexception typeaccessexception typeinitializationexception typeloadexception
184
+ typeunloadedexception unauthorizedaccessexception
185
+ ] +
186
+ # Common .NET interface types used in PowerShell
187
+ # https://learn.microsoft.com/en-us/dotnet/api/system#interfaces
188
+ %w[
189
+ iasyncresult icloneable icomparable icomparer iconvertible icustomformatter idisposable iequalitycomparer
190
+ iformattable iformatprovider iserviceprovider ienumerable ienumerator icollection ilist idictionary
191
+ ireadonlycollection ireadonlylist ireadonlydictionary iset iproducerconsumercollection
192
+ iconcurrentcollection inotifypropertychanged inotifycollectionchanged iobserver iobservable
193
+ ituple istructuralcomparable istructuralequatable ispanformattable ibinaryinteger ibinaryfloatingpoint
194
+ ibitwiseoperators icomparisonoperators iequalityoperators iincrementoperators iminmaxvalue
195
+ inumberbase iadditionoperators isubtractionoperators imultiplicationoperators idivisionoperators
196
+ imodaoperators ishiftoperators iunaryoperators iparsable ispanparsable iformatable
197
+ ] +
198
+ # Common .NET enum types used in PowerShell
199
+ # https://learn.microsoft.com/en-us/dotnet/api/system#enums
200
+ %w[
201
+ attributetargets base64formattingoptions consolecolor datetimekind dayofweek environmentspecialfolder
202
+ environmentvariabletarget gctype gcgeneration genotificationstatus globalizationmode
203
+ loaderoption midsreamstarttype normalizedform operatingsystem platformid processorarchitecture
204
+ stringcomparison stringsplitopions typecode urikind uricomponents urihostnametype uriformat
205
+ comparetoptions culturedupinfallbackstyles datetimestyles numberstyles runtimeidentifiertype
206
+ securityruleset targetframeworkmoniker timezonefindtype unmanagedfunctionpointercallingconvention
207
+ fileattributes fileaccess filemode fileshare fileaction filetype searchoption directoryoption
208
+ consolecanceltype consolespecialkey consolemodifiers
209
+ ] +
210
+ # Common .NET delegate types used in PowerShell
211
+ # https://learn.microsoft.com/en-us/dotnet/api/system#delegates
212
+ %w[
213
+ action func predicate comparison converter eventhandler asynccallback crossapplicationstringproc
214
+ waitortimercallback timerproc unhandledexceptioneventhandler assemblybindingprovider resolvehandler
215
+ convolecallback appdomainunloadhandler assemblyhandler modulehandler contexthandler
216
+ loadeventhandler unloadeventhandler begininvokedelegate endinvokedelegate asyncresultdelegate
217
+ predefineddelegate delegateserial multidelgate singletondelegate
218
+ ] +
219
+ # PowerShell variable scope keywords
220
+ # https://docs.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-02
221
+ %w[
222
+ global local private script using workflow
223
+ ] +
224
+ # PowerShell automatic variables
225
+ # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables
226
+ %w[
227
+ args consolefilename error executioncontext false home host input lastexitcode matches myinvocation nestedpromptlevel
228
+ null pid profile pscmdlet pscommandpath pshome psscriptroot psversiontable pwd shellid stacktrace true
229
+ ] +
230
+ # PowerShell preference variables
231
+ # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables
232
+ %w[
233
+ confirmpreference debugpreference erroractionpreference errorview formatenumerationlimit informationpreference
234
+ logcommandhealthevent logcommandlifecycleevent lopenginehealthevent logenginelifecycleevent logproviderhealthevent
235
+ logproviderlifecycleevent maximumhistorycount ofs outputencoding progresspreference psdefaultparametervalues
236
+ psemailserver psmoduleautoloadingpreference psnativecommandargumentpassing psnativecommanduseerroractionpreference
237
+ pssessionapplicationname pssessionconfigurationname pssessionoption psstyle transcript verbosepreference
238
+ specsapreference whatifpreference
239
+ ] +
240
+ # Common PowerShell cmdlets that should be avoided as identifiers
241
+ # https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands
242
+ %w[
243
+ add clear copy export find format get import invoke join move new out read remove rename select set sort
244
+ split start stop test where write compare group measure tee convertfrom convertto foreach object sort unique
245
+ first last skip skipuntil takewhile
246
+ ] +
247
+ # Common PowerShell cmdlet aliases and shortnames
248
+ # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_aliases
249
+ %w[
250
+ cat cd chdir clc clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cwmi dbp del diff dir echo epal epcsv
251
+ fc fhx fl foreach ft fw gal gbp gc gci gcm gcs gdr ghy gi gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv
252
+ gwmi h history icm iex ihy ii ipal ipcsv irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr
253
+ ni nmo npssc nsn nv ogv oh popd pushd pwd r rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rv
254
+ rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start sv swmi
255
+ tee type wget where wjb write
256
+ ] +
257
+ # PowerShell operators (word-based)
258
+ # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_operators
259
+ %w[
260
+ and band bnot bor bxor not or xor eq ne gt ge lt le like notlike match notmatch contains notcontains in notin
261
+ replace split join is isnot as
262
+ ]
263
+ ).uniq.freeze
264
+ )
265
+
130
266
  Opts = {
131
267
  default: DefaultOpts,
132
268
  java: JavaOpts,
133
269
  jsp: JSPOpts,
134
270
  javascript: JavaScriptOpts,
135
- php: PHPOpts,
136
- python: PythonOpts
271
+ python: PythonOpts,
272
+ powershell: PowershellOpts
137
273
  }
138
274
 
139
275
  # @param opts [Hash] Options, see {DefaultOpts} for default values
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module RandomIdentifier
3
- VERSION = "0.1.16"
3
+ VERSION = "0.1.18"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-random_identifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-22 00:00:00.000000000 Z
11
+ date: 2025-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake