-
Notifications
You must be signed in to change notification settings - Fork 22
Attack_Parameter_Types
Jens Keim edited this page Oct 15, 2019
·
1 revision
Type | Description | Accepted values or examples |
---|---|---|
Boolean | Either true or false | y, yes, t, true, on, 1, n, no, f, false, off, 0 |
Domain | A domain as URI | URI = scheme:[//authority]path[?query][#fragment], authority = [userinfo@]host[:port] |
FilePath | An existing file path | /path/to/file |
Float | A floating point number | 3.141592654 |
IntegerLimited([x,y]) | An integer value limited by two borders | x <= value <= y |
IntegerPositive | A positive integer value | value >= 0 |
IPAddress | One or multiple ip addresses | 10.0.0.1 OR 10.0.0.1,10.0.0.2 OR 10.0.0.1-10.0.0.10 |
MACAddress | One or multiple mac addresses | 00:0C:29:9C:70:64 OR 00:0C:29:9C:70:64,04:0C:32:2C:63:62 |
Percentage | A percentage as a float | 0 <= value <= 1 |
Port | One or multiple ports | portA OR portA,portB |
SpecificString(LIST) | One string of a specified list | Only strings specified in the list. |
String | A string | "text" |
Timestamp | Timestamp within the input pcap file | YYYY-MM-DD h:m:s, whereas h, m, s may be one or two digits |
Parameter Types are class objects that inherit from the class ParameterType
in BaseType.py
. If you wish to create a new Parameter, you can create a class that inherits from it or an already existing Parameter Type, as follows:
from Attack.ParameterTypes.BaseType import ParameterType
class NewParameterType(ParameterType):
def __init__(self):
super(NewParameterType, self).__init__()
self.name = "NewParameterType"
def validate(self, value) -> (bool, str):
# validate value and save result in is_valid
return is_valid, value