-
Notifications
You must be signed in to change notification settings - Fork 22
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
Rooted version FW 5.0.5 by hw programmer - sdcard option in progress ( was finding correct firmware version (Bricked device) ) #62
Comments
@Ierlandfan you can use binwalk and extract ppsapp -- in the ppsapp file there's the version information. In linux I usually do this command to pull up the date/model information used to display the firmware version: If you post your firmware file or ppsapp I can tell you the version. |
I am still not sure whether the ppsapp on the device is the same as original but let's say it is. ppsapp version is md5: 50ad9c96c65c0e446d8b3d5c8c828957 The device does something. Without a card a red light. Without a card and holding the reset button just a red light. With card and holding the reset button the light blinks blue for a brief moment and goes to red. Attached you will find it. |
Your firmware is this one: LSC Smart Connect Smart Doorbell
ppsapp-rtsp.zip please use this HOW TO PATCH GUIDE If your device is responding to the reset button during boot you should try restoring it as described in the TROUBLESHOOTING / RESTORE section here: #2 If the restore doesn't work, then something has gone bad with the device (as that basically restores factory boot loader settings). I have seen one user reporting that the built-in flash chip went bad (confirmed by hardware programmer reading the flash) -- when that happens just part of the flash chip goes bad (not the whole thing) but since everything is needed the device won't work anymore unless you replaced the chip and had an original flash dump to restore it. Unfortunately the only way to confirm it is if you can get a flash dump -- you may be able to do it using #11 -- definitely worth a try. |
Here's the firmware dump (Using programmer) |
@Ierlandfan do you have access to UART ? The firmware seems ok but I did see some differences compared to my (2.9.6 but different brand). It looks like at some point you used #2 which would require the files from #2 in the SD card during boot for the device to boot at all. Did you try the restore process and it did not work ? |
@guino The restore worked! It's back online! I never saw that part in #2. Great Job! A camera with Onvif back. |
@Ierlandfan that's awesome you got it working again! This is first version 5.x that I see that seems to have linux running -- did you try #11 and/or any URLs to see if they work (including with ppsfactorytool.txt) ? |
@Ierlandfan looks like this 505 firmware should have onvif support like the 4.0.x versions do (with tuya_config.json to enable it and set the password). It would be just a matter of finding the right address to load the hack into uboot which seems a little different on this one. Based on the kernel you could try applying: https://github.com/guino/Merkury1080P#conclusionusing the address 0x20008000 in env and ppsMmcTool.txt file (replacing the 0x81C08000 addresses -- one on each file) -- if it doesn't work it should not hurt the device either (plus you have a backup of the firmware). The thing to notice about this firmware is that I was unable to quickly locate any code that would allow snap/mjpeg.cgi and/or play.cgi to work. |
@Ierlandfan ppsFactoryTool.txt should work on 5.0.5 as well -- the URLs need to be requested under port 8090 like http://admin:056565099@IP:8090/proc/cmdline |
ppsFactoryTool.txt works indeed. It opens port 8090. Sifting through the extracted firmware I saw in /etc/init.d/S90app:
So that would suggest (No # ) that the hack will not work default I guess. |
@Ierlandfan were you able to get a /proc/cmdline after opening port 8090 ? From looking at the code it seems like when ppsFactoryTool.txt is present it will open port 8090 but it may not work 'normally' (connecting to cloud and starting services, etc), but we just need information to do the hack then ppsFactoryTool.txt can be removed. The main thing is finding which address the boot loader uses to load the kernel (so we can apply new boot loader settings) like I posted here: #62 (comment), the second thing is making sure the scripts are set to work with the right firmware layout -- in this case it looks like line 6 of initrun.sh (from Merkury1080P repository: https://github.com/guino/Merkury1080P/tree/main/mmc) should have this: It usually is easier to find the boot address using UART but I don't know if that's an option for you, but it does seem like this device can be rooted with the right changes in the firmware at least. |
ppsFactoryTool worked: http://192.168.1.66:8090/proc/cmdline:
|
@Ierlandfan if you want to just root this device and be done with it, my suggestion (since you have a hardware programmer) is to do what I did originally on my doorbell which was to modify initrun.sh and rebuild the cramfs partition:
Obviously the values would have to be adjusted for your firmware. If you'd like to help others with similar firmware then we really need to find the load address for your firmware so we can create the env+ppsMmcTool.txt files that work on 5.0.5. I'm willing to help either way it's just a question of how much time/effort you're willing to spend on it. |
I want to give back tot the community as always and I love the challenge. So if we can root this one and find more info for 5.0.5 or 5.0.6 maybe that would be awesome. Time and effort are no problem. I will try your suggestions tomorrow since I am little distracted by some Dutch winner!
Outlook voor Android<https://aka.ms/AAb9ysg> downloaden
…________________________________
From: Wagner ***@***.***>
Sent: Sunday, December 12, 2021 6:14:46 PM
To: guino/BazzDoorbell ***@***.***>
Cc: Ierlandfan ***@***.***>; Mention ***@***.***>
Subject: Re: [guino/BazzDoorbell] Finding correct firmware version (Bricked device) (Issue #62)
@Ierlandfan<https://github.com/Ierlandfan> if you want to just root this device and be done with it, my suggestion (since you have a hardware programmer) is to do what I did originally on my doorbell which was to modify initrun.sh and rebuild the cramfs partition:
mkfs.cramfs -b 4096 -e 1 -N little -n ppsapp mycramfs-root/ my.cramfs
cp bazz.bin mybazz.bin
dd conv=notrunc if=my.cramfs of=mybazz.bin bs=1 seek=3604480
Obviously the values would have to be adjusted for your firmware.
If you'd like to help others with similar firmware then we really need to find the load address for your firmware so we can create the env+ppsMmcTool.txt files that work on 5.0.5.
I'm willing to help either way it's just a question of how much time/effort you're willing to spend on it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#62 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABWNEDJSC7PBGH7CTSEDEPLUQTKANANCNFSM5JQWVBKQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Can you elaborate on the command a little more just to make sure I replaced the right data. mkfs.cramfs -b 4096 -e 1 -N little -n ppsapp |
@Ierlandfan I would not patch ppsapp in the firmware, the only change I would make is in initrun.sh to run a script from the sd card (just like I did in https://github.com/guino/BazzDoorbell/blob/master/initrun.sh. With the cramfs command you want to use the values which will produce the same format/name/output as in the original cramfs/firmware. the cp command is just to copy the firmware file as a new file that will be modified. the dd command will apply the new cramfs to the Firmware file you created. the binwalk outout of the new/modified firmware should be the same as the original one. |
Now I see, it's not 1 command. It's three! Now it makes sense! Poort 23 (Telnet) is open but telnet says connection denied, have to work on that but...) For reference: Binwalk camera-5.0.5.bin, attached somewhere here above
Strip cramfs from binary: cd cramfs-root/ We need to change initrun.sh in the cramfs-root to reflect the 5.0.5 modified init
Step 2: Repack:
Edir:minor clarification on the seek address. |
@Ierlandfan that is basically it -- if you're getting connection issues with telnet you may need to try a different busybox version (assuming you're using -l /bin/sh in the command that runs telnet) -- another possible explanation would be a missing |
I installed ssh as a workaround.. the device is not stable when started with the ppsapp on the card and using output.log, I have ssh ssh myselfedfinedname@ip /bin/sh) working (for maybe a minute or two every time) but that's for later. I used the custom. sh as a intermediate way for searching and testing. Wil try another busybox later. Any pointers of finding the bootloader address by telnet or ssh.? |
Another thing is my tuya config reads 110 instead of 1...looking into that as well.. it was 0 so I guess it adds a 1 in front of the 0 or so.. |
@Ierlandfan only way to know for sure the bootloader address is by uart or decompiling uboot (which requires knowing/guessing the uboot load address). In tuya_config most things that are not 0 are 'enabled' with any non-zero value, but some things can have multiple meanings like sd_recording: 0=disabled, 1=continuous 2=motion only. As long as it works it should not matter. If the device is rebooting after 1-2 minutes it usually means the watchdog isn't being fed -- usually this happens if you kill ppsapp and don't run another instance of it. I have also had reports of 4.0.x versions rebooting and doing weird things if the ppsFactoryTool.txt file exists in the SD card so you probably should remove/rename that to be sure. |
@Ierlandfan I also saw something on S60ppsapp suggesting that a boot parameter 'noapp' will not run ppsapp and instead runs |
bootcmd=sf probe 0; sf read 0x21000000 0x50000 0x280000; bootm 0x21000000 |
@Ierlandfan that 0x21000000 may or may not be the address where they load ppsMmcTool.txt -- an easy way to check is to try #11 using 21000000 as the address. I would tell you tot try https://github.com/guino/Merkury1080P#conclusion replacing the 0x81C08000 address in the 2 files for 0x21000000, that said: I don't see the file: /etc/init.d/S80network in the firmware and that is the file that allows the root exploit to work, so I don't think this would work for your firmware (it may still set the /proc/cmdline which we may be able to use in a different way). |
The 0x21000000 adress didn't worked out. I changed the adress manually by invoking fw_setenv from inside custom.sh BTW: Original U-boot env: baudrate=115200 |
@Ierlandfan I didn't notice your firmware had fw_setenv (older firmware doesn't have such tool). Based on your cmdline: I would try something like: To see if you get the device to boot with no ppsapp running (and hopefully likely no timeout from whatchdog). There's no point in trying the hack from Mercury1080P because the S80network script is not in the firmware, but if the above works we can try to find some other script to inject a command/script to run from the SD card. |
@Ierlandfan if you connect the serial console you should also be able to check uboot commands -- there's usually a 2 second prompt where you can press a key to stop booting and get into u-boot -- if you do get that let me know and I can give a few things to try. |
@arey11 One user with ppstrong-a3-tuya2_lsc-5.2.4.20211015 was able to root and enable onvif normally on the device (similar to 4.0.6). But most of the 5.0.x firmware we have seen doesn't run linux so can't be rooted. |
Hi no news about 5.0.5 ? |
Nope, 5.0.5 have onvif option included, it resolves two rtsp streams. Motion detection can be done with ha over tuya integration. Doorbell action can be catched via sonof rf 433 bridge with portish firmware. I had to return my doorbell due to poor wifi coverage outside my metal front door, so no more investigation on my side. |
I find UART if I can help `ààà�ü HW Reset BIST0_0001-OK MXP found at 0x00020000 offset:00010000 Checksum OK IPL_CUST g1554082 offset:00030000 XZ decomp_size=0x00043cc4 U-Boot 2015.01 (Oct 24 2020 - 11:52:58) Version: I6g237bd97 In: serial Booting kernel from Legacy Image at 21000000 …Image Name: MVX4##I6B0g2cc79a0e3KL_LX409##[B Starting kernel …` |
Just want to know when someone push button thanks |
@fennec622 your device should be rootable since the serial log shows it runs linux - most likely using the Merkury 1080p repository files. Send me an email (see my github profile) and I can give you some pointers for the serial port. |
Thanks i send email |
If you just want see if it rings try rf bridge, LSC version of camera is implemented with 433 antena to communicate with chime. You can easly catch this transmision with rf433 reciver. It is static code transmision. |
Yes thanks I see that but I prefer search to hack I try to apply |
@fennec622 from the information you provided by email (/proc/cmdline):
I was wrong -- this device is not running linux, it runs RTOS and they likely were just using the linux boot loader (That's why we see 'linux' displayed in the serial log. The only existing way to catch the button push on this device will be using the RF 433Mhz signal as pointed by arey11. |
Bad news ... Do you think can test flash firmware Linux I have hot gun Just programmer do you have link ? Amazon ? |
@fennec622 I do not have any compatible firmware for your hardware (BELL5S_S1_V10) -- if you open it up and check the hardware (chip/sensor/etc) you may be able to load openipc firmware on it with a programmer but I will give you a few wanings: |
@guino I see you develop plugin to Domoticz, I use Domoticz Do you think possible to have push button on Domoticz with Tuya web ? I have RF 433 but it's too far from doorbell |
ok i install In debug mode I can see log when I push button on doorbell TuyaOpenMQ onMessage: topic = cloud/token/in/bb9d0c73ba60ad62f427053cd8, message = {"data":{"bizCode":"event_notify","bizData":{"devId":"","edata":"","etype":"ac_doorbell"},"devId":"","productKey":"wkyfpsgtzkrjmsgr","ts":1645704345441,"uuid":""},"protocol":20,"pv":"2.0","sign":"","t":1645704345441} So I try to modify plugin to active virtual button when I see this log |
Ok i find way to have MQTT push when button push first create account on After create Cloud Project On your project add devices Link Tuya App Use data center from your region You must App Account with 1 device After note Authorization Key Access ID/Client ID and Access Secret/Client Secret now install https://github.com/jasonacox/tinytuya and start python -m tinytuya wizard With that you can have key for your device id [ Now install setup config.json for mqtt setting and start DEBUG=tuya-mqtt:* ./tuya-mqtt.js And after each button push you can see message like that tuya-mqtt:state MQTT DPS JSON: tuya/visiophone_wifi/dps/state -> {"244":"0"} +67ms {"244":"0"} is when button push |
@fennec622 looks like you found a viable way to get the button push notifications using the tuya cloud API -- I was unaware they had any kind of mqtt public api available. If you're running this stuff in linux/mac you should be able to something like this on a script (untested):
Basically it will loop forever monitoring the logfile until the match is found (button push) then it will execute the command and resume monitoring the log file. This would be an example command to notify home assistant (parameters must be adjusted and mosquitto_pub client must be installed): You should probably check that the 'motion' alert generates a different event or e may get confused with the doorbell push event (and/or you could have another similar script to monitor/notify of motion events). |
For anyone running 5.0.5 -- I would like you to try and reach URL: http://admin:056565099@ip:8090/download/iperf3 (you'll probably need ppsFactoryTool.txt -- I see in the ppsapp obtained with a programmer if it shows a page allowing you to upload a file. If that works there's a potential change that we can upload a script to be executed (and hopefully enable telnet) so we can configure the device (i.e.e tuya_config.json) and get more information. |
@guino Yes it's work |
@fennec622 I'll try to put together a package you can try to upload to see if we can enable telnet that way. I have to review the code and do some testing. |
@guino thanks a lot |
if i were to totally hypothetically attempt rooting my feit electric doorbell and managed to not get a good dump of the flash before stupidly overwriting it, how screwed am i? would flashing firmware from a merkury720 have any chance of working? or does someone happen to have firmware from a more similar device? it was running 4.0.10, can get any more info if needed |
@tvall43 for it to have any chance of working it would have to at least match the hardware string. Even then one of the two devices (firmware source or your device) would have to be used offline as they’ll have the same keys and won’t work online at the same time. If your device is compatible with one of the openipc firmware it would work as a camera with it (not as doorbell) unless you made some sort of custom notification system for it (which should be possible). You could potentially buy another one to copy the flash from it and use one of them offline. Full firmware dumps are hard to come by, I only have the ones from my devices and maybe one other that’s been posted for review, but none are 4.x version. |
Wow, I haven't checked this repository for some time, but this looks promising. I still have a V5.05 device somewhere in my desk drawer. Maybe there's some vulnerability in this upload form we could abuse. Did anyone ever dig deeper into this? |
@jilleb I started to look into it but without the device to try it is going to be very difficult for me. I checked a few paths and extraction locations to see if I could overwrite something but didn't immediately find anything. |
Hi @Ierlandfan and @guino
212D0000 = the read address 21000000 (fixed address where flash.bin is loaded) + 2D0000 (the offset of cramfs inside flash.bin)
Here is the binwalk of the flash.bin dumped with the mmc uboot commands:
Here is the serial output of the writing proccess.This also shows that ppsMmcToo.txt is loaded at 0x21000000: Click me
Here is the normal (no reset pressed) serial outputClick me
The Problem:Problem is now the doorbell does not seem to start the ppsapp (no audio feedback, no wifi connection, only red led stais on). It reaches Any idea where I could've messed up? Thank you all!!! |
@ihrapsa I sent you some information in reply to your email. Chances are something went wrong with either reading or writing the firmware data. The 60s reboot is the watchdog doing its job, since ppsapp isn't starting nothing is feeding it, so it reboots. There's a watchdog feeder in the offline cloud #4 (comment) that can be used but that's only helpful if you're running a shell. |
Hi, I've been reading through the u-boot docs and managed to flash the modified Load address for firmware 5.2.2 and 5.2.8 (the only ones I've tested) is indeed 21000000 even if binwalk and serial log sais These are the contents of the
|
@ihrapsa That's one way to do it. The ppsMmcTool.txt option is meant to be used with a 'formatted' upgrade file that the device understands and flashes automatically. |
Just dropped you an email. |
I have a semi-bricked Camera, I think it was on 2.9.6 but I am not sure. I attached the programmer and read the firmware correctly.
Device is not booting (Red light) and nothing gets written to the card. This was using the old bootcommand.
How or where do I find the right firmware version in the firmware?
The text was updated successfully, but these errors were encountered: