Need to install form login monitoring.

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
khgv67
Posts: 8
Joined: Thu Jul 24, 2014 12:30 pm

Need to install form login monitoring.

Post by khgv67 »

Hi,

My requirement is that I have to monitor one internal website abc.com through form login monitoring. Now the trouble part is that to access abc.com I do not require any proxy settings, but abc.com redirects for cokkie check to xyz.com( i.e. external website for which proxy is needed) internally and again xyz.com gives response to abc.com , which later presents the login page. So for abc.com the target page should be its login page but this is kind of getting stuck in between just before the redirection to xyz.com.

Below is the debug mode result of the script I am using.

Target URL: abc.com
POST Data: USER=*******&Password=*******
Login content: vhd
Target content: You have successfully logged in.
Verify target page redirect? 1
Debug mode? 1
request for protected url: abc.com
attempting site login...
ERROR: request for login resource failed: 405 Method Not Allowed
DEBUG: target content causing failure: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>The page cannot be displayed</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<STYLE type="text/css">
BODY { font: 8pt/12pt verdana }
H1 { font: 13pt/15pt verdana }
H2 { font: 8pt/12pt verdana }
A:link { color: red }
A:visited { color: maroon }
</STYLE>
</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

<h1>The page cannot be displayed</h1>
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
<hr>
<p>Please try the following:</p>
<ul>
<li>Contact the Web site administrator if you believe that this request should be allowed.</li>
<li>Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly. </li>
</ul>
<h2>HTTP Error 405 - The HTTP verb used to access this page is not allowed.<br>Internet Information Services (IIS)</h2>
<hr>
<p>Technical Information (for support personnel)</p>
<ul>
<li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>405</b>.</li>
<li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
and search for topics titled <b>Setting Application Mappings</b>, <b>Securing Your Site with Web Site Permissions</b>, and <b>About Custom Error Messages</b>.</li>
</ul>

</TD></TR></TABLE></BODY></HTML>

So here I believe I am not able to access the redirected external page from the internal url.

PS: Please help me out as I am badly stuck in this.

Regards
Ashutosh
khgv67
Posts: 8
Joined: Thu Jul 24, 2014 12:30 pm

Re: Need to install form login monitoring.

Post by khgv67 »

Attached is the script I am using for monitoring.
Attachments
script.pl
(3.57 KiB) Downloaded 266 times
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Need to install form login monitoring.

Post by abrist »

Can you access the internal page through the proxy?
Is xyz serving or checking the cookie?
Does this even work if you try to browse to the internal site?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
khgv67
Posts: 8
Joined: Thu Jul 24, 2014 12:30 pm

Re: Need to install form login monitoring.

Post by khgv67 »

Hello ,

Thanks for the reply.

Yes I can access the internal website abc.com from the browser.
Also xyz.com i.e. external website is serving the request and I can access it directly from the browser with the help of proxy. Even after setting up the proxies I can monitor the external website with form login monitoring.

Regards
Ashutosh
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Need to install form login monitoring.

Post by tmcdonald »

Is it possible that the remote site (or at least that login page) does not allow GET requests and only takes POST? I've seen this used as a form of security measure, and it would explain the HTTP 405 you are seeing. Try changing the HTTP method to POST, and check with the web admin for that site and inquire about the allowed methods.

You can always perform a HTTP OPTIONS request to see the supported methods:

https://www.owasp.org/index.php/Test_HT ... FIG-006%29
Former Nagios employee
Locked