Community discussions

MikroTik App
 
daiceman
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Tue Mar 01, 2005 9:43 pm

Setting up a Bait server for Firewall rules

Wed Jun 07, 2006 3:57 am

Hello,

Is it possible to build an input rule that will add-src-address of any ip that attempts a ssh,telnet or ftp connecton and fails 3 times within X number of seconds?

What I want to do is setup a target machine that will allow these hack attempts then add the addresses to an access list and block them from my entire network. No hack attempts, no spam, no nothing!!!

Any ideas?

Jeff
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6695
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Wed Jun 07, 2006 10:06 am

daiceman, I suppose, you can not implement this exactly in described way.
- To get rid of unauthorized access, allow access to the router only for trusted hosts (or for trusted hosts from public networks and for local hosts).
- Modify 'ip service', there are options to set different port for certain services or 'address' option.
 
daiceman
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Tue Mar 01, 2005 9:43 pm

Wed Jun 07, 2006 3:16 pm

daiceman, I suppose, you can not implement this exactly in described way.
- To get rid of unauthorized access, allow access to the router only for trusted hosts (or for trusted hosts from public networks and for local hosts).
- Modify 'ip service', there are options to set different port for certain services or 'address' option.
I already do this. Thank you.

What I was hoping for was to have a MT box that would have everything open and then create rules when it was attacked so that I could add firewall rules to my core firewall to block ANY traffic from the bad_people into my network. If I have say a firewall rule that only permits ssh into my network from IP's that I allow, that does not stop denied IP's from sending me spam and trying to FTP to my servers.

Guess I will look elsewhere.

Thanks
 
daiceman
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Tue Mar 01, 2005 9:43 pm

Tue Jun 27, 2006 10:25 pm

I GOT IT!!!

I set up a rule that adds any ssh attempt NOT from my network to an ACL and then DROP based on that ACL.

That way any prik that tries to SSH into my router will get listed and not be able to access ANYTHING on my network.

No spam, www, telnet, nothing!!!
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Wed Jun 28, 2006 7:09 am

you can do that way:

on accessing router to ssh port add user to 1st_try group in /ip firewall address-list with timeout of 10 minutes, then if there is another connection from that ip to that port add to 2nd_try address-list with timeout of, say, 20 minutes and after 3rd try in timout time you drop all the connections permanetly

if you try to login by yourself you have to login for the first time or you will get banned :roll:

drawback - you count login tries succesful+unsuccesful and thats bad
 
jarosoup
Long time Member
Long time Member
Posts: 596
Joined: Sun Aug 22, 2004 9:02 am

Wed Jun 28, 2006 6:34 pm

Alternatively, you can set the ssh, telnet, and www ports to something different than default in /ip service. As mentioned, you could end up blocking yourself. As a side note, alot of these ssh scans originate from compromised linux servers and you may only ever see them try to login one day. So, you might be blocking a lot of addresses that may never hit your router again.

Who is online

Users browsing this forum: bcmdevtl, overdrv, Qanj72, raiser, slimmerwifi and 200 guests