I've just put a rails 4 app into production, and I've noticed what look like a number of scripted attacks, mostly on urls that end with .php. They look like this:
I, [2015-05-11T22:03:01.715687 #18632] INFO -- : Started GET "/MyAdmin/scripts/setup.php" for 211.172.232.163 at 2015-05-11 22:03:01 +0100
F, [2015-05-11T22:03:01.719339 #18632] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/MyAdmin/scripts/setup.php"):
actionpack (4.1.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
I'd like to collect thee url from these RoutingError messages, mostly so I can set up routes for them, probably to simply render nothing.
I'd also like to redirect to a site which might keep script runners busy.
Anyway, here's the question. Is there any way I can intercept ActionController::RoutingError to run some code?
Bonus question: Does anyone know if there's actually a lot of php apps out there which can be broken into with urls like the one above?