lib/pwn/plugins/credit_card.rb in pwn-0.4.419 vs lib/pwn/plugins/credit_card.rb in pwn-0.4.421
- old
+ new
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require 'credit_card_validations'
+require 'credit_card_validations/string'
module PWN
module Plugins
# This plugin provides useful credit card capabilities
module CreditCard
@@ -24,10 +25,22 @@
cc_result_arr
rescue StandardError => e
raise e
end
+ # Supported Method Parameters::
+ # PWN::Plugins::CreditCard.type(
+ # cc: 'required - e.g. XXXX XXXX XXXX XXXX'
+ # )
+
+ public_class_method def self.type(opts = {})
+ cc = opts[:cc].to_s.scrub.strip.chomp
+ cc.credit_card_brand
+ rescue StandardError => e
+ raise e
+ end
+
# Author(s):: 0day Inc. <request.pentest@0dayinc.com>
public_class_method def self.authors
"AUTHOR(S):
0day Inc. <request.pentest@0dayinc.com>
@@ -39,9 +52,13 @@
public_class_method def self.help
puts "USAGE:
#{self}.generate(
type: 'required - card to generate :amex|:unionpay|:dankort|:diners|:elo|:discover|:hipercard|:jcb|:maestro|:mastercard|:mir|:rupay|:solo|:switch|:visa',
count: 'required - number of numbers to generate'
+ )
+
+ #{self}.type(
+ cc: 'required - e.g. XXXX XXXX XXXX XXXX'
)
#{self}.authors
"
end