Skip to content
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

GS105Ev2 - Cannot Login #98

Open
Hannes1909 opened this issue Mar 30, 2023 · 7 comments
Open

GS105Ev2 - Cannot Login #98

Hannes1909 opened this issue Mar 30, 2023 · 7 comments

Comments

@Hannes1909
Copy link

Hi, i just booted up a brand new GS105Ev2 only to realize it does not have some monitoring features i guessed from a "smart" and "managed" switch in 2023 - I was about to return the switch when I stumbled upon your tool, great work, btw!

Sadly i cant seem to get a successful authentication via the python script:

  retrieve_interval: 20.0
  retries: 10
  host: "0.0.0.0"
  port: 9493
switches:
  - hostname: 192.168.178.10
    password: Admin123
~/  prosafe_exporter /config.yml -vvv
INFO:ProSafeExporter:Created retriever for host 192.168.178.10
INFO:ProSafeExporter:ProSafeExporter is listening on 0.0.0.0:9493 for request on /metrics endpoint (but you can also use any other path)
INFO:ProSafeExporter:Retrieving data from all devies
INFO:ProSafeExporter:Start retrieval for 192.168.178.10
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.178.10:80
DEBUG:urllib3.connectionpool:http://192.168.178.10:80 "GET /login.htm HTTP/1.1" 200 None
WARNING:ProSafeExporter:Your switch 192.168.178.10 uses an old firmware which sends your password unencrypted while retrieving data. Please conscider updating
DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.178.10
DEBUG:urllib3.connectionpool:http://192.168.178.10:80 "POST /login.cgi HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.178.10
DEBUG:urllib3.connectionpool:http://192.168.178.10:80 "GET /switch_info.htm HTTP/1.1" 200 None
ERROR:ProSafeExporter:Login failed for 192.168.178.10
ERROR:ProSafeExporter:Failed to refrieve for host 192.168.178.10
INFO:ProSafeExporter:Retrieving done
^CINFO:ProSafeExporter:ProSafeExporter was stopped

When i perform the login manually via browser it works - at first i had set up another password, but figured maybe it was to long or complex, so i redacted it to "Admin123" which still only works for the Web-Login.

Thanks for any hints on this!
KR, Hannes

The switch is running the following firmware:

Bootloader Version | V1.6.0.2-VB
Firmware Version | V1.6.0.11

When I try to open the URLs in the verbose output in my browser it only results in blank pages (red bar only to censor bookmarks ;-) - the "login.cgi" page is working as expected in browser and shows the default login for the web GUI:
image
image

@tillsteinbach
Copy link
Owner

That is a quite old firmware I have not seen before.

@Hannes1909
Copy link
Author

Seems to be the current one though: https://www.netgear.de/support/product/gs105ev2#download

@tillsteinbach
Copy link
Owner

hmmm, I would be interested in debugging the problem, but unfortunately I don't own a GS105

@Hannes1909
Copy link
Author

If i can help on my end, just let me know, maybe i can provide you one of my three new Switches :)

@tillsteinbach
Copy link
Owner

let me first check if I cannot find one in my electronics box... But I will not be able to do that before sunday.

@Hannes1909
Copy link
Author

no problem :) Thanks! I'll try to debug as much as possible until then

@Hannes1909
Copy link
Author

I tried to recreate the login on the GS105Ev2 with python - seems to work pretty much the same as in your script (very simplified):

  • requests.post(url + 'login.cgi', data={'password': '************* hashed pw'})
  • if the post returns a cookie with session id, use it for requests.get(url + '/status.cgi')
  • print the result from the last request

I got the hashed password from logging the requests with burpsuite, and just pasted it in my script for the sake of simplicity, but was able to retrieve the status page with that three lines. Maybe the v2 firmware handles the login differently?

Additionally i have an GS108Ev3 that works pretty well with the prosafe_exporter except for a long password, e.g. "FJRND99zsymbwJyCLN5Y8mx4aPMR6BcE" (changing it afterwards, anyway ;)
With "Admin123" from the example above, it works fine. Logging in via the web GUI works with both passwords. Is there a limitation in characters maybe?

Firmware for the GS108Ev is 2.06.17, also the most recent from Netgear downloadpage.

Debug output with long password:

INFO:ProSafeExporter:Created retriever for host 192.168.178.12
INFO:ProSafeExporter:ProSafeExporter is listening on 0.0.0.0:9493 for request on /metrics endpoint (but you can also use any other path)
INFO:ProSafeExporter:Retrieving data from all devies
INFO:ProSafeExporter:Start retrieval for 192.168.178.12
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.178.12:80
DEBUG:urllib3.connectionpool:http://192.168.178.12:80 "GET /login.htm HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.178.12
DEBUG:urllib3.connectionpool:http://192.168.178.12:80 "POST /login.cgi HTTP/1.1" 200 None
ERROR:ProSafeExporter:I could not login at the switch 192.168.178.12 due to: The password is invalid.
ERROR:ProSafeExporter:Failed to refrieve for host 192.168.178.12
INFO:ProSafeExporter:Retrieving done
^CINFO:ProSafeExporter:ProSafeExporter was stopped

Debug output with "Admin123" as password:

INFO:ProSafeExporter:Created retriever for host 192.168.178.12
INFO:ProSafeExporter:ProSafeExporter is listening on 0.0.0.0:9493 for request on /metrics endpoint (but you can also use any other path)
INFO:ProSafeExporter:Retrieving data from all devies
INFO:ProSafeExporter:Start retrieval for 192.168.178.12
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.178.12:80
DEBUG:urllib3.connectionpool:http://192.168.178.12:80 "GET /login.htm HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.178.12
DEBUG:urllib3.connectionpool:http://192.168.178.12:80 "POST /login.cgi HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.178.12
DEBUG:urllib3.connectionpool:http://192.168.178.12:80 "GET /switch_info.htm HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.178.12
DEBUG:urllib3.connectionpool:http://192.168.178.12:80 "GET /status.htm HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Resetting dropped connection: 192.168.178.12
DEBUG:urllib3.connectionpool:Starting new HTTP connection (2): 192.168.178.12:80
DEBUG:urllib3.connectionpool:http://192.168.178.12:80 "GET /portStats.htm HTTP/1.1" 200 None
INFO:ProSafeExporter:Retrieval for 192.168.178.12 done
INFO:ProSafeExporter:Retrieving done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants