Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

269
Visualizações
How to prevent bots from spamming an API trying to hit vulnerable endpoints

I have a Node and Express api for my backend, currently it's running on Heroku and on my logs I see bots trying to spam the api with bad intent, trying to hit endpoints like GET /.env and GET /.aws-secret. My api will just simply return a 404 since these endpoints don't exist, but I'd like to stop these bots from making all these requests. I already have a rate limiter in place but it's annoying to see that the bots still make requests basically everyday trying to hit an endpoint.

I've seen some answers here on how to block an ip address using Express, but my idea would be to have a list of blacklisted endpoints (such as GET /.env) and banning any ip that makes a request to those endpoints, except I don't know if this solution is ideal, what would be the best way to get rid of these bots trying to hit vulnerable endpoints?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You could blacklist confidential files and directories and each time someone tries to access them, don't return any response.

about 4 years ago · Juan Pablo Isaza Relatório

0

The cure to this problem might be worse, than a disease.

Rate limiting has a high chance to block valid users, as scripts tend to be more persistent in achieving their goals than humans are.

Blocking IP addresses? You may want to try it out. Be aware, that one IP does not mean one person, machine or script. IPs are often shared among many users going over the same router. You will ban legitimate users by doing so.

The best idea seams to be some kind of a captcha mechanism - prove that you are a human by solving a riddle that is easy for humans, but hard for machines.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda