Is it possible to use wget or curl on Gargoyle interface?
Moderator: Moderators
Is it possible to use wget or curl on Gargoyle interface?
I am wondering is it possible to use curl or wget to login to Gargoyle? I have found some info on using them to login to a form based login screen, but Gargoyle appears to be a javascript login screen.
I had the idea of trying to grab the WAN up time and displaying it on my own page or maybe grabbing the wan ip address, in a what's my ip type page
I had the idea of trying to grab the WAN up time and displaying it on my own page or maybe grabbing the wan ip address, in a what's my ip type page
Re: Is it possible to use wget or curl on Gargoyle interface?
This would be much simpler just using SSH.
If you want to use a web call, make a POST call to
With the password as a parameter.
Once you have a valid login cookie from that, you should then be able to GET call most other pages and pass the cookie for authentication.
The gargoyle_session_validator source is here:
https://github.com/ericpaulbishop/gargo ... alidator.c
If you want to use a web call, make a POST call to
Code: Select all
http://192.168.1.1/utility/get_password_cookie.sh
Once you have a valid login cookie from that, you should then be able to GET call most other pages and pass the cookie for authentication.
The gargoyle_session_validator source is here:
https://github.com/ericpaulbishop/gargo ... alidator.c
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: Is it possible to use wget or curl on Gargoyle interface?
Thanks for that. I think I managed to get a cookie, but can't seem to get it to show me a logged in page like the status overview page. You are right, seems way harder than I had hoped.
Re: Is it possible to use wget or curl on Gargoyle interface?
Code: Select all
curl --data "password=myrootpassword" http://192.168.1.1/utility/get_password_cookie.sh
Code: Select all
Set-Cookie:hash=C4A26xxxxx53C; Path=/;
Set-Cookie:exp=1617017263; Path=/;
Code: Select all
curl --cookie "hash=C4A26xxxxx53C;exp=1617017263;" http://192.168.1.1/overview.sh
Hope that example helps
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: Is it possible to use wget or curl on Gargoyle interface?
Thank you very much. With your help I have been able to get what looks like the logged in overview page. But for some reason none of the values are there, here is a snippet of what I saved to a html file.
Code: Select all
Status
Device
Device Name:
Gargoyle Version:
Model:
Device Configuration:
Memory Usage:
Swap Memory Usage:
Connections:
CPU Load Averages: (1/5/15 minutes)
CPU Temperature: °C
RAM Temperature: °C
Wifi Temperature: °C
WAN
WAN IP Address:
WAN Netmask:
WAN MAC Address:
WAN Gateway IP:
WAN DNS Server(s):
WAN (PPPoE) Uptime:
WAN (3G) Signal Strength:
Re: Is it possible to use wget or curl on Gargoyle interface?
Yes, that would be the second part of why SSH would be better and just using something like ifstatus to get the data (depending on what you're looking for).
Gargoyle's GUI uses javascript to load the variables into the UI, which reduces the burden on the router to produce the entire content of the page. Earlier in the page you will see a bunch of lines that begin with "uci.set(...)". This is data coming out of the config files and ready to be loaded into the UI by the code.
There's no particularly good way of doing that with just a cURL call.
Gargoyle's GUI uses javascript to load the variables into the UI, which reduces the burden on the router to produce the entire content of the page. Earlier in the page you will see a bunch of lines that begin with "uci.set(...)". This is data coming out of the config files and ready to be loaded into the UI by the code.
There's no particularly good way of doing that with just a cURL call.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: Is it possible to use wget or curl on Gargoyle interface?
I did see the uci.set stuff in the browser when viewing the source, but it seems curl ignores everything in the <script></script>, because none if it appears in the html file when I capture it.
I will have a look and see if I can work out how to do it with ssh, Can that be done in a batch file?
Edit: I was mistaken the html file I capture does contain the values in javascript variables so might still be able to extract what I want.
I will have a look and see if I can work out how to do it with ssh, Can that be done in a batch file?
Edit: I was mistaken the html file I capture does contain the values in javascript variables so might still be able to extract what I want.
Re: Is it possible to use wget or curl on Gargoyle interface?
If you can get a batch file to connect to an ssh server i don't see why not. I have no experience in doing so.
If you let me know what information you're looking to retrieve i can try and advise the simplest commands that give that info.
If you let me know what information you're looking to retrieve i can try and advise the simplest commands that give that info.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: Is it possible to use wget or curl on Gargoyle interface?
I am basically after the uptime and the wan IP
Re: Is it possible to use wget or curl on Gargoyle interface?
I have been able to extract the uptime from the captured file.