|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
isc.sensor.parser.AbstractParser
isc.sensor.parser.StaticPortPacketCapture
public class StaticPortPacketCapture
A DNA Sensor Parser which captures selected whole packets for evaluating with tools compatible with tcpdump format. This parser works for both TCP and UDP procotols and is capable if creating a local pcap file (tcpdump format) or sending the packets to a repository (SQL-DB, JMS, Sockets, etc) via the output adaptor.
Configuation File Options: -------------------------- StaticPortPacketCapture.Ports: Value: Specify the list of ports or port ranges to capture seperated by a comma (,) for example: 80,8080,3500-4000,20-30 StaticPortPacketCapture.Flags: Value: Specify the TCP flags to capture, not used for UDP. for example data: 24,16 (data usually sent on these flags) StaticPortPackCapture.CreatePCAP: Value: True/False [False] - To specify whether to create a local pcap file. True=create the local file; False sends the packets the output adaptor StaticPortPacketCapture.OverwritePcap: Value: True/False [False] To overwrite existing local pcap. False will move the old file to [fname].bak[n] StaticPortPacketCapture.Filename: Value: Local filename for pcap file. Default is [pasername].pcap
Data Dictionary for Output Adaptor ---------------------------------- DataObect Name: PcapPacket Attributes:
Name Type --------- -------------- time String java.sql.Timestamp --- Some db's don't handle this correctly; should be: "YYYY-MM-DD HH:MM:SS[.fffffff]" milliseconds long nanoseconds integer sensorName String interface String sessionKey String packetSize integer packet byte[]
AppProperties
,
AbstractParsers
,
PacketEvent
,
for creating pcap files from packets stored in a repository.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class isc.sensor.parser.AbstractParser |
---|
AbstractParser.ParserState |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected java.lang.String |
_defaultfname
default filename for local pcap |
protected java.lang.String |
_filename
local pcap filename |
protected boolean |
_overwrite
overwrite local pcap file flag |
protected boolean |
createPCAP
create local pcap flag |
protected byte[] |
err
|
protected javacap |
jp
java libpcap processing class |
protected static org.apache.log4j.Logger |
log
the logger |
protected OAObjectManager |
packetObj
Output Adaptor |
Fields inherited from class isc.sensor.parser.AbstractParser |
---|
flushCtr, PARSER_WORKQUEUE_SZ, parserState, props, readyState, TCP, UDP, workQueue |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
StaticPortPacketCapture()
|
Method Summary | |
---|---|
protected void |
close()
close local pcap file or output adaptor |
protected void |
closeSession(SessionBean ses)
One of three asyncrhonous callback methods sent to a parser. |
protected void |
init()
Read system properties and setup configuration |
void |
init(int protocol)
Create a new Static port packet capture - Get properties - Register ports |
protected void |
open()
Open a local pcap file is requested by config file. |
protected void |
parse(PacketEvent ev)
Take selected packet and write it out to the output adaptor or create a local pcap file. |
protected void |
writeOpenAdaptor(PacketEvent ev)
Send the packet message to the output adaptors (SQL, JMS, File, etc) Data Obect Name = PcapPacket |
protected void |
writePcap(PacketEvent ev)
Create a local pcap file from the captured packets. |
protected void |
writeSession(java.lang.String key)
One of three asyncrhonous callback methods sent to a parser. |
Methods inherited from class isc.sensor.parser.AbstractParser |
---|
_addPacketEvent, _flush, _initMgr, _notifyProc, _processWork, _ready, _setFinish, _writeSession, initEvents, isServer, run |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger log
protected OAObjectManager packetObj
protected boolean createPCAP
protected javacap jp
protected java.lang.String _filename
protected boolean _overwrite
protected java.lang.String _defaultfname
protected byte[] err
Constructor Detail |
---|
public StaticPortPacketCapture()
Method Detail |
---|
public void init(int protocol)
init
in class AbstractParser
protected void init()
protected void open()
open
in class AbstractParser
AbstractParser.open()
protected void close()
close
in class AbstractParser
AbstractParser.close()
protected void writeSession(java.lang.String key)
AbstractParser
writeSession
in class AbstractParser
key
- The key of the sesssion to be written.#parse(PacketEvent)
protected void closeSession(SessionBean ses)
AbstractParser
closeSession
in class AbstractParser
ses
- The summary bean of closedAbstractParser.writeSession(String)
,
AbstractParser.parse(PacketEvent)
protected void parse(PacketEvent ev)
parse
in class AbstractParser
ev
- The packet event to be processedAbstractParser.parse(isc.sensor.parser.PacketEvent)
protected void writePcap(PacketEvent ev)
ev
- protected void writeOpenAdaptor(PacketEvent ev)
Data Dictionary for [PcapPacket] Name Type --------- -------------- time String java.sql.Timestamp // Some db's don't handle this correctly; should be: "YYYY-MM-DD HH:MM:SS[.fffffff]" milliseconds long nanoseconds integer sensorName String interface String sessionKey String packetSize integer packet byte[]
ev
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |