Code Monkey home page Code Monkey logo

find3-cli-scanner's Introduction

Read the docs Join slack Docker build status Donate

The Framework for Internal Navigation and Discovery (FIND) is like indoor GPS for your house or business, using only a simple smartphone or laptop. This command-line scanner provides a means for your laptop or your computer to monitor the address and signal of nearby WiFi and bluetooth devices (active scanning). Also, if equipped with a monitor-mode enabled WiFI card, you can use the scanner to intercept probe requests to do passive scanning.

This tool should be able to be used on Linux, Windows and OS X. Though, currently only Linux and OS X support bluetooth and passive scanning.

Install

There are a couple of ways to install. I recommend downloading the latest release as that is the easiest way.

Install natively

First make sure you have downloaded Go.

Then, install the dependencies.

Linux

$ sudo apt-get install wireless-tools net-tools libpcap-dev bluetooth

OS X

$ brew install libpcap

Now download and install the scanner with go get:

$ GO111MODULE=on go get -v github.com/schollz/find3-cli-scanner/v3 

If you are on Linux, then you should move it to a path that is available with sudo:

$ sudo mv $GOPATH/bin/find3-cli-scanner /usr/local/bin

That's it! See below for usage.

Install with Docker

Install Docker:

$ curl -sSL https://get.docker.com | sh

If not using a Raspberry Pi, fetch the latest image.

$ docker pull schollz/find3-cli-scanner

If you are using a Raspberry Pi (armf arch), you need to build the image yourself, although I suggest Raspberry Pi's just built natively above.

$ wget https://raw.githubusercontent.com/schollz/find3-cli-scanner/master/Dockerfile
$ docker build -t schollz/find3-cli-scanner .

Now you can start the scanning image in the background.

$ docker run --net="host" --privileged --name scanner -d -i -t schollz/find3-cli-scanner

To use the scanner, your syntax will be

$ docker exec scanner sh -c "find3-cli-scanner -device DEVICE -family FAMILY -wifi -bluetooth -forever"

Be sure to use your own device/family name. Use -help to see which flags are available.

You can start/stop the image using

$ docker start scanning
$ docker stop scanning

Note, you can jump inside the image and play if you are curious of trying new things.

$ docker run --net="host" --privileged --name scanning -i -t scanner /bin/bash

Usage

Active scanning

In active scanning the scanner will report the classified location of the device that is doing the scanning.

To use the find3-cli-scanner you must include the name of your interface (typically something like wlan0) with -i. You can determine the name using ifconfig or similar command.

You must also include a family name with -family and a device name specified with -device. This will help organize your data among the server, so choose them to be unique. You can have multiple devices in the same family.

The default server is https://cloud.internalpositioning.com which you can specify with -server.

I suggest using a scantime of about 10 seconds, which you can specify with -scantime 10. If you want bluetooth to be scanned as well, just add -bluetooth.

To keep the scanner running, just add -forever. Even if the scanner is unable to reach the server (i.e. the server is down) the scanner will continue to send out data. If the server does come back on, then it will automatically be reconnected. If you'd like to have the scanner run in the background forever you can prefix with nohup and suffix with &.

Finally, the basic command then becomes:

$ nohup find3-cli-scanner -i YOURINTERFACE \
    -device YOURDEVICE -family YOURFAMILY \
    -server https://cloud.internalpositioning.com \
    -scantime 10 -bluetooth -forever &

Passive scanning

In passive scanning the scanner will report the classified location of the devices that it scans. This mode requires having a WiFi card that supports monitor mode. There are a number of possible USB WiFi adapters that support monitor mode. Here's a list that are popular:

Namely you want to find a USB adapter with one of the following chipsets: Atheros AR9271, Ralink RT3070, Ralink RT3572, or Ralink RT5572. You can simply run the command above with the flag -passive added to enable passive scanning.

$ nohup find3-cli-scanner -i YOURINTERFACE \
    -device YOURDEVICE -family YOURFAMILY \
    -server https://cloud.internalpositioning.com \
    -scantime 10 -bluetooth -forever -passive &

The above command will start by enabling monitor mode of the specified interface, then run the scan (using tshark and the bluetooth adapter), and then it will disable monitor mode so that the scan can be uploaded to the server. The enabling/disabling of monitor mode requires about 10 seconds each time. To remove this step you can enable monitor mode permanently.

$ find3-cli-scanner -i YOURINTERFACE -monitor-mode

After enabling monitor mode permanently you need to add a flag -no-modify to tell the command line scanner not to enable/disable automatically.

$ nohup find3-cli-scanner -i YOURINTERFACE \
    -device YOURDEVICE -family YOURFAMILY \
    -server https://cloud.internalpositioning.com \
    -scantime 10 -bluetooth -forever -passive -no-modify &

Issues?

If you have issues, please file a bug report on Github.

Source

If you are interested, the app is completely open-source and available at https://github.com/schollz/find3-cli-scanner.

LICENSE

MIT

find3-cli-scanner's People

Contributors

hit0ri avatar kant avatar nash-stokes avatar schollz avatar tavalin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

find3-cli-scanner's Issues

ARMv5 support

hi, i'm trying to get this program in my armv5 device.
Is there any possibilities?

Bug: cli-scanner docker on mac needs sudo

installed the cli-scanner docker container on os x (tried high sierra and el capitan), but after trying to scan:

ix:~ ix$ docker exec scanner sh -c "find3-cli-scanner -i en0 -device ixbook -family test -server http://192.168.1.57:8005 -scantime 10 -location kueche"

it complains:

2018-07-28 10:52:37 [ERROR] main.go main:206 need to run with sudo

of course docker exec scanner sh -c "sudo find3-cli-scanner … does not work

also:

ix:~ ix$ docker run --net="host" --privileged --name scanning -i -t schollz/find3-cli-scanner /bin/bash
root@linuxkit-025000000001:/# find3-cli-scanner 
2018-07-28 11:11:19 [ERROR] main.go main:206 need to run with sudo 
root@linuxkit-025000000001:/# sudo
bash: sudo: command not found

Specifications

  • Version: latest find3
  • Platform: osx 10.13.6 / osx 10.11.6
  • Subsystem: docker 18.06.0-ce-mac70

Segmentation Fault on Raspberry pi

I am trying to run the scanner on a raspberry pi 3b+ and also a pi0w; in both instances I get a seg fault. I changed the name, family, and server below for privacy reasons.

pi@raspberrypi:~ $ sudo find3-cli-scanner -i wlan0 -d <name> -f <family> -server <server> -scantime 10 -bluetooth
2019-01-15 20:12:36 [INFO] main.go func1:212 scanning bluetooth
2019-01-15 20:12:36 [INFO] main.go func1:218 scanning for 10 seconds
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1c pc=0x397248]

goroutine 1 [running]:
main.postData(0x543797d8, 0x168, 0x7efa4859, 0x6, 0x7efa484d, 0x8, 0x0, 0x0, 0x1cfc100, 0x0, ...)
	/home/pi/go/src/github.com/schollz/find3-cli-scanner/server-main.go:59 +0x220
main.basicCapture(0x4701d9, 0x17)
	/home/pi/go/src/github.com/schollz/find3-cli-scanner/main.go:369 +0x640
main.main.func1(0x1cae370, 0x1cae370, 0x1cc7b40)
	/home/pi/go/src/github.com/schollz/find3-cli-scanner/main.go:219 +0x5e0
github.com/urfave/cli.HandleAction(0x3e05f0, 0x488d1c, 0x1cae370, 0x1c8e600, 0x0)
	/home/pi/go/src/github.com/urfave/cli/app.go:501 +0xac
github.com/urfave/cli.(*App).Run(0x1c01500, 0x1c16060, 0xc, 0xc, 0x0, 0x0)
	/home/pi/go/src/github.com/urfave/cli/app.go:268 +0x400
main.main()
	/home/pi/go/src/github.com/schollz/find3-cli-scanner/main.go:232 +0x920

I should mention that I installed go manually

pi@raspberrypi:~ $ go version
go version go1.11.4 linux/arm

And also followed the instructions at https://www.internalpositioning.com/doc/cli-scanner.md for installing the tool.

I couldn't get docker to run properly on the pi either.

Reminder user to use sudo, if they didn't

sudo is required to access the settings of the wifi card, so it will be required to run this command.

There should be a user reminder to use sudo if they didn't.

Discussion/Feature Request: Support NAME requests for BLE

For privacy reasons, most Apple devices, and some Android devices use randomized Bluetooth addresses when not paired to a host device. Devices do however use their real address when responding to a NAME request, but that request must already include the real address in the request.

Other projects, such as Monitor use a "known BLE addresses" list, and then issue NAME requests to figure out a device's real Bluetooth address.

Is this something that would be useful to FIND when doing passive scanning, or does it have some other way of consistently identifying a device?

Cannot run passive mode on OSX

OSX Version: Mojave 10.14.2
find-3-scanner version: (probably a bug)

usr/local/bin/find3-cli-scanner -v
find3-cli-scanner version

Hi, thank you for this library.

It looks like find3-cli-scanner needs iwconfig that is not present on OSX computers. Is there a work around? The install section describes how to install it on OSX, so I am assuming I can run it natively as well, without a docker image. The only other issue I found related to OSX is a closed issue that is actually running a docker linux image, so my apologies if I missed any other reference.

It doesn't look like iwconfig is available in brew either.

sudo /usr/local/bin/find3-cli-scanner -i en0 -device mycomputer -family myfamily -server https://cloud.internalpositioning.com -scantime 40 -forever -passive
Password:
2019-01-25 08:50:45 [INFO] main.go func1:209 scanning with en0 
2019-01-25 08:50:45 [INFO] main.go func1:218 scanning for 40 seconds 
2019-01-25 08:50:45 [INFO] main.go func1:222 working in passive mode 
2019-01-25 08:50:46 [ERROR] utils.go RunCommand:27 exec: "iwconfig": executable file not found in $PATH 

It seems iwconfig is only needed to switch the card to monitor mode (find3-cli-scanner invokes iwconfig en0 mode monitor), but I haven't found out how to switch the card to monitor mode and keep it that way and exit. Tools like airport and tcpdump (ref) only seem to switch on monitor mode for the duration of their own scans. I also tried running wireless diagnostics sniff (ref) whilst trying to run this cli program.

So is there a command equivalent I can use on OSX? In that case, I can just write a wrapper iwconfig script)

how to fix this problem

how to fix this problem
Now I use command
docker exec scanner sh -c "find3-cli-scanner -device DEVICE -family FAMILY -wifi -bluetooth -forever"
But I changre the family name and divice name

2021-08-24 07:23:19 [INFO] main.go func1:186 scanning with wlan0
2021-08-24 07:23:20 [WARN] main.go func1:200 unable to analyze: problem validating data: sensor data cannot be empty
2021-08-24 07:23:20 [INFO] main.go func1:186 scanning with wlan0
2021-08-24 07:23:20 [WARN] main.go func1:200 unable to analyze: problem validating data: sensor data cannot be empty
2021-08-24 07:23:20 [INFO] main.go func1:186 scanning with wlan0

Bluetooth detects MAC addresses only

Expected Behavior

Bluetooth LE devices (iBeacon) should have full data packets captured.

Actual Behavior

Detects MAC addresses only.

Steps to Reproduce the Problem

See command line below and debugging output.

root@raspberrypi:~# find3-cli-scanner -i wlan1 -device rbp0 -family XXXX -bluetooth -passive -no-modify -server https://cloud.internalpositioning.com -forever -debug
2018-04-02 04:26:56 [INFO] main.go main:79 reverse scanning with wlan1
2018-04-02 04:26:56 [DEBUG] reverse.go ReverseScan:21 saving tshark data to /tmp/tshark-yHOEFhQKTj
2018-04-02 04:26:56 [DEBUG] reverse.go ReverseScan:21 tshark -I -i wlan1 -a duration:10 -w /tmp/tshark-yHOEFhQKTj
2018-04-02 04:26:56 [DEBUG] utils.go RunCommand:14 tshark -I -i wlan1 -a duration:10 -w /tmp/tshark-yHOEFhQKTj
2018-04-02 04:26:56 [INFO] bluetooth.go scanBluetooth:19 scanning bluetooth
2018-04-02 04:26:56 [DEBUG] utils.go RunCommand:14 btmgmt find
2018-04-02 04:26:59 [ERROR] utils.go RunCommand:40 exit status 1: tshark -I -i wlan1 -a duration:10 -w /tmp/tshark-yHOEFhQKTj
2018-04-02 04:26:59 [DEBUG] utils.go RunCommand:14 /usr/bin/tshark -r /tmp/tshark-yHOEFhQKTj -T fields -e frame.time_epoch -e wlan.sa -e wlan.bssid -e radiotap.dbm_antsignal
2018-04-02 04:27:03 [ERROR] utils.go RunCommand:40 exit status 2: /usr/bin/tshark -r /tmp/tshark-yHOEFhQKTj -T fields -e frame.time_epoch -e wlan.sa -e wlan.bssid -e radiotap.dbm_antsignal
2018-04-02 04:27:03 [INFO] reverse.go ReverseScan:21 collected 0 packets
2018-04-02 04:27:06 [DEBUG] utils.go RunCommand:42 btmgmt find done gracefully without error
2018-04-02 04:27:06 [DEBUG] bluetooth.go btmgmtFind:48 finished btmgmt find
2018-04-02 04:27:06 [DEBUG] main.go reverseCapture:106 bluetooth data:map[bluetooth:map[41:8c:ea:8a:9c:eb:-52 51:a3:b9:d9:52:65:-51 4e:ee:9e:70:37:9d:-71 43:69:1c:bd:ec:b6:-50 3c:2b:ef:ea:2e:38:-90 65:3e:b3:ef:a0:89:-79 c4:d9:87:54:b1:c1:-93]]
2018-04-02 04:27:06 [DEBUG] main.go reverseCapture:87 {
"t": 1522643216052,
"f": "XXXX",
"d": "rbp0",
"l": "",
"s": {
"bluetooth": {
"3c:2b:ef:ea:2e:38": -90,
"41:8c:ea:8a:9c:eb": -52,
"43:69:1c:bd:ec:b6": -50,
"4e:ee:9e:70:37:9d": -71,
"51:a3:b9:d9:52:65": -51,
"65:3e:b3:ef:a0:89": -79,
"c4:d9:87:54:b1:c1": -93
}
}
}
2018-04-02 04:27:06 [ERROR] main.go reverseCapture:118 no packets found
2018-04-02 04:27:06 [INFO] main.go main:79 reverse scanning with wlan1
2018-04-02 04:27:06 [DEBUG] reverse.go ReverseScan:21 saving tshark data to /tmp/tshark-iuvgQQPyNv
2018-04-02 04:27:06 [DEBUG] reverse.go ReverseScan:21 tshark -I -i wlan1 -a duration:10 -w /tmp/tshark-iuvgQQPyNv
2018-04-02 04:27:06 [DEBUG] utils.go RunCommand:14 tshark -I -i wlan1 -a duration:10 -w /tmp/tshark-iuvgQQPyNv
2018-04-02 04:27:06 [INFO] bluetooth.go scanBluetooth:19 scanning bluetooth
2018-04-02 04:27:06 [DEBUG] utils.go RunCommand:14 btmgmt find

Some notes

This is a very cool project and hopefully it is still being developed! I would like to add some notes (summarized here) since I have been struggling with the setup quite a bunch and perhaps it will provide a milestone for others struggling.

  • Compiling or running find3-client-scanner fails with the provided instructions spectacularly.

If you are using a Raspberry Pi (armf arch), you need to build the image yourself, although I suggest Raspberry Pi’s just built natively above.

First, building the image via Docker fails with a non-zero code and sadly Docker spews the entire shell command out such that it is difficult to track where the problem may be in the whole command chain.

Compiling natively fails on all Go versions I have tried (about 4 versions; patience is my new redeeming virtue) except 1.13 which succeeds to compile find3-client-scanner on a Raspberry Pi W running Raspbian Jessie. The command used to successfully compile was:

GO111MODULE=on go get -v github.com/schollz/find3-cli-scanner

Note that this command seems to change a lot throughout the documentation, sometimes it is: go get -v github.com/schollz/find3-cli-scanner, other times it is GO111MODULE=on go get -v github.com/schollz/find3-cli-scanner/v3 (which does not exist?) and the above command is what did it but only with golang version 1.13 and on Raspbian jessie.

  • Compiling the Find3 server on the most recent stable Debian distribution (at the time of writing, Buster) fails with errors during compilation.

Running the Docker image seems to be the way to go and tends to work properly out of the box.

And some remarks:

  • On the cli scanner page, under Usage -> Active scanning, the example does not supply the -wifi parameter but just -bluetooth. It is not that much of an issue because re-reading the documentation multiple times does hint that -wifi should be there too for wifi scanning.

  • The Raspberry Pi W does support monitor mode via Nexmon. Perhaps that can be added to the documentation on the cli scanner page under Usage -> Passive scanning? It is very tough to get Nexmon to compile and patch the kernel properly but it works a treat once it succeeds. There is a Raspbian Jessie pre-made image available that contains both Nexmon patches as well as a compiled find3 client made to just start passive scanning and transmitting on startup - perhaps it helps someone build a better provisioning image.

  • There seems to be a minor issue where a device is added by MAC (and without the wifi- prefix) to the dashboard "Toggle learning" form that makes the table bug out and display empty / broken entries.

dashboard_toggle_learning

Clicking "Stop" does not remove the entries and I have tried to dig into the sqlite3 database and locate these entries manually to delete them to no avail. Perhaps the form is not performing sufficient sanity checks on what can be entered on the "Toggle learning" form?

  • One parameter that I would add to the Docker command when running the Find3 server would be --restart always to ensure that the container restarts properly after a reboot.

  • find3-cli-scanner contains an elusive -gps parameter about which I have found very little information. I assume that the -gps is meant for Android devices. If so, ESP and Raspberry Pi devices are easily equipped with GPS addons and wouldn't it be better to allow some access to a GPS device (let's say, via serial / NMEA)? Otherwise, I am not really sure how the -gps parameter and GPS functionality works.

  • Regrettably the openHAB instructions seem outdated and the new MQTT module has a very different syntax. I have long since moved away from openHAB exactly for the same reason since the MQTT update made me have to rewrite everything again.

Overall, the project is great and I am having a lot of fun with it. It is very useful and seems like the best option for my usage case out there. The only major major issue is just getting the tools to compile properly. Otherwise, once compiled, everything works a treat. Thanks!

Training with bluetooth beacons

Has anyone done training with bluetooth beacons? I purchased a small BLE beacon to try and increase accuracy. While my Pi 3 can see the device, the MAC address is not appearing in the location analysis. I put the Pi 3 only 2-3 inches away for the test. I also made sure to run the ./find3 command with the "-bluetooth" flag. Some bluetooth devices do appear, but not the beacon.

Bug:

$ docker exec scanner sh -c "find3-cli-scanner -device DEVICE -family FAMILY -wifi -bluetooth -forever"
I can't run this command, what should I do?

Remove requirement of running scanner with sudo (somehow)

Expected Behavior

passive command should work without sudo:

nohup find3-cli-scanner -i wlan1 -device xxxxxxx -family yyyyyy-server http://192.168.1.111:8005 -scantime 10 -bluetooth -forever -passive -no-modify

however returns errors:

2018-07-16 18:25:56 [ERROR] utils.go RunCommand:40 exit status 1: btmgmt find
2018-07-16 18:25:56 [ERROR] utils.go RunCommand:40 exit status 1: service bluetooth restart

if I run the command with sudo, with latest tshark version I'd need to remove hardcoded root protection (recompile?)

Specifications

  • Version: 3.2
  • Platform: Linux raspberrypi 4.14.54+ #1126 Wed Jul 11 19:56:40 BST 2018 armv6l GNU/Linux
  • Subsystem:

Bluetooth scanner does not work on Fedora because of the missing btmgmt dependency

Since btmgmt is declared as noinst[1] upstream it is not part of the bluez package in Fedora.

2018-04-05 20:51:17 [INFO] main.go main:76 scanning with wlan0
2018-04-05 20:51:17 [INFO] bluetooth.go scanBluetooth:19 scanning bluetooth
2018-04-05 20:51:17 [DEBUG] utils.go RunCommand:15 btmgmt find
2018-04-05 20:51:17 [DEBUG] utils.go RunCommand:15 /sbin/iw dev wlan0 scan -u
2018-04-05 20:51:17 [ERROR] utils.go RunCommand:25 exec: "btmgmt": executable file not found in $PATH
2018-04-05 20:51:17 [ERROR] utils.go RunCommand:39 exec: not started: btmgmt find
2018-04-05 20:51:17 [DEBUG] utils.go RunCommand:15 service bluetooth restart
...

Bug: Windows can not find the bluetooth device

Expected Behavior

main.go basicCapture should have bluetooth scanned result

Actual Behavior

bluetooth_windows.go scanBluetooth:7 Windows has no bluetooth interface
The basic Capture scanned no bluetooth mac:rssi data pair.

Steps to Reproduce the Problem

  1. add -bluetooth at command line and exexution

Specifications

  • Version: find3_client_scanner_3.3.2
  • Platform: Windws 10 HP ProBook
  • Subsystem:

Building Dockerimage on rpi-aarch64 fails


package github.com/cpuguy83/go-md2man/v2/md2man: cannot find package "github.com/cpuguy83/go-md2man/v2/md2man" in any of:
        /usr/local/go/src/github.com/cpuguy83/go-md2man/v2/md2man (from $GOROOT)
        /root/go/src/github.com/cpuguy83/go-md2man/v2/md2man (from $GOPATH)

Cannot launch find3-cli-scanner from Mac OSX

I followed all the steps from https://www.internalpositioning.com/doc/tracking_your_computer.md and I am trying to launch find3-cli-scanner from docker instance, but it gives following exception:

2018-03-27 02:00:14 [INFO] main.go main:76 scanning with en0
2018-03-27 02:00:14 [ERROR] utils.go RunCommand:40 exit status 1: /sbin/iw dev en0 scan -u
2018-03-27 02:00:15 [ERROR] main.go basicCapture:164 json: cannot unmarshal number into Go value of type main.Response

Looks like docker image is not able to access wifi. Inside docker image:

root@linuxkit-025000000001:/# iwconfig
tunl0     no wireless extensions.
lo        no wireless extensions.
ip6tnl0   no wireless extensions.
docker0   no wireless extensions.
eth0      no wireless extensions.

Is there any workaround to run the scanner from Mac OSX?

Limit the radius of the scan

Limiting the radius of the scan, by setting a min RSSID strengh could help make the scanner a lot more precise in regards to which audience it targets.

How could I use the cli-scanner on Docker for Windows?

I started the container with the command:
docker run --net="host" --privileged --name scanner -d -i -t schollz/find3-cli-scanner

The interfaces of the container:

docker exec scanner sh -c "ifconfig"
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:46ff:fe66:5537  prefixlen 64  scopeid 0x20<link>
        ether 02:42:46:66:55:37  txqueuelen 0  (Ethernet)
        RX packets 93  bytes 165994 (165.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 126  bytes 15926 (15.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.65.3  netmask 255.255.255.0  broadcast 192.168.65.255
        ether 02:50:00:00:00:01  txqueuelen 1000  (Ethernet)
        RX packets 153161  bytes 213995777 (213.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 58267  bytes 3198194 (3.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

hvint0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.75.2  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::215:5dff:fe95:103  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:95:01:03  txqueuelen 1000  (Ethernet)
        RX packets 1036  bytes 214405 (214.4 KB)
        RX errors 0  dropped 7  overruns 0  frame 0
        TX packets 620  bytes 267703 (267.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 162  bytes 14948 (14.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 162  bytes 14948 (14.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth8eaa615: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::2097:cdff:fee5:31b0  prefixlen 64  scopeid 0x20<link>
        ether 22:97:cd:e5:31:b0  txqueuelen 0  (Ethernet)
        RX packets 63  bytes 7328 (7.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 85  bytes 9818 (9.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

They don't look like WiFi adapters to me...
But I tried to use all of them like this:

docker exec scanner sh -c "find3-cli-scanner -i docker0 -device laptop -family mytest -server  http://localhost:11883 -scantime 1 -debug"
2018-04-02 10:49:45 [INFO] main.go main:76 scanning with docker0
2018-04-02 10:49:45 [DEBUG] utils.go RunCommand:14 /sbin/iw dev docker0 scan -u
2018-04-02 10:49:45 [ERROR] utils.go RunCommand:40 exit status 1: /sbin/iw dev docker0 scan -u
2018-04-02 10:49:45 [DEBUG] main.go basicCapture:162 {
 "t": 1522666185525,
 "f": "mytest",
 "d": "laptop",
 "s": {
  "wifi": {}
 },
 "gps": {}
}
2018-04-02 10:49:45 [DEBUG] server-main.go postData:47 posting data
2018-04-02 10:49:45 [ERROR] main.go basicCapture:164 Post http://localhost:11883/data: EOF

How could I use the scanner with Docker for Windows?

Use golang bluetooth library

package main

import (
	"context"
	"fmt"
	"log"
	"strings"
	"time"

	"github.com/currantlabs/ble"
	"github.com/currantlabs/ble/examples/lib/dev"
)

func main() {
	fmt.Println(scan())
	fmt.Println("done")
}

func scan() (devices map[string]interface{}, err error) {
	devices = make(map[string]interface{})
	d, err := dev.NewDevice("default")
	if err != nil {
		log.Println("can't new device : %s", err)
		return
	}
	defer d.Stop()

	ble.SetDefaultDevice(d)
	// Default to search device with name of Gopher (or specified by user).
	filter := func(a ble.Advertisement) bool {
		log.Println(a.Address(), a.RSSI())
		devices[a.Address().String()] = a.RSSI()
		return false
	}

	sd := 5 * time.Second
	// Scan for specified durantion, or until interrupted by user.
	log.Println("Scanning for %s...", sd.String())
	ctx := ble.WithSigHandler(context.WithTimeout(context.Background(), sd))
	_, errFinish := ble.Connect(ctx, filter)
	if errFinish != nil {
		if !strings.Contains(errFinish.Error(), "context deadline") {
			err = errFinish
		}
	}
	return
}

Installation failed "main.go:98:15: too many errors"

go get -u -v github.com/schollz/find3-cli-scanner

github.com/schollz/find3-cli-scanner (download)
github.com/cihub/seelog (download)
github.com/google/gopacket (download)
github.com/montanaflynn/stats (download)
github.com/schollz/find3 (download)
github.com/schollz/gatt (download)
github.com/schollz/wifiscan (download)
github.com/schollz/logger (download)
github.com/urfave/cli (download)
github.com/cpuguy83/go-md2man (download)
github.com/schollz/find3-cli-scanner
# github.com/schollz/find3-cli-scanner
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:54:14: cannot use []cli.Author literal (type []cli.Author) as type []*cli.Author in assignment
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:61:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:65:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:69:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:74:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:79:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:84:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:89:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:94:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:98:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
/usr/local/gopath/src/github.com/schollz/find3-cli-scanner/main.go:98:15: too many errors

I am using go version go1.11.13 linux/arm

Errors installing on Raspbian Lite Pi 3b+

Installed go via apt-get
Rebooted
Tried to install cli scanner and get the below error.
Cant progress beyond this. Any advice?
Had this working previously, but have started with fresh installs after recieving two usb wifi adapters capable of monitor mode.

pi@raspberrypi:~ $ go get -u -v github.com/schollz/find3-cli-scanner
github.com/schollz/find3-cli-scanner (download)
github.com/cihub/seelog (download)
github.com/google/gopacket (download)
github.com/montanaflynn/stats (download)
github.com/schollz/find3 (download)
github.com/schollz/gatt (download)
github.com/schollz/wifiscan (download)
github.com/schollz/logger (download)
github.com/urfave/cli (download)
github.com/cpuguy83/go-md2man (download)
github.com/schollz/find3-cli-scanner

github.com/schollz/find3-cli-scanner

go/src/github.com/schollz/find3-cli-scanner/main.go:54:14: cannot use []cli.Author literal (type []cli.Author) as type []*cli.Author in assignment
go/src/github.com/schollz/find3-cli-scanner/main.go:61:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:65:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:69:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:74:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:79:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:84:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:89:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:94:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:98:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/schollz/find3-cli-scanner/main.go:98:15: too many errors

remove tshark requirement

package main

import (
	"fmt"
	"log"
	"strings"
	"time"

	"github.com/google/gopacket"
	"github.com/google/gopacket/layers"
	"github.com/google/gopacket/pcap"
)

var (
	device       string = "wlx98ded014a3a9"
	snapshot_len int32  = 1024
	promiscuous  bool   = false
	err          error
	timeout      time.Duration = 3 * time.Second
	handle       *pcap.Handle
)

func main() {
	// Open device
	handle, err = pcap.OpenLive(device, snapshot_len, promiscuous, timeout)
	if err != nil {
		log.Fatal(err)
	}
	defer handle.Close()

	// Use the handle as a packet source to process all packets
	packetSource := gopacket.NewPacketSource(handle, handle.LinkType())
	for packet := range packetSource.Packets() {
		// Process packet here
		// fmt.Println(packet.String())
		address := ""
		rssi := 0
		for _, layer := range packet.Layers() {
			if layer.LayerType() == layers.LayerTypeRadioTap {
				rt := layer.(*layers.RadioTap)
				rssi = int(rt.DBMAntennaSignal)
			} else if layer.LayerType() == layers.LayerTypeDot11 {
				dot11 := layer.(*layers.Dot11)
				addresses := []string{dot11.Address1.String(), dot11.Address2.String(), dot11.Address3.String(), dot11.Address4.String()}
				isOk := false
				tempAddress := ""
				for _, ad := range addresses {
					if strings.Contains(ad, "ff:ff") {
						isOk = true
					} else if len(ad) > 0 {
						tempAddress = ad
					}
				}
				if isOk {
					address = tempAddress
				}
			}
		}
		if address != "" && rssi != 0 {
			fmt.Println(time.Now(), address, rssi)
		}
		// break
	}
}

Bug: Program Crash

Expected Behavior

I want the script to run forever but it crashes with the following error

Actual Behavior

panic: runtime error: slice bounds out of range

goroutine 2561 [running]:
panic(0x4b35a0, 0x10f22030)
/usr/local/go/src/runtime/panic.go:500 +0x33c
github.com/schollz/gatt.(*Advertisement).unmarshall(0x111e8820, 0x111e4eea, 0xb, 0x16, 0x0, 0x0)
/home/pi/mygo/src/github.com/schollz/gatt/adv.go:98 +0xbc0
github.com/schollz/gatt.(*device).Init.func3(0x111ea750)
/home/pi/mygo/src/github.com/schollz/gatt/device_linux.go:97 +0x74
github.com/schollz/gatt/linux.(*HCI).handleAdvertisement(0x11062280, 0x111b3bf3, 0x23, 0x23)
/home/pi/mygo/src/github.com/schollz/gatt/linux/hci.go:262 +0x370
created by github.com/schollz/gatt/linux.(*HCI).handleLEMeta
/home/pi/mygo/src/github.com/schollz/gatt/linux/hci.go:359 +0xc8

Steps to Reproduce the Problem

  1. sudo ./find3-cli-scanner -i wlan1 -device MYDEV-family FAMILY -server http://localhost:8080 -scantime 2 -bluetooth -forever -passive -no-modify
  2. after some scans it crashes

Specifications

  • Version: latest of July 2019
  • Platform: Raspberry 3+
  • Subsystem:

find3 scanner fills up entire disk with tshark tmp files =(

I have the find3-cli-scanner running on a Raspberry Pi with a 16GB MicroSD card.

However, after a few days, find3 appears to have filled up the entire disk. It all appears to be temporary tshark files.

Around 63,000 files of 200-300 KB - equates to around 12 GB.

root@rp3-cafetv:/# du -chs *
4.2M    bin
4.0K    boot
0       dev
2.4M    etc
4.0K    home
25M     lib
4.0K    media
4.0K    mnt
4.0K    opt
du: cannot access 'proc/36/task/36/fd/3': No such file or directory
du: cannot access 'proc/36/task/36/fdinfo/3': No such file or directory
du: cannot access 'proc/36/fd/3': No such file or directory
du: cannot access 'proc/36/fdinfo/3': No such file or directory
0       proc
27M     root
20K     run
2.9M    sbin
4.0K    srv
0       sys
11G     tmp
572M    usr
49M     var
12G     total
root@rp3-cafetv:/tmp# ls -l | wc -l
63349
root@rp3-cafetv:/tmp# ls -lah | head
total 11G
drwxrwxrwt 1 root root  1.8M Mar  9 03:00 .
drwxr-xr-x 1 root root  4.0K Mar  3 20:20 ..
-rw------- 1 root root  263K Mar  5 11:38 tshark-AAEvivubfU
-rw------- 1 root root   34K Mar  4 18:38 tshark-AAFJcHvFEv
-rw------- 1 root root     0 Mar  8 00:47 tshark-AAGOYgiwvQ
-rw------- 1 root root  272K Mar  5 13:20 tshark-AAKSpCNWno
-rw------- 1 root root   35K Mar  4 20:02 tshark-AAKnUEMjuI
-rw------- 1 root root   20K Mar  4 19:10 tshark-AALOwPuXoS
-rw------- 1 root root  283K Mar  6 12:13 tshark-AAMFZBDzPK

find3-cli-scanner is not working.

Hello,
Here is my little problem,after building the image, I use Rpi to serve as a client for Find3, as soon as I run the command:
$ docker run --net="host" --privileged --name 'MyName' -d -i -t schollz/find3-cli-scanner
The image does not mount, because when I type the second command:
$ docker exec 'MyName' sh -c "find3-cli-scanner -device DEVICE -family FAMILY -wifi -bluetooth -forever"
there is an error that is created:
Error response from deamon: Container '.............' is not running
And if I put the command:
docker start 'MyName'
It looks like it works, but with:
docker stats
it is not displayed.
t's been a few days or I'm struggling, if you have a solution I am interested.
Thank you in advance.
Nicolas.

install nativelly errors

I keep getting
go: cannot find main module; see 'go help modules'

whenever trying to install the cli on raspberry Pi
GO111MODULE=on go get -v github.com/schollz/find3-cli-scanner/v3
and whenever i open the github account it is not there

Running the docker CLI with costume host gave errors

Hey ,

So I had a problem with running the cli nativaly so i switched to the docker method however whenever I want to insert a costume host into the run command 👍
sudo docker run --net="xyz.westeurope.cloudapp.azure.com" --privileged --name scannerr -d -i -t schollz/find3-cli-scanner

it would give me 👍
d5ff234311386abec67f71e6beaa5c0fb91583c0514e7fb2b3c02835c7cf7286
docker: Error response from daemon: network xyz.westeurope.cloudapp.azure.com not found.

even when adding https:// still it gives me the same error . kindly note that my find program is up and running with full functionality on that link . so I dont know what is the proper formatting of the command

Scanner throws error

I am running the scanner on my wifi network and I get this error:

2018-03-31 05:22:18 [ERROR] main.go basicCapture:166 unable to analyze: problem validating data: sensor data cannot be empty 
2018-03-31 05:22:18 [INFO] main.go main:76 scanning with wlp2s0 
2018-03-31 05:22:18 [ERROR] utils.go RunCommand:39 exit status 255: /sbin/iw dev wlp2s0 scan -u

I don't quite understand what the issue is. Any help would be appreciated.

UID/EID tracking

I recently purchased Bluetooth beacons for passive tracking, not realizing that their MAC addresses are continuously randomized. I am able to set their UID/EID and make them Eddystone beacons. Is there a way to track this with passive tracking?

Raspberry Pi Zero W - cannot build project from binary

Getting this output from terminal when running "sudo make" inside of directory. Made sure mage is installed and functional. Also installed preliminary dependency installs (including package referenced at the end of the output). Is this project supported on this device?

go get github.com/magefile/mage
mage
fatal: not a git repository (or any of the parent directories): .git
go build -ldflags '-s -w -X main.version=dev'# _/home/pi/Projects/find3-cli-scanner-3.3.2
./main.go:54:14: cannot use []cli.Author literal (type []cli.Author) as type []*cli.Author in assignment
./main.go:61:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:65:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:69:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:74:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:79:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:84:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:89:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:94:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:98:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
./main.go:98:15: too many errors
You may need to install libpcap.

OS X: brew install libpcap

Linux: apt-get install libpcap-dev

Error: running "go build -ldflags -s -w -X main.version=dev" failed with exit code 2
make: *** [Makefile:8: basicbuild] Error 2

Cannot scan wifi and bluetooth at the same time

Device: Raspberry pi 4B with USB bluetooth adapter
When enable scan bluetooth with "-bluetooth" the debug info only show bluetooth info.

2021-11-02 10:53:42 [INFO] main.go func1:214 scanning bluetooth
2021-11-02 10:53:42 [INFO] main.go func1:218 scanning for 5 seconds
2021-11-02 10:53:42 [DEBUG] bluetooth.go scanBluetooth:38 scanning bluetooth
2021-11-02 10:53:47 [DEBUG] bluetooth.go scanBluetooth:61 bluetooth scan finished
2021-11-02 10:53:47 [DEBUG] main.go basicCapture:369 {
"t": 1635821622435,
"f": "walker",
"d": "rpi",
"l": "livingroom",
"s": {
"bluetooth": {
"0f:92:46:83:c6:5d": -67,
"7b:a8:06:a5:63:06": -87,
"fa:7a:a7:ea:31:05": -82
}
},
"gps": {}
}

If without "-bluetooth" I get:

2021-11-02 10:37:59 [INFO] main.go func1:211 scanning with wlan0
2021-11-02 10:38:00 [DEBUG] main.go basicCapture:369 {
"t": 1635820679441,
"f": "walker",
"d": "rpi",
"l": "livingroom",
"s": {
"wifi": {
"04:d9:f5:53:0f:c8": -32,
"04:d9:f5:53:0f:cc": -35,
"30:fc:68:bd:b5:55": -74,
"60:aa:ef:c0:e0:ec": -75,
"60:aa:ef:c0:e0:f1": -76,
"70:3a:73:06:0a:80": -66
}
},
"gps": {}
}
How can I scan both wifi and bluetooth?

Bluetooth scanning panic on macOS

Same behavior is found on golang 1.9, 1.10 and 1.11 on macOS Mojave v10.14.6. It may be related to paypal/gatt#64.

$ go/bin/find3-cli-scanner --bluetooth -d DEVICE -f FAMILY
panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 22 [running]:
github.com/schollz/gatt/xpc.XpcConnect.func2(0x5305630, 0xc4200af6b0, 0x5305630)
	~/go/src/github.com/schollz/gatt/xpc/xpc_darwin.go:169 +0x94
github.com/schollz/gatt/xpc.XpcConnect(0x45093b2, 0xf, 0x4563a60, 0xc42010e400, 0x0)
	~/go/src/github.com/schollz/gatt/xpc/xpc_darwin.go:169 +0xbd
github.com/schollz/gatt.NewDevice(0x0, 0x0, 0x0, 0x9, 0xc4200bbc28, 0x0, 0x0)
	~/go/src/github.com/schollz/gatt/device_darwin.go:66 +0x19f
main.scanBluetooth(0xc4200a4360, 0x0, 0x90)
	~/go/src/github.com/schollz/find3-cli-scanner/bluetooth.go:45 +0x2d2
created by main.basicCapture
	~/go/src/github.com/schollz/find3-cli-scanner/main.go:302 +0x99a

Native installation fails on Pi 3 B

On installing this from the manual using go get -u -v github.com/schollz/find3-cli-scanner, I get the following error.

$ go get -u -v github.com/schollz/find3-cli-scanner
.
.
github.com/google/gopacket/pcap # github.com/google/gopacket/pcap
../github.com/google/gopacket/pcap/pcap_unix.go:373:16: type [1073741824]_Ctype_int larger than address space 
../github.com/google/gopacket/pcap/pcap_unix.go:373:16: type [1073741824]_Ctype_int too large ../github.com/google/gopacket/pcap/pcap_unix.go:619:18: type [1073741824]_Ctype_int larger than address space 
../github.com/google/gopacket/pcap/pcap_unix.go:619:18: type [1073741824]_Ctype_int too large

I initially thought this was an error from the gopacket library, so I installed it separately using
go get github.com/google/gopacket, and that worked without any error. So I have to believe this happens only when using gopacket with this cli-scanner.

I installed go by downloading tar for ARMv6l and extracting it to /usr/local as given here: https://golang.org/doc/install

Bluetooth: failed to open device

After installing the new Version of find3-cli-scanner on Raspbian I get the following error...

pi@raspberrypi:~ $ find3-cli-scanner -i mon0 -device scanner-pi3 -family test -server https://xxx.xxx.de -scantime 10 -bluetooth -passive -forever -no -modify
2018-07-24 10:58:22 [INFO] main.go func1:179 scanning bluetooth
2018-07-24 10:58:22 [INFO] main.go func1:185 working in passive mode
2018-07-24 10:58:22 [ERROR] bluetooth.go scanBluetooth:37 Failed to open device, err: %sno supported devices available

tcpdump scanner for find3-server

Hi there,

Still a work in progress but I thought id mention that I wrote a scanner for OpenWrt to use with find3-server. Check my repo for a step-by-step tutorial.

Initially I tried to cross compile the find3-cli-scanner as a statically linked binary but this yield a huge binary that does not fit on most router devices. Also I faced quite some issues as OpenWrt uses musl as a standard c library instead of glibc. This is not well supported by xgo at the moment.

This solution is a little more lightweight and universal. It uses tcpdump and a python script to submit the fingerprints. I might want to add a simple ash script in the end to save some more space (as python won't fit on devices with smaller flash)

Feature Request: Add support for GPIO signals

My Raspberry Pi Zero Ws around the house have motion sensors attached to their GPIO pins. It would be great to be able to incorporate the status of the appropriate pins into the presence fingerprint.

panic: runtime error: index out of range

Hi. I'm experiencing frequent panics in ReverseScan function

$ t ~ sudo find3-cli-scanner -i wlp2s0mon -device scanner -family foobar -server http://xxx.xxx.x.xxx:8005 -scantime 40 -forever -passive -no-modify -debug
2018-04-05 16:00:16 [INFO] main.go main:79 reverse scanning with wlp2s0mon
2018-04-05 16:00:16 [DEBUG] reverse.go ReverseScan:35 saving tshark data to /tmp/tshark-EEwElGdpxR
2018-04-05 16:00:16 [DEBUG] reverse.go ReverseScan:36 tshark -I -i wlp2s0mon -a duration:40 -w /tmp/tshark-EEwElGdpxR
2018-04-05 16:00:16 [DEBUG] utils.go RunCommand:15 tshark -I -i wlp2s0mon -a duration:40 -w /tmp/tshark-EEwElGdpxR
2018-04-05 16:00:57 [DEBUG] utils.go RunCommand:39 tshark -I -i wlp2s0mon -a duration:40 -w /tmp/tshark-EEwElGdpxR done gracefully without error
2018-04-05 16:00:57 [DEBUG] utils.go RunCommand:15 /usr/bin/tshark -r /tmp/tshark-EEwElGdpxR -T fields -e frame.time_epoch -e wlan.ta -e wlan.ra -e radiotap.dbm_antsignal
2018-04-05 16:00:57 [DEBUG] utils.go RunCommand:39 /usr/bin/tshark -r /tmp/tshark-EEwElGdpxR -T fields -e frame.time_epoch -e wlan.ta -e wlan.ra -e radiotap.dbm_antsignal done gracefully without error
panic: runtime error: index out of range

goroutine 1 [running]:
main.ReverseScan(0x9502f9000, 0x16295e4b376, 0x7ffc8f94b3a5, 0x6, 0x7ffc8f94b395, 0x7, 0x0, 0x0, 0xc42007b9b0, 0x0, ...)
        /home/hitori/go/src/github.com/schollz/find3-cli-scanner/reverse.go:75 +0x18b0
main.reverseCapture()
        /home/hitori/go/src/github.com/schollz/find3-cli-scanner/main.go:98 +0xbb
main.main()
        /home/hitori/go/src/github.com/schollz/find3-cli-scanner/main.go:79 +0x4bd

Here's the example output of tshark that is causing a crash:

1522933949.290066078	00:00:00:00:52:78	ff:ff:ff:ff:ff:ff	-49,-49,-49
1522933949.439473026	00:00:00:00:52:78	ff:ff:ff:ff:ff:ff	-50,-50,-50
1522933949.452939537	00:00:00:00:52:78	ff:ff:ff:ff:ff:ff	-49,-49,-49
1522933949.459568631		00:00:00:00:0d:70	-50,-50,-50
1522933949.787056388	00:00:00:00:b0:64	ff:ff:ff:ff:ff:ff	-62,-62,-64
1522933949.953996842	00:00:00:00:57:f5	ff:ff:ff:ff:ff:ff	-52,-54,-52
1522933949.959195300	00:00:00:00:57:f5	ff:ff:ff:ff:ff:ff	-51,-53,-51
1522933949.974215793	00:00:00:00:57:f5	ff:ff:ff:ff:ff:ff	-48,-52,-48
1522933949.976558659	00:00:00:00:57:f5	ff:ff:ff:ff:ff:ff	-47,-50,-47
1522933949.996458237	00:00:00:00:57:f5	ff:ff:ff:ff:ff:ff	-50,-54,-50
1522933950.669809125	00:00:00:00:1e:d2	ff:ff:ff:ff:ff:ff	-64,-64,-65
1522933950.694347246	00:00:00:00:1e:d2	ff:ff:ff:ff:ff:ff	-59,-59,-62
1522933950.747135532	00:00:00:00:4b:ff	ff:ff:ff:ff:ff:ff	-66,-67,-66
1522933961.174288320	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-54,-54,-59
1522933961.185383139		00:00:00:00:ee:d6	-52,-52,-58
1522933961.192651386	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-52,-52,-58
1522933961.196418575		00:00:00:00:ee:d6	-54,-54,-59
1522933961.199881394	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-53,-53,-58
1522933961.203358944	00:00:00:00:ee:d6	00:00:00:00:d8:77	-73,-73,-84
1522933961.203653771		00:00:00:00:ee:d6	-54,-54,-59
1522933961.229108531	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-51,-51,-58
1522933961.237570373	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-49,-49,-56
1522933961.247386576	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-49,-49,-56
1522933961.257661756	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-53,-53,-63
1522933961.266957244	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-51,-51,-61
1522933961.277250665	00:00:00:00:d8:77	ff:ff:ff:ff:ff:ff	-52,-52,-61
1522933965.589258081	00:00:00:00:ee:d6	ff:ff:ff:ff:ff:ff	-73,-73,-80
1522933965.693361514	00:00:00:00:2e:38	ff:ff:ff:ff:ff:ff	-57,-57,-65
1522933965.696845552	00:00:00:00:ee:d6	00:00:00:00:2e:38	-72,-72,-78
1522933965.725199920	00:00:00:00:2e:38	ff:ff:ff:ff:ff:ff	-55,-55,-65
1522933967.181482941	00:00:00:00:1a:08	ff:ff:ff:ff:ff:ff	-65,-65,-68
1522933967.190208835	00:00:00:00:a0:f5	00:00:00:00:1a:08	-64,-65,-64
1522933967.351161755	00:00:00:00:1a:08	ff:ff:ff:ff:ff:ff	-66,-66,-69
1522933967.354155548		00:00:00:00:22:6f	-65,-65,-68
1522933967.368812628		00:00:00:00:0d:70	-65,-65,-71
1522933969.574723359		00:00:00:00:22:6f	-62,-62,-82
1522933969.635361181		00:00:00:00:61:49	-59,-59,-70
1522933969.639868085	00:00:00:00:61:49	ff:ff:ff:ff:ff:ff	-59,-59,-74
1522933969.642818065		00:00:00:00:a0:f5	-60,-60,-73
1522933969.645128578		00:00:00:00:a0:f5	-63,-63,-75
1522933969.660195755	00:00:00:00:61:49	ff:ff:ff:ff:ff:ff	-61,-61,-76
1522933969.684261668	00:00:00:00:61:49	ff:ff:ff:ff:ff:ff	-62,-62,-77
1522933970.194807561	00:00:00:00:e5:d0	ff:ff:ff:ff:ff:ff	-66,-66,-67
1522933970.201373817		00:00:00:00:ee:d6	-65,-65,-66
1522933970.223421346	00:00:00:00:e5:d0	ff:ff:ff:ff:ff:ff	-63,-64,-63
1522933970.251950891	00:00:00:00:e5:d0	ff:ff:ff:ff:ff:ff	-68,-70,-68
1522933972.887942551		00:00:00:00:22:6f	-57,-57,-66
1522933972.901310557	00:00:00:00:ce:64	ff:ff:ff:ff:ff:ff	-56,-56,-67
1522933972.920757665		00:00:00:00:ce:64	-58,-58,-66
1522933972.924853703	00:00:00:00:ce:64	ff:ff:ff:ff:ff:ff	-54,-54,-62
1522933972.944867075	00:00:00:00:ce:64	ff:ff:ff:ff:ff:ff	-55,-55,-63
1522933976.853702725	00:00:00:00:ee:d6	ff:ff:ff:ff:ff:ff	-74,-74,-86
1522933981.154875417	00:00:00:00:ee:d6	ff:ff:ff:ff:ff:ff	-75,-75,-77

System info:
go version go1.9.4 linux/amd64
find3-cli-scanner version: cc70e6a
TShark (Wireshark) 2.4.5 (v2.4.5)
Network controller: Intel Corporation Wireless 7260 (rev 73)

Building docker image failed

root@raspberrypi:~/image# docker build -t schollz/find3-cli-scanner .
Sending build context to Docker daemon 5.12kB
Step 1/5 : FROM ubuntu:18.04
---> ec875438e96e
Step 2/5 : ENV GOLANG_VERSION 1.10
---> Using cache
---> d6ce35af5074
Step 3/5 : ENV PATH="/usr/local/go/bin:${PATH}"
---> Using cache
---> e0ff002d27f6
Step 4/5 : ENV GOPATH /root/go
---> Using cache
---> 3a6d0768f556
Step 5/5 : RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get i nstall -y libc6-dev make pkg-config g++ gcc git wget wireless-tools bluetooth iw net-tools tshark && mkdir /root/go && rm -rf /var/lib/apt/lists/* && s et -eux; dpkgArch="$(dpkg --print-architecture)"; case "${ dpkgArch##-}" in amd64) goRelArch='linux-amd64'; goRelSha256='b5a 64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33' ;; a rmhf) goRelArch='linux-armv6l'; goRelSha256='6ff665a9ab61240cf9f11a07e03e6819e45 2a618a32ea05bbb2c80182f838f4f' ;; arm64) goRelArch='linux-arm64'; goRelSha256='efb47e5c0e020b180291379ab625c6ec1c2e9e9b289336bc7169e6aa1da43fd8' ; ; i386) goRelArch='linux-386'; goRelSha256='2d26a9f41fd80eeb445cc4 54c2ba6b3d0db2fc732c53d7d0427a9f605bfc55a1' ;; ppc64el) goRelArch='linu x-ppc64le'; goRelSha256='a1e22e2fbcb3e551e0bf59d0f8aeb4b3f2df86714f09d2acd260c65 97c43beee' ;; s390x) goRelArch='linux-s390x'; goRelSha256='71cde197e50 afe17f097f81153edb450f880267699f22453272d184e0f4681d7' ;; ) goRel Arch='src'; goRelSha256='f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4f a000c7f24'; echo >&2; echo >&2 "warning: current architectur e ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; echo >&2 ;; esac; url="https://golang.org/dl/go${G OLANG_VERSION}.${goRelArch}.tar.gz"; wget -O go.tgz "$url"; echo "${goRelSha 256} go.tgz" | sha256sum -c -; tar -C /usr/local -xzf go.tgz; rm go.tg z; if [ "$goRelArch" = 'src' ]; then echo >&2; e cho >&2 'error: UNIMPLEMENTED'; echo >&2 'TODO install golang-an y from jessie-backports for GOROOT_BOOTSTRAP (and uninstall after build)'; e cho >&2; exit 1; fi; export PATH="/usr/local/ go/bin:$PATH"; go version && go get -v github.com/schollz/find3-cli-scanner & & cd /root/go/src/github.com/schollz/find3-cli-scanner && go build -v && m v find3-cli-scanner /usr/local/bin/ && echo "removing go srces" && rm -rf /usr/ local/work/src && echo "purging packages" && apt-get remove -y --auto-remo ve git libc6-dev pkg-config g++ gcc make && echo "autoclean" && apt-get auto clean && echo "clean" && apt-get clean && echo "autoremove" && apt -get autoremove && echo "rm trash" && rm -rf ~/.local/share/Trash/ && e cho "rm go" && rm -rf /usr/local/go && echo "rm go" && rm -rf /root/go && echo "rm perl" && rm -rf /usr/share/perl* && echo "rm doc" && rm -rf /usr/share/doc*
---> Running in ab9c1dd4fba9
The command '/bin/sh -c apt-get update && DEBIAN_FRONTEND=noninteractive a pt-get install -y libc6-dev make pkg-config g++ gcc git wget wireless-tools blue tooth iw net-tools tshark && mkdir /root/go && rm -rf /var/lib/apt/list s/* && set -eux; dpkgArch="$(dpkg --print-architecture)"; c ase "${dpkgArch##-}" in amd64) goRelArch='linux-amd64'; goRelSha 256='b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33' ;; a rmhf) goRelArch='linux-armv6l'; goRelSha256='6ff665a9ab61240cf9f11a07e03e6819e45 2a618a32ea05bbb2c80182f838f4f' ;; arm64) goRelArch='linux-arm64'; goRelSha256='efb47e5c0e020b180291379ab625c6ec1c2e9e9b289336bc7169e6aa1da43fd8' ; ; i386) goRelArch='linux-386'; goRelSha256='2d26a9f41fd80eeb445cc4 54c2ba6b3d0db2fc732c53d7d0427a9f605bfc55a1' ;; ppc64el) goRelArch='linu x-ppc64le'; goRelSha256='a1e22e2fbcb3e551e0bf59d0f8aeb4b3f2df86714f09d2acd260c65 97c43beee' ;; s390x) goRelArch='linux-s390x'; goRelSha256='71cde197e50 afe17f097f81153edb450f880267699f22453272d184e0f4681d7' ;; ) goRel Arch='src'; goRelSha256='f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4f a000c7f24'; echo >&2; echo >&2 "warning: current architectur e ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; echo >&2 ;; esac; url="https://golang.org/dl/go${G OLANG_VERSION}.${goRelArch}.tar.gz"; wget -O go.tgz "$url"; echo "${goRelSha 256} go.tgz" | sha256sum -c -; tar -C /usr/local -xzf go.tgz; rm go.tg z; if [ "$goRelArch" = 'src' ]; then echo >&2; e cho >&2 'error: UNIMPLEMENTED'; echo >&2 'TODO install golang-an y from jessie-backports for GOROOT_BOOTSTRAP (and uninstall after build)'; e cho >&2; exit 1; fi; export PATH="/usr/local/ go/bin:$PATH"; go version && go get -v github.com/schollz/find3-cli-scanner & & cd /root/go/src/github.com/schollz/find3-cli-scanner && go build -v && m v find3-cli-scanner /usr/local/bin/ && echo "removing go srces" && rm -rf /usr/ local/work/src && echo "purging packages" && apt-get remove -y --auto-remo ve git libc6-dev pkg-config g++ gcc make && echo "autoclean" && apt-get auto clean && echo "clean" && apt-get clean && echo "autoremove" && apt -get autoremove && echo "rm trash" && rm -rf ~/.local/share/Trash/ && e cho "rm go" && rm -rf /usr/local/go && echo "rm go" && rm -rf /root/go && echo "rm perl" && rm -rf /usr/share/perl* && echo "rm doc" && rm -rf /usr/share/doc*' returned a non-zero code: 139

possible wrong option sequence?

In the source file "find3-cli-scanner/reverse.go" in line "36" is the code snippet
"... tshark -I -i %s -a duration:%d -w %s", wifiInterface ..."

According to Wireshark manual [https://www.wireshark.org/docs/man-pages/tshark.html] the "-I" option before the "-i" option affects all interfaces (not only the specified one).

"... If used before the first occurrence of the -i option, it enables the monitor mode for all interfaces. If used after an -i option, it enables the monitor mode for the interface specified by the last -i option occurring before this option. ..."

I'm not sure, if this was the purpose in this specific code location.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.