示例#1
0
def find_malware():
    r = do_some_searching()
    return jsonize(
        map(
            lambda r: {
                'sha256': r.sha256,
                'created_at': r.created_at.__str__()
            }, r))
示例#2
0
def list_tags():
    rows = db.list_tags()

    results = []
    for row in rows:
        results.append(row.tag)

    return jsonize(results)
示例#3
0
def full_search():
    query = request.forms.get('query')
    r = db.full_search(query)
    return jsonize(
        map(
            lambda r: {
                'sha256': r.sha256,
                'created_at': r.created_at.__str__()
            }, r))
示例#4
0
def recent_comms():
    r = []
    for cm in db.get_recent_vtcoms():
        r.append({
            'comment': cm.cmnt,
            'user': cm.user,
            'date': str(cm.date),
            'hash': cm.hash,
            'type': cm.type,
        })
    return jsonize(r)
示例#5
0
def add_tag(hash=None, tag=None):
    m = db.find_via_hash(hash)

    db.add_tag(m, tag)
    if tag.startswith('ripped:') or tag.startswith('contains:') and m.parent:
        ## propaget tags backwards
        x = tag.split(':', 1)[1]
        for p in m.parent:
            if 'archive' in p.tags:
                add_tag(hash=p, tag='contains:' + x)

    return jsonize({'success': True})
示例#6
0
def config_stats():
    return jsonize(configdb().stats())
示例#7
0
def config_recent():
    return jsonize(list(configdb().recent()))
示例#8
0
def config_get(cfg):
    if db.can_cfg_be_shared(cfg):
        return jsonize(configdb().config(cfg))
    return HTTPError(403, 'No sample matching this config was shared with you')
示例#9
0
def config_shared(cfg):
    return jsonize({'shared': db.can_cfg_be_shared(cfg)})
示例#10
0
def config_samples(cfg):
    smpls = db.config_samples(cfg)
    return jsonize(map(low_details, smpls))
示例#11
0
def find_malware():
    r = do_some_searching()
    if type(r) == list:
        return jsonize(map(details, r))
    return jsonize(details(r))
示例#12
0
def task(task_id):
    task = get_analysis_status(task_id)
    r = {'state': str(task.state)}
    if task.successful():
        r = task.result
    return jsonize(r)
示例#13
0
def comment(hash=None):
    cmt = request.forms.get('cmt')
    db.add_comment(hash, cmt)
    return jsonize({'success': True})