Advertisement
KKrasicki

pwnaggotchi

Sep 4th, 2022 (edited)
3,303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 21.51 KB | None | 0 0
  1. sudo apt-key adv --keyserver hkp://pgp.mit.edu --recv-keys 11764EE8AC24832F
  2. sudo apt install raspberrypi-ui-mods
  3. sudo apt install chromium-browser
  4.  
  5. Installing the Fan SHIM software
  6. git clone https://github.com/pimoroni/fanshim-python
  7. cd fanshim-python
  8. sudo ./install.sh
  9. cd examples
  10. sudo ./install-service.sh --on-threshold 65 --off-threshold 55 --delay 2
  11.  
  12. To install the PiSugar2 power management scripts/dependencies:
  13.  
  14. curl http://cdn.pisugar.com/release/Pisugar-power-manager.sh | sudo bash
  15.  
  16. The script will ask you to select which model of PiSugar2 you have and then finish. After that you can start accessing the PiSugar2’s web interface. It will tell you the address at the end of the script like this:
  17.  
  18. Clean up
  19. Now navigate to http://0.0.0.0:8421 on your browser to see PiSugar power management
  20.  
  21. *** Pwnagotchi Build Guide ***
  22. # Description:
  23. # My collective notes for building my pwnagotchi
  24. #
  25. # Last Updated: April 2022
  26.  
  27. *** Hardware: ***
  28.    * Raspberry Pi 4b
  29.    * Waveshare 3.7 e-ink display
  30.    * PiSugar 3 Plus 5000 mAh UPS
  31.    * Panda Wireless PAUN09 Wifi Adapter
  32.    * DIYmall VK-172 USB GPS Dongle (U-blox 7)
  33.    * Samsung EVO Micro SDXC 256GB (UHD, UHS-I, U3, A2, V30)
  34.  
  35. *** Kudos and Special Thanks: ***
  36. # Reddit User "u/panoptyk", for their "Guerrilla guide to Pwnagotchi [v1.5.5/2022]:
  37. #   Link: https://www.reddit.com/r/pwnagotchi/comments/sl2rv1/guerrilla_guide_to_pwnagotchi_v1552022/?utm_source=share&utm_medium=web2x&context=3
  38. #
  39. # Junohea (Wark#8463) on the "Pwnagotchi Unofficial" Discord, for their guidance on configuring an external wifi adapter.
  40. #
  41. # Reddit User "u/Capt_Panic" on Reddit and Discord, for their contributions to this guide.
  42. #   Link: https://www.reddit.com/r/pwnagotchi/comments/ubnlde/comment/i6gg8sj/?utm_source=share&utm_medium=web2x&context=3
  43. #
  44. # The Pwnagotchi Reddit Community:
  45. #   Link: https://www.reddit.com/r/pwnagotchi/
  46. #
  47. # The "Pwnagotchi Unofficial" Discord Community:
  48. #   Link: https://discord.gg/8fV5Ka32
  49. #
  50. # GaelicThunder on GitHub, for their Exp Plugin:
  51. #   Link: https://github.com/GaelicThunder/Experience-Plugin-Pwnagotchi
  52. #
  53. # Hanna.Diamond on GitHub, for their Age Plugin and Waveshare 3.7" e-ink display Plugin:
  54. #   Link: https://github.com/hannadiamond/pwnagotchi-plugins
  55.  
  56. *** Build Instructions Below: ***
  57.  
  58. Step 1) Download Pwnagotchi image from pwnagotchi.ai
  59.  #      Note: version 1.5.5 is the latest version as of April 2022
  60.  #            Many have recommended instead to flash version 1.5.3
  61.  #            in order to avoid reported bugs regarding AI mode not starting.
  62.  #            once installed, version 1.5.3 will automatically update to 1.5.5
  63.  #            with an established internet connection (host connection sharing or bt-tether)
  64.  Download version 1.5.3 to avoid having to fix AI Mode.
  65.      # Remediation guidance for v1.5.5 AI Mode bug is available from u/panoptyk on Reddit. See Link in Kudos section above.
  66.  
  67. Step 2) Flash pwnagotchi image to microSD.
  68.  #      Note: Recommended to use "balenaEtcher" to flash the image.
  69.  #            Several tutorials exist online (Google or YouTube) that
  70.  #            provide instructions for flashing an image to a microSD.
  71.  
  72. Step 3) Build your initial config.toml
  73.  #      Note: your initial config.toml will contain the baseline configuration
  74.  #            for your pwnagotchi, such as the name of the device. It is recommended to avoid
  75.  #            trying to configure all of your plugins at this stage, and only focus on the
  76.  #            essential plugins, such as 'bt-tether'.
  77.  
  78. ######## start of config.toml ########
  79.  
  80. #Main settings
  81. main.name = "pwnagotchi"
  82. main.lang = "en"
  83. main.custom_plugins = "/usr/local/share/pwnagotchi/custom-plugins/"
  84. main.whitelist = [
  85.   "Other...",
  86. ]
  87.  
  88. #Reporting results to PwnGRID
  89. main.plugins.grid.enabled = true
  90. main.plugins.grid.report = true
  91. main.plugins.grid.exclude = [
  92.   "Other..."
  93. ]
  94.  
  95. #Display configuration
  96. ui.display.enabled = false #set to false for now
  97. ui.display.type = "waveshare37inch" #"waveshare37inch" doesn't exist (yet). To be created later...
  98. ui.display.color = "black"
  99.  
  100. #Reduce Writes to preserve SD Lifespan
  101. fs.memory.enabled = true
  102. fs.memory.mounts.log.enabled = true
  103. fs.memory.mounts.data.enabled = true
  104.  
  105. #bt-tether settings
  106. main.plugins.bt-tether.enabled = true
  107. main.plugins.bt-tether.devices.ios-phone.enabled = true
  108. main.plugins.bt-tether.devices.ios-phone.search_order = 1
  109. main.plugins.bt-tether.devices.ios-phone.mac = "CH:AN:GE:XX:MM:EE" #mobile Bluetooth MAC
  110. main.plugins.bt-tether.devices.ios-phone.ip = "172.20.10.6" #custom static IP for iPhone PAN
  111. main.plugins.bt-tether.devices.ios-phone.netmask = 24
  112. main.plugins.bt-tether.devices.ios-phone.interval = 1
  113. main.plugins.bt-tether.devices.ios-phone.scantime = 10
  114. main.plugins.bt-tether.devices.ios-phone.max_tries = 10
  115. main.plugins.bt-tether.devices.ios-phone.share_internet = true
  116. main.plugins.bt-tether.devices.ios-phone.priority = 1
  117.  
  118. ######## end of config.toml ########
  119.  
  120. Step 4) Copy config.toml to MicroSD (boot)
  121.  #       Note: Insert the microSD card flashed in Step 3.
  122.  Open the new drive titled "boot", and copy over your config.toml
  123.  
  124. Step 5) Boot pwnagotchi for the first time, connected via USB (will boot into MANU Mode).
  125.  #       WARNING: BE PATIENT. The First boot will take longer than average due to key generation.
  126.  #       NOTE: If you specified settings for bt-tether plugin, ensure your mobile device is
  127.  #             nearby and listening for new bluetooth devices to pair.
  128.  #             Ensure Internet sharing via Personal Hotspot is enabled.
  129.  Your mobile device will be prompted to pair with your pwnagotchi.
  130.  
  131. Step 6) Configure host Internet sharing (macOS)
  132.  # This guide will cover host internet sharing for macOS only. Windows host internet sharing is available from u/panoptyk on Reddit. See Link in Kudos section above.
  133.  # ETH0 Instructions for Internet access via onboard ethernet port can be found via the following link, thanks to u/Capt_Panic on Reddit: https://reddit.com/r/pwnagotchi/comments/ucig3u/configuring_pi_3_b_for_pnwagotchi_for_nic/
  134.  ** On pwnagotchi: **
  135.   ssh pi@10.0.0.2
  136.      # type "yes" if prompted to accept the ssh key for this not-yet known host.
  137.      # default password: "raspberry" (to be changed later)
  138.      # Note: If you receive "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!":
  139.            # This is due to a previous ssh entry conflicting with your pwnagtochi's IP/hostname.
  140.            sudo nano /Users/{user}/.ssh/known_hosts
  141.            # comment-out or delete lines resembling your raspberry pi IP or hostname
  142.  
  143.   sudo nano /etc/resolv.conf
  144.        # modify "nameserver 127.0.0.1" to be "nameserver 1.1.1.1"
  145.  
  146.   sudo nano /etc/network/interfaces.d/usb0-cfg
  147.        # add "dns-nameservers 1.1.1.1" under the gateway line"
  148.  
  149.   sudo nano /etc/dnsmasq.conf
  150.        # add "server=1.1.1.1@usb0"
  151.  
  152.   sudo systemctl disable dnsmasq
  153.  
  154.   sudo chattr +i /etc/resolv.conf
  155.       # make file immutable
  156.  
  157.  ** On host macOS system: **
  158.       # Manually configure network device (RNDIS/Ethernet Gadget) IPv4 to support
  159.       # default IP addressing.
  160.         "IPv4 Address: 10.0.0.1"
  161.         "Subnet Mask: 255.255.255.0"
  162.         "Router: 10.0.0.1"
  163.  
  164.   sudo ./macos_connection_share.sh
  165.       # Note: Internet sharing scripts obtained from pwnagotchi.ai.
  166.       #       More scripts are available for Windows and Linux OS at pwnagotchi.ai
  167.       #
  168.       # The Raspberry Pi 4b comes equiped with a Ethernet Port, allowing most users the ability to directly connect
  169.       # their pwnagotchi to their home router, or to their computer via the CAT 5 port. This is a far simpler method
  170.       # of obtaining internet access than the instructions I provide below. However, if you are like me, the method below
  171.       # provides you the ability to quickly connect your rpi to your comptuer on-the-go via a USB C cable.
  172.       #
  173.       # Troubleshooting:
  174.         Unable to ping 1.1.1.1 from pwnagotchi with macOS host sharing:
  175.         # "sudo pfctl -sn" may sometimes report the following:
  176.           # nat on en0 inet from 10.0.0.0/24 to any -> (en0) round-robin
  177.           # Fix via: "sudo echo "nat on en0 from en6:network to any -> en0" | sudo pfctl -f -"
  178.           # The above cmd sets proper nat direction (rather than round-robin DNS).
  179.  
  180. Step 7) Install waveshare 3.7 e-ink display
  181.  cd ~
  182.  sudo mkdir /usr/local/share/pwnagotchi/custom-plugins/
  183.       #make custom-plugins directory defined in config.toml, if not done so already.
  184.      
  185.  sudo mkdir /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v37inch
  186.  
  187.  sudo git clone https://github.com/hannadiamond/pwnagotchi-plugins.git
  188.  
  189.  cd ./pwnagotchi-plugins/waveshare_37inch/
  190.  
  191.  sudo cp -r /home/pi/pwnagotchi-plugins/waveshare_37inch/v37inch/. /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v37inch
  192.  
  193.  sudo cp waveshare37inch.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw
  194.  
  195.  sudo nano /etc/pwnagotchi/config.toml
  196.       #set: ui.display.enabled = true
  197.       #set: ui.display.type = "waveshare37inch"
  198.  
  199.  sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/utils.py
  200.  #Locate "def load_config" and add the following:
  201.  elif config['ui']['display']['type'] in ('ws_37inch', 'ws37inch', 'waveshare_37inch', 'waveshare37inch'):
  202.     config['ui']['display']['type'] = 'waveshare37inch'
  203.  
  204.  sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/display.py
  205.  #Add the following:
  206.  def is_waveshare37inch(self):
  207.    return self.implementation.name == 'waveshare37inch'
  208.  
  209.  sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/components.py
  210.  #Locate "class LabeledValue" and REPLACE "def draw" with:
  211.      def draw(self, canvas, drawer):
  212.         if self.label is None:
  213.             drawer.text(self.xy, self.value, font=self.label_font, fill=self.color)
  214.         else:
  215.             pos = self.xy
  216.             drawer.text(pos, self.label, font=self.label_font, fill=self.color)
  217.             drawer.text((pos[0] + self.label_spacing + self.label_font.getsize(self.label)[0], pos[1]), self.value, font=self.text_font, fill=self.color)
  218.  
  219.  sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/__init__.py
  220.  #Add the following:
  221.  from pwnagotchi.ui.hw.waveshare37inch import Waveshare37inch
  222.  #Also, add the following into the elif block of the code:
  223.  elif config['ui']['display']['type'] == 'waveshare37inch':
  224.     return Waveshare37inch(config)
  225.    
  226.  sudo systemctl restart pwnagotchi.service #to initialize new waveshare 3.7 display.
  227.     # Troubleshooting: If the screen does not come on:
  228.     # Just SSH into your pwnagotchi via USB and check your work from the beginning of step 7.
  229.     # I typically add the waveshare37 code snippets right between the sections for "waveshare27" and
  230.     # "waveshare29" in their respective sections within each script being modified.
  231.  
  232. Step 8) Install & Configure Wireless adapter
  233.  lsusb #ensure wifi adapter is plugged in and detected
  234.  iw dev #ensure wlan1 is observed with mon0 under phy#1
  235.  sudo nano /boot/config.txt
  236.    # Find the following line:
  237.      # Additional overlays and parameters are documented /boot/overlays/README
  238.    # Add the following line under it:
  239.      dtoverlay=disable-wifi #disables the onboard wifi, allowing our adapter to operate as wlan0
  240.  
  241.  sudo nano /usr/bin/pwnlib
  242.  #locate and replace the contents of "start_monitor_interface with the following:
  243.    #rename adapter and bring up as mon0 in monitor mode
  244.    ip link set wlan0 down
  245.    ip link set wlan0 name mon0
  246.    iw dev mon0 set type monitor
  247.    ip link set mon0 up
  248.    #add a mon1 interface from the same adapter
  249.    iw phy "$(iw phy | head -1 | cut -d" " -f2)" interface add mon1 type monitor
  250.    
  251.  sudo nano /etc/systemd/system/pwngrid-peer.service
  252.   # update the service launch param. Replace "mon0" with "mon1"
  253.   # Everything else continues to use mon0, bettercap accepts it and works fine. Pwngrid works fine on the mon1 interface.
  254.  
  255.  sudo reboot #allow all changes to take affect.
  256.  
  257. Step 9) Install custom plugins
  258.  #Consider this step OPTIONAL, unless you would like these custom plugins. Otherwise, proceed to Step 10.
  259.  cd ~
  260.  sudo mkdir /usr/local/share/pwnagotchi/custom-plugins/
  261.       #make custom-plugins directory defined in config.toml, if not done so already.
  262.  
  263.  Step 9.1) aircrackonly plugin
  264.   sudo pwnagotchi plugins install aircrackonly
  265.   sudo nano /etc/pwnagotchi/config.toml
  266.        # add the following lines to config.toml:
  267.          main.plugins.aircrackonly.enabled = true
  268.          main.plugins.aircrackonly.face = "(>.<)"
  269.        
  270.  Step 9.2) Exp plugin #Generates an "experiance" level and progress bar for your pwnagotchi.
  271.   #Copy exp.py from git: https://github.com/GaelicThunder/Experience-Plugin-Pwnagotchi
  272.   sudo nano /usr/local/share/pwnagotchi/custom-plugins/exp.py #paste contents of exp.py from github to exp.py on your pwnagotchi.
  273.   sudo nano /etc/pwnagotchi/config.toml
  274.   #add the following to your config.toml. Please note that the positions have been adjusted to accomodate the waveshare 3.7 display.
  275.     main.plugins.exp.enabled = true
  276.     main.plugins.exp.lvl_x_coord = 0
  277.     main.plugins.exp.lvl_y_coord = 210
  278.     main.plugins.exp.exp_x_coord = 0
  279.     main.plugins.exp.exp_y_coord = 228
  280.  
  281.  Step 9.3) Age plugin #Generates the pwnagotchi's "age" and "strength".
  282.   #Copy exp.py from git: https://github.com/hannadiamond/pwnagotchi-plugins/blob/main/plugins/age.py
  283.   sudo nano /usr/local/share/pwnagotchi/custom-plugins/age.py #paste contents of exp.py from github to exp.py on your pwnagotchi.
  284.   sudo nano /etc/pwnagotchi/config.toml
  285.   #add the following to your config.toml. Please note that the positions have been adjusted to accomodate the waveshare 3.7 display.
  286.     main.plugins.age.enabled = true
  287.     main.plugins.age.age_x_coord = 0
  288.     main.plugins.age.age_y_coord = 56
  289.     main.plugins.age.str_x_coord = 125
  290.     main.plugins.age.str_y_coord = 56
  291.    
  292.  Step 9.4) GPS plugin #Uses the Ublox-7 USB GPS dongle to capture the GPS coordinates for a collected handshake.
  293.     #NOTE: Many people believe the GPS plugin should always communicate the current GPS coordinates. This is not true. the GPS coordinates will only update on the display when a handshake has been obtained.
  294.     #Troubleshooting: If the GPS dongle does not appear to be functioning, it is likely that the device is unable to capture a location (or has yet to capture a handshake. Try changing your physical location (i.e. go outside, walk around the house, down the street, etc).
  295.   lsusb #confirm the gps dongle is detected as plugged in.
  296.   sudo pwnagotchi plugins install gps
  297.   sudo nano /etc/pwnagotchi/config.toml
  298.   #add the following to your config.toml. Please note that the positions have been adjusted to accomodate the waveshare 3.7 display.
  299.     main.plugins.gps.enabled = true
  300.     main.plugins.gps.speed = 19200
  301.     main.plugins.gps.device = "/dev/ttyACM0" #gps dongle location
  302.     main.plugins.gps.position = "225,194" #adjusted to support waveshare 3.7
  303.     main.plugins.gps.linespacing = 18 #adjusted to support waveshare 3.7
  304.    
  305.  Step 9.5) PiSugar Plugin
  306.   #Ensure PiSugar Power Manager is installed:
  307.   curl http://cdn.pisugar.com/release/Pisugar-power-manager.sh | sudo bash
  308.   cd /usr/local/share/pwnagotchi/custom-plugins/
  309.   sudo nano pisugar2.py
  310.   #locate and modify the following contents of 'def on_ui_setup':
  311.         def on_ui_setup(self, ui):
  312.         ui.add_element(
  313.             "bat",
  314.             LabeledValue(
  315.                 color=BLACK,
  316.                 label="BAT",
  317.                 value="0%",
  318.                 position=(ui.width() / 2 + 30, 0),
  319.                 label_font=fonts.Bold,
  320.                 text_font=fonts.Medium,
  321.             ),
  322.         )
  323.  
  324.  Step 9.6) memtemp Plugin
  325.   sudo pwnagotchi plugins install memtemp
  326.   sudo nano /etc/pwnagotchi/config.toml
  327.   #add the following to your config.toml. Please note that the positions have been adjusted to accomodate the waveshare 3.7 display.
  328.     main.plugins.memtemp.enabled = true
  329.     main.plugins.memtemp.scale = "celsius"
  330.     main.plugins.memtemp.orientation = "vertical" #adjusted for preference on waveshare 3.7
  331.     main.plugins.memtemp.position = "382,194" #adjusted to support waveshare 3.7
  332.     main.plugins.memtemp.linespacing = 18 #adjusted to support waveshare 3.7
  333.    
  334.  Step 9.7) customize bt-tether display position #to accomodate waveshare 3.7
  335.   cd /usr/local/lib/python3.7/dist-packages/pwnagotchi/plugins/default
  336.   sudo nano bt-tether.py
  337.   #locate and modify the following under 'def pn_ui_setup':
  338.     def on_ui_setup(self, ui):
  339.         with ui._lock:
  340.             ui.add_element('bluetooth', LabeledValue(color=BLACK, label='BT', value='-', position=(ui.width() / 2 - 28$
  341.                            label_font=fonts.Bold, text_font=fonts.Medium))
  342.    
  343.   sudo systemctl restart pwnagotchi.service #reload pwnagotchi with new plugins
  344.  
  345. Step 10) Update everything. #OPTIONAL. I'm just obsessive about updating everything...
  346.  sudo pwnagotchi plugins update
  347.  sudo pwnagotchi plugins upgrade
  348.  sudo apt-get update --allow-releaseinfo-change
  349.       #Troubleshooting: Some repos for "re4son-kernel.com/re4son kali-pi" might present an error resembling the following: "The following signatures were invalid: EXPKEYSIG 11764EE8AC24832F Carsten Boeving <[email protected]>"
  350.       wget -O - https://re4son-kernel.com/keys/http/archive-key.asc | sudo apt-key add -
  351.  
  352.  sudo apt-get upgrade #This will take a while (~45 minutes). Be patient.
  353.       #Troubleshooting: You might encounter an error that looks similar to:
  354.       # Errors were encountered while processing:
  355.       #  /var/cache/apt/archives/kalipi-kernel_5.4.83-20211204_armhf.deb
  356.       # E: Sub-process /usr/bin/dpkg returned an error code (1)
  357.          sudo mv /boot/overlays/ overlaysbackup #rename the existing overlays in /boot/. The renamed overlays can be safely deleted later
  358.          sudo apt-get upgrade #attempt upgrade again.
  359.  
  360.  
  361. Step 11) Change all the default passwords
  362.  # Change "pi" password. Default "raspberry"
  363.  psswd
  364.  
  365.  # Change "root" password:
  366.  sudo su
  367.  psswd
  368.  
  369.  # Change pwnagotchi Web UI password. Default "changeme"
  370.  sudo nano /etc/pwnagotchi/config.toml
  371.   # locate and update the values for:
  372.     ui.web.username = "changeme"
  373.     ui.web.password = "changeme"
  374.  
  375.  # Update bettercap password. Default "pwnagotchi"
  376.  sudo nano /etc/pwnagotchi/config.toml
  377.   # locate and update the values for:
  378.     bettercap.username = "pwnagotchi"
  379.     bettercap.password = "pwnagotchi"
  380.   sudo nano /usr/local/share/bettercap/caplets/pwnagotchi-auto.cap
  381.     #modify the bettercap username & password to match config.toml
  382.   sudo nano /usr/local/share/bettercap/caplets/pwnagotchi-manual.cap
  383.     #modify the bettercap username & password to match config.toml
  384.  
  385.  sudo systemctl restart pwnagotchi.service #reload pwnagotchi for config changes to apply.
  386.    
  387. Step 12) Back up all your hard work!
  388.  Download the Backup script from Github.
  389.  # Link: https://github.com/evilsocket/pwnagotchi/blob/master/scripts/backup.sh
  390.  
  391.  Append the "FILES_TO_BACKUP" section of the backup script to include the following additional files that have been added or modified as a result of this guide:
  392.  
  393.   /usr/bin/pwnlib \
  394.   /etc/systemd/system/pwngrid-peer.service \
  395.   /usr/local/share/pwnagotchi/custom-plugins/ \
  396.   /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v37inch/ \
  397.   /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/waveshare37inch.py \
  398.   /usr/local/lib/python3.7/dist-packages/pwnagotchi/utils.py \
  399.   /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/display.py \
  400.   /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/components.py \
  401.   /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/__init__.py
  402.  
  403.      # Note: The last entry in the list must include an end quotation mark. Be sure to relocate this to the end of the list before saving.
  404.  
  405.   sudo chmod +x backup.sh # make backup.sh executable
  406.   sudo ./backup.sh
  407.  
  408. #### Enjoy your new Pwnagotchi, and please support the Pwnagotchi community on Reddit and Discord! ####
  409.  
  410. Step 13) [OPTIONAL] Accessing your handshakes
  411. #### Additional Optional step, curtosy of /u/Capt_Panic on Reddit and Discord ####
  412.     #Reference: https://www.reddit.com/r/pwnagotchi/comments/ubnlde/comment/i6gg8sj/?utm_source=share&utm_medium=web2x&context=3
  413.    
  414. #create file to access handshakes
  415.  sudo nano cph.sh
  416.  #insert these lines into the file
  417.     \#/bin/bash
  418.  
  419.  cp -r /root/handshakes/\* /home/pi/handshakes/
  420.  
  421.  chown pi:pi /home/pi/handshakes
  422.  
  423.  chown pi:pi /home/pi/handshakes/\*
  424.  sudo chmod +x cph.sh
  425.     #To run file, execute 'sudo cph.sh'. This will copy your handshakes into the /home/pi/handshakes directory
  426.  
  427. Step 14) [OPTIONAL] May be required if you are having troubles with bluetooth
  428. #### Additional Optional step, curtosy of /u/Capt_Panic on Reddit and Discord ####
  429.     #Reference: https://www.reddit.com/r/pwnagotchi/comments/ubnlde/comment/i6gg8sj/?utm_source=share&utm_medium=web2x&context=3
  430.  
  431.  # We need to add something into our profile which is in our root directory, hidden.
  432.  sudo su
  433.  cd /root
  434.  sudo nano ~/.profile
  435.  #add the following at the bottom of the file.
  436.  \# attempt to restart bluetooth
  437.  
  438.  sudo systemctl restart bluetooth
  439.  #save using crtl + x and then hit enter.
  440.  #Comment out an if-else-statement.
  441.  sudo nano /usr/bin/btuart
  442.  #At the first if-else-statement you see, comment it out like you you see below.
  443.  \#if grep -q "raspberrypi,4" /proc/device-tree/compatible; then
  444.  
  445.  BDADDR=
  446.  
  447.  \#else
  448.  
  449.  SERIAL='cat /proc/device-tree/serial-number | cut -c9-'
  450.  
  451.  B1='echo $SERIAL | cut -c3-4'
  452.  
  453.  B2='echo $SERIAL | cut -c5-6'
  454.  
  455.  B3='echo $SERIAL | cut -c7-8'
  456.  
  457.  BDADDR='printf b8:27:eb:%02x:%02x:%02x $((0x$B1 \^ 0xaa)) $((0x$B2 \^ 0xaa)) $((0x$B3 \^ 0xaa))'
  458.  
  459.  \#fi
  460.  #save it using crtl + x and then hit enter.
  461.  sudo reboot
Tags: pwnagotchi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement