Posts: 198
Threads: 49
Joined: Mar 2018
Reputation:
2
Location: Germany
Hi Alexandre,
I have installed my own NOT FOUND HANDLER (404) to prevent scraping.
When a user searches entire directories for files, after a certain number of times the user's IP address is temporarily blocked.
I have now discovered that the NOT FOUND HANDLER is no longer called by the server when file extensions are blocked.
Instead, a session is created and the server blocks after a while.
Could it be that the handling has changed in one of the last versions?
Regards
Juergen
Posts: 2,299
Threads: 202
Joined: Mar 2018
Reputation:
87
Location: Auckland, New Zealand
09-18-2023, 08:59 PM
(This post was last modified: 09-18-2023, 09:16 PM by Alexandre Machado.)
I'll need some more information.
How you register your handler? Also, for that matter, how do you keep the IP list?
PS: I have just tested the BlockedDocExtensions and it works as expected in the latest version, returning 404 - Resource not found whenever a document containing a blocked extension is requested, so there is something else going on
Posts: 198
Threads: 49
Joined: Mar 2018
Reputation:
2
Location: Germany
I may have expressed myself a bit unclearly.
My NOT FOUND HANDLER is always triggered when a file is requested from an IP address that does not exist on the server.
The HANDLER stores the IP address, the time of the first error and the number of errors. In addition, the session created is terminated immediately.
If too many such files are requested for an IP address within a certain time interval, this IP address will be temporarily blocked.
This has certainly worked so far, even for PHP files!
However, recently the NOT FOUND HANDLER no longer triggers for PHP files,
but only the INTRAWEB standard handler for 404, which does not terminate the created sessions immediately and does not recognize brute force attacks.
It seems like my HANDLER is no longer called for files whose file extension is blocked by INTRAWEB!
If I unblock PHP or other extensions, my HANDLER will trigger again.
Posts: 2,299
Threads: 202
Joined: Mar 2018
Reputation:
87
Location: Auckland, New Zealand
Can you provide a minimum test case for this?
The php extension is indeed blocked by default by IntraWeb, but way before a session is created. You can bombard an IW application with thousands of requests requiring a .php file and not a single session will be created. This has been extensively tested and I'm deeply sure that it works as intended.
Posts: 198
Threads: 49
Joined: Mar 2018
Reputation:
2
Location: Germany
I don't have a test case at the moment, but I could send the contents of real server log files that show the case.
Posts: 2,299
Threads: 202
Joined: Mar 2018
Reputation:
87
Location: Auckland, New Zealand
Please do. My email is alexandre [at] atozed dot com
Posts: 2,299
Threads: 202
Joined: Mar 2018
Reputation:
87
Location: Auckland, New Zealand
After analysing your log files I could recreate the issue.
The thing is not in IW code but actually in Indy server code. Some specific URLs were being (wrongly?) parsed by Indy code and the document part of the URL was being discarded, so the code to block certain file extensions was not able to identify and block the request.
This has been fixed and will be available in the next release.
Cheers,
Posts: 198
Threads: 49
Joined: Mar 2018
Reputation:
2
Location: Germany
Hi Alexandre,
unfortunately I'm having problems with PHP attacks again.
I'm using IW15.4.1.
Trace files would be available.
Regards
Jürgen
Posts: 198
Threads: 49
Joined: Mar 2018
Reputation:
2
Location: Germany
Hi Alexandre, you wrote:
09-20-2023, 03:45 AM
After analysing your log files I could recreate the issue.
The thing is not in IW code but actually in Indy server code. Some specific URLs were being (wrongly?) parsed by Indy code and the document part of the URL was being discarded, so the code to block certain file extensions was not able to identify and block the request.
This has been fixed and will be available in the next release.
Is it possible that these changes are not included in the latest Indy version?
Juergen