Wednesday, June 20, 2012

num_jenny - A Versatile Number Generator for the Security Mindset


A helpful ruby class for all sorts of security projects...this class is a member of my periodic table of classes.  Get it here:

https://github.com/ninp0/num_jenny 

It's pretty cool since this ruby class can be invoked to produce all types of numbers!

require './num_jenny'
# Only needed for last example
require 'creditcard'

n = NumJenny.new
puts n.range(:start_with => 0, :end_with => 10)

n.range(:start_with => 0, :end_with => 9999, :pad => true).each do |pin|
  puts "Attempting: #{pin}"
end

puts n.range(:start_with => 0, :end_with => 10, :random => true)

puts n.range(:start_with => 0, :end_with => 10, :pad => true, :random => true)

puts n.range(:start_with => 10, :end_with => 20, :pad => true)

n.range(:start_with => '1-493-555-0000', :end_with => '1-493-555-9999', :random => true).each do |phoneno|
  puts "ATDT#{phoneno}"
end

n.range(:start_with => "344543800000000", :end_with => "344543800999999", :random => true).each do |ccno|
  puts "Valid #{ccno.creditcard_type} Card Found: #{ccno}" if ccno.creditcard?
end


Cheers!

No comments:

Post a Comment