inspircd / inspircd-contrib

Third-party InspIRCd module repository.
https://www.inspircd.org
66 stars 72 forks source link

Add to [m_requirectcp] to show the CTCP response to #chanlog #198

Closed EpicNet closed 3 years ago

EpicNet commented 5 years ago

Add to the module “_mrequirectcp.cpp” if the requested CTCP response from the connected client is received so that it can be seen in the log channel when SnoMask (+p) is enabled, with the option to add your own response prefixes. And if there was no answer, then add the ability to set a ban for a specific time.

Prefix identifiers: $nick, $ident, $ip, $host, $version

Setup example: <requirectcp ctcp="VERSION" accepted="Check passed" chanlog="yes" prefix="VERSION: $nick \"$version\"" declined="Your client does not respond to CTCP requests" gline="yes" period="1h">

Log response example:

[12:45:18] <myserver: VERSION: User "my client v.1.0.0 by Master"

KoraggKnightWolf commented 5 years ago
  1. This belongs in inspircd-extras
  2. m_conn_require from the extras repo can do the blocking or banning you seek also based on more criteria. Logging the responses would be a lot on a large network not to mention some scripts even give out multiple responses.

Regards,

Koragg

NikosPapakonstantinou commented 3 years ago

The last version supports snomask ServerInstance->SNO->EnableSnomask('p', "REQUIRECTCP"); and ServerInstance->SNO->WriteGlobalSno('p', "Suspicious connection on port %d (class %s) from %s (%s) was blocked by m_requirectcp" which monitors the denied connect attempts. These connections are not reaching your server and you shouldn't ban them. If someone spams, m_conn_throttle is the right module.

The module modification request has been completed and you can find the updated version here: https://github.com/inspircd/inspircd-contrib/blob/master/2.0/m_requirectcp.cpp