Example #1
0
def filesobject(uid):
    try:
        http = Indicator.query.filter(Indicator.object == uid).first()
        newdict = helpers.row_to_dict(http)
        settings = Setting.query.filter_by(_id=1).first()
        taglist = http.tags.split(",")

        temprel = {}
        if http.relationships:
            rellist = http.relationships.split(",")
            for rel in rellist:
                reltype = Indicator.query.filter(
                    Indicator.object == rel).first()
                temprel[reltype.object] = reltype.type

        reldata = len(temprel)
        if settings.vtfile == "on":
            jsonvt = virustotal.vt_hash_lookup(str(http.object))
        else:
            jsonvt = ""
        return render_template('fileobject.html',
                               records=newdict,
                               settingsvars=settings,
                               address=http.object,
                               temprel=temprel,
                               reldata=reldata,
                               jsonvt=jsonvt,
                               taglist=taglist)
    except Exception as e:
        return render_template('error.html', error=e)
def filesobject(uid):
    try:
        http = Indicator.query.filter(Indicator.object == uid).first()
        newdict = helpers.row_to_dict(http)
        settings = Setting.query.filter_by(_id=1).first()
        taglist = http.tags.split(",")

        temprel = {}
        if http.relationships:
            rellist = http.relationships.split(",")
            for rel in rellist:
                reltype = Indicator.query.filter(Indicator.object == rel).first()
                temprel[reltype.object] = reltype.type

        reldata = len(temprel)
        if settings.vtfile == "on":
            jsonvt = virustotal.vt_hash_lookup(str(http.object))
        else:
            jsonvt = ""
        return render_template(
            "fileobject.html",
            records=newdict,
            settingsvars=settings,
            address=http.object,
            temprel=temprel,
            reldata=reldata,
            jsonvt=jsonvt,
            taglist=taglist,
        )
    except Exception as e:
        return render_template("error.html", error=e)
Example #3
0
def objectdetails1(uid):
    try:
        row = Indicator.query.filter(Indicator.indicator == uid).first()
        records = helpers.row_to_dict(row)
        campaign_name = Campaign.query.filter_by(
            _id=row.campaign_id).first().name
        records['campaign'] = campaign_name
        settings = Setting.query.filter_by(_id=1).first()
        taglist = row.tags.split(",")

        temprel = {}
        if row.relationships:
            rellist = row.relationships.split(",")
            for rel in rellist:
                reltype = Indicator.query.filter(
                    Indicator.indicator == rel).first()
                temprel[reltype.object] = reltype.type

        reldata = len(temprel)
        if settings.vtfile == "on":
            jsonvt = virustotal.vt_hash_lookup(str(row))
        else:
            jsonvt = ""
        return render_template('indicatordetails.html', **locals())
    except Exception as e:
        return render_template('error.html', error=e)
Example #4
0
def objectdetails1(uid):
    try:
        row = Indicator.query.filter(Indicator.indicator == uid).first()
        records = helpers.row_to_dict(row)
        campaign_name = Campaign.query.filter_by(_id=row.campaign_id).first().name
        records['campaign'] = campaign_name
        settings = Setting.query.filter_by(_id=1).first()
        taglist = row.tags.split(",")

        temprel = {}
        if row.relationships:
            rellist = row.relationships.split(",")
            for rel in rellist:
                reltype = Indicator.query.filter(Indicator.indicator == rel).first()
                temprel[reltype.object] = reltype.type

        reldata = len(temprel)
        if settings.vtfile == "on":
            jsonvt = virustotal.vt_hash_lookup(str(row))
        else:
            jsonvt = ""
        return render_template('indicatordetails.html', **locals())
    except Exception as e:
        return render_template('error.html', error=e)