Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 63 additions and 1 deletion.
  1. +8 −1 README
  2. +15 −0 bin/pull.rb
  3. +40 −0 modules/search/generic.rb
View
9 README
@@ -2,5 +2,12 @@ Exhumer is a framework for finding and extracting data from remote sources, some
PRE ALPHA EXPERIMENTAL VERSION! Don't expect anything at all to work.
-Example commands:
+Actual working examples:
+
+ruby bin/hunt.rb modules/plunder/crypt.rb modules/search/google.rb > search_results
+
+Vapour examples of commands:
+
bin/hunt.rb presets/crypt --config foo.baz=bar,foo.qux=quux,refresh=true
+# Search google and bing for crypt passwords, nmap command style. I like this.
+exhumer -sG -sB --scripts crypt
View
15 bin/pull.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env ruby
+
+load File.join(File.dirname(__FILE__), '..', 'config', 'setup.rb')
+
+require 'exhumer/module'
+
+
+search_path = File.join(MODULE_DIR, 'search', 'generic.rb')
+search_mod = Exhumer::Module.load_module(search_path)
+
+target = ARGV.first
+
+search_mod.each(target) do |origin, url, element|
+ puts url
+end
View
40 modules/search/generic.rb
@@ -0,0 +1,40 @@
+require 'exhumer/module/search'
+require 'exhumer/module/search/mechanize'
+
+require 'uri'
+require 'nokogiri'
+require 'cgi'
+
+class Awesomesauce < Exhumer::Module::Search
+ include Exhumer::Module::Search::Mechanize
+
+ def setup
+ end
+
+ def results_at(page)
+ results = {}
+
+ Nokogiri::HTML(page.body).traverse do |el|
+ [el[:src], el[:href], el[:action]].each do |uri|
+ next if uri.nil?
+
+ uri = URI(uri)
+ unless uri.absolute?
+ uri = page.uri.merge(uri)
+ end
+
+ results[uri.to_s] = el
+ end
+ end
+
+ results
+ end
+
+ def to_uri(uri)
+ URI(uri.to_s)
+ end
+
+ def next_page(last_uri, last_page)
+ nil
+ end
+end

No commit comments for this range

Something went wrong with that request. Please try again.