-
Notifications
You must be signed in to change notification settings - Fork 18
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
Confusion on how to OTA #3
Comments
Hi there! For clarity on the general process of how DNS hijacking is used:
Configuring the DNS spoofing part is very dependent on one's resources and network configuration - so I didn't include that much documentation. For many, its easiest to create an Ad-Hoc hotspot (on your laptop for example) that has a DNS override to catch the resolution of If you use a "smarter" router OS (like Ubiquiti's, pfSense, OpenWRT, OPNSense come to mind), it's not too hard to setup alternative DNS resolutions. I use pfSense for my home router & resolve DNS with the built-in "DNS Forwarder". Generally, this forwards all of my DNS requests directly to a third party DNS service; however it also allows me to make overrides: pfSense also has a DNS resolver that can be used instead that actually handles the DNS resolution manually, which also allows for a similar "Host Override" I'm less familiar with OPNSense, but I believe you can configure the builtin Unbound DNS service with a host override in the GUI - it should be fairly similar to the pfSense screenshot I sent above. The only issue would be if you are currently using third-party DNS resolution (for example, your DHCP config tells clients to use 8.8.8.8 for all DNS queries, instead of your router) -- if that's the case, you'd probably be best using the ad-hoc method I mentioned above If you happen to be using Pi-hole to handle your DNS, you may instead have to adjust the Unbound configuration via the Pi. I'd love to document this better but the extreme breadth of configurations makes it a bit verbose + hard to offer much support for. Additionally, since this is just a proof of concept, I want to be careful to not make the process "too straightforward" to avoid someone accidentally bricking their devices, if that makes sense. Please let me know if this helps & you're able to get your device working! Testing DNS changes is a bit tedious since your computer will cache the results, however, the end goal is that
|
Awesome! So i actually did it with Bluetility on the mac, adding the hex and pressing enter, and that worked! Seemed to work fine: Few things to note:
Thanks for sending me on my way! Maybe i can help you with the onboarding wiki for this as I'm also coming from a lesser-experienced ESP/IoT background. Feel free to close this, unless you plan to add a few more things and then tagging this issue into a wiki. Thanks! |
Closing this now - |
Serving spoofed DNS from index.js and temporary changing DNS IPs to our local computer's IP might be easier than trying to figure out how to spoof DNS for your particular router. See PR: #16 |
Hi i am struggling a bit to get this method working for a Switchbot Bulb. The web server is running and if i try to open www.wohand.com i see in the console logs of the web server that the request is redirected to my machine. So i think the web server part is correct configured. But can it be that the codes to start the upgrade process are different for the light bulb compared to the Plug? |
@smartmatic I don't personally have a Switchbot Bulb to test, but I wouldn't be surprised if the BLE command differed (I believe the first 2 bytes are a device identifier I believe @Cossid has a Switchbot Bulb - could you take a look at this? |
Bulbs come out of the box with 1.2 with an upgrade to 1.4 already available, so I'm not sure anyone has needed to use the Bluetooth method. I'll see if we can probe the firmware for values, but will need some time, on vacation and won't have pc access for a few days. |
Smartmatic joined us on discord and I believe it has been found that they had dns/dhcp issues. Others have stated the byte code for plugs and bulbs is the same, just following up here for reference. |
It seems it does not work anymore. After I tried resetting the plug, sending Edit: |
For folks cutting and pasting on their phones, the codes are:
|
Got a 4-pack of these from Amazon last week as a gift, so I'm keeping them |
Am I'm just interpreting nRF Connect incorrectly? It looks like I'm using a different version (Android 4.26.1) from the one that's screenshotted above. I'm using the included Node server app to intercept requests to www.wohand.com. Requests from my browser to that domain show in the Node app, and my router gives out the same DNS to all clients. |
@cendern FW version v1.4 was tested back in July when it came out on the HomeKit edition plugs; #19 (comment). Also from testimonial here: #38 (comment) The latest version seems to be currently 1.5 (#23). I installed 1.5 on a fresh plug via the standard UI, then used
to install down to version v1.2 (I didn't have switchbota running; so it just fetched the actual v1.2 binaries from wohand). I assume your plugs are connected to a network, right? Switchbota aside, |
Thanks for the reply and I really appreciate all the work you've done to uncover and share all this info!
|
To provide a bit more context:
Locking this thread since it's linked off the README; if you have a related issue please open a separate issue. |
Hey Kendall! Great work on opening a new door with Switchbot and Tasmota!
tl;dr: I was wondering how you 'hijacked' the DNS to do OTA. It wasn't too clear in the guide, but would be helpful for other people coming to this document.
I'm currently trying to figure out how to properly DNS-hijack (or DNS Spoof) to send the file over to the devices. Currently, I'm running OPNSense, which should theoretically allow me to set any device's DNS to point somewhere else. Here's what I had going:
192.168.x.99
Switchbot192.168.x.68
Macbook, running the node server @ port 80192.168.x.13
iPhone, which has the Switchbot app.I set the DNS for both Switchbot and iPhone to use
192.168.x.68
. However, after clicking upgrade, the macbook isn't loading files OTA.I know the server is working if i go on mobile safari/chrome/ff-mobile, hitting
http://192.168.x.68
directly, which allows me to "download" a fie. Furthermore, I know it's sending from the macbook via this console log i've placed in theapp.get('*')
But, the issue is i'm missing the key knowledge piece to allow
www.wohand.com
to actually map to192.168.x.68
here. Per document:Any guidance would be appreciated!
The text was updated successfully, but these errors were encountered: