This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:linux:bad_bot_trap [2013/10/13 14:50] gcooper |
networking:linux:bad_bot_trap [2013/10/13 14:59] (current) gcooper |
||
---|---|---|---|
Line 8: | Line 8: | ||
===== robots.txt ===== | ===== robots.txt ===== | ||
+ | |||
+ | Misbehaving bots may access areas of your web site even if you tell then not to. That's what we key on here. | ||
:!: First, change to your web root folder. | :!: First, change to your web root folder. | ||
Line 21: | Line 23: | ||
Disallow: /bot-trap/ | Disallow: /bot-trap/ | ||
</ | </ | ||
+ | |||
+ | ===== Web Site Header ===== | ||
We use a tiny image for embedding the hidden link. '' | We use a tiny image for embedding the hidden link. '' | ||
Line 30: | Line 34: | ||
</ | </ | ||
- | Edit your HTML header (''< | + | Edit your HTML header (''< |
< | < | ||
Line 37: | Line 41: | ||
<a href="/ | <a href="/ | ||
</ | </ | ||
+ | |||
+ | ===== bot-trap Folder ===== | ||
Now we create the '' | Now we create the '' | ||
Line 54: | Line 60: | ||
chown -R apache.apache bot-trap | chown -R apache.apache bot-trap | ||
</ | </ | ||
+ | |||
+ | ===== Fail2Ban ===== | ||
Add another regex to the fail2ban '' | Add another regex to the fail2ban '' | ||
Line 69: | Line 77: | ||
service fail2ban restart | service fail2ban restart | ||
</ | </ | ||
+ | |||
+ | ===== Test Fail2Ban Filter ===== | ||
+ | |||
+ | Modify your log path as necessary: | ||
+ | |||
+ | < | ||
+ | fail2ban-regex ../ | ||
+ | </ | ||
+ | |||
+ | Check the Fail2Ban log: | ||
+ | |||
+ | < | ||
+ | tail -f / | ||
+ | </ | ||
+ | |||
+ | :!: If Fail2Ban fails to parse your log files at all, try setting '' | ||
===== Parse IPTables Rules for List of Banned IPs ===== | ===== Parse IPTables Rules for List of Banned IPs ===== |