cedrozor / myrtille

A native HTML4 / HTML5 Remote Desktop Protocol and SSH client
https://www.myrtille.io
Apache License 2.0
1.81k stars 375 forks source link

The remote connection failed due to missing or invalid credentials #303

Closed kakafred closed 3 years ago

kakafred commented 3 years ago

I installed IIS and Myrtille on my VPS(aws).OS : Windows Server R2 Standard. I already can load in Myrtille Service‘s Link.But it will show xxx.xxx.xxx.xxx show The remote connection failed due to missing or invalid credentials.

243bb22d9ead864dd9fc17423b51551

And then,I checked the Myrtille.web.log

2d55e97560ee8f9f590af481111415e

I can not find the modules: IIS>Development application>Websokcet protocol also,maybe i just dont know where it is This is my Dashboard,could any one help me out?

d0971769ee12b03de7e1f13bf1b094c 552e8de21642d8f47e4c2ad6a8ba719

Could be AWS AMI problem?How can i fix this problem?

kakafred commented 3 years ago

It will be work when I use VPSs in VPC(Private cloud). But it will show this error when I use RD to connect Myrtille service VPS in Public net.

kakafred commented 3 years ago

image I searched many solutions until i find this guy.It seems like he has the same error with me.

cedrozor commented 3 years ago

It's surprising that you don't see the websocket protocol among the IIS features. It was added since Windows Server 2012. You can check what are the installed roles and features (IIS and others) by using the powershell Get-WindowsFeature cmdlet (https://stackoverflow.com/questions/35879081/how-to-find-the-name-of-the-iis-features).

But this has probably nothing to do with your error, because Myrtille does fallback to XHR+long polling or SSE if websockets are not available or failing.

As I said into the issue https://github.com/cedrozor/myrtille/issues/301, did you tried to connect with mstsc from the AWS machine? is it working?

kakafred commented 3 years ago

Thanks for ur response. I already tried to connect with mstsc from the AWS machine,and also I found the way to install Websockets with powershell. Then I found that was not the reason cause to error.(not IIS websockets protocol). I tried to connecct with 127.0.0.1(not used the Myrtille service Host IP) .This way can fix the certification problem 100%. Myrtille>localhost>local certification>connected (not need to Out to Public Net) Myrtille>Public IPv4 addr>Search?>connect>certification?>connected (need to Out to Public Net) This is my viewpiont,But i don't know if it's right :(

cedrozor commented 3 years ago

So, you are successfully connecting? do you still have the connection failed (missing or invalid credentials) popup?

JBarretoMan commented 3 years ago

I'm having the same problem... I tried the same things as @kakafred and it still doesn't works... the only error I found in the logs is in Myrtille.Web.log:

"ERROR System.Diagnostics redirection [(null)] - Failed to load credentials prompt (System.NullReferenceException: Object reference not set to an instance of an object. at Myrtille.Web.popups.CredentialsPrompt.Page_Load(Object sender, EventArgs e))"

Myrtille.RDP.log is empty

cedrozor commented 3 years ago

Are you using the hosts management dashboard, and have this problem after clicking an host? the CredentialsPrompt popup is meant to be displayed in this case.

Did you tried to connect the host manually, from the Myrtille login page?

@kakafred in your last comment you said you succeed to connect with both localhost and ipv4 addresses. is that correct?

JBarretoMan commented 3 years ago

I'm getting this problem from the host management dashboard and from the login page. but if I connect using the URL format it works.

cedrozor commented 3 years ago

This is weird because both the login page and connect from URL use the same code, except the params are retrieved from HTTP POST instead of HTTP GET (querystring), respectively.

Do you use a domain? how are you passing the username into the login page and url?

JBarretoMan commented 3 years ago

No, I don't use a domain. I use this URL and it works https://[server ip]/Myrtille/?EVENTTARGET=&EVENTARGUMENT=&user=[UserName]&passwordHash=[hash get from the API call]&connect=Connect%21

In the login screen, I leave the domain blank and in password, I don't use the hash but the plain password. the user I use the same in the URL and the login page

cedrozor commented 3 years ago

Does your password have any special characters that could be stripped on the server side? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password#value https://security.stackexchange.com/questions/2096/what-chars-should-i-not-allow-in-passwords/30179#30179

Or is it just a typo, did you click on the eye icon that shows the password you enter?

JBarretoMan commented 3 years ago

The password has a '*' character... Don't know if that could be the issue

cedrozor commented 3 years ago

I don't think so.

What browser do you use and do you have any extension to manage passwords that could interfere with the HTML input type=password field ? Did you click the eye icon, next to the input field, which shows the password you entered (to make sure you don't have a typo)?

Could you try to change the password for something simple (only letters and numbers for example), then check if it works? then put special characters and see when it goes wrong.

cedrozor commented 3 years ago

Any news please? I don't replicate the problem

matthewincardona commented 3 years ago

I was having the same issue and seemed to have fixed it. Started when Windows asked for a password change and I used a generated password for it. @cedrozor I took your advice and tried changing some of the symbols, making it resemble my old password more (used $ instead of % or *).

Original password (modified obviously): A*W5623hV$9%aR6%%yuA

Changed password: A$W5623hV$9$aR6$$yuA

cedrozor commented 3 years ago

Ok, I think I got it. Sometimes, something is so obvious that you can't see it.

If you connect from URL, with the syntax: https://myserver/Myrtille/?__EVENTTARGET=&__EVENTARGUMENT=&server=server&domain=domain[optional]&user=user&passwordHash=passwordHash&program=program[optional]&width=width(px)[optional]&height=height(px)[optional]&connect=Connect%21, then you must URL encode the parameters, including the password.

From the documentation

The parameters values must be URL encoded. You can use a tool like http://www.url-encode-decode.com/ (just copy & paste the encoded parameters into the URL).

if you have this problem from the Myrtille login form, then it's another problem because data is sent through an HTTP(S) POST method, using a standard HTML form.