码迷,mamicode.com
首页 > 其他好文 > 详细

解封waf黑名单

时间:2021-04-13 11:55:43      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:for   type   span   pen   rgb   _for   open   esc   waf   

  

 

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkwaf_openapi.request.v20190910.DescribeProtectionModuleRulesRequest import DescribeProtectionModuleRulesRequest
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkwaf_openapi.request.v20190910.ModifyProtectionModuleRuleRequest import ModifyProtectionModuleRuleRequest
import json

client = AcsClient(LTAI4G5DeZ51DVkPNQpRzLnC, iTiUiDnGzs7OFqMjIr9YURuRy9RWAr, cn-hangzhou)

request = DescribeProtectionModuleRulesRequest()
request.set_accept_format(json)

request.set_DefenseType("ac_blacklist")
#request.set_DefenseType("ac_custom")
request.set_InstanceId("waf-93ny2ehdkhca")
request.set_Domain("*.51cjml.com")

response = client.do_action_with_exception(request)
response=json.loads(response)[Rules][0][Content][remoteAddr]
print(type(response),response)
print(1.192.36.88 in response)

response.remove(1.192.36.88)

client = AcsClient(LTAI4G5DeZ51DVkPNQpRzLnC, iTiUiDnGzs7OFqMjIr9YURuRy9RWAr, cn-hangzhou)

request = ModifyProtectionModuleRuleRequest()
request.set_accept_format(json)

request.set_Domain("*.51cjml.com")
request.set_DefenseType("ac_blacklist")
request.set_RuleId("1512468")
request.set_Rule({"remoteAddr":response})
request.set_LockVersion("1")
request.set_InstanceId("waf-93ny2ehdkhca")

response = client.do_action_with_exception(request)
print(str(response, encoding=utf-8))

 

 

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkwaf_openapi.request.v20190910.DescribeProtectionModuleRulesRequest import DescribeProtectionModuleRulesRequest
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkwaf_openapi.request.v20190910.ModifyProtectionModuleRuleRequest import ModifyProtectionModuleRuleRequest
import json

client = AcsClient(LTAI4G5DeZ51DVkPNQpRzLnC, iTiUiDnGzs7OFqMjIr9YURuRy9RWAr, cn-hangzhou)

request = DescribeProtectionModuleRulesRequest()
request.set_accept_format(json)

request.set_DefenseType("ac_blacklist")
#request.set_DefenseType("ac_custom")
request.set_InstanceId("waf-93ny2ehdkhca")
request.set_Domain("*.zhipeicloud.com")

response = client.do_action_with_exception(request)
response=json.loads(response)[Rules][0][Content][remoteAddr]
print(type(response),response)
print(1.192.36.88 in response)

response.remove(1.192.36.88)

client = AcsClient(LTAI4G5DeZ51DVkPNQpRzLnC, iTiUiDnGzs7OFqMjIr9YURuRy9RWAr, cn-hangzhou)

request = ModifyProtectionModuleRuleRequest()
request.set_accept_format(json)

request.set_Domain("*.zhipeicloud.com")
request.set_DefenseType("ac_blacklist")
request.set_RuleId("1512468")
request.set_Rule({"remoteAddr":response})
request.set_LockVersion("1")
request.set_InstanceId("waf-93ny2ehdkhca")

response = client.do_action_with_exception(request)
print(str(response, encoding=utf-8))

 

解封waf黑名单

标签:for   type   span   pen   rgb   _for   open   esc   waf   

原文地址:https://www.cnblogs.com/dissipate/p/14646809.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!