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

Version Path
pwn-0.5.235 bin/pwn_pastebin_sample_filter
pwn-0.5.234 bin/pwn_pastebin_sample_filter
pwn-0.5.233 bin/pwn_pastebin_sample_filter
pwn-0.5.232 bin/pwn_pastebin_sample_filter
pwn-0.5.231 bin/pwn_pastebin_sample_filter
pwn-0.5.230 bin/pwn_pastebin_sample_filter
pwn-0.5.229 bin/pwn_pastebin_sample_filter
pwn-0.5.228 bin/pwn_pastebin_sample_filter
pwn-0.5.227 bin/pwn_pastebin_sample_filter
pwn-0.5.226 bin/pwn_pastebin_sample_filter
pwn-0.5.225 bin/pwn_pastebin_sample_filter
pwn-0.5.224 bin/pwn_pastebin_sample_filter
pwn-0.5.223 bin/pwn_pastebin_sample_filter
pwn-0.5.222 bin/pwn_pastebin_sample_filter
pwn-0.5.221 bin/pwn_pastebin_sample_filter
pwn-0.5.220 bin/pwn_pastebin_sample_filter
pwn-0.5.219 bin/pwn_pastebin_sample_filter
pwn-0.5.217 bin/pwn_pastebin_sample_filter
pwn-0.5.216 bin/pwn_pastebin_sample_filter
pwn-0.5.215 bin/pwn_pastebin_sample_filter