patronus_fati 0.9.15 → 0.9.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/patronus_fati/message_processor/client.rb +12 -9
- data/lib/patronus_fati/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 540a4de3ee3c1a9ff1c056d7677ed1ca6bf780e0
|
4
|
+
data.tar.gz: 924fafdee1e19b35334d354877169471159d300e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc85c22017ccd669d0a3c3c509e1cf075491627fe2fb6d87a16570481330f9ec2922b8e6e0e18ed90f662a6bf14926d8294e44bc98f0a4324091b61870b3edcd
|
7
|
+
data.tar.gz: c1da545bc293ba08ea3406a15db3df7202a720eb1ccaf8c09844e1dc8f027ca88c518c7325e0f819ee3b0b76cc47b97409a600b1a00533799697e83f33b9128d
|
@@ -5,9 +5,11 @@ module PatronusFati::MessageProcessor::Client
|
|
5
5
|
# We don't care about objects that would have expired already...
|
6
6
|
return if obj[:lasttime] < PatronusFati::DataModels::Client.current_expiration_threshold
|
7
7
|
|
8
|
+
# obj[:mac] is the client's MAC address
|
9
|
+
# obj[:bssid] is the AP's MAC address
|
8
10
|
unless obj[:bssid].nil? || obj[:bssid].empty? || obj[:bssid] == obj[:mac]
|
9
|
-
|
10
|
-
ap.seen!
|
11
|
+
ap = PatronusFati::DataModels::AccessPoint.first(bssid: obj[:bssid])
|
12
|
+
ap.seen! if ap
|
11
13
|
end
|
12
14
|
|
13
15
|
# Some messages from kismet come in corrupted with partial MACs. We care
|
@@ -19,6 +21,14 @@ module PatronusFati::MessageProcessor::Client
|
|
19
21
|
# These potentially represent wired assets leaking through the WiFi and
|
20
22
|
# devices not following the 802.11 spec.
|
21
23
|
if %w( unknown from_ds ).include?(obj[:type]) || obj[:mac].nil?
|
24
|
+
# We only care about these assets if the packet is actually coming from
|
25
|
+
# an access point. If it's not coming from an access point than it is
|
26
|
+
# most likely it is a wired client leaking through.
|
27
|
+
#
|
28
|
+
# It is possible but unlikely and unusual that we just haven't seen this
|
29
|
+
# AP yet. Not recording it now will just delay the 'seeing' of the client
|
30
|
+
# a little bit.
|
31
|
+
return unless ap
|
22
32
|
client = PatronusFati::DataModels::Client.first({bssid: obj[:mac]})
|
23
33
|
else
|
24
34
|
client = PatronusFati::DataModels::Client.first_or_create({bssid: obj[:mac]}, client_info)
|
@@ -34,13 +44,6 @@ module PatronusFati::MessageProcessor::Client
|
|
34
44
|
if (conn = PatronusFati::DataModels::Connection.connected.first(client: client, access_point: ap))
|
35
45
|
conn.seen!
|
36
46
|
else
|
37
|
-
average = (obj[:datapackets] == 0 ? 0 : obj[:datasize] / obj[:datapackets])
|
38
|
-
|
39
|
-
# Create a connection only if it meets our thresholding logic below
|
40
|
-
return unless !(obj[:gatewayip].nil? || obj[:ip].nil?) ||
|
41
|
-
(average >= 156 && obj[:datapackets] > 10) ||
|
42
|
-
(average >= 110 && obj[:datapackets] > 50)
|
43
|
-
|
44
47
|
PatronusFati::DataModels::Connection.create(client: client, access_point: ap)
|
45
48
|
end
|
46
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patronus_fati
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stelfox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dm-constraints
|
@@ -371,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
371
371
|
version: '0'
|
372
372
|
requirements: []
|
373
373
|
rubyforge_project:
|
374
|
-
rubygems_version: 2.
|
374
|
+
rubygems_version: 2.5.1
|
375
375
|
signing_key:
|
376
376
|
specification_version: 4
|
377
377
|
summary: A ruby implementation of the Kismet client protocol.
|