/ip firewall address-list add list=daily-conficker address=$listip
/ip firewall address-list add list=daily-conficker address=$listip comment=$entry
Yes, as noted in my post above, I only found out after finishing the scrip that the mikrotik :resolve command is currently broken, any failed resolution simple forces the script to quit, hence using opendns is the only way I see to get it to complete at this time.. too bad we've got no other solution for the 1st April
However, if you're still getting an error in the script even thou all addresses are resolving, run it from terminal instead and let me know what line it errors on and I'll have a look.
then paste the output./system run script daily-conficker-list
is what you want to do./system script run daily-conficker-list
arggh sorry, typois what you want to do./system script run daily-conficker-list
yeah but the previous post I did was incorrect..
when you ran
/system run script XXXXX
it didn't run the script at all.. because my syntax was wrong.
you need to run
/system script run XXXXXX
it was my message to you that had an error, I've also tried the script on one of my 3.17 boxes and it works fine.
Hey Man , is that means it won't work on 3.x !!?oh bugger. Just found out that the :resolve command failing causes a script to halt in 3.X
If it gets the failure message it means the :resolve has failed and stops the script from continuing (the bug mentioned in my second post)
If you're using opendns servers (208.67.222.222 208.67.220.220) as your dns servers this should not happen as any invalid requests will instead be returned an opendns address (normally in the 208.67.X.X range)
Hey Man , is that means it won't work on 3.x !!?oh bugger. Just found out that the :resolve command failing causes a script to halt in 3.X
and what about 2.x
something else , should i make a firewall filter rule to block any connection to these sites ?
i have a deep bad feeling about this mess , MS is crashing down
harry up man , tomorrow is the date
sorry , one more thing , this happened after i used this script from wiki
is this this right ?
Just received these from a security consultant friend. Combined with the script here this should help us pickup any infected users but requires a computer on the inside (we use an older server with ESXi which allows remote access) which i believe is a good investment for any sites over 500 users.Nmap has released a new (beta) release that enables Conficker infections
just by scanning the network.
For more information (including commands for Conficker scanning) see:
http://insecure.org/
An original tool (before it was added into nmap) is also available:
http://iv.cs.uni-bonn.de/uploads/media/scs.zip
And further info can be found at these sites:
http://www.honeynet.org/
(https://www.honeynet.org/node/389)
http://iv.cs.uni-bonn.de/wg/cs/applicat ... conficker/
:put [:resolve tleksfchxqb.com]
failure
ssh my-router ':local listip [:resolve "aa.com"]; :if ($listip != "failure" ) do={
/ip firewall address-list add list=daily-conficker address=$listip comment="aa.com"
:log info "$listip"
}
...'
#resolve each new line and add to the address list daily-conficker. updated to list domain as comment
:if ( [:pick $line 0 1] != "\n" ) do={
:local entry [:pick $line 0 ($lineEnd ) ]
:if ( [:len $entry ] > 0 ) do={
:local listip [:resolve "$entry"]
:if ($listip != "failure" ) do={
:if ((/ip firewall address-list find list=daily-conficker address=$listip) = "") do={
/ip firewall address-list add list=daily-conficker address=$listip comment=$entry
:log info "$listip"
} else={:log info "duplicate IP $entry"}
}
}
}
} while ($lineEnd < $contentLen)
}
:log info "Address List Modification Complete"
#cleaning up
/file remove "$month-$day-$year.txt"
At this part script stops. Last output in log is "duplicate IP fnsqijun.org"The following script will stop the addition of duplicate IP's.
You should be able to see from the comments what it replaces, but if not I've updated the wiki entry to reflect the new script.Code: Select all#resolve each new line and add to the address list daily-conficker. updated to list domain as comment :if ( [:pick $line 0 1] != "\n" ) do={ :local entry [:pick $line 0 ($lineEnd ) ] :if ( [:len $entry ] > 0 ) do={ :local listip [:resolve "$entry"] :if ($listip != "failure" ) do={ :if ((/ip firewall address-list find list=daily-conficker address=$listip) = "") do={ /ip firewall address-list add list=daily-conficker address=$listip comment=$entry :log info "$listip" } else={:log info "duplicate IP $entry"} } } } } while ($lineEnd < $contentLen) } :log info "Address List Modification Complete" #cleaning up /file remove "$month-$day-$year.txt"
Not work for me!, is I put set allow-remote-requests=yes work, but if it works but makes the blocks that have previously configured, the only way NAT works is redirected from the udp port 53 to the OpenDNS DNS server but that's how I mark the cache IP - DNS - CacheUse opendns servers.
clear dns cache.
/ip dns
set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 primary-dns=\
208.67.220.220 secondary-dns=208.67.222.222
/ip dns cache flush