Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tactics not implemented in techniques #1

Closed
tlhendri opened this issue Jul 22, 2019 · 4 comments · Fixed by #22
Closed

tactics not implemented in techniques #1

tlhendri opened this issue Jul 22, 2019 · 4 comments · Fixed by #22
Assignees

Comments

@tlhendri
Copy link

This doesn't seem to work:

for technique in attack.techniques:
    print(technique)

    # accessing tactics that this technique belongs to
    for tactic in technique.tactics:
        print(tactic)

From usage examples https://pypi.org/project/pyattck/

Tactics also don't seem to be fully returned when using the tactic:

# accessing tactics
for tactic in attack.tactics:
    #print(tactic.id, [technique.id for technique in tactic.techniques])
    if 'T1098' in [technique.id for technique in tactic.techniques]:
        print(tactic.id)
for technique in attack.techniques:
    #print(technique.id,[tactic.id for tactic in technique.tactics]) - doesnt work
    #print(technique.id,[tactic.id for tactic in technique.tactic]) - works
    if technique.id == 'T1098':
        print([tactic.id for tactic in technique.tactic])
    
#https://attack.mitre.org/techniques/T1078/
#Tactics = Defense Evasion - confirmed, Persistence - confirmed, Privilege Escalation - confirmed, Initial Access - confirmed
#4 listed at site, only two returned. when using the tactic method of technique only one returned.
@skyWalker1997
Copy link

Same question, I read the technique.py in pyattck package and I found out something strange.

image

temp_list = phase['phase_name'] in def tactic(self, obj),line71 caused every technique reflected only one tactic rather than a list of tactic, which is incorrect.

@skyWalker1997
Copy link

skyWalker1997 commented Jul 25, 2019

With the question I mentioned above, the function '@Property def tactic(self)' also has a bug.
image
Attention line 50 to line 52
cause self._tactic return a list.Then ,you can't compare a 'str(list).lower()' with a 'str().lower()'
It won't cause fault when a technique only belong to one tactic.But when a technique belong to several
tactics ,it will cause problem.
So to fix it ,you should traversal each tactic that self got, and then compare the each str(tactic).lower with str(item['x_mitre_shortname']).lower()

Here is my code:

image

@joshswimlane
Copy link
Contributor

@tlhendri & @skyWalker1997 Can you please create an issue for each of these and I will make the appropriate changes. Reading through this it looks like there are 3 or 4 issues here it would be easier to resolve each in their own individual issues.

I will be begin looking at these. Thanks for bringing them up!

@joshswimlane joshswimlane self-assigned this Jul 25, 2019
@joshswimlane
Copy link
Contributor

This should be fixed - pushing to pypi soon

@joshswimlane joshswimlane linked a pull request Feb 19, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants