Welcome Guest, Not a member yet? Register   Sign In
block hacker
#1

I'm sure there is a better way to do the following. My aim was to stop a hack attempt at the very start, so in routes, at the very top, I have
Code:
$sUrl = strtolower(uri_string());
if(str_starts_with($sUrl,'wp-')  || str_starts_with($sRUrl,'admin')  || str_starts_with($sUrl,'view-')   || str_starts_with($sUrl,'misc/')){
    // definite hacker - set default controller to Controllers/Home which shows simply "Site Under Construction"
    $routes->get('(:any)',$sHackerController );
    $routes->post('(:any)', $sHackerController);
    $routes->put('(:any)', $sHackerController);
    $routes->delete('(:any)', $sHackerController);
    service('auth')->routes($routes);
    return;
}
// and then come the proper routes
what is the right way to do this?
thanks, Bill
Reply


Messages In This Thread
block hacker - by badger - 01-08-2023, 10:42 AM
RE: block hacker - by superior - 01-09-2023, 08:35 AM
RE: block hacker - by badger - 01-09-2023, 09:19 AM
RE: block hacker - by InsiteFX - 01-09-2023, 11:42 PM
RE: block hacker - by badger - 01-10-2023, 02:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB