schollz / find3-cli-scanner

The command-line scanner that supports Bluetooth and WiFi
https://www.internalpositioning.com/doc/tracking_your_computer.md
148 stars 55 forks source link

Native installation fails on Pi 3 B #29

Closed zeroby0 closed 5 years ago

zeroby0 commented 5 years ago

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

jekkos commented 5 years ago

Maybe try to install using xgo.

./xgo -ldflags='-linkmode external -extldflags "-static -s -w"' --deps=http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz --depsargs=--with-pcap=linux --targets=linux/arm-6 github.com/schollz/find3-cli-scanner

jekkos commented 5 years ago

First build xgo wrapper from https://github.com/jekkos/xgo/

zeroby0 commented 5 years ago

Hey @jekkos ! Thanks for commenting :)

It fails, unfortunately. Here's the output.

$ xgo -ldflags='-linkmode external -extldflags "-static -s -w"' --deps=http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz --depsargs=--with-pcap=linux --targets=linux/arm-6 github.com/schollz/find3-cli-scanner

Checking docker installation...
Client:
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:57:21 2018
 OS/Arch:           linux/arm
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:17:57 2018
  OS/Arch:          linux/arm
  Experimental:     false

Checking for required docker image jekkos/xgo-latest... not found!
Pulling jekkos/xgo-latest from docker registry...
Using default tag: latest
latest: Pulling from jekkos/xgo-latest
18d680d61657: Pulling fs layer 
0addb6fece63: Pulling fs layer 
78e58219b215: Pull complete 
eb6959a66df2: Pull complete 
60ad253a943f: Pull complete 
11f386937c9c: Pull complete 
405b2c10ad63: Pull complete 
0e476f5f02b4: Pull complete 
c2f03308f2ca: Pull complete 
8eda80eb8f92: Pull complete 
57aada3a87a6: Pull complete 
1207c2c55730: Pull complete 
464a41bd6bd3: Pull complete 
9654fa2af097: Pull complete 
5e30fe9fae68: Pull complete 
8697237a7b22: Pull complete 
369f4a2a8bf4: Pull complete 
2906473ea2ea: Pull complete 
6e940c200eb6: Pull complete 
3ba639fd35cf: Pull complete 
4ee773a8ce8a: Pull complete 
bdd8d2be8784: Pull complete 
931dbb81f917: Pull complete 
739adbfd7511: Pull complete 
b3887d276dc1: Pull complete 
Digest: sha256:608a769009e1d5f7e3d9de506734895ee6ee5049e83214a6322528e75c98fe6a
Status: Downloaded newer image for jekkos/xgo-latest:latest
Downloading new dependency: http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz...
New dependency cached: /home/pi/.xgo-cache/libpcap-1.8.1.tar.gz.
Cross compiling github.com/schollz/find3-cli-scanner...
standard_init_linux.go:190: exec user process caused "exec format error"
2019/01/08 20:01:36 Failed to cross compile package: exit status 1.

I ran it once again, to check if it needs to pull the first two. Errored again.

$ xgo -ldflags='-linkmode external -extldflags "-static -s -w"' --deps=http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz --depsargs=--with-pcap=linux --targets=linux/arm-6 github.com/schollz/find3-cli-scanner

Checking docker installation...
Client:
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:57:21 2018
 OS/Arch:           linux/arm
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:17:57 2018
  OS/Arch:          linux/arm
  Experimental:     false

Checking for required docker image jekkos/xgo-latest... found.
Dependency already cached: /home/pi/.xgo-cache/libpcap-1.8.1.tar.gz.
Cross compiling github.com/schollz/find3-cli-scanner...
standard_init_linux.go:190: exec user process caused "exec format error"
2019/01/08 20:06:14 Failed to cross compile package: exit status 1.

Thanks

zeroby0 commented 5 years ago

I found this online https://github.com/containers/buildah/issues/475#issuecomment-382069330 . I'll check if it works.

jekkos commented 5 years ago

You could also try xgo from this repo ykyuen/xgo instead

jekkos commented 5 years ago

Or use my python script together with tcpdump to do the scanning.. (see other issue here in the repo)

jekkos commented 5 years ago

My repo also has a script to run it with airodump-ng. This might give you more control on how you want to setup the monitor mode itself.

zeroby0 commented 5 years ago

Yeah, that's better. I ended up forking schollz/wifiscan and making some small changes.

Thanks a lot @jekkos , this comment of yours led me to my implementation :)