Hello, I would like to consult you about some questions. It is the first time for me to use phywhisperer and I want to perform USB sniffing operation. I have downloaded the code from GitHub, installed the driver and connected the device.
WARNING: Root :Your firmware is overdue - latest is 1.1. Suggested to update Firmware, as you may experience errors
You can update the firmware using the program_sam3u() method. For now, youâll need to specify the path to the firmware file (should be phywhisperer/firmware/phywhisperer/phywhisperer-SAM3U1C.bin, but I should be able to push out a quick update that adds in a similar method as the hardware_type for the ChipWhisperer platform.
EDIT: I also want to mention that I believe this is firmware update just adds driver autodetect (so you donât need to go through the driver install), so this update is nothing critical and the warning you get should be safe to ignore.
EDIT 2: Nevermind, seems like this is already implemented. Simply call program_sam3u('COMPORT') and it should program.
Hi,Alex
I implemented the program_SAM3u () function according to your suggestion, but there was still an error. The corresponding serial port device could not be found. The device was connected as follows:
The serial port of phywhisperer could not be found in the device manager of the computer. We could only find the COM port of our target board, so we did not pass the program_SAM3u () function. The error was reported as follows:
You need to open Device Manager and check what com port the bootloader has shown up as and replace "COM5" with that com port.
EDIT: Whoops, missed a part of your post. Iâd recommend disconnecting everything from the phywhisperer except the Control PC USB. Has the firmware been erased (i.e. can you still connect to the PhyWhisperer as usual)? If so, you can connect and run phy.auto_program() if you have the newest update from git.
HiďźAlex
I have finished the firmware update of the phywhisperer equipment according to the method you mentioned, and now the software can run normally without error, and the function of reading data is normală
I have another question to ask, which data is read by the read_capture_data () function. I have not yet communicated with my target board when reading the dataďźCommunicate with the target board before reading dataďź ďźbut this function returns the result, which is in the file below.
I think it should be like this: the computer and the target board establish a connection, and then the computer sends the data. After the target board receives the data, it encrypts the data and returns the encryption result to the computer. In this process, it monitors or sniffs through the phywhisper USB, and analyzes the data or protocol sent or receivedă
Excuse me, is there any problem with the process I understand? Or if I want to do this, can the phywhisper device be implemented?
Best wishes
ShiTou
HiďźAlex
I met some problems in the use of the equipment, I need your helpďźThe test environment I built is as follows:
I set up the interaction with our development board through the serial debugging assistant,
Send plaintext â0123456789 abcdef0123456789abcdefâ,
Receive the ciphertext â363 eff6cde1adea8b244ad2e3c4ebdc8â,
I wanted to capture this data by doing a phywhisperer sniffing operation,The script used is as follows
I analyzed the process, and I thought what I read was the data of the electrical process on the target board, not the data that I wanted to send and receive.
I checked the API manual, tried calling the read_reg () function, and got the results shown below
But it seems that these data are not related to the data sent and received by the target board. I would like to ask whether the data interacting with the target board can be read through the phywhisperer? If so, what Settings are required? If not, are there other ways to get the data and analyze it?
1- I think there is a disconnect between what PhyWhisperer can do and what youâre expecting it do to.
PhyWhisperer has some USB analysis capabilities, but itâs not a USB analyzer, and we make this clear on the PhyWhisperer github page:
Basic USB sniffing capability exists in this tool, as itâs useful when deciding on the effect your glitch is having. If you require a more robust USB analyzer the TotalPhase Beagle 480 comes highly recommended by Colin (no connection - he just really likes them).
PW collects and timestamps the raw USB data thatâs decoded by the USB PHY. If you send a particular string like â0123456789 abcdef0123456789abcdefâ over a USB-to-serial link (Iâm guessing this is what youâre doing), this data is going to be encapsulated in other protocols before it gets transmitted by the USB PHY. We provide an interface to ViewSB to help parse and analyze the raw USB data. How far you can get with this depends on the capabilities of ViewSB, which is an external tool. See here for how to interface with ViewSB.
2- Your calls to phy.read_reg() with an incrementing address are not the correct way to read the captured data. Have a closer look at read_capture_data() in usb.py to see how it should be done (or just use read_capture_data() directly). What your pasted code is doing is reading all of the PWâs register space; thatâs not the way to read the captured data.
HiďźJean-Pierre
I have seen your reply, I downloaded the files in the link, copied them to Linux system environment, used the command âpython3 setup.py installâ to install, used the command "./ viewsb.sh phywhisperer "to run the program, and the error message of the program is as follows:
I searched the web for this problem and saw a response from a user: delete unused arguments from the function. I tried it, but it didnât work very well.
I also tried to run the project in Windows 10 system, but there were some problems when importing the package.
I used Python 3.9, and the error message is as follows:
Iâm unable to replicate the errors that you get.
It had been a few months since I ran ViewSB so I updated to the latest code to see whatâs changed. I found that Python >3.7 is now required due to the new requirement for python-usb-protocol. So I did a fresh install of Lubuntu 20.04.
I pulled and installed the master branch of:
phywhisperer
ViewSB
python-usb-protocol
and everything works for me; the only difference from before is that I need to specify the ViewSB frontend explicitly: viewsb.sh phywhisperer [qt|cli|tui]
I should note that the last time I tried, ViewSB did not work in Windows. I was able to run it in Linux and MacOS.
I hope this helps,
Jean-Pierre
HiďźJean-Pierre
I re-downloaded three parts of the code from Git today, including
phywhisperer
ViewSB
Python - usb protocol.
You used Ubuntu20.04 in your reply. I also downloaded and set up a Linux environment. The re-downloaded content was put into the virtual machine, but the operation process was not very smooth, such as:
No modue named âsetuptoolsâ
No nodule named pip
env:âpipâ : No such file or directory
Iâve looked up various solutions, but none of them worked.
The process of upgrading Ubuntu to Python is not going well either, and I donât know what to do now. I need your help with a little more detail
Hi ShiTou,
You simply need to install the missing packages.
From my command-line history, I see the following:
apt-get install python3-pip
pip3 install construct
pip3 install bitstruct
pip3 install urwid
pip3 install jupyter
pip3 install PySide2 # only needed if you want the Qt GUI in ViewSB
I may have done some additional installs in a different shell, but I think these should cover it.
Otherwise, it should not be too difficult to identify and install any additional missing packages.
To install the phywhisperer, viewsb, and python-usb-protocol tools, I did this: python3 -m pip install -e . --user
This is what you would get if phywhisperer isnât properly installed. Here are a few things to try to make sure that it is:
a) run python3, then import phywhisperer and make sure there is no error
b) make sure that the PhyWhisperer USB device is passed onto the VM (if using VirtualBox: Devices menu, under USB, then select PhyWhisperer-USB.
c) check that you can run our phywhisperer notebooks in Jupyter (it looks like you did this on Windows previously; does it work in your Linux VM)?
d) if that doesnât work, did you follow the Linux-specific installation instructions here?
e) make sure phywhisperer is listed as an available backend when you run viewsb.sh --list-backends
f) the qt frontend wonât work if you donât install pyside2.
HiďźJean-Pierreďź
The phywhisperer has been installed, using âImport phywhispererâ will not report an error. I listed the USB devices on the VM and found the Phywhisperer devices. The information is as follows:
Now I can use the command/ viewsb.sh phywhisperer cli or./ viewsb.sh phywhisperer tui
But the same error is reported with the following error message:
Traceback (most recent call last):
File "/home/shitou/shitou/ViewSB-master(1)/ViewSB-master/viewsb/backends/phywhisperer.py", line 149, in run
self.pw_device.run_capture(size=self.size, burst=self.burst, pattern=self.pattern, mask=self.mask, timeout=self.timeout, halt_callback=halt_callback)
TypeError: run_capture() got an unexpected keyword argument 'timeout'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/shitou/shitou/ViewSB-master(1)/ViewSB-master/viewsb/ipc.py", line 22, in run
multiprocessing.Process.run(self)
File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/shitou/shitou/ViewSB-master(1)/ViewSB-master/viewsb/ipc.py", line 117, in _subordinate_process_entry
task.run()
File "/home/shitou/shitou/ViewSB-master(1)/ViewSB-master/viewsb/backends/phywhisperer.py", line 152, in run
self.pw_device.close()
File "/home/shitou/.local/lib/python3.8/site-packages/phywhisperer/usb.py", line 742, in close
self.commthread.join()
AttributeError: 'Usb' object has no attribute 'commthread'
When I use the command "/ viewsb.sh A box will appear with some information, as follows:
Letâs start by taking ViewSB out of the equations for a moment.
Are you able to successfully run any of our example notebooks in Jupyter, in the Linux VM?
HiďźJean-Pierre
To be honest, I havenât heard of ViewSB before, and the same is true for Jupyter, which is just getting started. Viewsb hasnât run on Jupyter yet.I donât know much about Linux,A lot of things need to be found on the Internet or asked colleagues,So this period of time in the Linux system environment build progress is slow.
So far only the Phywhisperer device has been connected to a Windows system and some data has been captured.