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.214 lib/pwn/plugins/ssn.rb
pwn-0.5.213 lib/pwn/plugins/ssn.rb
pwn-0.5.212 lib/pwn/plugins/ssn.rb
pwn-0.5.211 lib/pwn/plugins/ssn.rb
pwn-0.5.210 lib/pwn/plugins/ssn.rb
pwn-0.5.209 lib/pwn/plugins/ssn.rb
pwn-0.5.207 lib/pwn/plugins/ssn.rb
pwn-0.5.206 lib/pwn/plugins/ssn.rb
pwn-0.5.205 lib/pwn/plugins/ssn.rb
pwn-0.5.204 lib/pwn/plugins/ssn.rb
pwn-0.5.203 lib/pwn/plugins/ssn.rb
pwn-0.5.202 lib/pwn/plugins/ssn.rb
pwn-0.5.201 lib/pwn/plugins/ssn.rb
pwn-0.5.200 lib/pwn/plugins/ssn.rb
pwn-0.5.199 lib/pwn/plugins/ssn.rb
pwn-0.5.198 lib/pwn/plugins/ssn.rb
pwn-0.5.197 lib/pwn/plugins/ssn.rb
pwn-0.5.196 lib/pwn/plugins/ssn.rb
pwn-0.5.195 lib/pwn/plugins/ssn.rb
pwn-0.5.194 lib/pwn/plugins/ssn.rb