pwnagotchi icon indicating copy to clipboard operation
pwnagotchi copied to clipboard

pwnagotchi on x86/64 Linux

Open cyrus104 opened this issue 5 years ago • 40 comments

Would like to take advantage of multiple atom based systems by being able to install pwnagotchi on these units. Would need to initially disable the display unless using a phone or webpage for displaying.

I haven't found an install script for this software yet but I've been trying to test it on Debian 10 running into issues.

cyrus104 avatar Oct 22 '19 14:10 cyrus104

See also: https://github.com/evilsocket/pwnagotchi/issues/155 (related issue, duplicate maybe?)

darrenmartyn avatar Oct 22 '19 15:10 darrenmartyn

@darrenmartyn after looking at issue #155 it is not a duplicate. That one is specifically happing issues with 32bit libraries. I was able to use pip to install all of the 64bit libraries on regular Debian.

After that install there are still many dependencies and configurations that aren't listed anywhere.

cyrus104 avatar Oct 23 '19 01:10 cyrus104

The software is based on:

  1. pwnagotchi (this repo), that can be installed with cd /path/to/repo && sudo pip3 install .
  2. pwngrid with this systemd service file
  3. bettercap with this service file

Both services have precompiled releases and can either be installed as systemd services or just executed manually.

This runs on *

evilsocket avatar Oct 23 '19 15:10 evilsocket

I'll go ahead and test on an x86_64 machine later tonight, and piece together a oneshot builder for debian10, might take me a day or two, but i'd love to contribute to this project entirely because it scares the piss out of my coworker @Xpistos

WaffleThief123 avatar Oct 23 '19 15:10 WaffleThief123

progress on the oneshot:

I can pull whatever master is, and build it, but i'm hitting some weird dependancy resolution with tensorflow. I think it's just python being python, will investigate further when i get home tonight

WaffleThief123 avatar Oct 23 '19 21:10 WaffleThief123

I ran into the same issue and it looks like I needed to apt install "mpich". I also needed to change the pip requirements.txt and remove the strict version of tensorflow. Debian did not like having a different version of tensorflow and tensorflow-estimator. Once I made sure those were installing the same revision, it made it past that part. Of course, I'm not sure if that broke anything in pwnagotchi or not.

Thanks for looking into it.

On Thu, Oct 24, 2019 at 4:31 AM wertyy102 [email protected] wrote:

progress on the oneshot:

I can pull whatever master is, and build it, but i'm hitting some weird dependancy resolution with tensorflow. I think it's just python being python, will investigate further when i get home tonight

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evilsocket/pwnagotchi/issues/361?email_source=notifications&email_token=AALWQ43IMWZUPHT3NZMWDZTQQC7EZA5CNFSM4JDQPEYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECC6HHI#issuecomment-545645469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWQ45FHN6DWXPHZW4SF5DQQC7EZANCNFSM4JDQPEYA .

cyrus104 avatar Oct 24 '19 00:10 cyrus104

@cyrus104 ty! Haven't had a lot of time to tinker this week, work got in the way, but with that info i'm confident i'll have some kind of semi-done oneshot builder done this weekend.

Happy hacking guys!

WaffleThief123 avatar Oct 25 '19 20:10 WaffleThief123

https://pwnagotchi.ai/installation/#installing-on-any-gnu-linux

evilsocket avatar Oct 25 '19 20:10 evilsocket

@evilsocket can i recommend switching the link to whatever the current master is? Saves you some time in the future :) image

WaffleThief123 avatar Oct 25 '19 20:10 WaffleThief123

The master contains unstable and untested code.

evilsocket avatar Oct 25 '19 22:10 evilsocket

I get this error when I run sudo pip3 install .

Error Log (click to expand)


ERROR: tensorflow 1.13.1 has requirement tensorflow-estimator<1.14.0rc0,>=1.13.0, but you'll have tensorflow-estimator 1.14.0 which is incompatible.
Installing collected packages: shellescape, PyYAML, urllib3, requests, Naked, crypto, scapy, numpy, scipy, pyglet, cloudpickle, gym, kiwisolver, cycler, matplotlib, joblib, opencv-python, mpi4py, stable-baselines, h5py, keras-applications, absl-py, wheel, markdown, tensorboard, gast, astor, keras-preprocessing, tensorflow-estimator, tensorflow, oauthlib, requests-oauthlib, tweepy, file-read-backwards, RPi.GPIO, smbus2, spidev, inky, Pillow, pwnagotchi
  Found existing installation: PyYAML 5.1.2
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.


EDIT:

@cyrus104 Thanks, I edited requirements.txt and got past the tensor flow errors. I'm still getting this error and I'm not sure how to correct it:


Found existing installation: PyYAML 5.1.2
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Ok. I got past the PyYAML error. Here is a one-liner that should work if you are experiencing the "Cannot uninstall 'PyYAML'" error. It will move the current PyYAML installation to your home directory and you should be able to get past that error if you run "sudo pip3 install ." again:


sudo find `sudo pip3 show pyyaml | grep Location | cut -d' ' -f2` -name 'PyYAML*' -exec mv -vf {} ~ \;

Unfortunately now I'm getting some more errors further into the install:

Error Log (click to expand)


Running setup.py install for mpi4py: started
    Running setup.py install for mpi4py: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kirw3w0w/mpi4py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kirw3w0w/mpi4py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yn4nzabj/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-kirw3w0w/mpi4py/
    Complete output (126 lines):
    running install
    running build
    running build_src
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/mpi4py
    copying src/mpi4py/__init__.py -> build/lib.linux-x86_64-3.7/mpi4py
    copying src/mpi4py/bench.py -> build/lib.linux-x86_64-3.7/mpi4py
    copying src/mpi4py/__main__.py -> build/lib.linux-x86_64-3.7/mpi4py
    copying src/mpi4py/run.py -> build/lib.linux-x86_64-3.7/mpi4py
    creating build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/futures/aplus.py -> build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/futures/__init__.py -> build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/futures/_lib.py -> build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/futures/pool.py -> build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/futures/server.py -> build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/futures/_base.py -> build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/futures/__main__.py -> build/lib.linux-x86_64-3.7/mpi4py/futures
    copying src/mpi4py/libmpi.pxd -> build/lib.linux-x86_64-3.7/mpi4py
    copying src/mpi4py/__init__.pxd -> build/lib.linux-x86_64-3.7/mpi4py
    copying src/mpi4py/MPI.pxd -> build/lib.linux-x86_64-3.7/mpi4py
    creating build/lib.linux-x86_64-3.7/mpi4py/include
    creating build/lib.linux-x86_64-3.7/mpi4py/include/mpi4py
    copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.linux-x86_64-3.7/mpi4py/include/mpi4py
    copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.linux-x86_64-3.7/mpi4py/include/mpi4py
    copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.linux-x86_64-3.7/mpi4py/include/mpi4py
    copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.linux-x86_64-3.7/mpi4py/include/mpi4py
    copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.linux-x86_64-3.7/mpi4py/include/mpi4py
    running build_clib
    MPI configuration: [mpi] from 'mpi.cfg'
    checking for library 'lmpe' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -llmpe -o _configtest
    /usr/bin/ld: cannot find -llmpe
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    building 'mpe' dylib library
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    creating build/temp.linux-x86_64-3.7/src/lib-pmpi
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c src/lib-pmpi/mpe.c -o build/temp.linux-x86_64-3.7/src/lib-pmpi/mpe.o
    creating build/lib.linux-x86_64-3.7/mpi4py/lib-pmpi
    gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--no-as-needed build/temp.linux-x86_64-3.7/src/lib-pmpi/mpe.o -o build/lib.linux-x86_64-3.7/mpi4py/lib-pmpi/libmpe.so
    checking for library 'vt-mpi' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -lvt-mpi -o _configtest
    /usr/bin/ld: cannot find -lvt-mpi
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    checking for library 'vt.mpi' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -lvt.mpi -o _configtest
    /usr/bin/ld: cannot find -lvt.mpi
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    building 'vt' dylib library
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c src/lib-pmpi/vt.c -o build/temp.linux-x86_64-3.7/src/lib-pmpi/vt.o
    gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--no-as-needed build/temp.linux-x86_64-3.7/src/lib-pmpi/vt.o -o build/lib.linux-x86_64-3.7/mpi4py/lib-pmpi/libvt.so
    checking for library 'vt-mpi' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -lvt-mpi -o _configtest
    /usr/bin/ld: cannot find -lvt-mpi
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    checking for library 'vt.mpi' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -lvt.mpi -o _configtest
    /usr/bin/ld: cannot find -lvt.mpi
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    building 'vt-mpi' dylib library
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c src/lib-pmpi/vt-mpi.c -o build/temp.linux-x86_64-3.7/src/lib-pmpi/vt-mpi.o
    gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--no-as-needed build/temp.linux-x86_64-3.7/src/lib-pmpi/vt-mpi.o -o build/lib.linux-x86_64-3.7/mpi4py/lib-pmpi/libvt-mpi.so
    checking for library 'vt-hyb' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -lvt-hyb -o _configtest
    /usr/bin/ld: cannot find -lvt-hyb
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    checking for library 'vt.ompi' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -lvt.ompi -o _configtest
    /usr/bin/ld: cannot find -lvt.ompi
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    building 'vt-hyb' dylib library
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -c src/lib-pmpi/vt-hyb.c -o build/temp.linux-x86_64-3.7/src/lib-pmpi/vt-hyb.o
    gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,--no-as-needed build/temp.linux-x86_64-3.7/src/lib-pmpi/vt-hyb.o -o build/lib.linux-x86_64-3.7/mpi4py/lib-pmpi/libvt-hyb.so
    running build_ext
    MPI configuration: [mpi] from 'mpi.cfg'
    checking for dlopen() availability ...
    checking for header 'dlfcn.h' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.7m -c _configtest.c -o _configtest.o
    success!
    removing: _configtest.c _configtest.o
    success!
    checking for library 'dl' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.7m -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -Lbuild/temp.linux-x86_64-3.7 -ldl -o _configtest
    success!
    removing: _configtest.c _configtest.o _configtest
    checking for function 'dlopen' ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.7m -c _configtest.c -o _configtest.o
    gcc -pthread _configtest.o -Lbuild/temp.linux-x86_64-3.7 -ldl -o _configtest
    success!
    removing: _configtest.c _configtest.o _configtest
    building 'mpi4py.dl' extension
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/usr/include/python3.7m -c src/dynload.c -o build/temp.linux-x86_64-3.7/src/dynload.o
    gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now build/temp.linux-x86_64-3.7/src/dynload.o -Lbuild/temp.linux-x86_64-3.7 -ldl -lpython3.7m -o build/lib.linux-x86_64-3.7/mpi4py/dl.cpython-37m-x86_64-linux-gnu.so
    checking for MPI compile and link ...
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/include/python3.7m -c _configtest.c -o _configtest.o
    _configtest.c:2:10: fatal error: mpi.h: No such file or directory
        2 | #include <mpi.h>
          |          ^~~~~~~
    compilation terminated.
    failure.
    removing: _configtest.c _configtest.o
    error: Cannot compile MPI programs. Check your configuration!!!
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kirw3w0w/mpi4py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kirw3w0w/mpi4py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yn4nzabj/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

EDIT:

I got it to finish installing. I installed the python-mpi4py package with my distribution's package manager and then reran the install. I'm on Archlinux so the command I ran was:

sudo pacman -S python-mpi4py
sudo pip3 install .

The package name may be different if you are on a distribution other than Archlinux. There also may be another way to correct the errors that I was getting without installing a package through the distribution's package manager, but that's what worked for me. I'd be interested in hearing any thoughts on any other ways that issue could have been resolved.

l0ophole avatar Oct 26 '19 01:10 l0ophole

I'm getting this error when I run the main binary:

Error Log (click to expand)


[2019-10-25 22:25:32,241] [INFO] grid plugin loaded.
[2019-10-25 22:25:32,256] [WARNING] ui.fps is 0, the display will only update for major changes
[2019-10-25 22:25:32,256] [INFO] initializing waveshare v2 display
Effective Configuration:
ai:
  enabled: true
  epochs_per_episode: 50
  laziness: 0.1
  params:
    alpha: 0.99
    ent_coef: 0.01
    epsilon: 1.0e-05
    gamma: 0.99
    learning_rate: 0.001
    lr_schedule: constant
    max_grad_norm: 0.5
    n_steps: 1
    tensorboard_log: null
    verbose: 1
    vf_coef: 0.25
  path: /root/brain.nn
bettercap:
  handshakes: /root/handshakes
  hostname: ***
  password: ***
  port: 8081
  scheme: http
  silence:
  - ble.device.new
  - ble.device.lost
  - ble.device.disconnected
  - ble.device.connected
  - ble.device.service.discovered
  - ble.device.characteristic.discovered
  - wifi.client.new
  - wifi.client.lost
  - wifi.client.probe
  - wifi.ap.new
  - wifi.ap.lost
  - mod.started
  username: ***
main:
  custom_plugins: null
  filter: null
  iface: mon0
  lang: en
  log: /var/log/pwnagotchi.log
  mon_max_blind_epochs: 50
  mon_start_cmd: /usr/bin/monstart
  mon_stop_cmd: /usr/bin/monstop
  no_restart: false
  plugins:
    AircrackOnly:
      enabled: false
    auto-backup:
      commands:
      - tar czf /tmp/backup.tar.gz {files}
      - scp /tmp/backup.tar.gz [email protected]:/home/pwnagotchi/backups/backup-$(date
        +%s).tar.gz
      enabled: false
      files:
      - /root/brain.nn
      - /root/brain.json
      - /root/.api-report.json
      - /root/handshakes/
      - /etc/pwnagotchi/
      - /etc/hostname
      - /etc/hosts
      - /etc/motd
      - /var/log/pwnagotchi.log
      interval: 1
    bt-tether:
      enabled: false
      interval: 1
      ip: 192.168.44.44
      mac: null
      netmask: 24
      share_internet: false
    gps:
      device: /dev/ttyUSB0
      enabled: false
      speed: 19200
    grid:
      enabled: true
      exclude:
      - YourHomeNetworkHere
      report: false
    memtemp:
      enabled: false
    net-pos:
      api_key: test
      enabled: false
    onlinehashcrack:
      email: null
      enabled: false
    quickdic:
      enabled: false
      wordlist_folder: /opt/wordlists/
    screen_refresh:
      enabled: false
      refresh_interval: 50
    twitter:
      access_token_key: aaa
      access_token_secret: aaa
      consumer_key: aaa
      consumer_secret: aaa
      enabled: false
    wigle:
      api_key: null
      enabled: false
    wpa-sec:
      api_key: null
      enabled: false
  whitelist:
  - EXAMPLE_NETWORK
  - ANOTHER_EXAMPLE_NETWORK
personality:
  advertise: true
  ap_ttl: 120
  associate: true
  bored_num_epochs: 15
  channels: []
  deauth: true
  excited_num_epochs: 10
  hop_recon_time: 10
  max_inactive_scale: 2
  max_interactions: 3
  max_misses_for_recon: 5
  min_recon_time: 5
  min_rssi: -200
  recon_inactive_multiplier: 2
  recon_time: 30
  sad_num_epochs: 25
  sta_ttl: 300
ui:
  display:
    color: black
    enabled: true
    rotation: 180
    type: waveshare_2
    video:
      address: 0.0.0.0
      enabled: true
      port: 8080
  fps: 0.0

Traceback (most recent call last):
  File "/usr/bin/pwnagotchi", line 36, in <module>
    display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()})
  File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/display.py", line 98, in __init__
    self.init_display()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/display.py", line 135, in init_display
    self._implementation.initialize()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/hw/waveshare2.py", line 58, in initialize
    from pwnagotchi.ui.hw.libs.waveshare.v2.waveshare import EPD
  File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/hw/libs/waveshare/v2/waveshare.py", line 50, in <module>
    import RPi.GPIO as GPIO
  File "/usr/lib/python3.7/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

l0ophole avatar Oct 26 '19 03:10 l0ophole

You need to your off display in the config file. It's trying to connect to the eink display.

On Sat, Oct 26, 2019, 10:27 l0ophole [email protected] wrote:

I'm getting this error when I run the main binary:

[2019-10-25 22:25:32,241] [INFO] grid plugin loaded. [2019-10-25 22:25:32,256] [WARNING] ui.fps is 0, the display will only update for major changes [2019-10-25 22:25:32,256] [INFO] initializing waveshare v2 display Effective Configuration: ai: enabled: true epochs_per_episode: 50 laziness: 0.1 params: alpha: 0.99 ent_coef: 0.01 epsilon: 1.0e-05 gamma: 0.99 learning_rate: 0.001 lr_schedule: constant max_grad_norm: 0.5 n_steps: 1 tensorboard_log: null verbose: 1 vf_coef: 0.25 path: /root/brain.nn bettercap: handshakes: /root/handshakes hostname: localhost password: pwnagotchi port: 8081 scheme: http silence:

  • ble.device.new
  • ble.device.lost
  • ble.device.disconnected
  • ble.device.connected
  • ble.device.service.discovered
  • ble.device.characteristic.discovered
  • wifi.client.new
  • wifi.client.lost
  • wifi.client.probe
  • wifi.ap.new
  • wifi.ap.lost
  • mod.started username: pwnagotchi main: custom_plugins: null filter: null iface: mon0 lang: en log: /var/log/pwnagotchi.log mon_max_blind_epochs: 50 mon_start_cmd: /usr/bin/monstart mon_stop_cmd: /usr/bin/monstop no_restart: false plugins: AircrackOnly: enabled: false auto-backup: commands:
    • tar czf /tmp/backup.tar.gz {files}
    • scp /tmp/backup.tar.gz [email protected]:/home/pwnagotchi/backups/backup-$(date +%s).tar.gz enabled: false files:
    • /root/brain.nn
    • /root/brain.json
    • /root/.api-report.json
    • /root/handshakes/
    • /etc/pwnagotchi/
    • /etc/hostname
    • /etc/hosts
    • /etc/motd
    • /var/log/pwnagotchi.log interval: 1 bt-tether: enabled: false interval: 1 ip: 192.168.44.44 mac: null netmask: 24 share_internet: false gps: device: /dev/ttyUSB0 enabled: false speed: 19200 grid: enabled: true exclude:
    • YourHomeNetworkHere report: false memtemp: enabled: false net-pos: api_key: test enabled: false onlinehashcrack: email: null enabled: false quickdic: enabled: false wordlist_folder: /opt/wordlists/ screen_refresh: enabled: false refresh_interval: 50 twitter: access_token_key: aaa access_token_secret: aaa consumer_key: aaa consumer_secret: aaa enabled: false wigle: api_key: null enabled: false wpa-sec: api_key: null enabled: false whitelist:
  • EXAMPLE_NETWORK
  • ANOTHER_EXAMPLE_NETWORK personality: advertise: true ap_ttl: 120 associate: true bored_num_epochs: 15 channels: [] deauth: true excited_num_epochs: 10 hop_recon_time: 10 max_inactive_scale: 2 max_interactions: 3 max_misses_for_recon: 5 min_recon_time: 5 min_rssi: -200 recon_inactive_multiplier: 2 recon_time: 30 sad_num_epochs: 25 sta_ttl: 300 ui: display: color: black enabled: true rotation: 180 type: waveshare_2 video: address: 0.0.0.0 enabled: true port: 8080 fps: 0.0

Traceback (most recent call last): File "/usr/bin/pwnagotchi", line 36, in display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()}) File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/display.py", line 98, in init self.init_display() File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/display.py", line 135, in init_display self._implementation.initialize() File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/hw/waveshare2.py", line 58, in initialize from pwnagotchi.ui.hw.libs.waveshare.v2.waveshare import EPD File "/usr/lib/python3.7/site-packages/pwnagotchi/ui/hw/libs/waveshare/v2/waveshare.py", line 50, in import RPi.GPIO as GPIO File "/usr/lib/python3.7/site-packages/RPi/GPIO/init.py", line 23, in from RPi._GPIO import * RuntimeError: This module can only be run on a Raspberry Pi!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evilsocket/pwnagotchi/issues/361?email_source=notifications&email_token=AALWQ4YQYRRIAOTXAASUZZDQQO2JLA5CNFSM4JDQPEYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECJ6M6Y#issuecomment-546563707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWQ4YIL42MXEXK2LMMNK3QQO2JLANCNFSM4JDQPEYA .

cyrus104 avatar Oct 26 '19 03:10 cyrus104

@cyrus104 I set it to false but it still gives me the same error. The config it prints out at runtime doesn't match up with the config.yml in the /etc directory even when I specify it with -C.

EDIT:

The config.yml keeps getting changed when I run the binary. I set ui.display.enabled to false and run the binary then it's set back to true when I check config.yml again.

EDIT: Ok. I copied the config to myconfig.yml and turned off the display then ran the binary with -U and it got past that part. Now this is what it says:

Error Log (click to expand)


Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3.7/site-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/lib/python3.7/site-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.7/http/client.py", line 1244, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1290, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1239, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 181, in connect
    conn = self._new_conn()
  File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3.7/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /api/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pwnagotchi", line 73, in <module>
    agent.start()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/agent.py", line 142, in start
    self.start_monitor_mode()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/agent.py", line 107, in start_monitor_mode
    s = self.session()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/bettercap.py", line 30, in session
    r = requests.get("%s/session" % self.url, auth=self.auth)
  File "/usr/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /api/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused'))

l0ophole avatar Oct 26 '19 03:10 l0ophole

I had to change it in the pip folder path.

On Sat, Oct 26, 2019, 10:45 l0ophole [email protected] wrote:

@cyrus104 https://github.com/cyrus104 I set it to false but it still gives me the same error. The config it prints out at runtime doesn't match up with the config.yml in the /etc directory even when I specify it with -C.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evilsocket/pwnagotchi/issues/361?email_source=notifications&email_token=AALWQ442NXRXOJJTGCQWOX3QQO4PLA5CNFSM4JDQPEYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECJ6WBA#issuecomment-546564868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWQ437JUIRSZJQWKKU77LQQO4PLANCNFSM4JDQPEYA .

cyrus104 avatar Oct 26 '19 03:10 cyrus104

@cyrus104 Thanks. I seem to have gotten past the display problem. I'm getting connection errors now:

Error Log (click to expand)


Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3.7/site-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/lib/python3.7/site-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.7/http/client.py", line 1244, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1290, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1239, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 181, in connect
    conn = self._new_conn()
  File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3.7/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /api/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pwnagotchi", line 73, in <module>
    agent.start()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/agent.py", line 142, in start
    self.start_monitor_mode()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/agent.py", line 107, in start_monitor_mode
    s = self.session()
  File "/usr/lib/python3.7/site-packages/pwnagotchi/bettercap.py", line 30, in session
    r = requests.get("%s/session" % self.url, auth=self.auth)
  File "/usr/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /api/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused'))

l0ophole avatar Oct 26 '19 03:10 l0ophole

Do you have bettercap installed and the API listening on port 8081?

On Sat, Oct 26, 2019, 10:56 l0ophole [email protected] wrote:

@cyrus104 https://github.com/cyrus104 Thanks. I seem to have gotten past the display problem. I'm getting connection errors now: Error Log (click to expand)

Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw) File "/usr/lib/python3.7/site-packages/urllib3/util/connection.py", line 80, in create_connection raise err File "/usr/lib/python3.7/site-packages/urllib3/util/connection.py", line 70, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1290, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1239, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 966, in send self.connect() File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 181, in connect conn = self._new_conn() File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 168, in _new_conn self, "Failed to establish a new connection: %s" % e) urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/lib/python3.7/site-packages/urllib3/util/retry.py", line 399, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /api/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/pwnagotchi", line 73, in agent.start() File "/usr/lib/python3.7/site-packages/pwnagotchi/agent.py", line 142, in start self.start_monitor_mode() File "/usr/lib/python3.7/site-packages/pwnagotchi/agent.py", line 107, in start_monitor_mode s = self.session() File "/usr/lib/python3.7/site-packages/pwnagotchi/bettercap.py", line 30, in session r = requests.get("%s/session" % self.url, auth=self.auth) File "/usr/lib/python3.7/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/usr/lib/python3.7/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 646, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8081): Max retries exceeded with url: /api/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f87d4861690>: Failed to establish a new connection: [Errno 111] Connection refused'))

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evilsocket/pwnagotchi/issues/361?email_source=notifications&email_token=AALWQ467SNUIKU2SYEGQWYDQQO5XXA5CNFSM4JDQPEYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECJ63DA#issuecomment-546565516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWQ42FWNGH4ZD75HJANOLQQO5XXANCNFSM4JDQPEYA .

cyrus104 avatar Oct 26 '19 03:10 cyrus104

@cyrus104 Yeah. Sorry, I forgot to start bettercap and pwngrid. It ran for a few seconds and then quit with "Illegal instruction."

Log (click to expand)

23:13 ✔ arch2 $ sudo pwnagotchi -U /etc/pwnagotchi/myconfig.yml --debug
[2019-10-25 23:13:53,054] [WARNING] ui.fps is 0, the display will only update for major changes
[2019-10-25 23:13:53,054] [WARNING] display module is disabled
[2019-10-25 23:13:53,062] [INFO] ui available at http://0.0.0.0:8080/
[2019-10-25 23:13:53,412] [INFO] arch2@*** (v1.0.1)
[2019-10-25 23:13:53,413] [INFO] entering auto mode ...
[2019-10-25 23:13:53,413] [INFO] connecting to http://localhost:8081/api ...
[2019-10-25 23:13:53,416] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,417] [INFO] [ai] bootstrapping dependencies ...
[2019-10-25 23:13:53,422] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 72
[2019-10-25 23:13:53,425] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,430] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 74
[2019-10-25 23:13:53,439] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,445] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 90
[2019-10-25 23:13:53,447] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,453] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 84
[2019-10-25 23:13:53,456] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,461] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 102
[2019-10-25 23:13:53,464] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,466] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 116
[2019-10-25 23:13:53,470] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,474] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 74
[2019-10-25 23:13:53,478] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,482] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 76
[2019-10-25 23:13:53,485] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,489] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 78
[2019-10-25 23:13:53,500] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,503] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 66
[2019-10-25 23:13:53,507] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,511] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 68
[2019-10-25 23:13:53,515] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,517] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 400 66
[2019-10-25 23:13:53,520] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,637] [DEBUG] http://localhost:8081 "GET /api/session HTTP/1.1" 200 None
[2019-10-25 23:13:53,694] [INFO] found monitor interface: mon0
[2019-10-25 23:13:53,697] [INFO] supported channels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
[2019-10-25 23:13:53,697] [INFO] handshakes will be collected inside /root/handshakes
[2019-10-25 23:13:53,702] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,713] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 200 26
[2019-10-25 23:13:53,719] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,726] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 200 26
[2019-10-25 23:13:53,729] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,733] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 200 26
[2019-10-25 23:13:53,736] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,763] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 200 26
[2019-10-25 23:13:53,779] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,792] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 200 26
[2019-10-25 23:13:53,801] [DEBUG] Starting new HTTP connection (1): localhost:8081
[2019-10-25 23:13:53,812] [DEBUG] http://localhost:8081 "POST /api/session HTTP/1.1" 200 26
[2019-10-25 23:13:53,820] [DEBUG] Starting new HTTP connection (1): localhost:8081
Illegal instruction
23:13 ✘ arch2 $

Is that a library issue? Do you know how I can figure out what's causing the illegal instruction? strace, maybe?

l0ophole avatar Oct 26 '19 04:10 l0ophole

This is the last 100 lines of output when I run it with strace:

Log (click to expand)


futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=77242000}, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f6509c, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 1
write(3, "[2019-10-25 23:29:57,064] [DEBUG"..., 83) = 83
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=78907000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f650f0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f650f8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f6509c, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 1
write(2, "[2019-10-25 23:29:57,064] [DEBUG"..., 83[2019-10-25 23:29:57,064] [DEBUG] Starting new HTTP connection (1): localhost:8081
) = 83
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=85729000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f650f4, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f650f8, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f6509c, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 1
stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=50, ...}) = 0
openat(AT_FDCWD, "/etc/hosts", O_RDONLY|O_CLOEXEC) = 5
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0644, st_size=388, ...}) = 0
read(5, "# Static table lookup for hostna"..., 4096) = 388
lseek(5, 0, SEEK_CUR)                   = 388
read(5, "", 4096)                       = 0
close(5)                                = 0
rt_sigprocmask(SIG_BLOCK, [HUP USR1 USR2 PIPE ALRM CHLD TSTP URG VTALRM PROF WINCH IO], [], 8) = 0
openat(AT_FDCWD, "/run/systemd/machines/localhost", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [HUP USR1 USR2 PIPE ALRM CHLD TSTP URG VTALRM PROF WINCH IO], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_ROUTE) = 5
bind(5, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 12) = 0
getsockname(5, {sa_family=AF_NETLINK, nl_pid=1233244, nl_groups=00000000}, [12]) = 0
sendto(5, {{len=20, type=0x16 /* NLMSG_??? */, flags=NLM_F_REQUEST|0x300, seq=1572064197, pid=0}, "\x00\x00\x00\x00"}, 20, 0, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, 12) = 20
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{{len=76, type=0x14 /* NLMSG_??? */, flags=NLM_F_MULTI, seq=1572064197, pid=1233244}, "\x02\x08\x80\xfe\x01\x00\x00\x00\x08\x00\x01\x00\x7f\x00\x00\x01\x08\x00\x02\x00\x7f\x00\x00\x01\x07\x00\x03\x00\x6c\x6f\x00\x00"...}, {{len=88, type=0x14 /* NLMSG_??? */, flags=NLM_F_MULTI, seq=1572064197, pid=1233244}, "\x02\x18\x80\x00\x02\x00\x00\x00\x08\x00\x01\x00\xc0\xa8\x01\x63\x08\x00\x02\x00\xc0\xa8\x01\x63\x08\x00\x04\x00\xc0\xa8\x01\xff"...}, {{len=80, type=0x14 /* NLMSG_??? */, flags=NLM_F_MULTI, seq=1572064197, pid=1233244}, "\x02\x18\x80\x00\x02\x00\x00\x00\x08\x00\x01\x00\xc0\xa8\x02\x63\x08\x00\x02\x00\xc0\xa8\x02\x63\x0b\x00\x03\x00\x65\x6e\x70\x33"...}], iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 244
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base=[{{len=72, type=0x14 /* NLMSG_??? */, flags=NLM_F_MULTI, seq=1572064197, pid=1233244}, "\x0a\x80\x80\xfe\x01\x00\x00\x00\x14\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x14\x00\x06\x00"...}, {{len=72, type=0x14 /* NLMSG_??? */, flags=NLM_F_MULTI, seq=1572064197, pid=1233244}, "\x0a\x40\x00\x00\x02\x00\x00\x00\x14\x00\x01\x00\xfd\xc5\x88\x1d\xd5\xcb\x00\x00\x22\x6a\x8a\xff\xfe\x3f\xeb\x7a\x14\x00\x06\x00"...}, {{len=72, type=0x14 /* NLMSG_??? */, flags=NLM_F_MULTI, seq=1572064197, pid=1233244}, "\x0a\x40\x80\xfd\x02\x00\x00\x00\x14\x00\x01\x00\xfe\x80\x00\x00\x00\x00\x00\x00\x22\x6a\x8a\xff\xfe\x3f\xeb\x7a\x14\x00\x06\x00"...}], iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 216
recvmsg(5, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=20, type=NLMSG_DONE, flags=NLM_F_MULTI, seq=1572064197, pid=1233244}, 0}, iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 20
close(5)                                = 0
socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 7
connect(7, {sa_family=AF_INET, sin_port=htons(8081), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
getsockname(7, {sa_family=AF_INET, sin_port=htons(35057), sin_addr=inet_addr("127.0.0.1")}, [28->16]) = 0
close(7)                                = 0
socket(AF_INET6, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_IP) = 5
connect(5, {sa_family=AF_INET6, sin6_port=htons(8081), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28) = 0
getsockname(5, {sa_family=AF_INET6, sin6_port=htons(49729), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, [28]) = 0
close(5)                                = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=117322000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=122896000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=128479000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=134371000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=140345000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=145703000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=151175000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=156532000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=162977000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=168347000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=173593000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=178913000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=184379000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=189727000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=195206000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=200569000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=206410000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=211767000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=218218000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=223792000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=229112000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=234474000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=240972000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=246315000}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f51d0f650a0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f51d0f65098, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1572064197, tv_nsec=251724000}, FUTEX_BITSET_MATCH_ANY) = ?
+++ killed by SIGILL (core dumped) +++
Illegal instruction

l0ophole avatar Oct 26 '19 04:10 l0ophole

bettercap and pwngrid are still running. I've collected three handshakes so far. It's just pwnagotchi that is dying with an illegal instruction.

l0ophole avatar Oct 26 '19 05:10 l0ophole

Looks like it might be something with tensor flow:


Core was generated by `/usr/bin/python /usr/bin/pwnagotchi -U /etc/pwnagotchi/myconfig.yml --debug'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00007f51586e6820 in nsync::nsync_mu_init(nsync::nsync_mu_s_*) ()
   from /usr/lib/python3.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so
[Current thread is 1 (Thread 0x7f516f7f6700 (LWP 1308651))]
(gdb)

l0ophole avatar Oct 26 '19 06:10 l0ophole

Yeah, I don't understand it. I reinstalled everything with "sudo pip3 install -r requirements.txt" so I've got the exact versions that the requirements file on this GitHub asks for. Still getting Illegal instruction, though.


Core was generated by `/usr/bin/python /usr/bin/pwnagotchi -U /etc/pwnagotchi/myconfig.yml --debug'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00007f15f70d665f in std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tensorflow::Node::NodeClass>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tensorflow::Node::NodeClass> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_Hashtable<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tensorflow::Node::NodeClass> const*>(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tensorflow::Node::NodeClass> const*, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tens--
Type <RET> for more, q to quit, c to continue without paging--

orflow::Node::NodeClass> const*, unsigned long, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&, std::__detail::_Mod_range_hashing const&, std::__detail::_Default_ranged_hash const&, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&, std::__detail::_Select1st const&, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tensorflow::Node::NodeClass> > const&) ()
   from /usr/lib/python3.7/site-packages/tensorflow/python/../libtensorflow_framework.so
[Current thread is 1 (Thread 0x7f16161da700 (LWP 1326322))]
(gdb)

l0ophole avatar Oct 26 '19 06:10 l0ophole

This is the instruction that crashed the program:

vmovsd -0x38(%rdp),%xmm0

vmovsd is part of the Advanced Vector Extensions(AVX) which my CPU doesn't support. I just googled tensorflow and it does appear that tensorflow was compiled using the AVX instruction set.

Someone suggested that it's possible to compile tensorflow without AVX instructions, so I'm going to see if I can do that.

l0ophole avatar Oct 26 '19 07:10 l0ophole

What CPU are you using that doesn't have that?

On Sat, Oct 26, 2019, 14:03 l0ophole [email protected] wrote:

This is the instruction that crashed the program:

vmovsd -0x38(%rdp),%xmm0

vmovsd is part of the Advanced Vector Extensions(AVX) which my CPU doesn't support. I just googled tensorflow and it does appear that tensorflow was compiled using the AVX instruction set.

Someone suggested that it's possible to compile tensorflow without AVX instructions, so I'm going to see if I can do that.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evilsocket/pwnagotchi/issues/361?email_source=notifications&email_token=AALWQ42YDKRHPYTROI72VMLQQPTUDA5CNFSM4JDQPEYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECKBVVY#issuecomment-546577111, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWQ43HE2ER5DM7EDMRTALQQPTUDANCNFSM4JDQPEYA .

cyrus104 avatar Oct 26 '19 07:10 cyrus104

@cyrus104


AMD Phenom II N970
Introduction date:	Jan 4, 2011
[Source: cpu-world.com]

It doesn't even support SSE3/SSE4.1/SSE4.2 instructions. I tried running Anbox a while back and it requires all of those instruction sets. ☹️

I still have the email from when I ordered it from Woot! in 2011:


From: "Woot" [email protected]
Date: Oct 30, 2011, 10:04 AM

Thank you for your purchase.

Your order number ******** for 1 Acer Aspire Quad-Core Notebook with 17.3” HD+ CineCrystal LED Display has been received by Woot on 10/30/2011 and your credit card has been charged $384.99.
Your order will typically ship within 5 business days. To check your order status, go to the Your Account tab at www.woot.com, log in and check your order history.

$ lscpu

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   48 bits physical, 48 bits virtual
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       AuthenticAMD
CPU family:                      16
Model:                           5
Model name:                      AMD Phenom(tm) II N970 Quad-Core Processor
Stepping:                        3
CPU MHz:                         2200.000
CPU max MHz:                     2200.0000
CPU min MHz:                     800.0000
BogoMIPS:                        4390.99
Virtualization:                  AMD-V
L1d cache:                       256 KiB
L1i cache:                       256 KiB
L2 cache:                        2 MiB
NUMA node0 CPU(s):               0-3
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, STIBP disabled, RSB filling
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate vmmcall npt lbrv svm_lock nrip_save

l0ophole avatar Oct 26 '19 09:10 l0ophole

Ok that makes sense.

On Sat, Oct 26, 2019, 16:42 l0ophole [email protected] wrote:

@cyrus104 https://github.com/cyrus104

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 48 bits physical, 48 bits virtual CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: AuthenticAMD CPU family: 16 Model: 5 Model name: AMD Phenom(tm) II N970 Quad-Core Processor Stepping: 3 CPU MHz: 2200.000 CPU max MHz: 2200.0000 CPU min MHz: 800.0000 BogoMIPS: 4390.99 Virtualization: AMD-V L1d cache: 256 KiB L1i cache: 256 KiB L2 cache: 2 MiB NUMA node0 CPU(s): 0-3 Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Spec store bypass: Not affected Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Full AMD retpoline, STIBP disabled, RSB filling Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate vmmcall npt lbrv svm_lock nrip_save

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/evilsocket/pwnagotchi/issues/361?email_source=notifications&email_token=AALWQ42CJSEAEM4U5VDRGW3QQQGJDA5CNFSM4JDQPEYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECKEIFQ#issuecomment-546587670, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALWQ43BCW2QDZTN3AMD7V3QQQGJDANCNFSM4JDQPEYA .

cyrus104 avatar Oct 26 '19 10:10 cyrus104

I'm still compiling version 1.13.1 of tensorflow. I kept getting errors because it's such an old version that it's not able to compile against modern versions of glibc. I finally found the patch that they applied when glibc version broke their tensorflow builds, so I applied that patch to version 1.13.1 and it's compiling now. I added "-march amdfam10 -mno-avx" to the compile flags so hopefully this version won't crash on my PC.

l0ophole avatar Oct 26 '19 16:10 l0ophole

hats off for the patience you have bro

evilsocket avatar Oct 26 '19 16:10 evilsocket

@evilsocket thanks. The compile failed. I couldn't get it to apply the patch so I keep getting errors regarding gettid() being ambiguous. The patch was supposed to change gettid to sys_gettid so that it didn't conflict with the new glibc syscall.

I'm having a hard time getting Bazel to let me patch a file before starting the build, though. Actually, the patch file I found wasn't even actually a patch file. It was a log file of a patch file being applied to the repo. I haven't actually been able to find the patch file. It only changes 4 or 5 function calls so I did that by hand and Bazel refuses to build with the source code that had already been downloaded. It downloads it fresh from the server before every build.

So, last night I started building 1.15.0 instead of 1.13.0 because I figured by then the patch must have been included in the repo. Woke up this morning to the same build error regarding gettid().

https://imgur.com/QphNKF2

I'm going to post on tensorflow's GitHub and see if they can help me find the patch and get Bazel to let me patch the source code before it starts to build. I'd like to build 1.13.0 since that's what you have in the requirements.txt file.

bettercap and pwngrid have been running since I started this adventure yesterday.

# ls -1 /root/handshakes/ | wc -l
14

l0ophole avatar Oct 27 '19 16:10 l0ophole

I got 1.13.1 to compile by setting up a local_repository for grpc in the WORKSPACE file for tensorflow and changing all the gettid function names to sys_gettid in the local_repository.

Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
  bazel-bin/tensorflow/tools/pip_package/build_pip_package
INFO: Elapsed time: 12803.103s, Critical Path: 439.59s, Remote (0.00% of the time): [queue: 0.00%, setup: 0.00%, process: 0.00%]
INFO: 4414 processes: 4414 local.
INFO: Build completed successfully, 4757 total actions

I downloaded the tarball for the version of grpc that the version of tensorflow that I'm compiling uses. I extracted the tarball to ~/grpc and manually changed gettid to sys_gettid in the source code. It was only three or four edits.

I set up a local repository of grpc and added it to the tensorflow WORKSPACE file as a local_repository. I commented out the grpc repository in the tensorflow/workspace.bzl file.

WORKSPACE: (added to bottom of file)

local_repository(
    name = "grpc",                                                     
    path = "/home/loophole/grpc",
) 

tensorflow/workspace.bzl: (I had to change the sha256 hash and I removed the mirror.bazel.build mirror. That may not be necessary but I downloaded the file from the python.org mirror used the sha256 hash of that file, but I didn't check the hash of the one on bazel.build.)

EDIT: I'm having some weird formatting issue. Change the sha256 value to "fcaec9796c8cc3618899b4aeb62d1a4741830b682b2d8db502a05f9b93c08937" and comment out or delete the bazel.build mirror in "filegroup_external" with the name of "org_python_license"

These are the files that needed to have gettid changed to sys_gettid. First I used grep to see which files had gettid in them, then I used nano and pressed ctrl+w to search for gettid:

./src/core/lib/iomgr/ev_epollex_linux.cc
./grpc/src/core/lib/gpr/log_posix.cc
./grpc/src/core/lib/gpr/log_linux.cc

Make sure you get the version of Bazel that was tested with the version of tensorflow you want to compile. There's a table at the bottom of this page: https://www.tensorflow.org/install/source

I used this command to remove the previous version of Bazel:

rm -rf ~/.bazel ~/.bazelrc ~/.cache/bazel ~/bin/bazel

I installed Bazel with --user, so if you installed without that flag then you may also need to remove: (before installing another version of Bazel)

/usr/local/bin/bazel

l0ophole avatar Oct 28 '19 04:10 l0ophole