AlexandrErohin / home-assistant-tplink-router

Home Assistant component for TP-Link router administration with sensors, button reboot, switches and device tracking.
https://community.home-assistant.io/t/custom-component-tp-link-router-integration
MIT License
73 stars 7 forks source link

Router login login no longer supports Web Encrypted Password fix #31

Open tekHudson opened 5 months ago

tekHudson commented 5 months ago

Describe the bug While attempting to setup I received the You need to use web encrypted password instead. Check the documentation! error. I arrived at the repo and scanned the documentation finding the section describing the error and the link to the fix. I went to the fix and began to follow the steps. At my routers login I

there appears to be a rename of the pw element.

Logs Add also all relevant logs from Settings->System->Logs.

Additional Information (please complete the following information)

AlexandrErohin commented 5 months ago

Could you try this command

document.getElementById("pcPassword").value;
tekHudson commented 5 months ago

Yeah, I was doing that, but it didn't execute the encryption against the string. It's just storing it as an input field so the value method returns simply the value attribute, which is just the password itself.

tekHudson commented 5 months ago

There is some JavaScript on the bottom of the page which does have some sort of AES and RSA encryption but I couldn't get it to execute against the password field but I think that's probably what would generate what you're looking for. Happy to do a pairing session or copy paste it here, if that would help.

AlexandrErohin commented 5 months ago

Could you try this steps to get WebEncryptedPassword?

  1. Open the browser and go to the webinterface of you TP-link router and open the developertools(ctrl+shift+i or F12).
  2. In the developertools navigate to the network tab.
  3. Make sure the recoder is enabeld.
  4. Login to your router
  5. There should appear activity in the networking tab.
  6. Scroll up until you find something like "login?form=login" and click it.
  7. Click payload, and copy the string of characters, it should be a long string.
  8. This is the web encrypted password.
tekHudson commented 5 months ago

So there isn't a simple login?form=login on my routers WebApp. Looks like we may have different versions. here is what i found though:

LaurentCole commented 4 months ago

Hi, I have tp-link archer C6 V4.0, firmware 1.13.2 build 230824 I connected to the console, developpertools, network tab but can't find the login in the records.

Can you help please. Thx Laurent

AlexandrErohin commented 4 months ago

@LaurentCole could you record requests following https://github.com/AlexandrErohin/TP-Link-Archer-C6U/blob/main/CONTRIBUTING.md#steps ?

AlexandrErohin commented 4 months ago

@tekHudson @LaurentCole Archer MR200 v5.3 support was added, It has different api, so maybe it is similar with yours. Could you try new version of the integration and let me know

LaurentCole commented 4 months ago

Hi, Updated the integration but still not working

Le 22 févr. 2024 à 12:09, AlexandrErohin @.***> a écrit :

@tekHudson https://github.com/tekHudson @LaurentCole https://github.com/LaurentCole Archer MR200 v5.3 support was added, It has different api, so maybe it is similar with yours. Could you try new version of the integration and let me know

— Reply to this email directly, view it on GitHub https://github.com/AlexandrErohin/home-assistant-tplink-router/issues/31#issuecomment-1959219142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2NEO7EVHHIN74PM66AYOLYU4RPBAVCNFSM6AAAAABDJBL4C2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGIYTSMJUGI. You are receiving this because you were mentioned.

AlexandrErohin commented 4 months ago

@tekHudson Hi. Could you test please the new version of this integration with your TL-WA801N v6 ?

LaurentCole commented 4 months ago

Hi, updated to 1.7.0

my TP-Link : Archer C6 v.4

I need to use encrypted password

Did the « web encrypted password » procedure

Not working Cannot find document.getElementById("login-password").value;

Le 27 févr. 2024 à 08:17, AlexandrErohin @.***> a écrit :

@tekHudson https://github.com/tekHudson Hi. Could you test please the new version of this integration with you TL-WA801N v6 ?

— Reply to this email directly, view it on GitHub https://github.com/AlexandrErohin/home-assistant-tplink-router/issues/31#issuecomment-1965925649, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2NEO7KZQQP7XWYWQ5PVETYVWCB3AVCNFSM6AAAAABDJBL4C2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRVHEZDKNRUHE. You are receiving this because you were mentioned.

plord12 commented 3 months ago

I have the same issue with my Archer C8

Borty97 commented 3 months ago

Me too. The password field does not have any ID associated, so this bypass does not work. Eventhough, it should return the same input: image

Here I added the login-password ID, and looked up for document.getElementById("login-password").value: image

Borty97 commented 3 months ago

I found a tpEncrypt.new.js?t=XXXXXXX file after login. One string 255 characters long found, but it isn't. Nothing seems to be there. Any ideas?

AlexandrErohin commented 3 months ago

@Borty97 What is your router hardware version?

Borty97 commented 3 months ago

@Borty97 What is your router hardware version?

Archer C6 4.0 Firmware 1.13.2 Bulld 230824 Rel. 75032n(4555)

Arun-R-S commented 3 months ago

Hi @AlexandrErohin, I am also facing the same issue. I cannot find the password for the below command. recieving the null value

document.getElementById("login-password").value;

My Device details below

Archer C80 AC1900 MU-MIMO Wi-Fi Router

Firmware Version: 1.13.2 Build 230824 Rel.75032n(5553) Hardware Version: Archer C80 2.0

AlexandrErohin commented 3 months ago

@Arun-R-S @Borty97 Archer C80 2.0 and Archer C6 4.0 has same API which is not supported by this integration currently. As I dont have any of these routers - I cannot add support for them

Would be great if you could add the support for this routers by implementing methods for TplinkC6V4Router class here https://github.com/AlexandrErohin/TP-Link-Archer-C6U/blob/main/tplinkrouterc6u/client.py#L644

Arun-R-S commented 3 months ago

@AlexandrErohin I am not sure how to add that.

@Borty97 do you have any idea on this?

Arun-R-S commented 3 months ago

@AlexandrErohin, can you tell me how to add that. I will try to work on this.

AlexandrErohin commented 3 months ago

@Arun-R-S You have to find out how the encryption works for this router in JS files. Unfortunately, there is no concrete algorithm for that

aventouris commented 3 months ago

Hello.

The same problem with the encrypted password here.

TP-LINK TL-WA901N HW: WA901N v6 00000000 FW: 3.16.9 Build 220701 Rel.62854n (4555)

Borty97 commented 2 months ago

@AlexandrErohin I am not sure how to add that.

@Borty97 do you have any idea on this?

I'm sorry but I could not find anything. I'm looking on it

programista4 commented 1 month ago

If we have already encrypted password, do we get "You need to use web encrypted password instead. Check the documentation!" message if our router is not supported or the message will be different?

AlexandrErohin commented 1 month ago

@programista4 What is your router hardware?

programista4 commented 1 month ago

This is TL-WA854RE v3.0 - repeater.

Niels7801 commented 1 month ago

Also cannot retrieve web encrypted password, get below error:

VM91:1 Uncaught TypeError: Cannot read properties of null (reading 'value') at :1:42

Router Deco M5 FW version: 1.7.4 Build 20231222 Rel. 63684

Thanks in advance

Niels7801 commented 1 month ago

Could you try this steps to get WebEncryptedPassword?

  1. Open the browser and go to the webinterface of you TP-link router and open the developertools(ctrl+shift+i or F12).
  2. In the developertools navigate to the network tab.
  3. Make sure the recoder is enabeld.
  4. Login to your router
  5. There should appear activity in the networking tab.
  6. Scroll up until you find something like "login?form=login" and click it.
  7. Click payload, and copy the string of characters, it should be a long string.
  8. This is the web encrypted password.

also tried above (copied the encrypted password) but get autentication error while trying to setup Home Assistant integration. (tried with http://... and https://... also checked to uncheck ssl in both situations but no luck)

AlexandrErohin commented 1 month ago

@Niels7801 Could you add also all relevant logs from Settings->System->Logs?

akshaydogra1 commented 2 weeks ago

Hi @AlexandrErohin ,

Same Issue. Unable to get encrypted password.

Device: Archer A10 Firmware Version:1.0.5 0.9.1 v1000.0 Build 200928 Rel.32191n(5553) Hardware Version:Archer A10 v1

tekHudson commented 1 week ago

I am stopping following this thread, I moved to a Unify home setup