Sha256: 1c85141634e700452dee43064059037f06fca34036a08b13ee3cffa5df62bff6
Contents?: true
Size: 1.13 KB
Versions: 68
Compression:
Stored size: 1.13 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'pwn' require 'optparse' opts = {} OptionParser.new do |options| options.banner = "USAGE: #{File.basename($PROGRAM_NAME)} [opts] " options.on('-rPATTERN', '--regex=PATTERN', "<Required - Regex Pattern for Interesting Pastes ('.*' for All)>") do |r| opts[:regex] = r end options.on('-pPROXY', '--proxy=PROXY', '<Optional - HTTP or Socks Proxy || tor>') do |p| opts[:proxy] = p end end.parse! if opts.empty? puts `#{File.basename($PROGRAM_NAME)} --help` exit 1 end proxy = opts[:proxy] regex = opts[:regex] browser_obj = PWN::WWW::Pastebin.open( browser_type: :headless, proxy: proxy ) browser = browser_obj[:browser] begin loop do browser.div(id: 'menu_2').links[0].click code_frame = browser.div(id: 'code_frame').text if code_frame.match?(/#{regex}/mi) puts "\nCurrent Link: #{browser.url}" puts "#{code_frame}\n\n\n" else print '.' end sleep 9 end rescue StandardError => e raise e ensure if browser_obj browser_obj = PWN::Plugins::TransparentBrowser.close( browser_obj: browser_obj ) end end
Version data entries
68 entries across 68 versions & 1 rubygems