3
0

AttackParameters.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import enum
  2. class Parameter(enum.Enum):
  3. """
  4. Defines the shortname for attack parameters. The shortname may be used for attack parameter specification
  5. when calling ID2T via the command line.
  6. """
  7. # recommended type: IP address -------------------------------
  8. IP_SOURCE = 'ip.src' # source IP address
  9. IP_DESTINATION = 'ip.dst' # destination IP address
  10. IP_DNS = 'ip.dns' # IP address of DNS server
  11. HOSTING_IP = 'hosting.ip'
  12. IP_DESTINATION_END = 'ip.dst.end'
  13. # recommended type: MAC address ------------------------------
  14. MAC_SOURCE = 'mac.src' # MAC address of source
  15. MAC_DESTINATION = 'mac.dst' # MAC address of destination
  16. # recommended type: Port -------------------------------------
  17. PORT_OPEN = 'port.open' # open ports
  18. PORT_DESTINATION = 'port.dst' # destination ports
  19. PORT_SOURCE = 'port.src' # source ports
  20. # recommended type: Integer positive -------------------------
  21. PACKETS_LIMIT = 'packets.limit'
  22. NUMBER_ATTACKERS = 'attackers.count'
  23. ATTACK_DURATION = 'attack.duration' # in seconds
  24. VICTIM_BUFFER = 'victim.buffer' # in packets
  25. TARGET_URI = 'target.uri'
  26. # recommended type: domain -----------------------------------
  27. TARGET_HOST = 'target.host'
  28. # recommended type: Float ------------------------------------
  29. PACKETS_PER_SECOND = 'packets.per-second' # packets per second
  30. INJECT_AT_TIMESTAMP = 'inject.at-timestamp' # unix epoch time (seconds.millis) where attack should be injected
  31. # recommended type: Packet Position ----------------------------------
  32. INJECT_AFTER_PACKET = 'inject.after-pkt' # packet after which attack should be injected
  33. # recommended type: boolean --------------------------------
  34. PORT_DEST_SHUFFLE = 'port.dst.shuffle' # shuffles the destination ports if a list of ports is given
  35. PORT_DEST_ORDER_DESC = 'port.dst.order-desc' # uses a descending port order instead of a ascending order
  36. IP_SOURCE_RANDOMIZE = 'ip.src.shuffle' # randomizes the sources IP address if a list of IP addresses is given
  37. PORT_SOURCE_RANDOMIZE = 'port.src.shuffle' # randomizes the source port if a list of sources ports is given
  38. PROTOCOL_VERSION = 'protocol.version'
  39. HOSTING_VERSION = 'hosting.version'
  40. SOURCE_PLATFORM = 'src.platform'
  41. CUSTOM_PAYLOAD = 'custom.payload' # custom payload for ftp exploits
  42. CUSTOM_PAYLOAD_FILE = 'custom.payload.file' # file that contains custom payload for ftp exploits
  43. class ParameterTypes(enum.Enum):
  44. """
  45. Defines types for parameters. These types may be used in the specification of allowed parameters within the
  46. individual attack classes. The type is used to verify the validity of the given value.
  47. """
  48. TYPE_IP_ADDRESS = 0
  49. TYPE_MAC_ADDRESS = 1
  50. TYPE_PORT = 2
  51. TYPE_INTEGER_POSITIVE = 3
  52. TYPE_TIMESTAMP = 4
  53. TYPE_BOOLEAN = 5
  54. TYPE_FLOAT = 6
  55. TYPE_PACKET_POSITION = 7 # used to derive timestamp from parameter INJECT_AFTER_PACKET
  56. TYPE_DOMAIN = 8
  57. TYPE_STRING = 9