forked from p34709852/monkey
Island: Add field `propagated` to node and rename image files
This commit is contained in:
parent
d6fe9c2ef2
commit
5e3829aab3
|
@ -128,8 +128,16 @@ class NodeService:
|
||||||
def get_node_group(node) -> str:
|
def get_node_group(node) -> str:
|
||||||
if "group" in node and node["group"]:
|
if "group" in node and node["group"]:
|
||||||
return node["group"]
|
return node["group"]
|
||||||
node_type = "exploited" if node.get("exploited") else "clean"
|
|
||||||
|
if node.get("exploited"):
|
||||||
|
node_type = "exploited"
|
||||||
|
elif node.get("propagated"):
|
||||||
|
node_type = "propagated"
|
||||||
|
else:
|
||||||
|
node_type = "clean"
|
||||||
|
|
||||||
node_os = NodeService.get_node_os(node)
|
node_os = NodeService.get_node_os(node)
|
||||||
|
|
||||||
return NodeStates.get_by_keywords([node_type, node_os]).value
|
return NodeStates.get_by_keywords([node_type, node_os]).value
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -202,6 +210,7 @@ class NodeService:
|
||||||
"ip_addresses": [ip_address],
|
"ip_addresses": [ip_address],
|
||||||
"domain_name": domain_name,
|
"domain_name": domain_name,
|
||||||
"exploited": False,
|
"exploited": False,
|
||||||
|
"propagated": False,
|
||||||
"os": {"type": "unknown", "version": "unknown"},
|
"os": {"type": "unknown", "version": "unknown"},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -288,6 +297,10 @@ class NodeService:
|
||||||
def set_node_exploited(node_id):
|
def set_node_exploited(node_id):
|
||||||
mongo.db.node.update({"_id": node_id}, {"$set": {"exploited": True}})
|
mongo.db.node.update({"_id": node_id}, {"$set": {"exploited": True}})
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def set_node_propagated(node_id):
|
||||||
|
mongo.db.node.update({"_id": node_id}, {"$set": {"propagated": True}})
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def update_dead_monkeys():
|
def update_dead_monkeys():
|
||||||
# Update dead monkeys only if no living monkey transmitted keepalive in the last 10 minutes
|
# Update dead monkeys only if no living monkey transmitted keepalive in the last 10 minutes
|
||||||
|
|
|
@ -52,6 +52,8 @@ def update_network_with_exploit(edge: EdgeService, telemetry_json):
|
||||||
edge.update_based_on_exploit(new_exploit)
|
edge.update_based_on_exploit(new_exploit)
|
||||||
if new_exploit["exploitation_result"]:
|
if new_exploit["exploitation_result"]:
|
||||||
NodeService.set_node_exploited(edge.dst_node_id)
|
NodeService.set_node_exploited(edge.dst_node_id)
|
||||||
|
if new_exploit["propagation_result"]:
|
||||||
|
NodeService.set_node_propagated(edge.dst_node_id)
|
||||||
|
|
||||||
|
|
||||||
def encrypt_exploit_creds(telemetry_json):
|
def encrypt_exploit_creds(telemetry_json):
|
||||||
|
|
|
@ -11,6 +11,8 @@ class NodeStates(Enum):
|
||||||
CLEAN_WINDOWS = "clean_windows"
|
CLEAN_WINDOWS = "clean_windows"
|
||||||
EXPLOITED_LINUX = "exploited_linux"
|
EXPLOITED_LINUX = "exploited_linux"
|
||||||
EXPLOITED_WINDOWS = "exploited_windows"
|
EXPLOITED_WINDOWS = "exploited_windows"
|
||||||
|
PROPAGATED_LINUX = "propagated_linux"
|
||||||
|
PROPAGATED_WINDOWS = "propagated_windows"
|
||||||
ISLAND = "island"
|
ISLAND = "island"
|
||||||
ISLAND_MONKEY_LINUX = "island_monkey_linux"
|
ISLAND_MONKEY_LINUX = "island_monkey_linux"
|
||||||
ISLAND_MONKEY_LINUX_RUNNING = "island_monkey_linux_running"
|
ISLAND_MONKEY_LINUX_RUNNING = "island_monkey_linux_running"
|
||||||
|
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Loading…
Reference in New Issue