LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-16-2012, 04:56 AM   #1
mr51m0n
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Rep: Reputation: 0
mod_security: track user to check if redirected to login failed page


Hi there

I have to log when a user fails to log in to a web application. No, this web application is not able to do this out of the box and I can not change it.

Now I'm experimenting with mod_security. My idea is to track the POST request, extract the username and then check if the user gets redirected to the "login failed" page.

I have:

Code:
<Location /login.php>
       # Sanitize password variable value
       SecAction nolog,phase:2,sanitiseArg:password

       SecRule REQUEST_BODY "username=(.*)&password" "capture,log,logdata:'login submitted: user %{TX.1}'"
</Location>
and

Code:
<Location /loginfailed.php>
       # Filter und log redirects to loginfailed
       SecRule RESPONSE_BODY "loginfailed.php" "phase:4,t:none,log,logdata:'login failed: %{TX.1}'"
</Location>

But of course "TX.1" is already unset when I need it the second time.

Can anyone give me a hint on how to solve this?


Thanks, mr51m0n
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid download file , check for viruses and redirect user to a local page cioannou Linux - Server 0 06-17-2011 07:03 AM
Using nagios to check user login on web page venuwin Linux - Software 5 01-25-2009 07:11 AM
how to Change TCP_MISS/403 to TCP_DENIED whn the page is redirected by squidguard msivasakthi Linux - Software 0 02-20-2008 05:20 AM
Using mod_security to disallow TRACE|TRACK Cerbere Linux - Security 1 09-27-2004 12:57 PM
Browser gets redirected at first page loaded - very annoying - why? (firefox-0.9.1... jomen Linux - General 9 08-06-2004 05:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration