Community discussions

MikroTik App
 
Alex
Member Candidate
Member Candidate
Topic Author
Posts: 214
Joined: Thu Sep 30, 2004 11:07 am

virus port list

Thu Jun 16, 2005 1:14 am

Hello mikrotik guys!!
Can you upload script with blocked virus ports from demo router to forum or somewhere else.I can`t login via ftp to demo router and demo user haven`t write priviligy...
 
edzix
Member
Member
Posts: 333
Joined: Thu Jul 01, 2004 3:01 pm
Location: Latvia

Thu Jun 16, 2005 3:33 pm

copy/paste from the terminal.

Edgars
 
tbutcher
newbie
Posts: 43
Joined: Thu Apr 07, 2005 5:38 pm

Thu Jun 16, 2005 5:35 pm

How do you export them and then import then into another MT box?

Tim
 
User avatar
bax
Member Candidate
Member Candidate
Posts: 268
Joined: Mon Dec 20, 2004 8:45 pm
Location: Croatia

Thu Jun 16, 2005 8:02 pm

Before few months I was already put on forum full code ... only seach on forum ...
anyway here is again code:
ip firewall add name=virus
ip firewall rule input add in-interface=all action=jump \ jump-target=virus comment="!!! Check for well-known viruses !!!"
ip firewall rule forward add in-interface=all action=jump \ jump-target=virus comment="!!! Check for well-known viruses !!!"

ip firewall rule virus add dst-address=:135-139 protocol=tcp action=drop comment="Drop Blaster Worm." 
ip firewall rule virus add dst-address=:135-139 protocol=udp action=drop comment="Drop Messenger Worm."
ip firewall rule virus add dst-address=:445 protocol=tcp action=drop comment="Drop Blaster Worm."
ip firewall rule virus add dst-address=:445 protocol=udp action=drop comment="Drop Blaster Worm."
ip firewall rule virus add dst-address=:593 protocol=tcp action=drop comment=".........."
ip firewall rule virus add dst-address=:1024-1030 protocol=tcp action=drop comment=".........."
ip firewall rule virus add dst-address=:1080 protocol=tcp action=drop comment="Drop MyDoom"
ip firewall rule virus add dst-address=:1214 protocol=tcp action=drop comment=".........."
ip firewall rule virus add dst-address=:1363 protocol=tcp action=drop comment="ndm requester"
ip firewall rule virus add dst-address=:1364 protocol=tcp action=drop comment="ndm server"
ip firewall rule virus add dst-address=:1368 protocol=tcp action=drop comment="screen cast"
ip firewall rule virus add dst-address=:1373 protocol=tcp action=drop comment="hromgrafx"
ip firewall rule virus add dst-address=:1377 protocol=tcp action=drop comment="cichlid"
ip firewall rule virus add dst-address=:1433-1434 protocol=tcp action=drop comment="Worm"
ip firewall rule virus add dst-address=:2745 protocol=tcp action=drop comment="Bagle Virus"
ip firewall rule virus add dst-address=:2283 protocol=tcp action=drop comment="Drop Dumaru.Y"
ip firewall rule virus add dst-address=:2535 protocol=tcp action=drop comment="Drop Beagle"
ip firewall rule virus add dst-address=:3127-3128 protocol=tcp action=drop comment="Drop MyDoom"
ip firewall rule virus add dst-address=:3410 protocol=tcp action=drop comment="Drop Backdoor OptixPro"
ip firewall rule virus add dst-address=:4444 protocol=tcp action=drop comment="Worm"
ip firewall rule virus add dst-address=:4444 protocol=udp action=drop comment="Worm"
ip firewall rule virus add dst-address=:5554 protocol=tcp action=drop comment="Drop Sasser"
ip firewall rule virus add dst-address=:8866 protocol=tcp action=drop comment="Drop Beagle.B"
ip firewall rule virus add dst-address=:10000 protocol=tcp action=drop comment="Drop Dumaru.Y"
ip firewall rule virus add dst-address=:10080 protocol=tcp action=drop comment="Drop MyDoom.B"
ip firewall rule virus add dst-address=:12345 protocol=tcp action=drop comment="Drop NetBus"
ip firewall rule virus add dst-address=:17300 protocol=tcp action=drop comment="Drop Kuang2"
ip firewall rule virus add dst-address=:27374 protocol=tcp action=drop comment="Drop SubSeven"
ip firewall rule virus add dst-address=:65506 protocol=tcp action=drop comment="Drop PhatBot, Agobot, Gaobot"
Just copy and paste ...
 
Alex
Member Candidate
Member Candidate
Topic Author
Posts: 214
Joined: Thu Sep 30, 2004 11:07 am

Fri Jun 17, 2005 12:14 am

thx
 
OrCAD
Member Candidate
Member Candidate
Posts: 133
Joined: Wed Apr 20, 2005 12:37 pm

Thu Jul 07, 2005 12:40 am

Plz post virus-rules list for 2.9 terminal input ?
10x
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Thu Jul 07, 2005 11:10 am

ip firewall filter add chain=input ... etc.
ip firewall filter add chain=forward adn etc. :roll: :wink:
ip firewall filter add chain=virus... and add whatever you need :roll: :wink:
Last edited by sergejs on Thu Jul 07, 2005 11:13 am, edited 1 time in total.
 
OrCAD
Member Candidate
Member Candidate
Posts: 133
Joined: Wed Apr 20, 2005 12:37 pm

Thu Jul 07, 2005 1:10 pm

No problem, but is very simple to copy & paste from terminal...
only from OS 2.9 because 2.8 input line is different..

another thanks
 
lovellh
just joined
Posts: 6
Joined: Mon Feb 14, 2005 2:03 pm

firewall

Sun Jul 10, 2005 8:08 am

防火墙策略的内容

/ ip firewall
set input name="input" policy=accept comment=""
set forward name="forward" policy=accept comment=""
set output name="output" policy=accept comment=""
add name="virus" policy=none comment=""
/ ip firewall rule forward
add connection-state=invalid action=drop comment="Drop invalid connections" \
disabled=no
add connection-state=established action=accept comment="Established \
connections" disabled=no
add connection-state=related action=accept comment="Related connections" \
disabled=no
add action=jump jump-target=virus comment="!!! Check for well-known viruses \
!!!" disabled=no
add protocol=udp action=accept comment="UDP" disabled=no
add protocol=icmp limit-count=50 limit-burst=2 limit-time=5s action=accept \
comment="Allow limited pings" disabled=no
add protocol=icmp action=drop comment="Drop excess pings" disabled=no
/ ip firewall rule input
add connection-state=invalid action=drop comment="Drop invalid connections" \
disabled=no
add tcp-options=non-syn-only connection-state=established action=accept \
comment="Accept established connections" disabled=no
add connection-state=related action=accept comment="Accept related \
connections" disabled=no
add action=jump jump-target=virus comment="!!! Check for well-known viruses \
!!!" disabled=no
add protocol=udp action=accept comment="UDP" disabled=no
add protocol=icmp limit-count=50 limit-burst=2 limit-time=5s action=accept \
comment="Allow limited pings" disabled=no
add protocol=icmp action=drop comment="Drop excess pings" disabled=no
add dst-address=:22 protocol=tcp action=accept comment="SSH for demo \
purposes" disabled=no
add dst-address=:23 protocol=tcp action=accept comment="Telnet for demo \
purposes" disabled=no
add dst-address=:80 protocol=tcp action=accept comment="http for demo \
purposes" disabled=no
add dst-address=:3987 protocol=tcp action=accept comment="winbox for demo \
purposes" disabled=no
add action=drop log=yes comment="Log and drop everything else" disabled=no
/ ip firewall rule virus
add dst-address=:135-139 protocol=tcp action=drop comment="Drop Blaster Worm" \
disabled=no
add dst-address=:135-139 protocol=udp action=drop comment="Drop Messenger \
Worm" disabled=no
add dst-address=:445 protocol=tcp action=drop comment="Drop Blaster Worm" \
disabled=no
add dst-address=:445 protocol=udp action=drop comment="Drop Blaster Worm" \
disabled=no
add dst-address=:593 protocol=tcp action=drop comment="________" disabled=no
add dst-address=:1024-1030 protocol=tcp action=drop comment="________" \
disabled=no
add dst-address=:1080 protocol=tcp action=drop comment="Drop MyDoom" \
disabled=no
add dst-address=:1214 protocol=tcp action=drop comment="________" disabled=no
add dst-address=:1363 protocol=tcp action=drop comment="ndm requester" \
disabled=no
add dst-address=:1364 protocol=tcp action=drop comment="ndm server" \
disabled=no
add dst-address=:1368 protocol=tcp action=drop comment="screen cast" \
disabled=no
add dst-address=:1373 protocol=tcp action=drop comment="hromgrafx" \
disabled=no
add dst-address=:1377 protocol=tcp action=drop comment="cichlid" disabled=no
add dst-address=:1433-1434 protocol=tcp action=drop comment="Worm" \
disabled=no
add dst-address=:2745 protocol=tcp action=drop comment="Bagle Virus" \
disabled=no
add dst-address=:2283 protocol=tcp action=drop comment="Drop Dumaru.Y" \
disabled=no
add dst-address=:2535 protocol=tcp action=drop comment="Drop Beagle" \
disabled=no
add dst-address=:2745 protocol=tcp action=drop comment="Drop Beagle.C-K" \
disabled=no
add dst-address=:3127-3128 protocol=tcp action=drop comment="Drop MyDoom" \
disabled=no
add dst-address=:3410 protocol=tcp action=drop comment="Drop Backdoor \
OptixPro" disabled=no
add dst-address=:4444 protocol=tcp action=drop comment="Worm" disabled=no
add dst-address=:4444 protocol=udp action=drop comment="Worm" disabled=no
add dst-address=:5554 protocol=tcp action=drop comment="Drop Sasser" \
disabled=no
add dst-address=:8866 protocol=tcp action=drop comment="Drop Beagle.B" \
disabled=no
add dst-address=:9898 protocol=tcp action=drop comment="Drop Dabber.A-B" \
disabled=no
add dst-address=:10000 protocol=tcp action=drop comment="Drop Dumaru.Y" \
disabled=no
add dst-address=:10080 protocol=tcp action=drop comment="Drop MyDoom.B" \
disabled=no
add dst-address=:12345 protocol=tcp action=drop comment="Drop NetBus" \
disabled=no
add dst-address=:17300 protocol=tcp action=drop comment="Drop Kuang2" \
disabled=no
add dst-address=:27374 protocol=tcp action=drop comment="Drop SubSeven" \
disabled=no
add dst-address=:65506 protocol=tcp action=drop comment="Drop PhatBot, \
Agobot, Gaobot" disabled=no
 
gianluca
Member Candidate
Member Candidate
Posts: 258
Joined: Sun Aug 08, 2004 11:00 pm
Location: Italy - Spain - USA

Mon Jul 11, 2005 11:09 pm

I suppose that p2p programs (like emule or edonkey or bittorrent) can also use these ports so that blocking virus like that can also block the peer to peer program.

any experience on it?
 
OrCAD
Member Candidate
Member Candidate
Posts: 133
Joined: Wed Apr 20, 2005 12:37 pm

Tue Jul 12, 2005 12:37 am

Plz post list in OS2.9 syntax !
10x
 
User avatar
jp
Long time Member
Long time Member
Posts: 611
Joined: Wed Mar 02, 2005 5:06 am
Location: Maine
Contact:

Tue Jul 12, 2005 5:29 pm

Couldn't any tcp program choose to use a port randomly above 1024 for a return path? Would these mess that up?
 
gianluca
Member Candidate
Member Candidate
Posts: 258
Joined: Sun Aug 08, 2004 11:00 pm
Location: Italy - Spain - USA

Tue Jul 12, 2005 6:10 pm

that's what I am saying....
 
Vadim
newbie
Posts: 27
Joined: Sat May 29, 2004 9:58 pm
Location: Liepaja, Latvia
Contact:

Thu Jul 14, 2005 1:14 pm

[quote="gianluca"]I suppose that p2p programs (like emule or edonkey or bittorrent) can also use these ports so that blocking virus like that can also block the peer to peer program.

any experience on it?[/quote]Yes, that's true, but p2p programs select these ports randomly, and if the port is firewalled, they simply try another one. So, blocking some of these ports wouldn't affect operation of p2p programs.
 
marvin
Member Candidate
Member Candidate
Posts: 119
Joined: Mon Nov 15, 2004 9:56 pm

Tue Jul 26, 2005 6:45 pm

Got a question for you. Is it possible to get the IP or MAC address of the computer that it finds the known virus on? We only use static ip's for our customers so we would immediately know who it came from and can call or email them informing them a possible virus has been determined from their system.
 
Vadim
newbie
Posts: 27
Joined: Sat May 29, 2004 9:58 pm
Location: Liepaja, Latvia
Contact:

Tue Jul 26, 2005 9:40 pm

Hi, Marvin
The easiest way to do this is turning on logging on the firewall rule, that filters unwanted virus activity. Or you can create a forwarding rule for any specific part of traffic with "passthrough" action, and turn on logginig on it.
Be carefull if you do this from winbox on a heavy loaded system. Catching a pair of thousands of packets within some seconds, when the log window is open, can hang your router. Turn logging off before opening a log window.
 
gianluca
Member Candidate
Member Candidate
Posts: 258
Joined: Sun Aug 08, 2004 11:00 pm
Location: Italy - Spain - USA

Tue Jul 26, 2005 11:12 pm

we are thinking about a deeper solution:

pass all the traffic with a rule called virus (that checks all viruses with the rules here explained)

we also limit the maximum connection per src-address to 120, so if a virus is opening a lot of connections this fill the connection and the customer cannot use the internet.

if a virus is found for a certain IP address we would like to redirect the user to a local web page that says: attention, you have a virus.

extra function can be to have the name of the virus (if we know the rule that blocked the traffic) and also have the pacth of this/all virus downloadable from this page.

is there someone with good ideas on it or that would like to collaborate to such a solution ? we can set up a team and create this very added value solution for the residential market customers.
 
timew
just joined
Posts: 12
Joined: Mon Oct 11, 2004 8:31 pm

2.9 version

Sat Aug 20, 2005 10:40 pm

/ip firewall filter add chain=virus comment="Reglas Antivirus"


/ip firewall filter add chain=forward connection-state=invalid action=drop comment="Drop invalid connections" disabled=no
/ip firewall filter add chain=forward connection-state=established action=accept comment="Established Connections" disabled=no
/ip firewall filter add chain=forward connection-state=related action=accept comment="Related connections" disabled=no
/ip firewall filter add chain=forward action=jump jump-target=virus comment="!!! Check for well-known viruses !!!" disabled=no
/ip firewall filter add chain=forward protocol=udp action=accept comment="UDP" disabled=no
/ip firewall filter add chain=forward protocol=icmp limit=50/5,2 action=accept comment="Allow limited Pings" disabled=no
/ip firewall filter add chain=forward protocol=icmp action=drop comment="Drop excess pings" disabled=no


/ip firewall filter add chain=input connection-state=invalid action=drop comment="Drop invalid connections" disabled=no
/ip firewall filter add chain=input tcp-flags=!syn connection-state=established action=accept comment="Accept established connections" disabled=no
/ip firewall filter add chain=input connection-state=related action=accept comment="Accept related connections" disabled=no
/ip firewall filter add chain=input action=jump jump-target=virus comment="!!! Check for well-known viruses !!!" disabled=no
/ip firewall filter add chain=input protocol=udp action=accept comment="UDP" disabled=no
/ip firewall filter add chain=input protocol=icmp limit=50/5,2 action=accept comment="Allow limited pings" disabled=no
/ip firewall filter add chain=input protocol=icmp action=drop comment="Drop excess pings" disabled=no
/ip firewall filter add chain=input dst-port=22 protocol=tcp action=accept comment="SSH for demo purposes" disabled=no
/ip firewall filter add chain=input dst-port=23 protocol=tcp action=accept comment="Telnet for demo purposes" disabled=no
/ip firewall filter add chain=input dst-port=80 protocol=tcp action=accept comment="http for demo purposes" disabled=no
/ip firewall filter add chain=input dst-port=3987 protocol=tcp action=accept comment="winbox for demo purposes" disabled=no
/ip firewall filter add chain=input action=accept log=yes comment="Log and drop everything else" disabled=no


/ip firewall filter add chain=virus dst-port=135-139 protocol=tcp action=drop comment="Drop Blaster Worm" disabled=no
/ip firewall filter add chain=virus dst-port=135-139 protocol=udp action=drop comment="Drop Messenger Worm" disabled=no
/ip firewall filter add chain=virus dst-port=445 protocol=tcp action=drop comment="Drop Blaster Worm" disabled=no
/ip firewall filter add chain=virus dst-port=445 protocol=udp action=drop comment="Drop Blaster Worm" disabled=no
/ip firewall filter add chain=virus dst-port=593 protocol=tcp action=drop comment="________" disabled=no
/ip firewall filter add chain=virus dst-port=1024-1030 protocol=tcp action=drop comment="________" disabled=no
/ip firewall filter add chain=virus dst-port=1080 protocol=tcp action=drop comment="Drop MyDoom" disabled=no
/ip firewall filter add chain=virus dst-port=1214 protocol=tcp action=drop comment="________" disabled=no
/ip firewall filter add chain=virus dst-port=1363 protocol=tcp action=drop comment="ndm requester" disabled=no
/ip firewall filter add chain=virus dst-port=1364 protocol=tcp action=drop comment="ndm server" disabled=no
/ip firewall filter add chain=virus dst-port=1368 protocol=tcp action=drop comment="screen cast" disabled=no
/ip firewall filter add chain=virus dst-port=1373 protocol=tcp action=drop comment="hromgrafx" disabled=no
/ip firewall filter add chain=virus dst-port=1377 protocol=tcp action=drop comment="cichlid" disabled=no
/ip firewall filter add chain=virus dst-port=1433-1434 protocol=tcp action=drop comment="Worm" disabled=no
/ip firewall filter add chain=virus dst-port=2745 protocol=tcp action=drop comment="Bagle Virus" disabled=no
/ip firewall filter add chain=virus dst-port=2283 protocol=tcp action=drop comment="Drop Dumaru.Y" disabled=no
/ip firewall filter add chain=virus dst-port=2535 protocol=tcp action=drop comment="Drop Beagle" disabled=no
/ip firewall filter add chain=virus dst-port=2745 protocol=tcp action=drop comment="Drop Beagle.C-K" disabled=no
/ip firewall filter add chain=virus dst-port=3127-3128 protocol=tcp action=drop comment="Drop MyDoom" disabled=no
/ip firewall filter add chain=virus dst-port=3410 protocol=tcp action=drop comment="Drop Backdoor OptixPro" disabled=no
/ip firewall filter add chain=virus dst-port=4444 protocol=tcp action=drop comment="Worm" disabled=no
/ip firewall filter add chain=virus dst-port=4444 protocol=udp action=drop comment="Worm" disabled=no
/ip firewall filter add chain=virus dst-port=5554 protocol=tcp action=drop comment="Drop Sasser" disabled=no
/ip firewall filter add chain=virus dst-port=8866 protocol=tcp action=drop comment="Drop Beagle.B" disabled=no
/ip firewall filter add chain=virus dst-port=9898 protocol=tcp action=drop comment="Drop Dabber.A-B" disabled=no
/ip firewall filter add chain=virus dst-port=10000 protocol=tcp action=drop comment="Drop Dumaru.Y" disabled=no
/ip firewall filter add chain=virus dst-port=10080 protocol=tcp action=drop comment="Drop MyDoom.B" disabled=no
/ip firewall filter add chain=virus dst-port=12345 protocol=tcp action=drop comment="Drop NetBus" disabled=no
/ip firewall filter add chain=virus dst-port=17300 protocol=tcp action=drop comment="Drop Kuang2" disabled=no
/ip firewall filter add chain=virus dst-port=27374 protocol=tcp action=drop comment="Drop SubSeven" disabled=no
/ip firewall filter add chain=virus dst-port=65506 protocol=tcp action=drop comment="Drop PhatBot, Agobot, Gaobot" disabled=no
 
arffer
just joined
Posts: 21
Joined: Tue Mar 29, 2005 3:14 am

Fri Sep 09, 2005 1:57 am

Three questions about timew's filter set

1) In the chain=forward set, the 4th rule does a jump to the virus chain. As the virus chain does not have a return at its end, how do the remaining 3 forward rules ever get tested? (udp accept, limit pings, drop excess pings). I don't see how the chain ever gets back to those rules.

2) In the chain=input section, rule 4 also does a jump to the virus check chain. How can the actual router itself successfully be attacked by a virus/worm? Does the actual router really need protecting by this chain?

3) The last rule in the chain=input section states in the comment that the rule will log and drop everything else. But the action on the rule is accept. Shouldn't it be drop?

Thanks for helping me learn! :)

Who is online

Users browsing this forum: anav, capy2008, clambert, wkahla and 120 guests