rverr 0.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +33 -0
- data/README.md +20 -0
- data/hint_hint.gemspec +21 -0
- data/lib/rverr.rb +27 -0
- data/lib/rverr/harvest.rb +68 -0
- data/lib/rverr/harvest/blacklist.rb +31 -0
- data/lib/rverr/harvest/site.rb +47 -0
- data/lib/rverr/hint.rb +12 -0
- data/lib/rverr/navigate.rb +18 -0
- data/lib/rverr/query.rb +39 -0
- data/rverr.gemspec +21 -0
- metadata +69 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 98996059de999671326ce940beed6625a02ab4dd
|
4
|
+
data.tar.gz: 268495990d2fd200a046f7e12a5cb6c7846dc647
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c91ca8c7e384d482b18ad796d133a1e437e9fae7da96df59b5cce896748d575a99eb55faa41011fb1b5d64e71fad2a89dad4d4a06ab9d6846f12004ba5b251eb
|
7
|
+
data.tar.gz: a1cf332da10d92085f730aa906841f3e9fc8aaa7f45d7f52d7704f35c6cb51f043e03079505c31bf832ce9053989658146c1da31851057794c4c96a1cfd1d0e1
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
domain_name (0.5.24)
|
5
|
+
unf (>= 0.0.5, < 1.0.0)
|
6
|
+
http-cookie (1.0.2)
|
7
|
+
domain_name (~> 0.5)
|
8
|
+
mechanize (2.7.3)
|
9
|
+
domain_name (~> 0.5, >= 0.5.1)
|
10
|
+
http-cookie (~> 1.0)
|
11
|
+
mime-types (~> 2.0)
|
12
|
+
net-http-digest_auth (~> 1.1, >= 1.1.1)
|
13
|
+
net-http-persistent (~> 2.5, >= 2.5.2)
|
14
|
+
nokogiri (~> 1.4)
|
15
|
+
ntlm-http (~> 0.1, >= 0.1.1)
|
16
|
+
webrobots (>= 0.0.9, < 0.2)
|
17
|
+
mime-types (2.6.2)
|
18
|
+
mini_portile (0.6.2)
|
19
|
+
net-http-digest_auth (1.4)
|
20
|
+
net-http-persistent (2.9.4)
|
21
|
+
nokogiri (1.6.6.2)
|
22
|
+
mini_portile (~> 0.6.0)
|
23
|
+
ntlm-http (0.1.1)
|
24
|
+
unf (0.1.4)
|
25
|
+
unf_ext
|
26
|
+
unf_ext (0.0.7.1)
|
27
|
+
webrobots (0.1.1)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
mechanize (~> 2.7)
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# rver
|
2
|
+
|
3
|
+
This is a project to alert website owners of vulnerabilities.
|
4
|
+
|
5
|
+
## DESCRIPTION
|
6
|
+
|
7
|
+
To be continued...
|
8
|
+
|
9
|
+
## DISCLAIMER
|
10
|
+
|
11
|
+
This is a working project and may have multiple bugs/issues.
|
12
|
+
|
13
|
+
## MIT LICENSE
|
14
|
+
|
15
|
+
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/hint_hint.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'hint_hint'
|
5
|
+
gem.version = '0.0.beta'
|
6
|
+
gem.date = '2015-09-25'
|
7
|
+
gem.platform = Gem::Platform::RUBY
|
8
|
+
gem.required_ruby_version = '>= 1.8'
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split("\n")
|
11
|
+
gem.test_files = `git ls-files -- test/*`.split("\n")
|
12
|
+
|
13
|
+
gem.summary = 'Uses Mechanize and WHOIS to alert website owners of vulns'
|
14
|
+
gem.description = 'Hint website owners of SQL vulnerabilities'
|
15
|
+
gem.authors = ['John Mason']
|
16
|
+
gem.email = 'mace2345@gmail.com'
|
17
|
+
gem.homepage = 'https://github.com/m8ss/hint_hint'
|
18
|
+
gem.license = 'MIT'
|
19
|
+
|
20
|
+
gem.add_runtime_dependency('mechanize', '~> 2.7')
|
21
|
+
end
|
data/lib/rverr.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'mechanize'
|
6
|
+
require './hint_hint/query'
|
7
|
+
require './hint_hint/hint'
|
8
|
+
require './hint_hint/harvest'
|
9
|
+
require './hint_hint/navigate'
|
10
|
+
|
11
|
+
# A scan for vulnerable websites.
|
12
|
+
class Crawler
|
13
|
+
include Harvest
|
14
|
+
include Hint
|
15
|
+
include Query
|
16
|
+
include Navigate
|
17
|
+
|
18
|
+
def initialize
|
19
|
+
set_agent
|
20
|
+
@search_engine = 'http://google.com'
|
21
|
+
@current_page = @search_engine
|
22
|
+
@queries = [
|
23
|
+
"inurl:product.php?id= intext:'error in your SQL syntax'",
|
24
|
+
"inurl:item.php?id= intext:'error in your SQL syntax'"
|
25
|
+
]
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# TODO: build the following methods.
|
2
|
+
# - Go to vulnerable site
|
3
|
+
# - Store URL
|
4
|
+
# - Store error message
|
5
|
+
# - Find & store email
|
6
|
+
#
|
7
|
+
|
8
|
+
# actions performed during crawl of specific website
|
9
|
+
require './hint_hint/harvest/site'
|
10
|
+
require './hint_hint/harvest/blacklist'
|
11
|
+
|
12
|
+
# the actions of gathering
|
13
|
+
module Harvest
|
14
|
+
attr_accessor :vulnerable_sites
|
15
|
+
|
16
|
+
# This function already exists with URI. But, this is
|
17
|
+
# necessary because links are found and stored as string
|
18
|
+
def extract_host(url_str)
|
19
|
+
arr = url_str.split('/')
|
20
|
+
|
21
|
+
# If url text has 'http', host will be arr[3]
|
22
|
+
result =
|
23
|
+
if arr[0].include? 'http'
|
24
|
+
arr[2]
|
25
|
+
else
|
26
|
+
arr[0]
|
27
|
+
end
|
28
|
+
result
|
29
|
+
end
|
30
|
+
|
31
|
+
# Stores host names until I figure out how to use Watir to extract
|
32
|
+
# data-href from javascript.
|
33
|
+
def store_links
|
34
|
+
current_collection = []
|
35
|
+
|
36
|
+
current_page.search('cite').each do |link|
|
37
|
+
link = link.inner_text
|
38
|
+
host = extract_host(link)
|
39
|
+
|
40
|
+
if !Collection.blacklisted?(host) && !Collection.harvested?(host)
|
41
|
+
current_collection << Collection::Site.new(host, link)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
current_collection # Display current, not all results.
|
45
|
+
end
|
46
|
+
|
47
|
+
# Convenience method for Harvest::Collection.all_sites
|
48
|
+
def all_sites
|
49
|
+
Collection.all_sites
|
50
|
+
end
|
51
|
+
|
52
|
+
# Convenience method to display urls from Harvest::Collection.all_sites
|
53
|
+
def all_links
|
54
|
+
Collection.all_sites.each do |site|
|
55
|
+
puts site.host
|
56
|
+
end
|
57
|
+
nil
|
58
|
+
end
|
59
|
+
|
60
|
+
# temporary method for debugging and situational awareness....
|
61
|
+
def print_page_links
|
62
|
+
links = current_page.search('cite')
|
63
|
+
links.each do |link|
|
64
|
+
puts link.text
|
65
|
+
end
|
66
|
+
nil
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Harvest
|
2
|
+
class Collection
|
3
|
+
|
4
|
+
attr_accessor :blacklist
|
5
|
+
|
6
|
+
# if any of these words are in a url, it will be skipped over
|
7
|
+
@blacklist = [
|
8
|
+
'google',
|
9
|
+
'hackbusters',
|
10
|
+
'exploit',
|
11
|
+
'vcoer'
|
12
|
+
]
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
def blacklisted?(host)
|
17
|
+
@url = host
|
18
|
+
@arr = ['google', 'nothing', 'exploit', 'ha']
|
19
|
+
|
20
|
+
@blacklist.each do |word|
|
21
|
+
if url.include?(word) == true
|
22
|
+
@result = true
|
23
|
+
break
|
24
|
+
else
|
25
|
+
@result = false
|
26
|
+
end
|
27
|
+
end
|
28
|
+
@result # return True or False
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Harvest
|
2
|
+
# All instances of sites gathered are stored here.
|
3
|
+
class Collection
|
4
|
+
@all_sites = []
|
5
|
+
|
6
|
+
def self.all_sites
|
7
|
+
@all_sites
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.harvested?(host)
|
11
|
+
@url = host
|
12
|
+
@result = false
|
13
|
+
|
14
|
+
@all_sites.each do |site|
|
15
|
+
@result = site.host.include? @url
|
16
|
+
break if @result == true
|
17
|
+
end
|
18
|
+
|
19
|
+
@result # return True or False
|
20
|
+
end
|
21
|
+
|
22
|
+
# Instances of a vulnerable site.
|
23
|
+
class Site
|
24
|
+
attr_accessor :host, :error_url, :visited, :email, :notified
|
25
|
+
|
26
|
+
def initialize(
|
27
|
+
host, error_url, visited = false, email = nil, notified = false
|
28
|
+
)
|
29
|
+
|
30
|
+
@host = host
|
31
|
+
@error_url = error_url # This is not always a working url.
|
32
|
+
@visited = visited
|
33
|
+
@email = email
|
34
|
+
@notified = notified
|
35
|
+
Harvest::Collection.all_sites << self
|
36
|
+
end
|
37
|
+
|
38
|
+
def visited?
|
39
|
+
@visited
|
40
|
+
end
|
41
|
+
|
42
|
+
def notified?
|
43
|
+
@notified
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/rverr/hint.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# TODO: build the following methods.
|
2
|
+
# - set From
|
3
|
+
# - set To
|
4
|
+
# - set Subject
|
5
|
+
# - set Body (include url, err_msg, and helpful info)
|
6
|
+
# - ask for final verification
|
7
|
+
# - send hint
|
8
|
+
#
|
9
|
+
|
10
|
+
# actions performed during notification process
|
11
|
+
module Hint
|
12
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# actions performed while navigating pages or elements
|
2
|
+
module Navigate
|
3
|
+
attr_accessor :current_page
|
4
|
+
|
5
|
+
def scan(url)
|
6
|
+
@agent.get(url)
|
7
|
+
end
|
8
|
+
|
9
|
+
def find_next
|
10
|
+
@nextpagelink = current_page.link_with text: /Next/
|
11
|
+
end
|
12
|
+
|
13
|
+
def go_next
|
14
|
+
find_next
|
15
|
+
@current_page = @nextpagelink.click
|
16
|
+
@current_page.uri
|
17
|
+
end
|
18
|
+
end
|
data/lib/rverr/query.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# TODO: build the following methods.
|
2
|
+
# - set search engine
|
3
|
+
# - set user-alias
|
4
|
+
# - submit query
|
5
|
+
# - begin iteration
|
6
|
+
# - iterate through page of results
|
7
|
+
# - each result: yield to harvest instructions
|
8
|
+
# - go to next page
|
9
|
+
#
|
10
|
+
|
11
|
+
# actions performed with search engine
|
12
|
+
module Query
|
13
|
+
attr_accessor :current_page, :queries, :agent
|
14
|
+
|
15
|
+
def set_agent
|
16
|
+
@agent = Mechanize.new { |a| a.user_agent_alias = 'Mac Safari' }
|
17
|
+
end
|
18
|
+
|
19
|
+
def set_form
|
20
|
+
@current_page = scan(@search_engine)
|
21
|
+
@form = @current_page.form_with(name: /f/)
|
22
|
+
end
|
23
|
+
|
24
|
+
def set_search
|
25
|
+
@current_query = @queries[0] # use first query for now...
|
26
|
+
@form.field_with(name: /q/).value = @current_query
|
27
|
+
end
|
28
|
+
|
29
|
+
def search_submit
|
30
|
+
@current_page = @form.submit
|
31
|
+
@current_page.uri
|
32
|
+
end
|
33
|
+
|
34
|
+
def search
|
35
|
+
set_form
|
36
|
+
set_search
|
37
|
+
search_submit
|
38
|
+
end
|
39
|
+
end
|
data/rverr.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'rverr'
|
5
|
+
gem.version = '0.0.0.beta'
|
6
|
+
gem.date = '2015-09-25'
|
7
|
+
gem.platform = Gem::Platform::RUBY
|
8
|
+
gem.required_ruby_version = '>= 1.8'
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split("\n")
|
11
|
+
gem.test_files = `git ls-files -- test/*`.split("\n")
|
12
|
+
|
13
|
+
gem.summary = 'Alert website owners of vulnerabilities'
|
14
|
+
gem.description = 'Hint website owners of vulnerabilities'
|
15
|
+
gem.authors = ['John Mason']
|
16
|
+
gem.email = 'mace2345@gmail.com'
|
17
|
+
gem.homepage = 'https://github.com/m8ss/rverr'
|
18
|
+
gem.license = 'MIT'
|
19
|
+
|
20
|
+
gem.add_runtime_dependency('mechanize', '~> 2.7')
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rverr
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0.beta
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- John Mason
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-09-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mechanize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.7'
|
27
|
+
description: Hint website owners of vulnerabilities
|
28
|
+
email: mace2345@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- Gemfile
|
34
|
+
- Gemfile.lock
|
35
|
+
- README.md
|
36
|
+
- hint_hint.gemspec
|
37
|
+
- lib/rverr.rb
|
38
|
+
- lib/rverr/harvest.rb
|
39
|
+
- lib/rverr/harvest/blacklist.rb
|
40
|
+
- lib/rverr/harvest/site.rb
|
41
|
+
- lib/rverr/hint.rb
|
42
|
+
- lib/rverr/navigate.rb
|
43
|
+
- lib/rverr/query.rb
|
44
|
+
- rverr.gemspec
|
45
|
+
homepage: https://github.com/m8ss/rverr
|
46
|
+
licenses:
|
47
|
+
- MIT
|
48
|
+
metadata: {}
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.8'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.3.1
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 2.4.6
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Alert website owners of vulnerabilities
|
69
|
+
test_files: []
|