Module: PWN::Plugins::SSN

Defined in:
lib/pwn/plugins/ssn.rb

Overview

This plugin provides useful social security number capabilities

Class Method Summary collapse

Class Method Details

.authorsObject

Author(s)

0day Inc. <[email protected]>



33
34
35
36
37
# File 'lib/pwn/plugins/ssn.rb', line 33

public_class_method def self.authors
  "AUTHOR(S):
    0day Inc. <[email protected]>
  "
end

.generate(opts = {}) ⇒ Object

Supported Method Parameters

PWN::Plugins::SSN.generate(

count: 'required - number of SSN numbers to generate'

)



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/pwn/plugins/ssn.rb', line 12

public_class_method def self.generate(opts = {})
  count = opts[:count].to_i

  # Based upon new SSN Randomization:
  # https://www.ssa.gov/employer/randomization.html
  ssn_result_arr = []
  (1..count).each do
    this_area = format('%0.3d', Random.rand(1..999))
    this_group = format('%0.2d', Random.rand(1..99))
    this_serial = format('%0.4d', Random.rand(1..9999))
    this_ssn = "#{this_area}-#{this_group}-#{this_serial}"
    ssn_result_arr.push(this_ssn)
  end

  ssn_result_arr
rescue StandardError => e
  raise e
end

.helpObject

Display Usage for this Module



41
42
43
44
45
46
47
48
49
# File 'lib/pwn/plugins/ssn.rb', line 41

public_class_method def self.help
  puts "USAGE:
    #{self}.generate(
      count: 'required - number of SSN numbers to generate'
    )

    #{self}.authors
  "
end