gengiscan 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.rvmrc +1 -0
- data/Gemfile +9 -0
- data/LICENSE +22 -0
- data/README.md +26 -0
- data/Rakefile +8 -0
- data/bin/gengiscan +6 -0
- data/gengiscan.gemspec +17 -0
- data/lib/gengiscan.rb +5 -0
- data/lib/gengiscan/engine.rb +36 -0
- data/lib/gengiscan/version.rb +3 -0
- data/spec/gengiscan_spec.rb +16 -0
- data/spec/spec_helper.rb +3 -0
- metadata +66 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.3@gengiscan
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Paolo Perego
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Gengiscan
|
2
|
+
|
3
|
+
Gengiscan is a CMS fingerprinting tool using Generator meta tag and Seerver HTTP response header to tell the technology behind a CMS serving a target website.
|
4
|
+
No intrusive attacks are performed, just a plain GET using Net::HTTP standard ruby library
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
To install gengiscan gem
|
9
|
+
|
10
|
+
$ gem install gengiscan
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
Using gengiscan it's easy:
|
15
|
+
|
16
|
+
require 'gengiscan'
|
17
|
+
|
18
|
+
puts Gengiscan.new.detect("http://www.targetcms.com")[:generator]
|
19
|
+
|
20
|
+
## Contributing
|
21
|
+
|
22
|
+
1. Fork it
|
23
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
24
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
25
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
26
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/gengiscan
ADDED
data/gengiscan.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/gengiscan/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Paolo Perego"]
|
6
|
+
gem.email = ["thesp0nge@gmail.com"]
|
7
|
+
gem.description = %q{gengiscan is a CMS fingerprinting tool using Generator meta tag and Server HTTP response header to fingerpring a CMS used by a website}
|
8
|
+
gem.summary = %q{gengiscan is a CMS fingerprinting tool using Generator meta tag and Server HTTP response header to fingerpring a CMS used by a website}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "gengiscan"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Gengiscan::VERSION
|
17
|
+
end
|
data/lib/gengiscan.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
module Gengiscan
|
5
|
+
class Engine
|
6
|
+
|
7
|
+
|
8
|
+
attr_reader :res
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
def initialize(url)
|
13
|
+
@uri = URI(url)
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def detect
|
18
|
+
@res = Net::HTTP.get_response(@uri)
|
19
|
+
|
20
|
+
{:code=>@res.code, :server=>@res['Server'], :generator=>get_generator_signature} #if res == Net::HTTPOK
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
def get_generator_signature
|
25
|
+
|
26
|
+
generator = ""
|
27
|
+
doc=Nokogiri::HTML(@res.body)
|
28
|
+
doc.xpath("//meta[@name='generator']/@content").each do |value|
|
29
|
+
generator = value.value
|
30
|
+
end
|
31
|
+
|
32
|
+
generator
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
include WebMock::API
|
3
|
+
|
4
|
+
describe 'gengiscan' do
|
5
|
+
let(:g) {Gengiscan::Engine.new('http://www.test.com/index.html')}
|
6
|
+
|
7
|
+
it 'is great' do
|
8
|
+
stub_request(:get, "http://www.test.com/index.html").
|
9
|
+
with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
|
10
|
+
to_return(:status=>200, :body=>"<!DOCTYPE html><html><head><meta name=\"generator\" content=\"WordPress 2.3\" /></head><body>A test cms powered</body></html>", :headers=>{})
|
11
|
+
|
12
|
+
hash = g.detect
|
13
|
+
hash[:generator].should == "WordPress 2.3"
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gengiscan
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.10.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Paolo Perego
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-07-12 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: gengiscan is a CMS fingerprinting tool using Generator meta tag and Server
|
15
|
+
HTTP response header to fingerpring a CMS used by a website
|
16
|
+
email:
|
17
|
+
- thesp0nge@gmail.com
|
18
|
+
executables:
|
19
|
+
- gengiscan
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- .gitignore
|
24
|
+
- .rvmrc
|
25
|
+
- Gemfile
|
26
|
+
- LICENSE
|
27
|
+
- README.md
|
28
|
+
- Rakefile
|
29
|
+
- bin/gengiscan
|
30
|
+
- gengiscan.gemspec
|
31
|
+
- lib/gengiscan.rb
|
32
|
+
- lib/gengiscan/engine.rb
|
33
|
+
- lib/gengiscan/version.rb
|
34
|
+
- spec/gengiscan_spec.rb
|
35
|
+
- spec/spec_helper.rb
|
36
|
+
homepage: ''
|
37
|
+
licenses: []
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
segments:
|
49
|
+
- 0
|
50
|
+
hash: 2616998851965209666
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.8.24
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: gengiscan is a CMS fingerprinting tool using Generator meta tag and Server
|
63
|
+
HTTP response header to fingerpring a CMS used by a website
|
64
|
+
test_files:
|
65
|
+
- spec/gengiscan_spec.rb
|
66
|
+
- spec/spec_helper.rb
|