This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
chagrinboy2001
Posts: 16 Joined: Fri Mar 09, 2012 3:17 am
Post
by chagrinboy2001 » Mon May 28, 2012 9:32 am
Hi,
I try to use webinject script to monitor the authentication.
What I did? ( step by step )
- Downloaded Webinject script from
http://www.webinject.org/download.html
- Extracted and copied webinject.pl, config.xml and testcases.xml to nagios libexec folder
-testcases.xml
Code: Select all
<testcases repeat="1">
<case
id="1"
method="post"
url="http://xx.xx.xx.xx/page/SMlogin.html"
postbody="username=guid&password=password"
logrequest="yes"
logresponse="yes"
/>
</testcases>
The result of my test ever is the same, if I put a bad user o pass, the result is always ok.
Cheers,
bb
chagrinboy2001
Posts: 16 Joined: Fri Mar 09, 2012 3:17 am
Post
by chagrinboy2001 » Wed May 30, 2012 9:15 am
Still doesn't work
Can you remark an error in my files config/commands?
Thanks
Case 1 is OK !
Config.xml
Code: Select all
<testcasefile>testcases.xml</testcasefile>
<baseurl>https://mywebsite/Redirect.pl</baseurl>
<timeout>10</timeout>
<globaltimeout>20</globaltimeout>
<reporttype>nagios</reporttype>
testcases.xml
Code: Select all
<testcases repeat="1">
<case id="1"
description="Open page"
method="get"
url="{BASEURL}"
verifypositive="To reset your password, please send a signed e-mail to"
errormessage="Unable to open page 1" />
<case id="2"
description="Authentication"
url="{BASEURL}"
method="post"
postbody="username=USERNAME&password=PASSWORD"
verifypositive="Hello, USERNAME"
errormessage="Unable to open page no 2" />
</testcases>
Login form
Code: Select all
<form id="loginForm" action="" method="post">
<div id="loginbox">
<input type="hidden" name="SMENC" value="ISO-8859-1" />
<input type="hidden" name="SMLOCALE" value="US-EN" />
<input type="hidden" name="target" value="HTTP://mywebsite2/Redirect.pl" />
<input type="hidden" name="smauthreason" value="0" />
<input type="hidden" name="smagentname" value="XiZ/NRJ2FQHcsw03St3G8a21q2S6eSB/Rj0SVWhyp4SE0+KWFg6SA7WqudluBejI" />
<input type="hidden" name="postpreservationdata" value="" />
<fieldset>
<legend>Login</legend>
<div id="usernamecon">
<label for="username">GUID</label>
<input type="text" id="username" name="USER" />
</div>
<div id="passwordcon">
<label for="password">Password</label>
<input type="password" id="password" name="PASSWORD" />
</div>
<div id="submit">
<input class="button" type="submit" name="loginbutton" id="loginbutton" value="login" />
</div>
</fieldset>
</div>
</form>
Code: Select all
[root@NagiosXi libexec]# ./webinject.pl
WebInject CRITICAL - Unable to open page no 2 |time=1.032;20;;0
Cheers,
bb
scottwilkerson
DevOps Engineer
Posts: 19396 Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:
Post
by scottwilkerson » Wed May 30, 2012 9:39 am
Does this form allow submitting without that smagentname field?
chagrinboy2001
Posts: 16 Joined: Fri Mar 09, 2012 3:17 am
Post
by chagrinboy2001 » Wed May 30, 2012 9:52 am
No. Can I include somehow this field in files config?
Cheers,
bb