rabid 0.0.6 → 0.2.0
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/bin/rabid +5 -6
- data/lib/bigipcookie/version.rb +1 -1
- data/lib/bigipcookie.rb +17 -17
- metadata +10 -120
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '082674e58cc0d1ca47abf42e4ec403110e8eed575412368698f08f8ede8a007b'
|
4
|
+
data.tar.gz: 73ab50545c2dff7fb2b1424e347a690a6f6d7dad63e5489568902df5c8ed4d78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c31b21ae75ca7c8218c603a672bac786486db372441b7ed15822f08f16d337b27d1cf218d430262a56192d699ed25f56da28d4eed44dbb233259fe0f6894883
|
7
|
+
data.tar.gz: ad6bb2450dd50e0204768316dd5b5ccf73b27960a9f36fd3c2ad9b3074b33f62799d04045ea25deba5b7cd817955f94ff765f5328d240928af505560a91111f3
|
data/bin/rabid
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# Ruby internal
|
5
|
-
require 'pp'
|
6
5
|
# Project internal
|
7
6
|
require 'bigipcookie'
|
8
7
|
# External
|
@@ -36,7 +35,7 @@ DOCOPT
|
|
36
35
|
begin
|
37
36
|
args = Docopt.docopt(doc, version: BigIPCookie::VERSION)
|
38
37
|
Paint.mode = 0 if args['--no-color']
|
39
|
-
|
38
|
+
puts args if args['--debug']
|
40
39
|
# use case 1, using the tool
|
41
40
|
if args['<raw_cookie>']
|
42
41
|
bip = BigIPCookie::Decode.new(args['<raw_cookie>'])
|
@@ -47,10 +46,10 @@ begin
|
|
47
46
|
if args['--short']
|
48
47
|
puts Paint[bip.decoded_cookie, :green]
|
49
48
|
else
|
50
|
-
puts Paint['Pool name:', :white, :bold]
|
51
|
-
puts Paint['Cookie type:', :white, :bold]
|
52
|
-
puts Paint['Raw cookie:', :white, :bold]
|
53
|
-
puts Paint['Decoded cookie:', :white, :bold]
|
49
|
+
puts "#{Paint['Pool name:', :white, :bold]} #{bip.pool_name}"
|
50
|
+
puts "#{Paint['Cookie type:', :white, :bold]} #{bip.cookie_type}"
|
51
|
+
puts "#{Paint['Raw cookie:', :white, :bold]} #{bip.raw_cookie}"
|
52
|
+
puts "#{Paint['Decoded cookie:', :white, :bold]} #{Paint[bip.decoded_cookie, :green]}"
|
54
53
|
end
|
55
54
|
end
|
56
55
|
# use case 2, help: already handled by docopt
|
data/lib/bigipcookie/version.rb
CHANGED
data/lib/bigipcookie.rb
CHANGED
@@ -51,25 +51,25 @@ class BigIPCookie
|
|
51
51
|
# @!visibility public
|
52
52
|
# @param ip [String] the encoded IP address
|
53
53
|
# @param opts [Hash] options for the decoding process (only
|
54
|
-
#
|
55
|
-
# @option opts [Integer] :default default behavior, default value is 1
|
56
|
-
# value is set to 0 it disables
|
57
|
-
# @option opts [Integer] :ipversion 4 for IPv4 and 6 for IPv6, default is 4
|
58
|
-
# 4
|
59
|
-
#
|
54
|
+
# `:ipv6compression` should be used, others are for developers)
|
55
|
+
# @option opts [Integer] :default default behavior, default value is `1`, if
|
56
|
+
# value is set to `0` it disables `:ip2hex` and `:reverse`
|
57
|
+
# @option opts [Integer] :ipversion `4` for IPv4 and `6` for IPv6, default is `4`,
|
58
|
+
# `4` sets `:joinchar` to `.` and `:scanby` to `2`, `6` sets `:joinchar` to `:` and
|
59
|
+
# `:scanby` to `6`
|
60
60
|
# @option opts [Integer] :ip2hex encode IP address groups into hexadecimal,
|
61
|
-
# default is 1
|
61
|
+
# default is `1`, set to `0` disable
|
62
62
|
# @option opts [Integer] :joinchar the character used to join the IP
|
63
|
-
# address groups, default is
|
64
|
-
#
|
63
|
+
# address groups, default is `.` (IPv4), for example it can be set to
|
64
|
+
# `:` for IPv6
|
65
65
|
# @option opts [Integer] :hex2ip decode hexadecimal IP address groups to
|
66
|
-
# decimal, default is 1
|
67
|
-
# @option opts [Integer] :reverse reverse the IP address groups if set to 1
|
68
|
-
# default is 1
|
69
|
-
# @option opts [Integer] :ipv6compression compress IPv6 address if set to 1
|
70
|
-
# default is 1
|
66
|
+
# decimal, default is `1`, set `0` to disable
|
67
|
+
# @option opts [Integer] :reverse reverse the IP address groups if set to `1`,
|
68
|
+
# default is `1`
|
69
|
+
# @option opts [Integer] :ipv6compression compress IPv6 address if set to `1`,
|
70
|
+
# default is `1`
|
71
71
|
# @option opts [Integer] :scanby parse the raw cookie value by n to find IP
|
72
|
-
# address groups, default is 2 for IPv4 and 4 for IPv6
|
72
|
+
# address groups, default is `2` for IPv4 and `4` for IPv6
|
73
73
|
# @return [String] the decoded IP address
|
74
74
|
def decode_ip(ip, opts = {})
|
75
75
|
opts[:default] ||= 1
|
@@ -95,7 +95,7 @@ class BigIPCookie
|
|
95
95
|
end
|
96
96
|
|
97
97
|
ip = format('%02x', ip) if opts[:ip2hex] == 1 # ip to hex
|
98
|
-
ip =
|
98
|
+
ip = "0#{ip}" if ip.size.odd? # prepend a 0 when we have an odd number
|
99
99
|
ip = ip.scan(/.{#{opts[:scanby]}}/) # split by n
|
100
100
|
ip.reverse! if opts[:reverse] == 1 # reverse array
|
101
101
|
ip = ip.map { |i| i.to_i(16) } if opts[:hex2ip] == 1 # hex to ip
|
@@ -167,7 +167,7 @@ class BigIPCookie
|
|
167
167
|
end
|
168
168
|
|
169
169
|
# Return that the cookie is encrypted
|
170
|
-
# @param
|
170
|
+
# @param _cookie [String] raw cookie value
|
171
171
|
# @return [String] Encrypted cookie detection message
|
172
172
|
def encrypted(_cookie)
|
173
173
|
return 'Unknown:Encrypted'
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre ZANNI
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-30 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: docopt
|
@@ -38,118 +37,6 @@ dependencies:
|
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '2.2'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '2.1'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '2.1'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: commonmarker
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.21'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0.21'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: github-markup
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: minitest
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '5.11'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '5.11'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rake
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '13.0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '13.0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: redcarpet
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '3.4'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '3.4'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0.80'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0.80'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: yard
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0.9'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0.9'
|
153
40
|
description: A library and CLI tool allowing to decode all 4 types of BigIP cookies
|
154
41
|
email: alexandre.zanni@engineer.com
|
155
42
|
executables:
|
@@ -173,23 +60,26 @@ metadata:
|
|
173
60
|
documentation_uri: https://noraj.github.io/rabid/
|
174
61
|
homepage_uri: https://noraj.github.io/rabid/
|
175
62
|
source_code_uri: https://github.com/noraj/rabid/
|
176
|
-
|
63
|
+
funding_uri: https://github.com/sponsors/noraj
|
64
|
+
rubygems_mfa_required: 'true'
|
177
65
|
rdoc_options: []
|
178
66
|
require_paths:
|
179
67
|
- lib
|
180
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
181
69
|
requirements:
|
182
|
-
- - "
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 3.1.0
|
73
|
+
- - "<"
|
183
74
|
- !ruby/object:Gem::Version
|
184
|
-
version: '
|
75
|
+
version: '4.0'
|
185
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
77
|
requirements:
|
187
78
|
- - ">="
|
188
79
|
- !ruby/object:Gem::Version
|
189
80
|
version: '0'
|
190
81
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
192
|
-
signing_key:
|
82
|
+
rubygems_version: 3.6.2
|
193
83
|
specification_version: 4
|
194
84
|
summary: RApid Big IP Decoder
|
195
85
|
test_files: []
|