owasp_zap 0.0.84 → 0.0.91
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/owasp_zap/alert.rb +1 -1
- data/lib/owasp_zap/attack.rb +2 -2
- data/lib/owasp_zap/spider.rb +3 -3
- data/lib/owasp_zap/version.rb +1 -1
- data/lib/owasp_zap.rb +2 -2
- data/spec/zap_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c541ec393a716435c374a50c2a9900b8b2f4e3e1
|
4
|
+
data.tar.gz: cd3223f7cb8c8d8469cb86f0dee218c07aaf25cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92c649d9707bcea142030259ca99d7f2114b4771f62f36bcfd3f6737dcd5ad37b681434b21293656c46f4633d4f9728a7291818910476e5ef6d58a9b2b4c9ca
|
7
|
+
data.tar.gz: e2eddb6c6a51afa45eedc4a6c059cc4b4d1fea7446e8fd305ef6a756ef5a86432e1bb9fcdd92ddd4b044c47cc650fb99a70629227a7ef8512ddfcb8a4e62d83e
|
data/lib/owasp_zap/alert.rb
CHANGED
@@ -11,7 +11,7 @@ module OwaspZap
|
|
11
11
|
def view(format = "JSON")
|
12
12
|
raise OwaspZap::WrongFormatException,"Output format not accepted" unless ["JSON","HTML","XML"].include?(format)
|
13
13
|
#http://localhost:8080/JSON/core/view/alerts/?zapapiformat=JSON&baseurl=http%3A%2F%2F192.168.1.113&start=&count=
|
14
|
-
url = Addressable::URI.parse "#{@base}/core/view/alerts/"
|
14
|
+
url = Addressable::URI.parse "#{@base}/#{format}/core/view/alerts/"
|
15
15
|
url.query_values = {:zapapiformat=>format,:baseurl=>@target}
|
16
16
|
RestClient::get url.normalize.to_str
|
17
17
|
end
|
data/lib/owasp_zap/attack.rb
CHANGED
@@ -8,13 +8,13 @@ module OwaspZap
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def start
|
11
|
-
url = Addressable::URI.parse
|
11
|
+
url = Addressable::URI.parse("#{@base}/JSON/ascan/action/scan/")
|
12
12
|
url.query_values = {:zapapiformat=>"JSON",:url=>@target}
|
13
13
|
RestClient::get url.normalize.to_str
|
14
14
|
end
|
15
15
|
|
16
16
|
def status
|
17
|
-
ret = JSON.parse(RestClient::get("#{@base}/ascan/view/status/?zapapiformat=JSON"))
|
17
|
+
ret = JSON.parse(RestClient::get("#{@base}/JSON/ascan/view/status/?zapapiformat=JSON"))
|
18
18
|
if ret.has_key? "status"
|
19
19
|
ret["status"].to_i
|
20
20
|
else
|
data/lib/owasp_zap/spider.rb
CHANGED
@@ -10,17 +10,17 @@ module OwaspZap
|
|
10
10
|
|
11
11
|
def start
|
12
12
|
#http://localhost:8080/JSON/spider/action/scan/?zapapiformat=JSON&url=
|
13
|
-
url = Addressable::URI.parse "#{@base}/spider/action/scan/"
|
13
|
+
url = Addressable::URI.parse "#{@base}/JSON/spider/action/scan/"
|
14
14
|
url.query_values = {:zapapiformat=>"JSON",:url=>@target}
|
15
15
|
RestClient::get url.normalize.to_str
|
16
16
|
end
|
17
17
|
|
18
18
|
def stop
|
19
|
-
RestClient::get "#{@base}/spider/action/stop/?zapapiformat=JSON"
|
19
|
+
RestClient::get "#{@base}/JSON/spider/action/stop/?zapapiformat=JSON"
|
20
20
|
end
|
21
21
|
|
22
22
|
def status
|
23
|
-
ret = JSON.parse(RestClient::get("#{@base}/spider/view/status/?zapapiformat=JSON"))
|
23
|
+
ret = JSON.parse(RestClient::get("#{@base}/JSON/spider/view/status/?zapapiformat=JSON"))
|
24
24
|
if ret.has_key? "status"
|
25
25
|
ret["status"].to_i
|
26
26
|
else
|
data/lib/owasp_zap/version.rb
CHANGED
data/lib/owasp_zap.rb
CHANGED
@@ -20,7 +20,7 @@ module OwaspZap
|
|
20
20
|
def initialize(params = {})
|
21
21
|
#TODO
|
22
22
|
# handle params
|
23
|
-
@base = params[:base] || "http://127.0.0.1:8080
|
23
|
+
@base = params[:base] || "http://127.0.0.1:8080"
|
24
24
|
@target = params[:target]
|
25
25
|
@zap_bin = params [:zap] || "#{ENV['HOME']}/ZAP/zap.sh"
|
26
26
|
end
|
@@ -83,7 +83,7 @@ module OwaspZap
|
|
83
83
|
|
84
84
|
#shutdown zap
|
85
85
|
def shutdown
|
86
|
-
RestClient::get "#{@base}/core/action/shutdown/"
|
86
|
+
RestClient::get "#{@base}/JSON/core/action/shutdown/"
|
87
87
|
end
|
88
88
|
|
89
89
|
#xml report
|
data/spec/zap_spec.rb
CHANGED
@@ -68,8 +68,8 @@ describe Zap do
|
|
68
68
|
@zap.base.wont_be :nil?
|
69
69
|
end
|
70
70
|
|
71
|
-
it "base default should be http://127.0.0.1:8080
|
72
|
-
assert_equal @zap.base, "http://127.0.0.1:8080
|
71
|
+
it "base default should be http://127.0.0.1:8080" do
|
72
|
+
assert_equal @zap.base, "http://127.0.0.1:8080"
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: owasp_zap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.91
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pereira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|