https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /etc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //etc/copper.lua
-- vim: set ts=2 expandtab:

require 'apache2'
require 'os'

-- We use socket.http rather than lua-http because lua-http is completely broken on Bionic :'(
local http = require "socket.http"
http.TIMEOUT = 1

function query_access_controller(client_ip)
  -- We expect this call to return either a 200 OK or 429
  local req, code, headers = http.request("http://localhost:1997/access-check?client_ip=" .. client_ip)
  return code, headers
end

function distributed_traffic(r)
  -- Let bots do *some* botty things
  if r.uri == "/robots.txt" then
    return apache2.DECLINED
  end

  -- `success` denotes whether the call to query_access_controller() succeeded or not
  -- `response` is the return code from query_access_controller() if it did succeed
  local success, response, headers = pcall(query_access_controller, r.useragent_ip)
  if success == false then
    -- Tell Apache that we've decided to not handle the request
    return apache2.DECLINED
  elseif response == 429 then
    -- return `Too Many Requests`
    r.err_headers_out['copper-block-reason'] = headers['block-reason']
    return 429
  end
  -- Fallback
  return apache2.DECLINED

end


https://t.me/RX1948 - 2025