{% extends "base.html" %}
{% load staticfiles %}
{% load analysis_tags %}
{% block content %}

    <div class="flex-nav">
        {% include "analysis/pages/nav-sidebar.html" %}
        <section class="flex-nav__body cuckoo-analysis" tabindex="0">

            <header class="page-header cuckoo-analysis__header">
                <h1>Dropped Buffers</h1>
            </header>

            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-8">
                        
                        {% if report.analysis.buffer|length %}
                            {% for file in report.analysis.buffer %}
                                <div class="panel panel-default">
                                    <table class="table table-striped table-condensed">
                                        <tr>
                                            <th class="col-md-1 text-right">Name</th>
                                            <td><b>{{file.name}}</b></td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">Size</th>
                                            <td>{{ file.size | sizeof_fmt }}</td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">Type</th>
                                            <td>{{file.type}}</td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">MD5</th>
                                            <td class="break-everwhere"><tt>{{file.md5}}</tt></td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">SHA1</th>
                                            <td class="break-everwhere"><tt>{{file.sha1}}</tt></td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">SHA256</th>
                                            <td class="break-everwhere"><tt>{{file.sha256}}</tt></td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">CRC32</th>
                                            <td class="break-everwhere"><tt>{{file.crc32}}</tt></td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">ssdeep</th>
                                            <td class="break-everwhere"><tt>{{file.ssdeep}}</tt></td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">Yara</th>
                                            <td>
                                            {% if file.yara %}
                                                <ul style="margin-bottom: 0;">
                                                {% for sign in file.yara %}
                                                    <li>{{sign.name}} - {{sign.meta.description}}</li>
                                                {% endfor %}
                                                </ul>
                                            {% else %}
                                                None matched
                                            {% endif %}
                                            </td>
                                        </tr>
                                        <tr>
                                            <th class="text-right">VirusTotal</th>
                                            <td><a href="https://www.virustotal.com/en/file/{{file.sha256}}/analysis/">Search for analysis</a></td>
                                        </tr>
                                        {% if file.object_id %}
                                            <tr>
                                                <th class="text-right"></th>
                                                <td><a href="{% url "analysis.views.file" "buffer" file.object_id %}" class="btn btn-primary btn-small">Download</a></td>
                                            </tr>
                                        {% endif %}
                                    </table>
                                </div>
                            {% endfor %}
                        {% else %}
                            <div class="alert alert-info"><b>Sorry!</b> No dropped buffers.</div>
                        {% endif %}

                    </div>
                </div>
            </div>

             <!-- footer replacement to avoid double scrollbars -->
            <footer class="flex-grid__footer spread-alignment">
                <p class="footnote">
                    &copy;2010-2017 <a href="http://www.cuckoosandbox.org" target="_blank">Cuckoo Sandbox</a>
                </p>
                <div class="logo">
                    <img src="{% static "graphic/cuckoo_inverse.png" %}" alt="Cuckoo Malware Analysis Sandbox" />
                    <a href="#">Back to Top</a>
                </div>
            </footer>

        </section>
    </div>

{% endblock %}