dap 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cd019aba689251f56e3ec08abb75533f3fe8eac
4
- data.tar.gz: 75ce91184b5c8e1320acb557c009607530c6be17
3
+ metadata.gz: ff9410dfc65b7f7aa6445a67ef23e153c185383f
4
+ data.tar.gz: 7dbb33c223d9523223b1517940a7cfb961aafd76
5
5
  SHA512:
6
- metadata.gz: 3a1f4d012a8b452f0671c0a262aa06b0f0f5787d9aba133e79f5389ad9bf5fb9e8c8c16df51201e0014410e711d29f5984f0599407944ccfbabc27b79a7bd27c
7
- data.tar.gz: 996ff5f0efae982df396c29d1bad7c1b3a9a69cb97f451bbb65c09ec6589a7dc7f7bfca018ff971d7c9060b60211c9a0f1a6c7a000ba548ab6dd35681e5896eb
6
+ metadata.gz: 3c9663e75f37a411208cc45daf18789aed596ef90ce314ac48c870ccce2aca0d81fe52afbdf2160df924565dfe0edf15b26bd0479b25c5cae664eebf17093d1d
7
+ data.tar.gz: 81fe7e7456f13f1aa79261c88166dae6da32200c463992526f8d323e924cff941d09efc26c4f3941b05a7fc103d07f2547a5397713635e42ea77af0fa963a453
data/README.md CHANGED
@@ -14,15 +14,16 @@ DAP was written to process terabyte-sized public scan datasets, such as those pr
14
14
 
15
15
  ### Prerequisites
16
16
 
17
- DAP requires Ruby, and is best suited for systems with a relatively current version,
18
- preferably one installed and managed by
19
- [`rbenv`](https://github.com/rbenv/rbenv) or [`rvm`](https://rvm.io/). Using
20
- system managed/installed Rubies is possible but fraught with peril.
17
+ DAP requires Ruby, and is best suited for systems with a relatively current version with 2.1.0 being the minimum requirement.
18
+ Ideally, this will be managed with either
19
+ [`rbenv`](https://github.com/rbenv/rbenv) or [`rvm`](https://rvm.io/) with the bundler gem also installed and up to date.
20
+ Using system managed/installed Rubies is possible but fraught with peril.
21
21
 
22
22
  DAP depends on [Maxmind's geoip database](http://dev.maxmind.com/geoip/legacy/downloadable/) to be able to append geographic metadata to analyzed datasets. If you intend on using this capability, run the following as `root`:
23
23
 
24
24
  ```bash
25
- mkdir -p /var/lib/geoip && cd /var/lib/geoip && wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && gunzip GeoLiteCity.dat.gz && mv GeoLiteCity.dat geoip.dat
25
+ 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 mv GeoLiteCity.dat geoip.dat && sudo wget http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz && sudo gunzip GeoIPASNum.dat.gz
26
+
26
27
  ```
27
28
 
28
29
  ### Ubuntu
@@ -9,10 +9,12 @@ module GeoIPLibrary
9
9
  "/var/lib/geoip"
10
10
  ]
11
11
  GEOIP_CITY = %W{ geoip.dat geoip_city.dat GeoCity.dat IP_V4_CITY.dat GeoCityLite.dat }
12
- GEOIP_ORGS = %W{ geoip_org.dat IP_V4_ORG.dat }
12
+ GEOIP_ORGS = %W{ geoip_org.dat IP_V4_ORG.dat }
13
+ GEOIP_ASN = %W{ GeoIPASNum.dat }
13
14
 
14
15
  @@geo_city = nil
15
16
  @@geo_orgs = nil
17
+ @@geo_asn = nil
16
18
 
17
19
  GEOIP_DIRS.each do |d|
18
20
  GEOIP_CITY.each do |f|
@@ -28,7 +30,14 @@ module GeoIPLibrary
28
30
  @@geo_orgs = GeoIP::Organization.new(path)
29
31
  break
30
32
  end
31
- end
33
+ end
34
+ GEOIP_ASN.each do |f|
35
+ path = File.join(d, f)
36
+ if ::File.exist?(path)
37
+ @@geo_asn = GeoIP::Organization.new(path)
38
+ break
39
+ end
40
+ end
32
41
  end
33
42
  end
34
43
 
@@ -67,6 +76,19 @@ class FilterGeoIPOrg
67
76
  end
68
77
  end
69
78
 
79
+ #
80
+ # Add GeoIP ASN tags using the MaxMind GeoIP::ASN database
81
+ #
82
+ class FilterGeoIPAsn
83
+ include BaseDecoder
84
+ include GeoIPLibrary
85
+ def decode(ip)
86
+ return unless @@geo_asn
87
+ geo_hash = @@geo_asn.look_up(ip)
88
+ return unless (geo_hash and geo_hash[:name])
89
+ { :asn => geo_hash[:name].split(' ')[0] }
90
+ end
91
+ end
70
92
 
71
93
  end
72
- end
94
+ end
@@ -1,3 +1,3 @@
1
1
  module Dap
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rapid7 Research
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-07 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec