rex-text 0.2.33 → 0.2.37

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: 3121a348aed99e006e8413ec63eadbb4de00ed5a8be4c0b11446757d414aa99e
4
- data.tar.gz: 33de5bb9deb6958ce55e64a089613380ec700924e010659fdb1b3292c8917cb7
3
+ metadata.gz: 7b3c8a4e9870f41cc0c8b6dbb175ab5eb56b9fc188a3cbe2be85ebcf05bd8945
4
+ data.tar.gz: 5f23d20961036a7886e15b432b332c72ee014837687040cab44b368ee9eac0ff
5
5
  SHA512:
6
- metadata.gz: bce961c3e20f2e646101565c44c3b31fa8bc636e474cc9f07e24b26bd9fbf3a6d7fe14a03a92bce97ef8afc15440f575d22d625ba5262127af8f0f7c9bf4aa33
7
- data.tar.gz: c4804270646f5d5bca45d0f029295b0fbf25e13b486af66a0f69563d8007029cdf892733a207a225a8accf5744ae36fc01ded65fe304c17548bfa7cdd6bc4763
6
+ metadata.gz: eb340466122a0875e63c7da7da642892c14b4c9880fc68c167aefd4c49a0617d6c4a3cf39a4ca97d3e60748bc6de19ca0c66976c9b7701a7768dfedf3f5454a2
7
+ data.tar.gz: a6b14508fa0e30c49c1afd10b170fe9fce99e9112a3dda3073557ffb99abe1ff7d9c467e992dbc4881cba4fba35fe53509b40fc44563119f756c496f2ad91460
checksums.yaml.gz.sig CHANGED
Binary file
@@ -10,7 +10,7 @@ on:
10
10
 
11
11
  jobs:
12
12
  test:
13
- runs-on: ubuntu-16.04
13
+ runs-on: ubuntu-18.04
14
14
  timeout-minutes: 40
15
15
 
16
16
  strategy:
@@ -29,25 +29,11 @@ jobs:
29
29
  - name: Checkout code
30
30
  uses: actions/checkout@v2
31
31
 
32
- - uses: actions/setup-ruby@v1
32
+ - name: Setup Ruby
33
+ uses: ruby/setup-ruby@v1
33
34
  with:
34
35
  ruby-version: ${{ matrix.ruby }}
35
-
36
- - name: Setup bundler
37
- run: |
38
- gem install bundler
39
-
40
- - uses: actions/cache@v2
41
- with:
42
- path: vendor/bundle
43
- key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
44
- restore-keys: |
45
- ${{ runner.os }}-gems-
46
-
47
- - name: Bundle install
48
- run: |
49
- bundle config path vendor/bundle
50
- bundle install --jobs 4 --retry 3
36
+ bundler-cache: true
51
37
 
52
38
  - name: ${{ matrix.test_cmd }}
53
39
  run: |
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.33"
3
+ VERSION = "0.2.37"
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-text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.33
4
+ version: 0.2.37
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-09-16 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file