pull/216/head
midoks 3 years ago
parent 7bdcd0ac2b
commit 444ff40570
  1. 4
      plugins/op_waf/t/index.py
  2. 8
      plugins/op_waf/waf/html/safe_js.html
  3. 3
      plugins/op_waf/waf/lua/common.lua
  4. 15
      plugins/op_waf/waf/lua/init.lua

@ -212,10 +212,10 @@ def test_start():
# test_OK() # test_OK()
# test_Dir() # test_Dir()
# test_UA() # test_UA()
test_UA_for(1000) # test_UA_for(1000)
# test_POST() # test_POST()
# test_scan() # test_scan()
# test_CC() test_CC()
# test_url_ext() # test_url_ext()
# test_cdn() # test_cdn()

@ -125,14 +125,14 @@ function ajax(type,bool){
return xhr; return xhr;
} }
var ok = setInterval(function(){ ajax('JSON',true).post('{uri}',{'pass':"ok"}, function(data){
ajax('JSON',true).post('{uri}',{'pass':"ok"},function(data){
if (data['status'] == 0){ if (data['status'] == 0){
document.getElementById('status').innerHTML = 'ok';
location.reload(); location.reload();
} }
}); });
var ok = setInterval(function(){
var id = document.getElementById('change').innerHTML; var id = document.getElementById('change').innerHTML;
id = id - 1; id = id - 1;
if (id == 0){ if (id == 0){

@ -180,7 +180,10 @@ end
function _M.return_message(self, status, msg) function _M.return_message(self, status, msg)
ngx.header.content_type = "application/json" ngx.header.content_type = "application/json"
self:D("return_message:"..tostring(status)..tostring(msg))
local data = self:return_state(status, msg) local data = self:return_state(status, msg)
self:D("return_message[data]:"..tostring(data))
ngx.say(json.encode(data)) ngx.say(json.encode(data))
ngx.exit(200) ngx.exit(200)
end end

@ -62,6 +62,15 @@ local function get_waf_drop_ip()
return data return data
end end
local function return_json(status,msg)
ngx.header.content_type = "application/json"
result = {}
result['status'] = status
result['msg'] = msg
ngx.say(json.encode(data))
ngx.exit(200)
end
local function is_chekc_table(data,strings) local function is_chekc_table(data,strings)
if type(data) ~= 'table' then return 1 end if type(data) ~= 'table' then return 1 end
if not data then return 1 end if not data then return 1 end
@ -308,8 +317,10 @@ local function waf_cc_increase()
if params['uri_request_args']['token'] then if params['uri_request_args']['token'] then
local args_token = params['uri_request_args']['token'] local args_token = params['uri_request_args']['token']
if args_token == make_token then if args_token == make_token then
ngx.shared.waf_limit:set(cache_token,1, config['safe_verify']['time']) ngx.shared.waf_limit:set(cache_token, 1, config['safe_verify']['time'])
C:return_message(0,'ok') local data = get_return_state(0, "ok")
ngx.say(json.encode(data))
ngx.exit(200)
end end
end end

Loading…
Cancel
Save