troublestarter

Commands and options

Jan 3rd, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.36 KB | None | 0 0
  1. #PoC CVE-2011-0762 ( vsftpd )
  2. #Remote Denial of Service
  3.  
  4. #Affected: 2.3.2
  5. #Fix: 2.3.4
  6.  
  7. #Author:
  8.  
  9.  
  10. # A script that will pretend to resize a number of images
  11.  require 'optparse'
  12.  
  13.  # This hash will hold all of the options
  14.  # parsed from the command-line by
  15.  # OptionParser.
  16.  options = {}
  17.  
  18.  optparse = OptionParser.new do|opts|
  19.    # Set a banner, displayed at the top
  20.    # of the help screen.
  21.    opts.banner = "Usage: vsftpd2.3.2dos.rb [options] HOST PORT"
  22.  
  23.    # Define the options, and what they do
  24.    options[:verbose] = false
  25.    opts.on( '-v', '--verbose', 'Output more information' ) do
  26.      options[:verbose] = true
  27.    end
  28.  
  29.    # This displays the help screen, all programs are
  30.    # assumed to have this option.
  31.    opts.on( '-h', '--help', 'Display Help' ) do
  32.      puts opts
  33.      exit
  34.    end
  35.  end
  36.  #puts optparse
  37.  # Parse the command-line. Remember there are two forms
  38.  # of the parse method. The 'parse' method simply parses
  39.  # ARGV, while the 'parse!' method parses ARGV and removes
  40.  # any options found there, as well as any parameters for
  41.  # the options. What's left is the list of files to resize.
  42.  optparse.parse!
  43.  
  44.  puts "Being verbose" if options[:verbose]
  45.  
  46. if ARGV.length < 2 || ARGV.length > 2
  47.     puts "Usage: vsftpd2.3.2dos.rb [options] HOST PORT"
  48. end
  49.  
  50.  #ARGV.each do|f|
  51.  #  puts "Resizing image #{f}..."
  52.  #  sleep 0.5
  53.  #end
Advertisement
Add Comment
Please, Sign In to add comment