rabid 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fb66b7c9b3281ef662bdd6dc6c65e6ed5093e490f15e9aaa999332bad9154f9
4
- data.tar.gz: c483b97746a73410651ddc054b17ee70cd49c1f018231a1f274159d3530b16b0
3
+ metadata.gz: bc6129ff43ec4e9cf11036b001c0dbd6526089038692a7f30708f62249933efe
4
+ data.tar.gz: 715442b0e16c1148450038d5582ffcb87188a054b5659582a8caf3196fc2fca0
5
5
  SHA512:
6
- metadata.gz: 4eef5f2d9387f6d939e1950e55599a21817eee083d1715a33167aba68bc5cc9bdbf2ce0f5cb7128bb041ddea4d3d37a9cf9f2502fb36583c40474aaf4de98264
7
- data.tar.gz: 974535723fa1b1c0ee77ca6f2b868fb7cf51f2db4ec63f93dbb5a2d20f55cef1c75385fbf4a67df0a1cc18700c2a215425d5283c5dde169d749ccc47305e7c95
6
+ metadata.gz: 8a41f95d9ca6bf5070251ece01ff2e118788e96f703b51b77bdf8092333ea356b1641ac8ebcfb47b61b2f2d27aaff27b137052842ce17cdb99c69c74b58dc8df
7
+ data.tar.gz: a2b796a96e55137452605b5b6b52641d38e577208e5c444d12d14bf9ff9e581b68a4bbea2df49c28d77ee6cdfe65820f0cc18904534662f7be71757dcca06d18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rabid (0.0.3)
4
+ rabid (0.0.4)
5
5
  docopt (~> 0.6)
6
6
  paint (~> 2.1)
7
7
 
data/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.4]
4
+
5
+ - Fix regex in `auto_decode` and `retrieve_pool_name` for base64 encoded cookie (encrypted) - lazy quantifier instead of greedy one to match the first `=` sign
6
+
3
7
  ## [0.0.3]
4
8
 
5
9
  - Update `commonmarker` dependency
data/docs/_coverpage.md CHANGED
@@ -8,7 +8,7 @@
8
8
  - CLI tool & library
9
9
  - Hackable
10
10
 
11
- [GitHub]()
11
+ [GitHub](https://github.com/Orange-Cyberdefense/rabid/)
12
12
  [Get Started](pages/quick-start?id=quick-start)
13
13
 
14
14
  ![color](#ffffff)
@@ -3,7 +3,7 @@
3
3
  ## On Rubygems.org
4
4
 
5
5
  ```
6
- $ git tag vx.x.x
6
+ $ git tag -a vx.x.x
7
7
  $ git push --follow-tags
8
8
  $ gem push rabid-x.x.x.gem
9
9
  ```
@@ -748,11 +748,11 @@
748
748
  <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\=</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='ivar'>@raw_cookie</span><span class='rparen'>)</span> <span class='comment'># if there is a key
749
749
  </span> <span class='kw'>if</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^BIGipServer</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match?'>match?</span><span class='lparen'>(</span><span class='ivar'>@raw_cookie</span><span class='rparen'>)</span> <span class='comment'># if default cookie name
750
750
  </span> <span class='id identifier rubyid_pool_name'>pool_name</span> <span class='op'>=</span> <span class='id identifier rubyid_retrieve_pool_name'>retrieve_pool_name</span>
751
- <span class='id identifier rubyid_cookie_value'>cookie_value</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^BIGipServer.+=(.+)</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='ivar'>@raw_cookie</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_captures'>captures</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
751
+ <span class='id identifier rubyid_cookie_value'>cookie_value</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^BIGipServer.*?=(.+)</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='ivar'>@raw_cookie</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_captures'>captures</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
752
752
  <span class='id identifier rubyid_decoded_cookie'>decoded_cookie</span> <span class='op'>=</span> <span class='id identifier rubyid_decode_cookie'>decode_cookie</span><span class='lparen'>(</span><span class='id identifier rubyid_cookie_value'>cookie_value</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
753
753
  <span class='ivar'>@pool_name</span> <span class='op'>=</span> <span class='id identifier rubyid_pool_name'>pool_name</span>
754
754
  <span class='kw'>else</span> <span class='comment'># custom cookie name
755
- </span> <span class='id identifier rubyid_cookie_value'>cookie_value</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.+=(.+)</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='ivar'>@raw_cookie</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_captures'>captures</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
755
+ </span> <span class='id identifier rubyid_cookie_value'>cookie_value</span> <span class='op'>=</span> <span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>.*?=(.+)</span><span class='regexp_end'>/</span></span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='ivar'>@raw_cookie</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_captures'>captures</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
756
756
  <span class='id identifier rubyid_decoded_cookie'>decoded_cookie</span> <span class='op'>=</span> <span class='id identifier rubyid_decode_cookie'>decode_cookie</span><span class='lparen'>(</span><span class='id identifier rubyid_cookie_value'>cookie_value</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
757
757
  <span class='ivar'>@pool_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>unknown</span><span class='tstring_end'>&#39;</span></span>
758
758
  <span class='kw'>end</span>
@@ -772,9 +772,9 @@
772
772
  </div>
773
773
 
774
774
  <div id="footer">
775
- Generated on Thu Oct 3 03:20:25 2019 by
775
+ Generated on Thu Oct 3 11:49:14 2019 by
776
776
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
777
- 0.9.20 (ruby-2.6.0).
777
+ 0.9.20 (ruby-2.6.2).
778
778
  </div>
779
779
 
780
780
  </div>
@@ -149,9 +149,9 @@
149
149
  </div>
150
150
 
151
151
  <div id="footer">
152
- Generated on Thu Oct 3 03:20:24 2019 by
152
+ Generated on Thu Oct 3 11:49:14 2019 by
153
153
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
154
- 0.9.20 (ruby-2.6.0).
154
+ 0.9.20 (ruby-2.6.2).
155
155
  </div>
156
156
 
157
157
  </div>
@@ -100,7 +100,7 @@
100
100
  <dt id="VERSION-constant" class="">VERSION =
101
101
 
102
102
  </dt>
103
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.0.3</span><span class='tstring_end'>&#39;</span></span></pre></dd>
103
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>0.0.4</span><span class='tstring_end'>&#39;</span></span></pre></dd>
104
104
 
105
105
  </dl>
106
106
 
@@ -116,9 +116,9 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Thu Oct 3 03:20:24 2019 by
119
+ Generated on Thu Oct 3 11:49:13 2019 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
- 0.9.20 (ruby-2.6.0).
121
+ 0.9.20 (ruby-2.6.2).
122
122
  </div>
123
123
 
124
124
  </div>
@@ -128,9 +128,9 @@
128
128
  </div>
129
129
 
130
130
  <div id="footer">
131
- Generated on Thu Oct 3 03:20:24 2019 by
131
+ Generated on Thu Oct 3 11:49:13 2019 by
132
132
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
133
- 0.9.20 (ruby-2.6.0).
133
+ 0.9.20 (ruby-2.6.2).
134
134
  </div>
135
135
 
136
136
  </div>
@@ -60,9 +60,9 @@
60
60
  <div id="content"><div id='filecontents'>The MIT License (MIT)<br/><br/>Copyright (c) 2019 Alexandre ZANNI<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy<br/>of this software and associated documentation files (the &quot;Software&quot;), to deal<br/>in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>copies of the Software, and to permit persons to whom the Software is<br/>furnished to do so, subject to the following conditions:<br/><br/>The above copyright notice and this permission notice shall be included in<br/>all copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br/>THE SOFTWARE.</div></div>
61
61
 
62
62
  <div id="footer">
63
- Generated on Thu Oct 3 03:20:24 2019 by
63
+ Generated on Thu Oct 3 11:49:13 2019 by
64
64
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
65
- 0.9.20 (ruby-2.6.0).
65
+ 0.9.20 (ruby-2.6.2).
66
66
  </div>
67
67
 
68
68
  </div>
@@ -95,9 +95,9 @@
95
95
  </div></div>
96
96
 
97
97
  <div id="footer">
98
- Generated on Thu Oct 3 03:20:24 2019 by
98
+ Generated on Thu Oct 3 11:49:13 2019 by
99
99
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
100
- 0.9.20 (ruby-2.6.0).
100
+ 0.9.20 (ruby-2.6.2).
101
101
  </div>
102
102
 
103
103
  </div>
data/docs/yard/index.html CHANGED
@@ -95,9 +95,9 @@
95
95
  </div></div>
96
96
 
97
97
  <div id="footer">
98
- Generated on Thu Oct 3 03:20:24 2019 by
98
+ Generated on Thu Oct 3 11:49:13 2019 by
99
99
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
100
- 0.9.20 (ruby-2.6.0).
100
+ 0.9.20 (ruby-2.6.2).
101
101
  </div>
102
102
 
103
103
  </div>
@@ -102,9 +102,9 @@
102
102
  </div>
103
103
 
104
104
  <div id="footer">
105
- Generated on Thu Oct 3 03:20:24 2019 by
105
+ Generated on Thu Oct 3 11:49:13 2019 by
106
106
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
107
- 0.9.20 (ruby-2.6.0).
107
+ 0.9.20 (ruby-2.6.2).
108
108
  </div>
109
109
 
110
110
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Version
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
data/lib/bigipcookie.rb CHANGED
@@ -224,7 +224,7 @@ class BigIPCookie
224
224
  # cookie name is used or if no cookie key was provided
225
225
  # @return the pool name
226
226
  def retrieve_pool_name
227
- pool_name = /BIGipServer(.+)=.+/.match(@raw_cookie).captures[0]
227
+ pool_name = /BIGipServer(.*?)=.+/.match(@raw_cookie).captures[0]
228
228
  return pool_name
229
229
  end
230
230
 
@@ -237,11 +237,11 @@ class BigIPCookie
237
237
  if /\=/.match?(@raw_cookie) # if there is a key
238
238
  if /^BIGipServer/.match?(@raw_cookie) # if default cookie name
239
239
  pool_name = retrieve_pool_name
240
- cookie_value = /^BIGipServer.+=(.+)/.match(@raw_cookie).captures[0]
240
+ cookie_value = /^BIGipServer.*?=(.+)/.match(@raw_cookie).captures[0]
241
241
  decoded_cookie = decode_cookie(cookie_value, opts)
242
242
  @pool_name = pool_name
243
243
  else # custom cookie name
244
- cookie_value = /.+=(.+)/.match(@raw_cookie).captures[0]
244
+ cookie_value = /.*?=(.+)/.match(@raw_cookie).captures[0]
245
245
  decoded_cookie = decode_cookie(cookie_value, opts)
246
246
  @pool_name = 'unknown'
247
247
  end
@@ -62,4 +62,15 @@ class BigIPCookieTest < Minitest::Test
62
62
  # Cookie type
63
63
  assert_equal('Encrypted', bip.cookie_type)
64
64
  end
65
+
66
+ def test_encrypted_2
67
+ bip = BigIPCookie::Decode.new('BIGipServerhttp-pool=!VGVzdCBzdHJpbmcgMiBlcXVhbCBzaWducw==')
68
+ bip.auto_decode
69
+ # Decoded cookie
70
+ assert_equal('Unknown:Encrypted', bip.decoded_cookie)
71
+ # Pool name
72
+ assert_equal('http-pool', bip.pool_name)
73
+ # Cookie type
74
+ assert_equal('Encrypted', bip.cookie_type)
75
+ end
65
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre ZANNI