-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
28 lines (23 loc) · 1.08 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from event_finder import EventFinder
from graph_generator import GraphGenerator
from graph_traverser import GraphTraverser
from input_parser import Parser
from possibilities import Possibilities
from state_node import StateNode
parser = Parser()
startNodeSet = parser.parseStartNodes()
adjList = parser.parseReachability()
vulnDict, portDict = parser.parseVulnerabilities()
eventMapping = parser.parseEventMapping()
eventSet = EventFinder()
# Generate attack graph
graphGenerator = GraphGenerator(startNodeSet, adjList, vulnDict, portDict)
DG = graphGenerator.generate_graph()
timestamp, src, dst, port, description, accessLevel = parser.parseNotableEvent()
graphTraverser = GraphTraverser(DG, eventSet, eventMapping, portDict.keys())
eventSequence = graphTraverser.start_traversal(timestamp, src, dst, port, description, accessLevel)
# Print possibilities
crownJewelSet = parser.parseCrownJewels()
possibilitiesGenerator = Possibilities()
notableEventStateNode = StateNode(dst, accessLevel)
possibilitiesGenerator.printPossiblePaths(DG, notableEventStateNode, crownJewelSet)