pentest 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +29 -12
- data/lib/pentest.rb +16 -6
- data/lib/pentest/checkers/sqli_checker.rb +1 -1
- data/lib/pentest/checkers/xss_checker.rb +4 -4
- data/lib/pentest/version.rb +1 -1
- data/pentest.gemspec +1 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3547b3f94cd85caca4403a70837c6c34274a0a3d32dd558126e487e57d094b92
|
4
|
+
data.tar.gz: be2427f73734cb304511956f153ac8b9d0bea0ab7f329816071346d20298fee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a00c70df512440d9bf89992dd9f341a95c4ff8850614586836426caa687df54d5908ec8df04e2f9c842d4ce2481cde21a888def1f12b1761d43d7ca6b808b257
|
7
|
+
data.tar.gz: 560a984fc2ec3131b29846eef3218ff40f6fd06a06123431556d939de36c362e724661c3cb80ab1063580ac6496bbb27646bfd450a874c2a20d3e9b2d7240a28
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,26 +1,38 @@
|
|
1
1
|
# Pentest
|
2
2
|
|
3
|
-
|
3
|
+
Full-automated dynamic vulnerability scanning tool for Ruby on Rails project!
|
4
4
|
|
5
|
-
|
5
|
+

|
6
6
|
|
7
|
-
##
|
7
|
+
## About
|
8
|
+
|
9
|
+
The word "Pentest" is taken from penetration testing, which simulates cyberattacks
|
10
|
+
|
11
|
+
This gem loads controller methods of Rails project and cracks against it.
|
12
|
+
|
13
|
+
## Installation Prerequisite
|
8
14
|
|
9
15
|
* libgda
|
10
16
|
|
11
|
-
### Windows
|
17
|
+
### Windows Instruction
|
12
18
|
|
13
|
-
|
19
|
+
\# TODO
|
14
20
|
|
15
|
-
|
21
|
+
### Mac Instruction
|
22
|
+
|
23
|
+
Please be reminded that you have to link keg-only dependent libxml2.
|
16
24
|
|
17
25
|
```
|
18
|
-
brew install libgda
|
19
|
-
brew link libxml2 --force
|
20
|
-
bundle install
|
26
|
+
$ brew install libgda
|
27
|
+
$ brew link libxml2 --force
|
28
|
+
$ bundle install
|
21
29
|
```
|
22
30
|
|
23
|
-
### Ubuntu
|
31
|
+
### Ubuntu Instruction
|
32
|
+
|
33
|
+
```
|
34
|
+
$ apt install libgda-5.0
|
35
|
+
```
|
24
36
|
|
25
37
|
## Installation
|
26
38
|
|
@@ -41,7 +53,12 @@ Or install it yourself as:
|
|
41
53
|
## Usage
|
42
54
|
|
43
55
|
```
|
44
|
-
$
|
56
|
+
$ bundle exec pentest
|
57
|
+
```
|
58
|
+
|
59
|
+
### Pentestfile
|
60
|
+
|
61
|
+
```
|
45
62
|
```
|
46
63
|
|
47
64
|
## Development
|
@@ -52,7 +69,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
52
69
|
|
53
70
|
## Contributing
|
54
71
|
|
55
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
72
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/hakatashi/pentest.
|
56
73
|
|
57
74
|
## License
|
58
75
|
|
data/lib/pentest.rb
CHANGED
@@ -27,16 +27,26 @@ module Pentest
|
|
27
27
|
Logger.debug "Loading Rails project..."
|
28
28
|
@app_path = File.expand_path(options[:app_path])
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
unless File.directory?(@app_path)
|
31
|
+
Logger.error "#{options[:app_path]} is not valid directory."
|
32
|
+
return :error
|
33
|
+
end
|
34
|
+
|
35
|
+
environment_path = File.expand_path('config/environment.rb', @app_path)
|
36
|
+
|
37
|
+
unless File.file?(environment_path)
|
38
|
+
Logger.error "Your project does not contain config/environment.rb file, which must be exist on every valid Rails project. Check your configuration."
|
39
|
+
return :error
|
40
|
+
end
|
41
|
+
|
42
|
+
require environment_path
|
34
43
|
|
35
44
|
unless is_project_loaded?
|
36
|
-
|
45
|
+
Logger.error "Rails project not loaded. Check if your config/environment.rb file is valid."
|
46
|
+
return :error
|
37
47
|
end
|
38
48
|
|
39
|
-
Logger.debug "Loaded Rails project #{get_project_name.inspect}"
|
49
|
+
Logger.debug "Loaded Rails project #{get_project_name.inspect} (Rails #{Rails::VERSION::STRING})"
|
40
50
|
|
41
51
|
# TODO: Check if Pentestfile exists
|
42
52
|
pentestfile_path = options[:pentestfile] || 'Pentestfile'
|
@@ -73,7 +73,7 @@ class Pentest::SqliChecker < Pentest::BaseChecker
|
|
73
73
|
return [nil, errors] if penetrated_payload.nil?
|
74
74
|
|
75
75
|
# attack
|
76
|
-
attack_payloads = generate_attack_payloads(params, penetrated_payload.values, injection_point)
|
76
|
+
attack_payloads = generate_attack_payloads(@params, penetrated_payload.values, injection_point)
|
77
77
|
|
78
78
|
Pentest::SqlProxy.enable!(self.method(:handle_query))
|
79
79
|
|
@@ -9,7 +9,7 @@ class Pentest::XssChecker < Pentest::BaseChecker
|
|
9
9
|
@description = "Checks for Cross-Site Scripting"
|
10
10
|
|
11
11
|
XSS_PAYLOADS = File.read(File.expand_path('../fuzzers/xss.txt', File.dirname(__FILE__)), encoding: 'utf-8').lines.map(&:strip).select {|l| l.size > 5 && l =~ /\W/}
|
12
|
-
CRACKER_PAYLOAD = %q(
|
12
|
+
CRACKER_PAYLOAD = %q(<xzyxz>)
|
13
13
|
|
14
14
|
def initialize(endpoint, params)
|
15
15
|
super(endpoint, params)
|
@@ -29,7 +29,7 @@ class Pentest::XssChecker < Pentest::BaseChecker
|
|
29
29
|
|
30
30
|
errors << normalize_error(err, payload)
|
31
31
|
document = Nokogiri::HTML(response.body)
|
32
|
-
document_errors = document.errors.
|
32
|
+
document_errors = document.errors.select {|e| is_critical_error(e)}
|
33
33
|
|
34
34
|
if document_errors.any?
|
35
35
|
payload.penetration_type = 'Cross-Site Scripting Vulnerability'
|
@@ -67,8 +67,8 @@ class Pentest::XssChecker < Pentest::BaseChecker
|
|
67
67
|
|
68
68
|
private
|
69
69
|
|
70
|
-
def
|
71
|
-
error.to_s =~ /
|
70
|
+
def is_critical_error(error)
|
71
|
+
error.to_s =~ /xzyxz/
|
72
72
|
end
|
73
73
|
|
74
74
|
def report_errors(body, errors)
|
data/lib/pentest/version.rb
CHANGED
data/pentest.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Koki Takahashi"]
|
10
10
|
spec.email = ["hakatasiloving@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
12
|
+
spec.summary = %q{Full-automated dynamic vulnerability scanning tool for Ruby on Rails project!}
|
13
13
|
spec.description = %q{}
|
14
14
|
spec.homepage = "https://github.com/hakatashi/pentest"
|
15
15
|
spec.license = "MIT"
|
@@ -17,8 +17,6 @@ Gem::Specification.new do |spec|
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
19
|
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
21
|
-
|
22
20
|
spec.metadata["homepage_uri"] = spec.homepage
|
23
21
|
spec.metadata["source_code_uri"] = "https://github.com/hakatashi/pentest"
|
24
22
|
spec.metadata["changelog_uri"] = "https://github.com/hakatashi/pentest"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pentest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koki Takahashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby_parser
|
@@ -192,7 +192,6 @@ homepage: https://github.com/hakatashi/pentest
|
|
192
192
|
licenses:
|
193
193
|
- MIT
|
194
194
|
metadata:
|
195
|
-
allowed_push_host: https://rubygems.org
|
196
195
|
homepage_uri: https://github.com/hakatashi/pentest
|
197
196
|
source_code_uri: https://github.com/hakatashi/pentest
|
198
197
|
changelog_uri: https://github.com/hakatashi/pentest
|
@@ -214,5 +213,5 @@ requirements: []
|
|
214
213
|
rubygems_version: 3.0.3
|
215
214
|
signing_key:
|
216
215
|
specification_version: 4
|
217
|
-
summary:
|
216
|
+
summary: Full-automated dynamic vulnerability scanning tool for Ruby on Rails project!
|
218
217
|
test_files: []
|