rex-text 0.2.32 → 0.2.36

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: 773453d5051de2afb27648e60806d80e5b8cd5c3cd090726be2c41d647045b97
4
- data.tar.gz: a42ef28301df43aaeff36747701d34ea2dbaeaab5ea541b64aee69961a1220af
3
+ metadata.gz: ed5e7201007a3c09cec5c931c006e00de6d55b0c76f602b7641c25b02c8d6a14
4
+ data.tar.gz: 445ecf81d92555096f960255bb8a424153f113735d88c02aec6fbaa3508dd250
5
5
  SHA512:
6
- metadata.gz: 1b90644c5cc4372da2e9a4101a5b68601e81db49f158c61645b1b8572f8e5daad6a5c31592130a60e647a6acc897e97ce6c50f2d21150089bbb1121f5df7cb32
7
- data.tar.gz: f037bbda67f8ee6ae64a8c9712bb765fbb66531c8e6b5a5e7efcc034d63894d810c18e3d6576a1706b00606c88366e5f2d047bd7fd5a06a92a9a5f29ad58ea82
6
+ metadata.gz: 9bb526a85fbeeef3a3afd1b1d9b26f3ab5025f27415b13528d96e9bdb61e0362e13f5939fa41b5c9882c118d490d0ca4f7c3c0bd9c56a2e129c7fde0f2c92620
7
+ data.tar.gz: 9ceb7ea946a1d2156614116c7f5b6d57f0529c464f1432e04c840f242e376f64b8c16c2807e7a9e2b7d45e0395ef1660c1d5c849676e72e83f1d03b0c8b4b81f
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ?d��l'���]ʧQ�<~��Vj?�S� �|�|���s]oF��T�q�Z�QzQ9 Z���`�5�a�� ���(6��Y��}�\� )l�c*g5�t��-��/�60�U^.�0F�!�^��q8>�n�� ����̯�ޓ 'N�#R��^ ����x���`�zk!jʀjz:�z�j{�5E[k�_��l�^#�4㵏=�}
2
- �8����rد'ض�b�\��/�E�GNfR��
1
+ ���'��Z�紬ɺ�3%,�[請���ZG�@� �����w��#�Zb �Q�/�P(nϊ=���հO8�������<��S�}+) a.>��"���q����qb��Wc'&*�mi�î�qr��k�uY�:qڈ���nqw
data/lib/rex/text/lang.rb CHANGED
@@ -127,7 +127,7 @@ module Rex
127
127
  buff = "#{name} = Array("
128
128
  maxbytes = 80
129
129
 
130
- 1.upto(code.length) do |idx|
130
+ 0.upto(code.length-1) do |idx|
131
131
  buff << code[idx].to_s
132
132
  buff << "," if idx < code.length - 1
133
133
  buff << " _\r\n" if (idx > 1 and (idx % maxbytes) == 0)
data/lib/rex/text/rand.rb CHANGED
@@ -92,6 +92,15 @@ module Rex
92
92
  "tammy", "teresa", "theresa", "tina", "virginia", "wanda"
93
93
  ]
94
94
 
95
+ Func_Verb = [
96
+ "get", "set", "put", "describe", "acquire", "release", "initialize", "free",
97
+ "init", "find", "list", "create", "destroy"
98
+ ]
99
+
100
+ Func_Subj = [
101
+ "file", "directory", "dir", "address", "addr", "process", "proc", "user",
102
+ "privileges", "priv", "attribute", "attr", "mutex", "handle", "type"
103
+ ]
95
104
 
96
105
  # Generates a random character.
97
106
  def self.rand_char(bad, chars = AllChars)
@@ -258,5 +267,32 @@ module Rex
258
267
  mail_address << '@'
259
268
  mail_address << Rex::Text.rand_hostname
260
269
  end
270
+
271
+ # Generate a strong password of specified length and attributes
272
+ def self.rand_password(len=10, mix_case:true, numbers:true, special_characters: false)
273
+ allowed_characters=[]
274
+ upper=('A'..'Z').to_a
275
+ lower=('a'..'z').to_a
276
+ number=('0'..'10').to_a
277
+ specials = ((32..47).to_a + (58..64).to_a + (91..96).to_a + (123..126).to_a).pack('U*').chars
278
+ allowed_characters+=upper
279
+ if mix_case
280
+ allowed_characters+=lower
281
+ end
282
+ if numbers
283
+ allowed_characters+=number
284
+ end
285
+ if special_characters
286
+ allowed_characters+=specials
287
+ end
288
+ rand_base(len,'',*allowed_characters)
289
+ end
290
+
291
+ # Generate a random function name
292
+ def self.rand_func_name
293
+ verb = rand(9) > 4 ? Func_Verb.sample.capitalize : Func_Verb.sample
294
+ subj = rand(9) > 4 ? Func_Subj.sample.capitalize : Func_Subj.sample
295
+ verb + subj
296
+ end
261
297
  end
262
298
  end
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.2.32"
3
+ VERSION = "0.2.36"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.32
4
+ version: 0.2.36
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: 2021-02-24 00:00:00.000000000 Z
96
+ date: 2021-08-13 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
@@ -1,4 +1,2 @@
1
- ��X)dI��mjv(�,s4kN~��ӚF���"�p�+i�!�����7��'�=����3w��F���Ț �q��s
2
- ]c}��΃U�~Q��VɁj����M5(ӣ�Ȅ�r�\
3
- ��#^ F'I�Б
4
- �nͻ ����YziC��!j��)3�Ix
1
+ V:9�s
2
+ �(I����/@r�7햴���Hp}E�*J e�j'�$��_�?�E��,�< kk@�N�B�w�T��\3��|�E��]��wi3I�Q��� M� w�qmqP�M2>�ck��,+w�t%Z�JU�����x%J�v��K&��Og�����*�~�,�r}J�c��0��{ooe�wT�u�������A�-;q�Q�Ԟ� ����|1�+�L�� )��L�=�M'_k�Dse�ʴ�"�'&�U��g�A�k�}