AttackParameters.py 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: 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. # recommended type: MAC address ------------------------------
  13. MAC_SOURCE = 'mac.src' # MAC address of source
  14. MAC_DESTINATION = 'mac.dst' # MAC address of destination
  15. # recommended type: Port -------------------------------------
  16. PORT_OPEN = 'port.open' # open ports
  17. PORT_DESTINATION = 'port.dst' # destination ports
  18. PORT_SOURCE = 'port.src' # source ports
  19. # recommended type: Integer positive -------------------------
  20. PACKETS_LIMIT = 'packets.limit'
  21. NUMBER_ATTACKERS = 'attackers.count'
  22. ATTACK_DURATION = 'attack.duration' # in seconds
  23. VICTIM_BUFFER = 'victim.buffer' # in packets
  24. TARGET_URI = 'target.uri'
  25. NUMBER_INITIATOR_BOTS = 'bots.count'
  26. INTERVAL_SELECT_START = 'interval.selection.start'
  27. INTERVAL_SELECT_END = 'interval.selection.end'
  28. # recommended type: domain -----------------------------------
  29. TARGET_HOST = 'target.host'
  30. # recommended type: Float ------------------------------------
  31. PACKETS_PER_SECOND = 'packets.per-second' # packets per second
  32. INJECT_AT_TIMESTAMP = 'inject.at-timestamp' # unix epoch time (seconds.millis) where attack should be injected
  33. # recommended type: Packet Position ----------------------------------
  34. INJECT_AFTER_PACKET = 'inject.after-pkt' # packet after which attack should be injected
  35. # recommended type: boolean --------------------------------
  36. PORT_DEST_SHUFFLE = 'port.dst.shuffle' # shuffles the destination ports if a list of ports is given
  37. PORT_DEST_ORDER_DESC = 'port.dst.order-desc' # uses a descending port order instead of a ascending order
  38. IP_SOURCE_RANDOMIZE = 'ip.src.shuffle' # randomizes the sources IP address if a list of IP addresses is given
  39. PORT_SOURCE_RANDOMIZE = 'port.src.shuffle' # randomizes the source port if a list of sources ports is given
  40. NAT_PRESENT = 'nat.present' # if NAT is active, external computers cannot initiate a communication in MembersMgmtCommAttack
  41. TTL_FROM_CAIDA = 'ttl.from.caida' # if True, TTLs are assigned based on the TTL distributions from the CAIDA dataset
  42. MULTIPORT = "multiport" # select destination port as an ephemeral port if True, calculate the destination port based on the hostname, otherwise
  43. HIDDEN_MARK = "hidden_mark" # indicating if the attack will mark generated packets
  44. # recommended type: Filepath ------------------------------------
  45. FILE_CSV = 'file.csv' # filepath to CSV containing a communication pattern
  46. FILE_XML = 'file.xml' # filepath to XML containing a communication pattern
  47. # recommended type: CommType ------------------------------------
  48. COMM_TYPE = "comm.type" # the locality of bots in botnet communication (e.g. local, external, mixed)
  49. # recommended type: Percentage (0.0-1.0) ------------------------------------
  50. IP_REUSE_TOTAL = 'ip.reuse.total' # percentage of IPs in original PCAP to be reused
  51. IP_REUSE_LOCAL = 'ip.reuse.local' # percentage of private IPs in original PCAP to be reused
  52. IP_REUSE_EXTERNAL = 'ip.reuse.external' # percentage of public IPs in original PCAP to be reused
  53. # recommended type: Positive Integer between 0 and 100 ------------------------------------
  54. PACKET_PADDING = 'packet.padding'
  55. #recommended type: interval selection strategy, i.e. 'random', 'optimal' or 'custom' ------------------------------------
  56. INTERVAL_SELECT_STRATEGY = 'interval.selection.strategy'
  57. PROTOCOL_VERSION = 'protocol.version'
  58. HOSTING_VERSION = 'hosting.version'
  59. SOURCE_PLATFORM = 'src.platform'
  60. CUSTOM_PAYLOAD = 'custom.payload' # custom payload for ftp exploits
  61. CUSTOM_PAYLOAD_FILE = 'custom.payload.file' # file that contains custom payload for ftp exploits
  62. class ParameterTypes(enum.Enum):
  63. """
  64. Defines types for parameters. These types may be used in the specification of allowed parameters within the
  65. individual attack classes. The type is used to verify the validity of the given value.
  66. """
  67. TYPE_IP_ADDRESS = 0
  68. TYPE_MAC_ADDRESS = 1
  69. TYPE_PORT = 2
  70. TYPE_INTEGER_POSITIVE = 3
  71. TYPE_TIMESTAMP = 4
  72. TYPE_BOOLEAN = 5
  73. TYPE_FLOAT = 6
  74. TYPE_PACKET_POSITION = 7 # used to derive timestamp from parameter INJECT_AFTER_PACKET
  75. TYPE_DOMAIN = 8
  76. TYPE_STRING = 9
  77. TYPE_FILEPATH = 10
  78. TYPE_PERCENTAGE = 11
  79. TYPE_PADDING = 12
  80. TYPE_INTERVAL_SELECT_STRAT = 13