forked from savon-noir/python-libnmap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlite.py
More file actions
25 lines (19 loc) · 690 Bytes
/
sqlite.py
File metadata and controls
25 lines (19 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
import sqlite3
from libnmap.report import NmapReport
from libnmap.plugins.backendplugin import NmapBackendPlugin
class NmapSqlitePlugin(NmapBackendPlugin):
def __init__(self, dbname=None):
NmapBackendPlugin.__init__(self)
conn = sqlite3.connect(dbname)
curs = conn.cursor()
# Create table if not exist
curs.execute('''CREATE TABLE f not exists reports
(date text, trans text, symbol text, qty real, price real)''')
def db_insert(self, nmap_report):
nr = NmapReport()
return nr
def db_get(self, report_id=None):
pass
def db_delete(self, report_id=None):
pass