A
A
Alexey Bolgov2021-04-12 11:52:43
Nginx
Alexey Bolgov, 2021-04-12 11:52:43

How to block access to sites by link?

Hello. Please tell me, I have a site, for example site.ru, I am being attacked by a DDoS attack of the l7 level, how to prohibit access to the site using a link of this type site.ru/?GHBGFFUJN. Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2021-04-12
@Alex2412729

at the nginx level

if ($arg_GHBGFFUJN) {
    return 444;
}

at the PHP level,
in the case of laravel, you can enter directly at the beginning of the filepublic/index.php
if(isset($_GET['GHBGFFUJN'])) {
    http_response_code(403);
    exit;
}

it is better to block requests at the nginx level so that they do not reach PHP and do not create additional. load.
also, if all requests have the same pattern, for example, they contain GHBGFFUJN, then you can get ip from access logs from which such requests arrive, and add ip to the block already at the firewall level, for 30 minutes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question