Webpage login check

I would like to know how to, if possible, check a login page for an e-mail server. I would like to be able to navigate to the login page for e-mail, login using some specified user and password and then check to make sure it successfully logs in to the email display page, otherwise it would fail if it couldn’t find the email display page. Thank you!

Well, it might not really help you, but I encountered the same problem;
Here are 2 solutions that I used:

you own the website; if so, just create a test page that will simulate all the requests a normal page would do, and report a “TEST OK” or “TEST KO” as an output.
Then use the check_http plugin to poll directly this test page
That’s a nice workaround the problem, which will help you greatly when trying to solve an issue on your website … but you have to be the owner of the site!

ok; this solution is a bit of a brutal, but I like it:
just write a (big) piece of code in perl using a few plugins (such as a http or cgi plug in) to create a step by step test…
or, if you want, you can even use the telnet plugin and send yourself the GET and POST commands to your web server (that’s the solution I prefer).

It would look like:
-create the telnet connection on port 80
-send the command “GET /index.php HTTP/1.1”
-read the result and check that a prerequisite sentence is in it
-send the command “POST /login.php?user=me&pass=my_pass”
…and so on

ps: if you don’t know what answer to expect or what command to send to your web server, don’t hesitate to install Ethereal : it’s free and will help you greatly on the http client-server protocol!

I hope this will help :slight_smile:

Hi,

This is a popular question. Loose provides some good answers, but a popular application called “webinject” is made specifically for this type of stuff. It even has a mode specific for nagios. Check it out here:

webinject.org/plugin.html

It’ll save you from coding a bunch of your own stuff, and has some neat features that you probably wouldn’t include if you write your own little plugin.

Thanks MP for the link :wink: