Block IP permanently after a few failed login attempts

You can share your Lua Scripts with everybody here.

Block IP permanently after a few failed login attempts

Postby FTP » Wed Apr 08, 2020 3:49 am

First, enable the anti-hammer option under "Domain > Settings > General Settings > Password & Security > Enable Anti-hammer".

And then insert the following Lua script in the event "OnExceedUSERPASS":

Code: Select all
local ipmasks = c_GetGlobalIPMaskList()
local g_ipmasks = {}
if type(ipmasks) == "table" then
   for _,ipmask in pairs(ipmasks) do
      local temp = {}
      table.insert(temp,ipmask.ip)
      table.insert(temp,ipmask.refuse)
      table.insert(g_ipmasks,temp)
   end
end
table.insert(g_ipmasks,{"%IP",true})
c_SetGlobalIPMaskList(g_ipmasks)
FTP
Site Admin
 
1876
 
Tue Sep 29, 2009 6:09 am

Re: Block IP permanently after a few failed login attempts

Postby TeamBas » Wed Sep 22, 2021 1:11 pm

And how can I reverse a ban if I have used the script?
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron