Originally posted by SteveRiley
View Post
Announcement
Collapse
No announcement yet.
fail2ban & WordPress Plugin: some help with PHP please?
Collapse
This topic is closed.
X
X
-
Fly to Hawaii for a telecom conference?!! Who doesn't have the concept of what a 'teleconference' is about? Or do you just want to go to Hawaii for other reasons? Hmm?
- Top
- Bottom
-
I suspect it'll work. I have to fly to Honolulu this evening for a telecom conference; back home Wednesday. We can experiment on Thursday if you'd like.
- Top
- Bottom
Leave a comment:
-
Exactly, otherwise any host that gets banned is on the blacklist, regardless of whether or not it got unbanned afterwards. So when you reboot, you'd be re-banning (permanently) all the unbanned IPs as well as the banned ones.Originally posted by SteveRiley View PostAs I think about this some more, what I suspect you want to do is have Fail2Ban's list survive a reboot, but still allow the entries to unban once the required time has elapsed. Is this correct?
My addition is supposed to remove entries from the blacklist when they are unbanned, so you don't end up re-banning people you previously wanted to unban.
- Top
- Bottom
Leave a comment:
-
Probably not your Pi, but possibly your head.Originally posted by Feathers McGraw View Postany reason why this might cause my pi to explode?
I know my head isn't completely where yours is at the moment (uh, don't go there...just...don't). As I think about this some more, what I suspect you want to do is have Fail2Ban's list survive a reboot, but still allow the entries to unban once the required time has elapsed. Is this correct?
- Top
- Bottom
Leave a comment:
-
so, how about this :
?Code:actionunban = iptables -D fail2ban-<name> -s <ip> -j DROP sed -i".bak" '/<ip>/d' /etc/fail2ban/ip.blacklist
any reason why this might cause my pi to explode?
- Top
- Bottom
Leave a comment:
-
Yeah, but if I'd like the ip.blacklist file to always reflect the current state of iptables, I'll have to modify "actionunban" or whatever it's called to search for that IP address in the ip.blacklist file and remove it. Otherwise there's little point in fail2ban being able to block people for a few hours and then unblock them, since they'll be blocked permanently after a reboot (unless I manually edit the list to unblock them, which surely defeats the point of automating with fail2ban!).
- Top
- Bottom
Leave a comment:
-
Oh. Duh, reading without comprehending again!
To remove an IP address from the permanent block list, just edit the file. Then, after a reboot, that IP will no longer be banned.
- Top
- Bottom
Leave a comment:
-
Thanks. That's useful for manually releasing a block, but I was getting at the fact that fail2ban usually unbans people after the specified amount of time, but anyone that is banned once will be permanently banned using the instructions in the link above, right?
EDIT: after a reboot, that is.
- Top
- Bottom
Leave a comment:
-
Probably a good argument for not permanently banning. You could get really fancy and have some kind of script look up potential to-be-banned addresses against whois, and if the address is in a netblock reserved for dynamic addresses, you could not add them to the block list. But because there's no single standard format for notating such blocks, I don't see the point.Originally posted by Feathers McGraw View PostHow do you deal with offenders that are on dynamic IPs? Surely when the IP addresses rotate, you'll still be banning the wrong user?
Originally posted by Feathers McGraw View PostThat tutorial includes an actionban statement that writes IPs to the blacklist, but how are the bans released?Fill in the italicized items appropriately.Code:sudo iptables -D [i]chain[/i] -s [i]ip-addr[/i] -j DROP
- Top
- Bottom
Leave a comment:
-
Cool! Thanks, that looks like a good solution.
Now fail2ban is up and running I just have to make sure I don't ban myself... lol.
(my home network is whitelisted, but I could easily lock myself out at work etc.)
How do you deal with offenders that are on dynamic IPs? Surely when the IP addresses rotate, you'll still be banning the wrong user?
That tutorial includes an actionban statement that writes IPs to the blacklist, but how are the bans released?
Feathers
- Top
- Bottom
Leave a comment:
-
Can't see any of your site at the moment, actually. Me <-- sad!Originally posted by Feathers McGraw View PostUnfortunately, you won't be able to access my turbo instructive tutorials for a few hours!! I'm sure you're inconsolable!
This should work: http://zach.seifts.us/posts/2013/07/...ans-persistentOriginally posted by Feathers McGraw View PostAs I understand it, iptables rules don't survive a reboot. What's the best way to make sure they are restored? I've read a few things, but most of them seem to be working around Network Manager. I'm pretty sure the Pi doesn't have NM...
- Top
- Bottom
Leave a comment:
-
Thanks for the link.
That's cool, I just wanted to be clear on what you meant when you said it "failed" - just the login or your entire connection to the server.
Glad it's working, thanks for your help testing.
Unfortunately, you won't be able to access my turbo instructive tutorials for a few hours!! I'm sure you're inconsolable!
Moving on...
As I understand it, iptables rules don't survive a reboot. What's the best way to make sure they are restored? I've read a few things, but most of them seem to be working around Network Manager. I'm pretty sure the Pi doesn't have NM...
- Top
- Bottom
Leave a comment:
-
My earlier round was only a one-shot thing. The ban happened on the third shot from my second round. If Fail2Ban is banning after the third failed attempt from the same source IP address, then it makes sense that the third attempt from my second round got hung -- that would be my fourth attempt from the same source IP address, which by definition is "anything after the third."
- Top
- Bottom
Leave a comment:
-
Yep, your domain name appears there.
I'm just surprised that only one of those login attempts was written to the log file (initially), and yet you were still banned! Or do you mean you were banned on your second iteration, when you were using a much more appropriately suggestive username?
Lol...Code:Jan 18 10:49:22 samhobbs wordpress(www.samhobbs.co.uk)[21060]: Authentication failure for dayncchaigh from 37.187.79.141 Jan 18 17:23:34 samhobbs wordpress(www.samhobbs.co.uk)[3766]: Authentication failure for admin from 86.173.246.243 Jan 18 22:54:03 samhobbs wordpress(www.samhobbs.co.uk)[4587]: Authentication failure for h4x0rd00d from 24.19.53.43 Jan 19 00:32:42 samhobbs wordpress(www.samhobbs.co.uk)[4913]: Authentication failure for insertinto from 24.19.53.43 Jan 19 00:32:50 samhobbs wordpress(www.samhobbs.co.uk)[4884]: Authentication failure for insertinto from 24.19.53.43 Jan 19 00:32:59 samhobbs wordpress(www.samhobbs.co.uk)[4844]: Authentication failure for insertinto from 24.19.53.43
- Top
- Bottom
Leave a comment:
-
Yeah, I think we all knew it's just for show. Deep down you're as twisted as the rest of us!Originally posted by Feathers McGraw View Postveneer of innocence
OK, I tried three times, with a little bit of SQL even. Attemps one and two returned the "invalid login" error, while attempt three just hang. Looks like Fail2Ban did its job.
To see current bans, run
Some discussion about how Fail2Ban watches log files and builds its block files: http://stuffphilwrites.com/2013/03/p...ders-fail2ban/Code:sudo iptables -L
Last edited by SteveRiley; Jan 18, 2014, 06:40 PM.
- Top
- Bottom
Leave a comment:
Users Viewing This Topic
Collapse
There are 0 users viewing this topic.
Leave a comment: