Skip to content

Commit

Permalink
Tweaked BinSkim to give more results.
Browse files Browse the repository at this point in the history
  • Loading branch information
sn0b4ll committed Feb 26, 2017
1 parent 05df9fa commit a1701dd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
22 changes: 15 additions & 7 deletions StaticAnalyzer/views/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def __binskim(name, bin_an_dic, run_local=False, app_dir=None):
path = bin_path
output_p = "-o"
output_d = bin_path + "_binskim"
# verbose = "-v"
verbose = "-v"
policy_p = "--config"
policy_d = "default" # TODO(Other policies?)

Expand All @@ -340,7 +340,7 @@ def __binskim(name, bin_an_dic, run_local=False, app_dir=None):
command,
path,
output_p, output_d,
# verbose,
verbose,
policy_p, policy_d
]

Expand Down Expand Up @@ -369,11 +369,19 @@ def __parse_binskim(bin_an_dic, output):
if 'results' in current_run:
rules = output['runs'][0]['rules']
for res in current_run['results']:
result = {
"rule_id": res['ruleId'],
"status": "Insecure",
"desc": rules[res['ruleId']]['shortDescription']
}
if res['level'] != "pass":
result = {
"rule_id": res['ruleId'],
"status": "Insecure",
"desc": rules[res['ruleId']]['shortDescription'],
"info": res['formattedRuleMessage']["arguments"][2]
}
else:
result = {
"rule_id": res['ruleId'],
"status": "Secure",
"desc": rules[res['ruleId']]['shortDescription']
}
bin_an_dic['results'].append(result)
else:
print "[WARNING] binskim has no results."
Expand Down
4 changes: 2 additions & 2 deletions install/windows/rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def binskim(sample, signature):
path = config['MobSF']['samples'] + sample
output_p = "-o"
output_d = config['MobSF']['samples'] + sample + "_binskim"
# verbose = "-v"
verbose = "-v"
policy_p = "--config"
policy_d = "default" # TODO(Other policies?)

Expand All @@ -110,7 +110,7 @@ def binskim(sample, signature):
command,
path,
output_p, output_d,
# verbose,
verbose,
policy_p, policy_d
]

Expand Down
4 changes: 3 additions & 1 deletion templates/static_analysis/windows_binary_analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h3 class="box-title"><i class="fa fa-mobile"></i> Binary Analysis</h3>
<th>ISSUE</th>
<th>STATUS</th>
<th>DESCRIPTION</th>

<th>INFO</th>
</tr>
</thead>
<tbody>
Expand All @@ -239,6 +239,7 @@ <h3 class="box-title"><i class="fa fa-mobile"></i> Binary Analysis</h3>
</span>
</td>
<td>{{ result.desc }}</td>
<td>{{ result.info }}</td>
</tr>
{% endfor %}
{% for warn in bin_an_warnings %}
Expand All @@ -250,6 +251,7 @@ <h3 class="box-title"><i class="fa fa-mobile"></i> Binary Analysis</h3>
</span>
</td>
<td>{{ warn.desc }}</td>
<td>{{ warn.info }}
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit a1701dd

Please sign in to comment.