-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
d.RFxmit() throws exception on long bytestrings #93
Comments
I've tried transmitting larger messages and the one that you have included in the post, they seem to be working fine for me (as of commit #601):
I recommend that you fast-forward code in rfcat directory, if you haven't done so already, as there were quite a few updates recently. Also you might want to update your device's boot-loader as well. |
I will try updating everything in the following few days and give feedback. I remember trying once but none of the instructions seemed to work with a fresh kali and python3. |
@Xaxoxuxu are you using kali's version of RfCat? or did you check out from github, or pip install? |
@atlas0fd00m I did pip install |
just pushed updates to pypi. check out the latest version: https://pypi.org/project/rfcat/1.9.4/ $ pip install -U rfcat let me know if that solves your problem, @Xaxoxuxu . hopefully this is easier for you than working with the latest git checkout. i needed to cut a incremental update anyway. |
I am happy to say that it works like a charm now. Since I am a bit inexperienced, I couldn't manage to make a script when installing with pip install, it kept giving me an error that it can't find rflib so that it can import. So I downloaded 1.9.4 from the repo and I put the script there. Now I can replay longer bytestrings. |
glad to hear it's working for you... but i'm confused about the problem. @ |
Thanks for the support and assistance, I will contact you if I cannot manage something further. |
It seems that I was mistaken, long strings no longer throw an error, but instead they are ignored and not transmitted. My config is as follows: And now: Gives me: I am using latest version from pip install - 1.9.4.1 Also, I did not quite understand the contact you left - is it an email? I am once again sorry for anything unclear, doing my best and learning. |
That's odd... I've tried sending message with your settings on my system - it seems to be working (did not check if the data is transmitted correctly though). SDR clearly shows peaks when message is sent with rfcat, indicating that the was a transmission is taking place:
As you mentioned above, 132 is returned (status/error code???). I am not exactly sure where that is returned; my guess would be one of the dependent libraries... Was there any debug/error messages after executing the command? |
@Loumiakas No idea what the return is, I only get a one red line output. It gets shorter by 1 for each symbol I remove from the string... |
My YS1: In [1]: print(d.reprRadioConfig()) == Software == == Frequency Configuration == == Modem Configuration == == Packet Configuration == == AES Crypto Configuration == == Radio Test Signal Configuration == == Radio State == == Client State ==
|
I've noticed that your firmware version is quite old: Here is the steps that I usually perform to do firmware update:
|
@Loumiakas I am getting a ton of python errors due to the version mismatch.. Is there a clean way to perform this with python 3? Do I have to somehow switch to python2? `sudo make installRfCatYS1CCBootloader ==RfCatYS1CCBootloader.hex building== |
Are you invoking this update from cloned repository? If so, you might want to update it |
I had python-is-python3, so I installed python-is-python2 and now when I run the above cmd I get: And also, I am invoking inside 1.9.4.1 source. Isn't that the latest? Edit: Just cloned again, getting same error :ImportError: No module named serial |
It is the latest, and it has no syntax errors for Python3. Your rfcat_bootloader looks outdated; my guess is that it's picking up older version of the script. You might want to make sure that rfcat_bootloader is not coming from older installation that you might have performed earlier... Since you have both Python2 and Python3 installed on your system, |
Ok it seems that I had old rfcat files, I did The issue i get now is: But I have it installed: |
What I did now is ===== RESETUP set from recv thread Something is talking to the RfCat dongle (Modem Manager, most likely). Retrying again after 5 seconds. This can take a minute, please be patient. (error: SerialException(2, "could not open port /dev/RFCAT_BL_YS1: [Errno 2] No such file or directory: '/dev/RFCAT_BL_YS1'")) Something is talking to the RfCat dongle (Modem Manager, most likely). Retrying again after 5 seconds. This can take a minute, please be patient. (error: SerialException(2, "could not open port /dev/RFCAT_BL_YS1: [Errno 2] No such file or directory: '/dev/RFCAT_BL_YS1'")) Something is talking to the RfCat dongle (Modem Manager, most likely). Retrying again after 5 seconds. This can take a minute, please be patient. (error: SerialException(2, "could not open port /dev/RFCAT_BL_YS1: [Errno 2] No such file or directory: '/dev/RFCAT_BL_YS1'")) Something is talking to the RfCat dongle (Modem Manager, most likely). Retrying again after 5 seconds. This can take a minute, please be patient. (error: SerialException(2, "could not open port /dev/RFCAT_BL_YS1: [Errno 2] No such file or directory: '/dev/RFCAT_BL_YS1'")) |
It could be that case where the referenced device might have a different name. I recommend that you try following workaround:
|
Thanks a lot.. it just finished updating. |
You are welcome, glad it worked out for you! In regards to identifying appropriate device, there was a bit of guesswork involved. When you put device into boot loader mode, timestamp of the device will change in /dev directory. When performing I noticed that /dev/ttyACM0 was one of the most recent entries, so I cross checked with udev management tool: Command output indicated that it was indeed YardStick One Bootloader, which was exactly what I needed:
There are probably myriad of easier ways to do this, but this process was the most convenient to me at the time :) |
Thanks again for the info and assistance. Resolved. Closing. |
great job, @Loumiakas . @ |
Currently when I try to execute from the interactive shell (or from a script), d.RFxmit(b'') with a long byte sequence for example:
d.RFxmit(b'\xfe\xbd\x5e\xfb\xb7\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x86\x08\x0f\x1e\x30\x60\xe0\xf9\xf3\x83\xe7\xce\x0f\x9f\x1e\x3e\x70\x78\xf9\xf1\x83\x07\xcf\x8f\x9c\x38\x30\x70\xe0\xc1\xf3\x83\xe7\x07\x8f\x9c\x18\x3e\x70\x7c\xc1\xf1\x83\x07\x07\x80\x00\x00\x00\x00\x00\x1f\xc0\x30\x60\xc1\xf1\x83\x03\xc6\x0c\x1c\x1f\x3e\x7c\x60\xf9\xf1\x83\x07\x07\xcf\x9c\x1f\x3e\x30\x7c\xf8\xf1\xf3\x83\xc7\xcf\x8c\x18\x3e\x7c\x7c\xe1\xc1\x83\x07\x06\x0f\x9c\x1f\x38\x3e\x7c\xe0\xc1\xf3\x83\xe7\x07\xcc\x1c\x18\x3e\x00\x00\x00\x00\x00\x00\xfe\x01\x83\x07\x07\x8c\x18\x3e\x30\x70\xe0\xf9\xf1\xe3\x07\xcf\x8c\x1c\x38\x3e\x7c\x60\xf9\xf1\x83\xe7\xc7\x8f\x9c\x1e\x3e\x7c\x60\xc1\xf3\xe3\xe6\x0e\x0c\x18\x38\x30\x7c\xe0\xf9\xc3\xe3\xc6\x0e\x1f\x18\x3e\x70\x7c\xe0\xc1\x83\xe0\x00\x00\x00\x00\x00\x0f\xe0\x18\x30\x70\x7c\xc1\xc1\xf3\x07\x06\x0f\x9f\x1e\x30\x7c\xf8\xc1\x83\x83\xe7\xce\x0f\x9f\x18\x3e\x7c\x78\xf9\xc1\xf3\xe7\xc6\x0c\x1f\x1e\x3e\x70\x60\xc1\xc1\x83\x07\xce\x0f\x9c\x1f\x3e\x70\x60\xf9\xc1\xf3\x83\xe6\x0e\x0c\x1f\x00\x00\x00\x00\x00\x00\x7f\x00\xc1\x83\x83\xc6\x0c\x1f\x18\x30\x70\x78\xf9\xf1\x83\xe7\xc6\x0c\x1c\x1e\x3e\x70\xf8\xf9\xc3\xe3\xe7\xcf\x8c\x1f\x3e\x3e\x70\xe0\xf9\xf1\xe3\x06\x0e\x0c\x18\x38\x3e\x70\x7c\xe0\xf1\xf3\x83\x07\xce\x0f\x9c\x1e\x30\x60\xe0\xf0\x00\x00\x00\x00\x00\x07\xf8\x0c\x0c\x18\x3e\x70\x60\xf9\xc1\x83\x87\xc7\xcf\x9c\x1f\x3e\x30\x60\xe1\xf1\xf3\x87\xc7\xcc\x1f\x1e\x3e\x7c\x60\xf9\xf1\xf3\x07\x07\x8f\x9f\x18\x30\x70\x60\xc1\xc1\xe3\x07\xce\x0f\x9f\x18\x30\x7c\xe0\xf9\xc1\xf3\x07\x06\x0f\x80\x00\x00\x00\x00\x00\x3f\x80\x60\xc1\x83\xe3\x06\x0f\x8c\x18\x38\x3c\x7c\xf8')
I get the error in the stacktrace, however when I try with a shorter one it transmits fine. This is very important because we cannot replay big transmissions.
When I try to transmit with a short bytestring, it works.
Stacktrace:
Traceback (most recent call last):
File "/home/xaxo/Desktop/rfcat-1.9.2/rf_car_replay.py", line 34, in
d.RFxmit(key_packed) # replay packet to car
File "/home/xaxo/Desktop/rfcat-1.9.2/rflib/chipcon_nic.py", line 1121, in RFxmit
return self.RFxmitLong(data, doencoding=False)
File "/home/xaxo/Desktop/rfcat-1.9.2/rflib/chipcon_nic.py", line 1154, in RFxmitLong
error = struct.unpack("<B", retval[0])[0]
TypeError: a bytes-like object is required, not 'int'
===== RESETUP set from recv thread
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.')
The text was updated successfully, but these errors were encountered: