Skip to content

Commit

Permalink
restructuring how we handle our obfuscators (mitre#980)
Browse files Browse the repository at this point in the history
  • Loading branch information
david authored Dec 30, 2019
1 parent 7cf31dc commit 29d4da5
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/objects/c_obfuscator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ def unique(self):

@property
def display(self):
return dict(name=self.name)
return dict(name=self.name, description=self.description)

def __init__(self, name, module):
def __init__(self, name, description, module):
super().__init__()
self.name = name
self.description = description
self.module = module

def store(self, ram):
Expand Down
11 changes: 11 additions & 0 deletions app/utility/base_obfuscator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from app.utility.base_world import BaseWorld


class BaseObfuscator(BaseWorld):

def run(self, link, **kwargs):
agent = self.__getattribute__('agent')
supported_platforms = self.__getattribute__('supported_platforms')
if agent.platform in supported_platforms and link.ability.executor in agent.executors:
o = self.__getattribute__(link.ability.executor)
return o(link, **kwargs)
9 changes: 9 additions & 0 deletions static/css/shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,12 @@ select {
top: -1px;
*overflow: hidden;
}
.obfuscation-table {
color: white;
width: 100%;
border-spacing: 15px;
}
.obfuscation-table img {
height: 30px;
margin: 5px;
}
Binary file added static/img/obfuscation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions templates/chain.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<a onclick="viewSection('sources')">sources</a>
<a onclick="viewSection('planners')">planners</a>
<a onclick="viewSection('c2')">c2</a>
<a onclick="viewSection('obfuscators')">obfuscators</a>
</div>
</div>
<div class="subnav-right">
Expand Down Expand Up @@ -299,6 +300,23 @@ <h3 id="c2-name"></h3>
</div>
</div>

<div id="obfuscators" class="section-profile" style="display: none">
<div class="advanced row">
<div class="topleft duk-icon"><img onclick="removeSection('obfuscators')" src="/gui/img/x.png"></div>
<div class="column planner-header" style="flex:100%;text-align: left">
<table class="obfuscation-table" border=1 frame=void rules=rows>
{% for o in obfuscators %}
<tr>
<td><img src="/gui/img/obfuscation.png"/></td>
<td><h4>{{ o.name }}</h4></td>
<td>{{ o.description }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>

<!-- operation -->

<div id="operations" class="section-profile" style="display: none">
Expand Down

0 comments on commit 29d4da5

Please sign in to comment.