block ip addresses that request a specific url

user1670469

I'm receiving too many requests on my server from different ip addresses. I discovered, watching apache access.log, that all these ip addresses are requesting a specific file (teXeFe.php). I'd like to block the access to all these ip addresses. How can I do it?

Patrik Martinsson

How about using the iptables string match ?

Something like,

iptables -I INPUT 1 -m string --algo bm --string "teXeFe.php" -j DROP

I inserted the rule at position one just for testing since I had other rules that matched before this one if it was insterted furhter down the chain. Anyway, you get the concept. You could also be a little more specific in the rule (including the GET /full/url/path etc).

Here is page describing the string-matching filter,
- http://spamcleaner.org/en/misc/w00tw00t.html

And here's another stackoverflow-question about it,
- iptable rule to drop packet with a specific substring in payload

Hope that helps!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Block a specific request by it's url in firefox

From Dev

htaccess block GET request to specific URL

From Dev

IIS | Block page specific url except for specific internal IP address

From Dev

netsh, block all IP addresses in a text file?

From Dev

How to block all IP addresses in a range?

From Dev

How to use .htaccess to block Russian IP addresses?

From Dev

Block Docker port and access it to few IP addresses

From Dev

Lock down squid proxy to specific IP addresses

From Dev

Unable to allow specific ip addresses in ufw

From Dev

Block docker access to specific IP

From Dev

Block Ping from a specific IP

From Dev

Amazon VPC n^2 -4 IP Addresses? CIDR Block

From Dev

How Can I Block Multiple IP Addresses with PHP

From Dev

Automatically block ip addresses with iptables accessing a web page

From Dev

Does Ubuntu automatically block visitors that do not have similar IP addresses?

From Dev

Block specific URL on web browsers

From Dev

Block one specific URL by htaccess

From Dev

How do I configure two IP addresses on a specific vlan

From Dev

How to set hostnames to specific range of IP addresses on DHCP Server?

From Dev

Allow all inbound traffic from specific IP addresses

From Dev

How to set hostnames to specific range of IP addresses on DHCP Server?

From Dev

How do I configure two IP addresses on a specific vlan

From Dev

run specific IP addresses or host names through OpenVPN connection

From Dev

Firewall to block traffic to a specific IP - troubleshoot

From Dev

Getting ip from specific URL

From Dev

How to retry a block based URL Request

From Dev

ip6tables rules to allow port 80 and port 443 traffic to only a few specific IP addresses

From Dev

How to use Apache to block a specific URL type?

From Dev

How to use Apache to block a specific URL type?

Related Related

  1. 1

    Block a specific request by it's url in firefox

  2. 2

    htaccess block GET request to specific URL

  3. 3

    IIS | Block page specific url except for specific internal IP address

  4. 4

    netsh, block all IP addresses in a text file?

  5. 5

    How to block all IP addresses in a range?

  6. 6

    How to use .htaccess to block Russian IP addresses?

  7. 7

    Block Docker port and access it to few IP addresses

  8. 8

    Lock down squid proxy to specific IP addresses

  9. 9

    Unable to allow specific ip addresses in ufw

  10. 10

    Block docker access to specific IP

  11. 11

    Block Ping from a specific IP

  12. 12

    Amazon VPC n^2 -4 IP Addresses? CIDR Block

  13. 13

    How Can I Block Multiple IP Addresses with PHP

  14. 14

    Automatically block ip addresses with iptables accessing a web page

  15. 15

    Does Ubuntu automatically block visitors that do not have similar IP addresses?

  16. 16

    Block specific URL on web browsers

  17. 17

    Block one specific URL by htaccess

  18. 18

    How do I configure two IP addresses on a specific vlan

  19. 19

    How to set hostnames to specific range of IP addresses on DHCP Server?

  20. 20

    Allow all inbound traffic from specific IP addresses

  21. 21

    How to set hostnames to specific range of IP addresses on DHCP Server?

  22. 22

    How do I configure two IP addresses on a specific vlan

  23. 23

    run specific IP addresses or host names through OpenVPN connection

  24. 24

    Firewall to block traffic to a specific IP - troubleshoot

  25. 25

    Getting ip from specific URL

  26. 26

    How to retry a block based URL Request

  27. 27

    ip6tables rules to allow port 80 and port 443 traffic to only a few specific IP addresses

  28. 28

    How to use Apache to block a specific URL type?

  29. 29

    How to use Apache to block a specific URL type?

HotTag

Archive