-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from swimlane/7_0_0
7.0.0
- Loading branch information
Showing
17 changed files
with
583 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ per-file-ignores = | |
logger.py:F841, | ||
configuration.py:E501, | ||
attck.py:E501 | ||
base.py:E501 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,7 @@ | |
|
||
|
||
def main(args=None): | ||
attck = Attck() | ||
fire.Fire(attck) | ||
fire.Fire(Attck) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""Main interactive menu for pyattck.""" | ||
from ..base import Base | ||
from .layout import CustomLayout | ||
from .menu import Menu | ||
|
||
|
||
class Interactive(Base): | ||
"""Generates the interactive menu, options, and drives the display of the menu system.""" | ||
|
||
_framework = None | ||
_type = None | ||
_object = None | ||
|
||
def __init__(self, attck_instance) -> None: | ||
"""A pyattck Attck instance class.""" | ||
self._attck_instance = attck_instance | ||
|
||
def generate(self): | ||
"""Generates the interactive console for pyattck.""" | ||
main_menu = Menu() | ||
main_menu.prompt = "Select the appropriate MITRE ATT&CK Framework:\n" | ||
for framework in self.FRAMEWORKS: | ||
obj_menu = Menu() | ||
obj_menu.prompt = "Select an entity below:\n" | ||
for obj in dir(getattr(self._attck_instance, framework)): | ||
if not obj.startswith("_") and obj in self.ATTCK_TYPES: | ||
item_menu = Menu() | ||
for item in getattr(getattr(self._attck_instance, framework), obj): | ||
item_menu.add_option(getattr(item, "name"), CustomLayout(item)) | ||
obj_menu.add_option(obj, item_menu) | ||
main_menu.add_option(framework, obj_menu, True) | ||
main_menu.run() |
Oops, something went wrong.