Ejemplo n.º 1
0
def general_report():
    endrow = []
    conn = sqlite3.connect('../tcpspy/super_spy.db')
    c = conn.cursor()
    c.execute("SELECT * FROM tcp")
    rows = c.fetchall()
    for row in rows:
        arow = geo.alter_row(row)
        endrow.append(arow)
    c.close()
    return endrow
Ejemplo n.º 2
0
def get_countries():
    endrow = []
    dict_ = {}
    conn = sqlite3.connect('../tcpspy/super_spy.db')
    c = conn.cursor()
    c.execute("SELECT * FROM tcp WHERE conn_stat = 'connect'")
    rows = c.fetchall()
    c.close()
    for row in rows:
        arow = geo.alter_row(row)
        endrow.append(arow)

    for row in endrow:
        if row[2] not in dict_:
            dict_[row[2]] = 1
        else:
            dict_[row[2]] = dict_[row[2]] + 1
    return dict_