-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2fae4b
commit c483a4c
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env python | ||
|
||
#---------------------------------------------- | ||
# ble_finder.py | ||
# Authors: Troy Brown (@waveguyd) and Garrett Gee (@ggee) | ||
# Developed for: | ||
# http://hackerwarehouse.com / @hackerwarehouse | ||
# http://hackerwarehouse.tv | ||
# | ||
# requirements: | ||
# run from blue_hydra directory and rssi file output option enabled | ||
# tailer module | ||
# | ||
# todo: | ||
# foxhunting | ||
# change last seen to dd:hh:mm:ss | ||
#---------------------------------------------- | ||
|
||
import datetime, os | ||
from time import sleep | ||
|
||
import tailer | ||
|
||
devices = [ | ||
['D5:3D:F4:CO:FF:EE', 'Ronalds tile tag', ''], | ||
['CF:19:F8:0X:DE:AD', 'Gerrards tile tag', ''], | ||
['FF:FF:C0:0X:BE:EF', 'Jasons iTAG', ''], | ||
] | ||
|
||
# threshold for reporting in seconds | ||
#seenthreshold = 10 | ||
seenthreshold = 45 | ||
|
||
for line in tailer.follow(open("blue_hydra_rssi.log")): | ||
for idx, (mac, name, lastseen) in enumerate(devices): | ||
if mac in line: | ||
currentseen = float(line.split()[0]) | ||
if lastseen: | ||
lastseen = float(lastseen) | ||
tdelta = datetime.datetime.fromtimestamp(currentseen) - datetime.datetime.fromtimestamp(lastseen) | ||
tsec = tdelta.total_seconds() | ||
if tsec >= seenthreshold: | ||
print name + ' (' + mac + ') is nearby - last seen ' + str(tsec) + ' seconds ago' | ||
# os.system('aplay ping.wav &') | ||
else: | ||
# first time seen | ||
print name + ' (' + mac + ') is nearby' | ||
# os.system('aplay ping.wav &') | ||
|
||
# update last seen field with current timestamp | ||
devices[idx][2] = currentseen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
log_level: info | ||
bt_device: hci0 | ||
info_scan_rate: 60 | ||
status_sync_rate: 86400 | ||
btmon_log: false | ||
btmon_rawlog: false | ||
file: false | ||
rssi_log: true | ||
aggressive_rssi: false |