Skip to content
Snippets Groups Projects

Added RBL lookups on connection via DroneDL.

Merged Nigel Reed requested to merge add_rbl_to_ircd into master
3 unresolved threads

RBL lookups are turned on by dedault and highly recommended all irc admins leave it in place. This will block known spambots from invading the Synchronet IRC network. If you want to add this to an older version of the ircd, take the checkip function from core.js along with the section between RBL comments and added them to the older version. Thanks to Keyop for finding DroneDL.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
3117 fillpos = a.indexOf('');
3118 if (fillpos === -1)
3119 return false;
3120 a.splice(fillpos, 0, '0000');
3121 }
3122 fillpos = a.indexOf('');
3123 if (fillpos != -1)
3124 a.splice(fillpos, 1, '0000');
3125 a.reverse();
3126 qstr = '';
3127 a.forEach(function(piece) {
3128 qstr += piece[3] + '.' + piece[2] + '.' + piece[1] + '.' + piece[0] + '.' + rbl;
3129 });
3130
3131 }
3132 return resolve_ip(qstr) || 'NXDOMAIN';
  • Why 'NXDOMAIN' as a magic string to return and check for? resove_ip() returns null on failure to resolve, so just check for a non-truth result of checkip() and return the return value of resolve_ip() here.

  • Author Developer

    Because I suck and I did what works for me just so we can get it working and stop the bots.

  • Please register or sign in to reply
  • 3066 3086 this.executions = 0;
    3067 3087 }
    3068 3088
    3089
    3090 function checkip(ip) {
    3091 const rbl='dnsbl.dronebl.org';
    3092 m = ip.match(/^(?:::ffff:)?([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i);
    3093 if (m !== null) {
    3094 // IPv4 Address
    3095 if (parseInt(m[1], 10) > 255 || parseInt(m[2], 10) > 255 || parseInt(m[3], 10) > 255 || parseInt(m[4], 10) > 255)
    3096 return false;
    • So here (and later) checkip() is returning false, but the code that checks the return value of checkip() only checks for 'NXDOMAIN' and undefined and handles those as expected return values.

      Edited by Rob Swindell
    • Author Developer

      I thought I changed these to just return; rather than return false;. I'll have to check.

    • You'd want to return a value in all cases, not just return;

      But make sure you're actually checking-for/handling the possible return values in the caller.

    • Please register or sign in to reply
  • 3066 3086 this.executions = 0;
    3067 3087 }
    3068 3088
    3089
    3090 function checkip(ip) {
    3091 const rbl='dnsbl.dronebl.org';
  • Author Developer

    It was either that or wait a week while I figure out how to add it to the ircd config. Sorry I bothered, I'm sure.

  • merged

  • Rob Swindell mentioned in commit 43074410

    mentioned in commit 43074410

  • Please register or sign in to reply
    Loading