AttackParameters.py 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. from enum import Enum
  2. class Parameter(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. # recommended type: MAC address ------------------------------
  12. MAC_SOURCE = 'mac.src' # MAC address of source
  13. MAC_DESTINATION = 'mac.dst' # MAC address of destination
  14. # recommended type: Port -------------------------------------
  15. PORT_OPEN = 'port.open' # open ports
  16. PORT_DESTINATION = 'port.dst' # destination ports
  17. PORT_SOURCE = 'port.src' # source ports
  18. # recommended type: Integer positive -------------------------
  19. PACKETS_LIMIT = 'packets.limit'
  20. NUMBER_ATTACKERS = 'attackers.count'
  21. ATTACK_DURATION = 'attack.duration' # in seconds
  22. VICTIM_BUFFER = 'victim.buffer' # in packets
  23. TARGET_URI = 'target.uri'
  24. NUMBER_INITIATOR_BOTS = 'bots.count'
  25. # recommended type: domain -----------------------------------
  26. TARGET_HOST = 'target.host'
  27. # recommended type: Float ------------------------------------
  28. PACKETS_PER_SECOND = 'packets.per-second' # packets per second
  29. INJECT_AT_TIMESTAMP = 'inject.at-timestamp' # unix epoch time (seconds.millis) where attack should be injected
  30. # recommended type: Packet Position ----------------------------------
  31. INJECT_AFTER_PACKET = 'inject.after-pkt' # packet after which attack should be injected
  32. # recommended type: boolean --------------------------------
  33. PORT_DEST_SHUFFLE = 'port.dst.shuffle' # shuffles the destination ports if a list of ports is given
  34. PORT_DEST_ORDER_DESC = 'port.dst.order-desc' # uses a descending port order instead of a ascending order
  35. IP_SOURCE_RANDOMIZE = 'ip.src.shuffle' # randomizes the sources IP address if a list of IP addresses is given
  36. PORT_SOURCE_RANDOMIZE = 'port.src.shuffle' # randomizes the source port if a list of sources ports is given
  37. NAT_PRESENT = 'nat.present' # if NAT is active, external computers cannot initiate a communication in MembersMgmtCommAttack
  38. # recommended type: Filepath ------------------------------------
  39. FILE_CSV = 'file.csv' # filepath to CSV containing a communication pattern
  40. FILE_XML = 'file.xml' # filepath to XML containing a communication pattern
  41. # recommended type: CommType ------------------------------------
  42. COMM_TYPE = "comm.type" # the locality of bots in botnet communication (e.g. local, external, mixed)
  43. # recommended type: Percentage (0.0-1.0) ------------------------------------
  44. IP_REUSE_TOTAL = 'ip.reuse.total' # percentage of IPs in original PCAP to be reused
  45. IP_REUSE_LOCAL = 'ip.reuse.local' # percentage of private IPs in original PCAP to be reused
  46. IP_REUSE_EXTERNAL = 'ip.reuse.external' # percentage of public IPs in original PCAP to be reused
  47. # recommended type: Positive Integer between 0 and 100 ------------------------------------
  48. PACKET_PADDING = 'packet.padding'
  49. class ParameterTypes(Enum):
  50. """
  51. Defines types for parameters. These types may be used in the specification of allowed parameters within the
  52. individual attack classes. The type is used to verify the validity of the given value.
  53. """
  54. TYPE_IP_ADDRESS = 0
  55. TYPE_MAC_ADDRESS = 1
  56. TYPE_PORT = 2
  57. TYPE_INTEGER_POSITIVE = 3
  58. TYPE_TIMESTAMP = 4
  59. TYPE_BOOLEAN = 5
  60. TYPE_FLOAT = 6
  61. TYPE_PACKET_POSITION = 7 # used to derive timestamp from parameter INJECT_AFTER_PACKET
  62. TYPE_DOMAIN = 8
  63. TYPE_FILEPATH = 9
  64. TYPE_COMM_TYPE = 10
  65. TYPE_PERCENTAGE = 11
  66. TYPE_PADDING = 12