sedrubal / brother_printer_fwupd

Script to update the firmware of some Brother printers
https://pypi.org/project/brother_printer_fwupd/
GNU General Public License v3.0
30 stars 5 forks source link

[!] Unknown versioncheck response for firmid=FIRM. #9

Closed thebitmaster closed 9 months ago

thebitmaster commented 2 years ago

I'm getting this bug trying to run on macOS Catalina Version 10.15.7, with brother_printer_fwupd installed with Homebrew and Python 3.9.13

Here's the debug output:

RadioMac:~ thebitmaster$ brother_printer_fwupd -p 192.168.11.162 --debug

[i] Querying printer info via SNMP. [i] Detected MFC-J480DW with following firmware version(s): FIRM@N1901041316:79BC [i] Querying firmware download URL from Brother update API. [d] Sending POST request to https://firmverup.brother.co.jp/kne_bh7_update_nt_ssl/ifax2.asmx/fileUpdate with following content:

FIRM MAC 1 MFC-J480DW 0001 FIRM N1901041316:79BC 1 2 1

[d] Response: <?xml version="1.0" encoding="UTF-8" ?>2 [!] Unknown versioncheck response for firmid=FIRM. [!] There seems to be a bug. [!] Open an issue with the full debug output: https://github.com/sedrubal/brother_printer_fwupd/issues/new [i] Done.

I'm interested in getting this to work because Brother just pushed out a firmware update that disables the ability to use aftermarket printer cartridges, which I had just installed. It seems like there's a way to get access to older firmware using a variation of this script.

sedrubal commented 2 years ago

Your use case is very interesting and we should try to support firmware downgrades. Therefore, we've to find out how we can get the firmware URL from the API and how we have to interpret the API responses. I assume that 2 means up to date, as we've seen this in #8 as well. If there is an update, the API responses contains a URL to download the firmware. We should try to play with the data in the request to find out if we can get other information.

thebitmaster commented 2 years ago

Thanks for the fast response! I agree the next step is to find out more about the API to see if we can get it to produce older firmware. Altering the existing Python script is one way to test, but maybe it would be easier to use some web-based tool for sending those kinds of requests? Another possibility would be to use Wireshark or something to packet sniff the transactions from the firmware updater. I have the one for Mac, but haven't done a lot of work like that before. Getting the actual firmware number of a printer with older firmware would also be really helpful.

sedrubal commented 2 years ago

What would the web-based tool be supposed to do? Sniffing the traffic of the original updater would be very helpful. Unfortunately this might be hard because the traffic is encrypted. Maybe you better use mitm-proxy.

I also thought of crowd-sourcing the requests and kindly ask for the firmware blobs retrieved from the API at the end of the script to upload them to an archive.

nutterthanos commented 2 years ago

yes these brother printers do allow downgrades of firmware i mean i have done it myself

nutterthanos commented 2 years ago

i mean i do have a few firmware files

nutterthanos commented 2 years ago

Thanks for the fast response! I agree the next step is to find out more about the API to see if we can get it to produce older firmware. Altering the existing Python script is one way to test, but maybe it would be easier to use some web-based tool for sending those kinds of requests? Another possibility would be to use Wireshark or something to packet sniff the transactions from the firmware updater. I have the one for Mac, but haven't done a lot of work like that before. Getting the actual firmware number of a printer with older firmware would also be really helpful.

i mean the api is only designed to display the latest firmware available for the printer.

thebitmaster commented 2 years ago

I was just thinking it might be easier to try out different requests to the server if they could be entered by hand into a webform instead of hacking the python source code.

The point about the encryption is a good one. How did you get the protocol in the first place?

Crowdsourcing for data would be super helpful. Even having the previous version numbers would be a big step in the right direction.

On Fri, Jun 10, 2022 at 4:13 PM sedrubal @.***> wrote:

What would the web-based tool supposed to do? Sniffing the traffic of the original updater would be very helpful. Unfortunately this might be hard because the traffic is encrypted. Maybe you better use mitm-proxy https://mitmproxy.org/.

I also thought of crowd-sourcing the requests and kindly ask for the firmware blobs retrieved from the API at the end of the script to upload them to an archive.

— Reply to this email directly, view it on GitHub https://github.com/sedrubal/brother_printer_fwupd/issues/9#issuecomment-1152742694, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARTQM7Z2DMEWLVA37JNX3ULVOOVY5ANCNFSM5YMLO5KA . You are receiving this because you authored the thread.Message ID: @.***>

thebitmaster commented 2 years ago

Might it be possible to get an older firmware file for my MFC-J480DW? I think the ink maker said it needed to be verion G or older.

On Fri, Jun 10, 2022 at 7:03 PM nutterthanos @.***> wrote:

i mean i do have a few firmware files

— Reply to this email directly, view it on GitHub https://github.com/sedrubal/brother_printer_fwupd/issues/9#issuecomment-1152808509, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARTQM74GGLIMK7PW6AGHX2LVOPJVJANCNFSM5YMLO5KA . You are receiving this because you authored the thread.Message ID: @.***>

nutterthanos commented 2 years ago

i mean the update server is missing some older firmware likev those older versions did/do get deleted over time

nutterthanos commented 2 years ago

The point about the encryption is a good one. How did you get the protocol in the first place?

um what protocol are you on about?

thebitmaster commented 2 years ago

I realize that with the specific commands you are currently using, it only gives out the latest firmware for a given printer. What I'm wondering is if there is some other command or loophole that would give access to the older firmwares.

On Mon, Jun 13, 2022 at 7:22 AM nutterthanos @.***> wrote:

i mean the update server is missing some older firmware

— Reply to this email directly, view it on GitHub https://github.com/sedrubal/brother_printer_fwupd/issues/9#issuecomment-1153848050, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARTQM76MBQEFZS55VJ6D43LVO4RZLANCNFSM5YMLO5KA . You are receiving this because you authored the thread.Message ID: @.***>

nutterthanos commented 2 years ago

I realize that with the specific commands you are currently using, it only gives out the latest firmware for a given printer. What I'm wondering is if there is some other command or loophole that would give access to the older firmwares. On Mon, Jun 13, 2022 at 7:22 AM nutterthanos @.> wrote: i mean the update server is missing some older firmware — Reply to this email directly, view it on GitHub <#9 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARTQM76MBQEFZS55VJ6D43LVO4RZLANCNFSM5YMLO5KA . You are receiving this because you authored the thread.Message ID: @.>

i don't believe there is any way and still brother deletes the older firmware from the server anyway

moriel5 commented 1 year ago

I am chiming in here, that the same occurs with my MFC-J4410DW (preupdated to the latest firmware, version M, on Windows).

Interestingly, when I try sending a different firmware ID (by attempting to get a specific firmware version, the current version), brother_printer_fwupd ignores my input, and continues sending "FIRM" as the ID.

This persists no matter what I input, and attempting to add multiple cakes via spaces, has only the first value recognized, but still ignored when it is a valid value.

moriel5 commented 1 year ago

Update: For anyone wanting to take a look without sniffing the network, it appears that Brother's Windows firmware upgrade executables are merely unencrypted archives, with the XML being sent, BrUpdSys.xml, being located inside the "res" folder.

sedrubal commented 1 year ago

As far as I know, the BrUpdSys.xml is not the content of the request that will be sent to the update API. Maybe it is some client software configuration (see <UseCheckBox>).

Interestingly, when I try sending a different firmware ID (by attempting to get a specific firmware version, the current version), brother_printer_fwupd ignores my input, and continues sending "FIRM" as the ID.

Is this a bug in brother_printer_fwupd? If yes, feel free to open a new issue and paste the full debug output (--debug).

moriel5 commented 1 year ago

@sedrubal Interesting, it's content made it seem like it was the file, as it contained almost all of the the necessary information within it.

Thanks, I'll make sure to post a new bug report with the debug content next time I get to test the J4410DW here.

sedrubal commented 9 months ago

I'll close this issue as I don't think there is anything we can do...