标签: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‘))
标签:for type span pen rgb _for open esc waf
原文地址:https://www.cnblogs.com/dissipate/p/14646809.html