Sha256: 97bffe6b000f3a31ef209f8f2d4a9d75ecd09cbab31265bf914251234092cae9

Contents?: true

Size: 1.34 KB

Versions: 65

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module PWN
  module Plugins
    # This plugin provides useful social security number capabilities
    module SSN
      # Supported Method Parameters::
      # PWN::Plugins::SSN.generate(
      #   count: 'required - number of SSN numbers to generate'
      # )

      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

      # Author(s):: 0day Inc. <support@0dayinc.com>

      public_class_method def self.authors
        "AUTHOR(S):
          0day Inc. <support@0dayinc.com>
        "
      end

      # Display Usage for this Module

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

          #{self}.authors
        "
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
pwn-0.5.152 lib/pwn/plugins/ssn.rb
pwn-0.5.151 lib/pwn/plugins/ssn.rb
pwn-0.5.150 lib/pwn/plugins/ssn.rb
pwn-0.5.106 lib/pwn/plugins/ssn.rb
pwn-0.5.105 lib/pwn/plugins/ssn.rb