0

I want to add some ip adresses to a blacklist, and i want to show these ip addresses in blacklist a custom web page that includes a "you are in blacklist" message on body.

How can i do this?

I have ubuntu server and apache. I tried to add rule to ip tables but it only drops connection. I do not want to drop connection i want to route it to a custom .html . Thanks.

cemonatk
  • 1
  • 1
  • Define *"show"*, *"them"* and the processs of *staring*. Until done you can print a banner **"you are in a blacklist"**, stick it to a chassis of your server - whenever *they* will look at it, *they* will see your message. – drookie Feb 11 '16 at 16:23

1 Answers1

1

If you are referring to HTTP protocol and remote web-clients, like browsers, then, to display a warning page to a set of such clients, basing on their IP address information, you can use mod_rewrite to rewrite the DocumentRoot of a given vhost (the one that you want to protect) to some path, say /blacklisted.html.

For example, consider the following approach:

RewriteCond %{REMOTE_ADDR} ^12\.34\.56\.78$
RewriteRule ^/.* /blacklisted.html

And /blacklisted.html is supposed to contain scary warnings and threats.

drookie
  • 8,051
  • 1
  • 17
  • 27