Here is the 4N6 database table creation script: db_defn.sql
Here is a list of commonly used SQL queries:
forked
to create the child. This used recursively to get all ancestors of a given pid:SELECT pid, date FROM event
WHERE syscall = 2 OR syscall = 190 OR syscall = 120
AND rc = ?
open executed by the
given process between the given times: SELECT rc FROM event
WHERE rc > 0
AND source_path = ?
AND syscall = 5
AND date >= ?
AND date <= ?
dup executed by the given process between
the given times:
SELECT oldfd, newfd FROM dup, event
WHERE dup.parent = event.id
AND event.pid = ?
AND event.date >= ?
AND event.date <= ?
ORDER BY event.date
close calls are not currently handled by this SELECT
statement. I intended to handle them by performing a UNION of this statement with
another statement to get information about close calls. However, you
can't do UNION in MySQL 3.x. This is on my TODO list to fix.
SELECT DISTINCT e.pid, e.ppid, e.name, e1.pid, e1.ppid, e1.name
FROM event e, event e1
WHERE e.name LIKE "bash"
AND e.pid = e1.pid
AND e1.name LIKE "ssh"
SELECT event.pid, event.id, io.fd, io.data
FROM io, event
WHERE io.parent = event.id
SELECT event.date, oldfd, newfd, 0, syscall, dup.id FROM dup, event WHERE
dup.parent = event.id AND
event.pid = %d AND
event.roll_count = %d AND
( dup.cmd = 0 OR dup.cmd = 2 OR dup.cmd IS NULL OR event.syscall = 6) AND
event.rc >= 0
UNION
SELECT event.date, fd, 0, 0, syscall , io.id FROM io, event WHERE
io.parent = event.id AND
event.pid = %d AND
event.roll_count = %d AND
event.syscall = 4 AND
event.rc >= 0
UNION
SELECT event.date, 0, 0, rc, syscall, event.id FROM event WHERE
event.pid = %d AND
event.roll_count = %d AND
(syscall = 120 OR syscall = 2 OR syscall = 190 OR syscall = 11)
ORDER BY event.date"