RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.62k stars 979 forks source link

Offline 'hf 14a sniff' not terminated by new usb connection #2317

Closed McEloff closed 3 months ago

iceman1001 commented 4 months ago

We have a reason for this.

The timing is critical and the extra checks will disrupt the sniffs.

McEloff commented 4 months ago

That is right. But we could not correctly terminate offline sniffing to receive trace log after usb reconnecting. Push button terminates sniffing but device is not communicates with client. OS resets usb connection and device reboots. After this trace log is missing. PS In current code state BUTTON_PRESS() is called every while-cycle, that is timing critical too PPS For example we can move data_available() check outside of main while-loop. In this case interruption will have two phases: at the first we push button to cancel main while-loop. Second while-loop with data_available() check would wait a new usb-connection

iceman1001 commented 4 months ago

I must be missing something.

I set up a pm3 w a blueshark (battery) and installed hf_unisniff. Disconnected the pm3, turn it on with battery, entered standalone mode. Did the sniffinf, clicked the button to exit. Connected the proxmark3 to the client and look at the trace data which was both in the spiffs and tracelog...

iceman1001 commented 3 months ago

I was curious, so I made a video about UNISNIFF. I wanted to try out the not available in ram when reconnecting.

I had no issue what so ever to reconnect and extract the tracelog from ram. I think you are using the mode in the wrong way. I am guessing you don't push the button to exit the mode.

McEloff commented 3 months ago

You're right! These steps work correctly with the pm3 client for desktop. I was also able to receive the trace after exiting sniffer mode by button. Apparently the problem occurs under Android smartphones and pm3, that connects via OTG with own battary. I tests my light android-client supports some pm3-fuctions. I should close merge requst.

McEloff commented 3 months ago

Not actual for generic clients

iceman1001 commented 3 months ago

You closed it. Question is if the issue itself is resolved for you and what steps you needed to do?

I don't think we need a change to the source code but curious on what might have gone wrong in your android setup.

McEloff commented 3 months ago

I will push this source code to my local repository. In this case my android-client is works and I did not saw any sniffing fails. I think, this malfunction is the hardware Android feature for external devices with own battary. When this device connected to multiply-purpose usb port, OS detects an external power supply, then switched to slave device mode for listen.