Showing posts with label SCRIPT. Show all posts
Showing posts with label SCRIPT. Show all posts

Mikrotik Malicious Spam IP Blacklist – Firewall Auto Update Script



We have published a malicious ip blacklist for free! Combined dshield and spamhaus malicious blacklists formatted for Mikrotik RouterOS .rsc import script to firewall address list, updated daily and formatted by our servers for easy import and download into your Mikrotik Router.


It can be downloaded directly here. Or follow the instructions below to setup firewall rules and schedule automatic daily updates on any Mikrotik Router.



To automatically download, update, and apply the combind Dshield, Spamhaus ip blacklists on your Mikrotik Router:
First: Log into Winbox.


Open a terminal and add the following firewall rules


ip firewall raw add chain=prerouting dst-address-list="sbl malc0de" action=drop comment="sbl malc0de"
ip firewall raw add chain=prerouting dst-address-list="sbl dshield" action=drop comment="sbl dshield"
ip firewall raw add chain=prerouting dst-address-list="sbl spamhaus" action=drop comment="sbl spamhaus"
ip firewall raw add chain=prerouting dst-address-list="sbl blocklist.de" action=drop comment="sbl blocklist.de"


Now we need to schedule the automated update: Go to system scheduler and create a new task.





/tool fetch address=www.squidblacklist.org host=www.squidblacklist.org mode=http src-path=/downloads/drop.malicious.rsc


Now we schedule the import task: Go to system scheduler and create a new task.




:log warning "Disabling system Logging";
import drop.malicious.rsc
/system logging enable 0

Block registration spam bot using jquery html


THIS SCRIPT DISABLE SUBMIT BUTTON IF THE HIDDEN FORM TEXT AREA IS AUTO FILLED BY BOT

<script src='http://code.jquery.com/jquery-1.7.1.min.js'></script>
<input type="text" id="message" style="display:none;">
                <input class="button" name="adduser" type="submit" id="adduser" value="{NUSRREGNM17}">

<SCRIPT>
$(document).ready(function(){
    $('#adduser').attr('disabled',false);
    
    $('#message').keyup(function(){
        if($(this).val().length !=0){
            $('#adduser').attr('disabled', true);
        }
        else
        {
            $('#adduser').attr('disabled', false);        
        }
    })
});
</script>

Mikrotik dual wan failover script


Mikrotik Multi wan failover script

# Script Starts here...
# Internet Host to be checked You can modify them as per required, JZ
:local host1   "8.8.8.8"
:local host2   "208.67.222.123"
 
# Do not modify data below without proper understanding.
:local i 0;
:local F 0;
:local date;
:local time;
:global InternetStatus;
:global InternetLastChange;
 
# PING each host 5 times
:for i from=1 to=5 do={
if ([/ping $host1 count=1]=0) do={:set F ($F + 1)}
if ([/ping $host2 count=1]=0) do={:set F ($F + 1)}
:delay 1;
};
 
# If both links are down and all replies are timedout, then link is considered down
:if (($F=10)) do={
:if (($InternetStatus="UP")) do={
:log error "WARNING : The INTERNET link seems to be DOWN. Please Check";
:set InternetStatus "DOWN";
 
##      ADD YOUR RULES HERE, LIKE ROUTE CHANGE OR WHAT EVER IS REQUIRED, Example is below ...
##     /ip route set [find comment="Default Route"] distance=3
##     /ip firewall nat disable [find comment="Your Rules, Example"]
 
:set date [/system clock get date];
:set time [/system clock get time];
:set InternetLastChange ($time . " " . $date);
} else={:set InternetStatus "DOWN";}
} else={
 
##      If reply is received , then consider the Link is UP
:if (($InternetStatus="DOWN")) do={
:log warning "WARNING :The INTERNET link have been restored";
:set InternetStatus "UP";
 
##      ADD YOUR RULES HERE, LIKE ROUTE CHANGE OR WHAT EVER IS REQUIRED, Example is below ...
##     /ip route set [find comment="Default Route"] distance=1
##     /ip firewall nat enable  [find comment="Your Rules, Example"]
 
:set date [/system clock get date];
:set time [/system clock get time];
:set InternetLastChange ($time . " " . $date);
} else={:set InternetStatus "UP";}
}
 
# Script Ends Here.
# Thank you

Auto Send Email Mikrotik Backup File

Auto Send Email Mikrotik Backup File Script


:log info "*** Auto-backup konfigurasi RB Central Ganesha - RB450G"
:global backupfile Konfigurasi_RBCentralGanesha_RB450G
:global mikrotikexport Resource_RBCentralGanesha_RB450G
 
/system backup save name=$backupfile
/export file=$mikrotikexport
 
:log info "*** Sending Email ..."
:delay 400s
 
/tool e-mail send to="windhiartoarief@gmail.com" subject=([/system clock get date] . \
" - AutoBackup Konfigurasi - RB Central Ganesha - RB450G") body="File autobackup konfigurasi Mikrotik"  file=$backupfile start-tls=yes
 
/tool e-mail send to="ariefwindhiarto@gmail.com" subject=([/system clock get date] . \
" - AutoBackup Konfigurasi - RB Central Ganesha - RB450G") body="File autobackup konfigurasi Mikrotik"  file=$backupfile start-tls=yes
 
/tool e-mail send to="windhiartoarief@gmail.com" subject=([/system clock get date] . \
" - AutoBackup Resource - RB Central Ganesha - RB450G") body="File autobackup resource Mikrotik" file=$mikrotikexport start-tls=yes
 
/tool e-mail send to="ariefwindhiarto@gmail.com" subject=([/system clock get date] . \
" - AutoBackup Resource - RB Central Ganesha - RB450G") body="File autobackup resource Mikrotik" file=$mikrotikexport start-tls=yes
 
:delay 40s
:log info "*** Email Send Successfully !!"
/file remove $backupfile

Mikrotik Malicious Spam IP Blacklist – Firewall Auto Update Script

We have published a malicious ip blacklist for free! Combined dshield and spamhaus malicious blacklists formatted for Mikrotik RouterOS .r...