AttackParameters.py 6.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 Core via the command line.
  6. """
  7. # recommended type: (list/range of) IP address(es)------------------------------------------------------------------
  8. IP_SOURCE = 'ip.src' # source IP address(es)
  9. IP_DESTINATION = 'ip.dst' # destination IP address(es)
  10. IP_DNS = 'ip.dns' # IP address of DNS server
  11. IP_VICTIM = 'ip.victim' # victim IP address (only needed for indirect attacks)
  12. HOSTING_IP = 'hosting.ip' # IP address(es) hosting the vulnerable service
  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_DESTINATION = 'port.dst' # destination ports
  18. PORT_SOURCE = 'port.src' # source ports
  19. PORT_OPEN = 'port.open' # open 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. NUMBER_INITIATOR_BOTS = 'bots.count'
  27. INTERVAL_SELECT_START = 'interval.selection.start'
  28. INTERVAL_SELECT_END = 'interval.selection.end'
  29. TARGET_COUNT = "target.count" # count of target IP addresses
  30. # recommended type: domain -----------------------------------------------------------------------------------------
  31. TARGET_HOST = 'target.host'
  32. # recommended type: Float ------------------------------------------------------------------------------------------
  33. PACKET_LIMIT_PER_SECOND = 'packet.limit-per-second' # packets per second
  34. INJECT_PPS = 'inject.pps' # packets per seconds injected by the attack
  35. INJECT_AT_TIMESTAMP = 'inject.at-timestamp' # unix epoch time (seconds.millis) where attack should be injected
  36. # recommended type: Packet Position --------------------------------------------------------------------------------
  37. INJECT_AFTER_PACKET = 'inject.after-pkt' # packet after which attack should be injected
  38. # recommended type: boolean ---------------------------------------------------------------------------------------
  39. PORT_DEST_SHUFFLE = 'port.dst.shuffle' # shuffles the destination ports if a list of ports is given
  40. PORT_DEST_ORDER_DESC = 'port.dst.order-desc' # uses a descending port order instead of a ascending order
  41. IP_SOURCE_RANDOMIZE = 'ip.src.shuffle' # randomizes the sources IP address if a list of IP addresses is given
  42. PORT_SOURCE_RANDOMIZE = 'port.src.shuffle' # randomizes the source port if a list of sources ports is given
  43. NAT_PRESENT = 'nat.present' # if NAT is active, external computers cannot initiate a communication in MembersMgmtCommAttack
  44. TTL_FROM_CAIDA = 'ttl.from-caida' # if True, TTLs are assigned based on the TTL distributions from the CAIDA dataset
  45. PORT_MULTI = "port.multi" # select destination port as an ephemeral port if True, calculate the destination port based on the hostname, otherwise
  46. PACKETS_MARK = "packets.mark" # indicating if the attack will mark generated packets
  47. # recommended type: file path --------------------------------------------------------------------------------------
  48. FILE_CSV = 'file.csv' # file path to CSV containing a communication pattern
  49. FILE_XML = 'file.xml' # file path to XML containing a communication pattern
  50. CUSTOM_PAYLOAD_FILE = 'custom.payload.file' # file that contains custom payload for ftp exploits
  51. # recommended type: CommType ---------------------------------------------------------------------------------------
  52. COMM_TYPE = "comm.type" # the locality of bots in botnet communication (e.g. local, external, mixed)
  53. # recommended type: Percentage (0.0-1.0) ---------------------------------------------------------------------------
  54. IP_REUSE_TOTAL = 'ip.reuse.total' # percentage of IPs in original PCAP to be reused
  55. IP_REUSE_LOCAL = 'ip.reuse.local' # percentage of private IPs in original PCAP to be reused
  56. IP_REUSE_EXTERNAL = 'ip.reuse.external' # percentage of public IPs in original PCAP to be reused
  57. HOSTING_PERCENTAGE = 'hosting.percentage' # percentage of target IPs hosting the vulnerable service
  58. # recommended type: Positive Integer between 0 and 100 -------------------------------------------------------------
  59. PACKET_PADDING = 'packet.padding'
  60. # recommended type: interval selection strategy, i.e. 'random', 'optimal' or 'custom' ------------------------------
  61. INTERVAL_SELECT_STRATEGY = 'interval.selection.strategy'
  62. # recommended type: version number (string)
  63. PROTOCOL_VERSION = 'protocol.version' # version of the protocol to be used
  64. HOSTING_VERSION = 'hosting.version' # version of the protocol being hosted on targets
  65. # recommended type: platform abridgement, i.e. 'Win7', 'WinXP' or 'linux'
  66. SOURCE_PLATFORM = 'src.platform' # the operating system used by attacker aka source
  67. # recommended type: string
  68. CUSTOM_PAYLOAD = 'custom.payload' # custom payload for ftp exploits
  69. class ParameterTypes(enum.Enum):
  70. """
  71. Defines types for parameters. These types may be used in the specification of allowed parameters within the
  72. individual attack classes. The type is used to verify the validity of the given value.
  73. """
  74. TYPE_IP_ADDRESS = 0
  75. TYPE_MAC_ADDRESS = 1
  76. TYPE_PORT = 2
  77. TYPE_INTEGER_POSITIVE = 3
  78. TYPE_TIMESTAMP = 4
  79. TYPE_BOOLEAN = 5
  80. TYPE_FLOAT = 6
  81. TYPE_PACKET_POSITION = 7 # used to derive timestamp from parameter INJECT_AFTER_PACKET
  82. TYPE_DOMAIN = 8
  83. TYPE_STRING = 9
  84. TYPE_FILEPATH = 10
  85. TYPE_PERCENTAGE = 11
  86. TYPE_PADDING = 12
  87. TYPE_INTERVAL_SELECT_STRAT = 13