🌘 硬體駭客入門 (一) - PiFex 設定 - VoidStar Security 部落格
➤ 透過 PiGen 和 PiFex 打造你的硬體滲透測試平臺
https://voidstarsec.com/blog/pifex-pigen
本文介紹如何使用 Raspberry Pi 及 PiFex 工具,建立一個適合硬體反向工程的環境。文章詳細說明瞭使用 PiGen 產生包含必要工具和公用程式的 SD 卡映像檔的步驟,包括修改設定檔以啟用 UART、SPI、I2C 和 USB 乙太網路介面。此外,還涵蓋了PiFex軟體安裝、服務設定(OLED 螢幕、Jupyter Notebook、OpenOCD、網路 Gadget)以及如何透過 USB 連接存取 Raspberry Pi 的方法。最終目標是提供一個方便易用的平臺,用於學習和進行硬體安全研究。
+ 這篇文章對想要入門硬體安全的人來說非常實用,提供了清晰的步驟和連結,讓新手也能輕鬆上手。
+ 很好,作者詳細說明瞭每個設定的用途,讓讀者不僅能跟著做,也能理解背後的
#硬體安全 #滲透測試 #PiFex #Raspberry Pi
Brushing Up on Hardware Hacking Part 1 - PiFex Configuration

With this post we provide an introduction to a three part series on hardware hacking and how to use a Raspberry Pi as a hardware hacking multitool. This post covers how to configure the Raspberry Pi and describes the first target that we will be using for the series

VoidStar Security Blog
I just installed an integrated wireless hacking platform called #WHAD (https://github.com/whad-team/whad-client) which was very easy. Here is is running with 4 different radios (besides the one in the RPi): Ubertooth, Yardstick One, CrazyRadio PA, and Makerdiary nRF52840-MDK dongle. Who says the #PiFex is just for hardware hacking?
GitHub - whad-team/whad-client: Wireless Hacking Devices Protocol client

Wireless Hacking Devices Protocol client. Contribute to whad-team/whad-client development by creating an account on GitHub.

GitHub

When @wrongbaud gets the discord server and provides the images for the #PiFex, I can provide more detailed documentation. But the key parts are in /boot/firmware/config.txt where you need to add
dtoverlay=i2c-gpio,bus=4,i2c_gpio_sda=22,i2c_gpio_scl=23
I used the https://luma-oled.readthedocs.io/en/latest/ drivers.
----------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time-stamp: <2024-06-05 20:52:59 pi>
# Author: grymoire
# Usage: display <arg> .......
# Revisions
# * Added text wrapping

# I'm sure this could be made more efficient/elegant, but it works

"""
Write text to ssd1306 display on PiFex - Grymoire
"""

import time
from luma.core.interface.serial import i2c
from luma.oled.device import ssd1306
from luma.core.render import canvas
from luma.core.virtual import viewport
import sys # for shell arguments
import textwrap # for text wrapping

def do_nothing(obj): # define a custom routine to do nothing on exit instead of clearing the screen (the default)
pass

def main():

virtual = viewport(device, width=device.width, height=device.height)
args=' '.join(sys.argv[1:]) # collect all of the shell arguments
data=textwrap.wrap(args,width=20);
# Hmm. I'm not sure how many lines we now have....

with canvas(virtual) as draw:
if ((len(data) > 0) and len(data[0]) > 0):
draw.text((0, 0), data[0], fill="white")
if (len(data) > 1 and len(data[1]) > 0):
draw.text((0, 12), data[1], fill="white")
if (len(data) > 2 and len(data[2]) > 0):
draw.text((0, 24), data[2], fill="white")
if (len(data) > 3 and len(data[3]) > 0):
draw.text((0, 36), data[3], fill="white")

if __name__ == "__main__":
try:
serial = i2c(port=4, address=0x3c)
device = ssd1306(serial)
device.cleanup = do_nothing # exit without clearing the display
main()
except KeyboardInterrupt:
pass

Luma.OLED: Display drivers for SSD1306 / SSD1309 / SSD1322 / SSD1325 / SSD1327 / SSD1331 / SSD1351 / SSD1362 / SH1106 / SH1107 — Luma.OLED: Display drivers for SSD1306, SSD1309, SSD1322, SSD1362, SSD1322_NHD, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, WS0010, WINSTAR_WEH 3.13.0 documentation

I've written a python program that lets me send shell script results to my 128x64 OLED display on my #PiFex w/Autowrap: e.g.
display.py IP: $(IP), uptime: $(uptime)
Hey @wrongbaud! I'm testing my #PiFex display using some luma examples
#PiFex has arrived! Thanks @voidstarsec