dap 0.1.22 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +5 -1
- data/README.md +1 -1
- data/lib/dap/filter.rb +1 -0
- data/lib/dap/filter/gquic.rb +40 -0
- data/lib/dap/version.rb +1 -1
- data/spec/dap/filter/gquic_filter_spec.rb +37 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7825d15d19bfc4d5e8c3186b3061cfbdeec4544
|
4
|
+
data.tar.gz: 44db06642179239ec8cd0dd5a74b942d7ddd2099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39b2014c7ff8dae7f9b7fc682e11ced8a440e6851f7a3a2f66e2650e8b003ace087bbd1dbf61e4edbf6a9c1187dc5f30d08120e07caa5d57d5bf35da5562af16
|
7
|
+
data.tar.gz: d8ba566df260622890b602b21dd41cf5a69e90da230532640ccc4d9d0dfc3805e298c73df92f84ffed31b823b340a28d482b7c6a5aeea1bb186f8bc4686d6278
|
data/CONTRIBUTING.md
CHANGED
@@ -81,7 +81,7 @@ Finally, submit the PR. Navigate to ```https://github.com/<your-github-username
|
|
81
81
|
|
82
82
|
### Testing
|
83
83
|
|
84
|
-
When your PR is submitted, it will be automatically subjected to the full run of tests in [Travis](https://travis-ci.org/rapid7/dap/), however you are encourage to perform testing _before_ submitting the PR. To do this, simply run `
|
84
|
+
When your PR is submitted, it will be automatically subjected to the full run of tests in [Travis](https://travis-ci.org/rapid7/dap/), however you are encourage to perform testing _before_ submitting the PR. To do this, simply run `bundle exec rspec spec`.
|
85
85
|
|
86
86
|
## Landing PRs
|
87
87
|
|
@@ -138,3 +138,7 @@ When a new version of dap is to be released, you _must_ follow the instructions
|
|
138
138
|
2. Edit [lib/dap/version.rb](https://github.com/rapid7/dap/blob/master/lib/dap/version.rb) and increment ```VERSION```. Commit and push to rapid7/dap master.
|
139
139
|
3. Run `rake release`. Among other things, this creates the new gem, uploads it to Rubygems and tags the release with a tag like `v<VERSION>`, where `<VERSION>` is replaced with the version from `version.rb`. For example, if you release version 1.2.3 of the gem, the tag will be `v1.2.3`.
|
140
140
|
4. If your default remote repository is not `rapid7/dap`, you must ensure that the tags created in the previous step are also pushed to the right location(s). For example, if `origin` is your fork of dap and `upstream` is `rapid7/master`, you should run `git push --tags --dry-run upstream` to confirm what tags will be pushed and then `git push --tags upstream` to push the tags.
|
141
|
+
|
142
|
+
## Misc tips on building dap
|
143
|
+
|
144
|
+
Ruby often comes prepackaged on linux/mac os systems. Although the README already mentions using rbenv, it useful to make sure your envoiroment is actually using the rbenv version of ruby, gem, & bundler before running any ruby commands such as gem, bundle, ruby or dap itself utilizing the which command.
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@ DAP reads data using an input plugin, transforms it through a series of filters,
|
|
10
10
|
DAP was written to process terabyte-sized public scan datasets, such as those provided by https://scans.io/. Although DAP isn't particularly fast, it can be used across multiple cores (and machines) by splitting the input source and wrapping the execution with GNU Parallel.
|
11
11
|
|
12
12
|
|
13
|
+
|
13
14
|
## Installation
|
14
15
|
|
15
16
|
### Prerequisites
|
@@ -25,7 +26,6 @@ DAP depends on [Maxmind's geoip database](http://dev.maxmind.com/geoip/legacy/do
|
|
25
26
|
sudo mkdir -p /var/lib/geoip && cd /var/lib/geoip && sudo wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && sudo gunzip GeoLiteCity.dat.gz && sudo wget http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz && sudo gunzip GeoIPASNum.dat.gz
|
26
27
|
|
27
28
|
```
|
28
|
-
|
29
29
|
### Ubuntu 16.04
|
30
30
|
|
31
31
|
```bash
|
data/lib/dap/filter.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
module Dap
|
2
|
+
module Filter
|
3
|
+
|
4
|
+
#
|
5
|
+
# Decode a Google Quic VersionsRequest probe response
|
6
|
+
#
|
7
|
+
class FilterDecodeGquicVersionsResult
|
8
|
+
include BaseDecoder
|
9
|
+
|
10
|
+
#
|
11
|
+
# Decode an GQUIC ( Google Quic) versions probe response
|
12
|
+
#
|
13
|
+
# @param data [String] Binary string containing raw response from server
|
14
|
+
# @return [Hash] containing all GQUIC versions supported else nil
|
15
|
+
#
|
16
|
+
def decode(data)
|
17
|
+
return unless data
|
18
|
+
# need to skip 9 bytes and assume at least one valid version Q044
|
19
|
+
if data.length > 9 + 4 && (data.length - 9) % 4
|
20
|
+
versions = []
|
21
|
+
i = 9
|
22
|
+
step = 4
|
23
|
+
while i < data.length
|
24
|
+
version = data[i..i+4-1]
|
25
|
+
# Versions start with the letter Q
|
26
|
+
if data[i] == 'Q'
|
27
|
+
versions.push(version)
|
28
|
+
end
|
29
|
+
i = i + step
|
30
|
+
end
|
31
|
+
if versions.length > 0
|
32
|
+
# examples show versions in descending order, but in case its not reverse sort
|
33
|
+
info = {'versions' => versions.sort.reverse}
|
34
|
+
return info
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/dap/version.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
require "base64"
|
2
|
+
|
3
|
+
describe Dap::Filter::FilterDecodeGquicVersionsResult do
|
4
|
+
describe '.decode' do
|
5
|
+
|
6
|
+
let(:filter) { described_class.new(['data']) }
|
7
|
+
|
8
|
+
context 'testing gquic valid input' do
|
9
|
+
let(:decode) { filter.decode(Base64.decode64("DQAAAAECAwQFUTA0NFEwNDNRMDM5UTAzNQ=="))}
|
10
|
+
it 'returns an hash w/ versions as list of versions' do
|
11
|
+
expect(decode).to eq({"versions"=> ["Q044","Q043","Q039","Q035"]})
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'testing valid string but not gquic versions' do
|
16
|
+
let(:decode) { filter.decode("H044R043E039L035") }
|
17
|
+
it 'returns nil' do
|
18
|
+
expect(decode).to eq(nil)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'testing gquic empty string input' do
|
23
|
+
let(:decode) { filter.decode("") }
|
24
|
+
it 'returns nil' do
|
25
|
+
expect(decode).to eq(nil)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'testing gquic nil input' do
|
30
|
+
let(:decode) { filter.decode(nil) }
|
31
|
+
it 'returns nil' do
|
32
|
+
expect(decode).to eq(nil)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rapid7 Research
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11
|
11
|
+
date: 2018-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- lib/dap/filter.rb
|
182
182
|
- lib/dap/filter/base.rb
|
183
183
|
- lib/dap/filter/geoip.rb
|
184
|
+
- lib/dap/filter/gquic.rb
|
184
185
|
- lib/dap/filter/http.rb
|
185
186
|
- lib/dap/filter/ldap.rb
|
186
187
|
- lib/dap/filter/names.rb
|
@@ -220,6 +221,7 @@ files:
|
|
220
221
|
- samples/ssl_certs_org.sh
|
221
222
|
- samples/udp-netbios.csv.bz2
|
222
223
|
- samples/udp-netbios.sh
|
224
|
+
- spec/dap/filter/gquic_filter_spec.rb
|
223
225
|
- spec/dap/filter/http_filter_spec.rb
|
224
226
|
- spec/dap/filter/ldap_filter_spec.rb
|
225
227
|
- spec/dap/filter/simple_filter_spec.rb
|
@@ -253,11 +255,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
255
|
version: '0'
|
254
256
|
requirements: []
|
255
257
|
rubyforge_project:
|
256
|
-
rubygems_version: 2.
|
258
|
+
rubygems_version: 2.6.11
|
257
259
|
signing_key:
|
258
260
|
specification_version: 4
|
259
261
|
summary: 'DAP: The Data Analysis Pipeline'
|
260
262
|
test_files:
|
263
|
+
- spec/dap/filter/gquic_filter_spec.rb
|
261
264
|
- spec/dap/filter/http_filter_spec.rb
|
262
265
|
- spec/dap/filter/ldap_filter_spec.rb
|
263
266
|
- spec/dap/filter/simple_filter_spec.rb
|