mirror of
https://github.com/dongdongunique/EvoSynth.git
synced 2026-06-01 20:51:40 +02:00
16 lines
505 B
Python
16 lines
505 B
Python
from ..base_attack import BaseAttack
|
|
from abc import ABC, abstractmethod
|
|
class BaseBlackBoxAttack(BaseAttack):
|
|
"""黑盒攻击的基类,可以提供通用工具。"""
|
|
@abstractmethod
|
|
def attack(self, target: str):
|
|
"""
|
|
执行攻击,返回攻击结果。
|
|
|
|
Args:
|
|
target: 攻击目标
|
|
|
|
Returns:
|
|
AttackResult: 攻击结果对象
|
|
"""
|
|
raise NotImplementedError("Subclasses must implement the attack method.") |