Skip to content
Snippets Groups Projects
Commit e3b6119f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

DNSBL-exempt localhost (127.*) and private network (10.*, 192.168.*) addresses

Someone should add IPv6 exempted addresses too

Maybe perform a check against ctrl/dnsbl_exempt.cfg too?
parent d5fcf032
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4543 passed
......@@ -2775,6 +2775,7 @@ function accept_new_socket() {
}
// Start of DNSBL check
if(!dnsbl_exempt(sock.remote_ip_address)) {
const dnsbl_result = check_dnsbl(sock.remote_ip_address, 'dnsbl.dronebl.org');
if (dnsbl_result) {
sock.send(format(
......@@ -2785,6 +2786,7 @@ function accept_new_socket() {
sock.close();
return false;
}
}
// End of DNSBL check
if (IP_Banned(sock.remote_ip_address)) {
......@@ -3079,6 +3081,15 @@ function StatsM() {
this.executions = 0;
}
function dnsbl_exempt(ip) {
if(ip.indexOf("192.168.") == 0)
return true;
if(ip.indexOf("10.") == 0)
return true;
if(ip.indexOf("127.") == 0)
return true;
return false;
}
function check_dnsbl(ip, rbl) {
m = ip.match(/^(?:::ffff:)?([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment