|
|||||||||
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.HttpParser
public class HttpParser
A simple HTTP Protocol application parser. Output can be both HTTP packet detail information and HTTP Session summary information, which is driven by the configuration file
Configuration attributes required for this parser:
example:
registers this parser to be loaded for use with TCP and UDP. The parser will
register it's ports for 80, 8008 and 8080. For TCP, this parser will recieve
packets (ACK/PSH) 24 and (ACK) 16 flags. This parser will output both session
summary records and packet detail records (definition of the records are
defined within this module).
------- server's config.cfg file ------------- !===================================================================== ! Define the Application Parser Methods and Classes !===================================================================== ! Semicolon seperated list of classes to load AppLayerTCP.Parsers=isc.sensor.parser.HttpParser AppLayerUDP.Parsers=isc.sensor.parser.HttpParser ! HTTP Parser specifics HttpParser.Ports=80,8008,8080 HttpParser.Flags=24,16 HttpParser.OutputSummary=true HttpParser.OutputDetail=true -----------------------------------------------
Data Dictionary
HTTPSummary HTTPDetail attribute type attribute type startTime java.sql.Timestamp packetTime java.sql.Timestamp sensorName String sensorName String interface_f1 String interface String interface_f2 String sessionKey String sessionKey String protoNam String duration Long srcAddr String protoNam String srcPort Integer clientAddr String dstAddr String clientPort Integer dstPort Integer serverAddr String pktLen Integer serverPort Integer referer String status String method String serviceName String host String packetsSent Long response String packetsRecv Long dataSent Long dataRecv Long retryPktSent Long retryPktRecv Long hostName String numRequests Integer maxURLSize Integer agentType String
AppProperties
,
AbstractParsers
,
PacketEvent
Nested Class Summary | |
---|---|
class |
HttpParser.HttpSummary
|
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 |
host
temp holds the packet http host |
protected OAObjectManager |
httpDetailObj
output adaptor for HTTPDetail |
protected OAObjectManager |
httpSumObj
output adaptor for HTTPSummary |
protected static org.apache.log4j.Logger |
log
log4j |
protected java.lang.String |
method
temp holds the packet http method |
protected java.lang.String |
referer
temp holds the packet http referer |
protected java.lang.String |
response
temp holds the packet http response |
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 | |
---|---|
HttpParser()
|
Method Summary | |
---|---|
protected void |
close()
Call from the AbstractParser to close all open output channels. |
protected void |
closeSession(SessionBean ses)
Call from the AbstractParser to set the session as closed and wait for the "write". |
protected void |
doDetail(PacketEvent ev,
java.lang.String[] t)
Parse a packet for detailed writing |
protected void |
doSummary(PacketEvent ev,
java.lang.String[] t)
Parser a packet for summary writing |
void |
init(int protocol)
Call from AbstractParser to initialize of the new parser. |
protected java.lang.String |
isClientMethod(java.lang.String t)
Determine if String is from an HTTP Client |
protected void |
open()
Call from AbstractParser to open all channels. |
protected void |
parse(PacketEvent ev)
Parse the incomming packet if it contains an HTTP header. |
protected void |
writeOutDetail(PacketEvent ev)
Write detail recored to AppWriter |
protected void |
writeOutSession(HttpParser.HttpSummary sum)
Write out summary session to the AppWriter |
protected void |
writeSession(java.lang.String key)
Call from the AbstractParser to tell us that this session should be written out. |
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 OAObjectManager httpSumObj
protected OAObjectManager httpDetailObj
protected static org.apache.log4j.Logger log
protected java.lang.String method
protected java.lang.String referer
protected java.lang.String host
protected java.lang.String response
Constructor Detail |
---|
public HttpParser()
Method Detail |
---|
public void init(int protocol)
init
in class AbstractParser
AbstractParser.init(int)
,
AbstractParser.TCP
,
AbstractParser.UDP
protected void parse(PacketEvent ev)
parse
in class AbstractParser
ev
- The packet event to be processedAbstractParser.parse(isc.sensor.parser.PacketEvent)
protected void doDetail(PacketEvent ev, java.lang.String[] t)
ev
- The packet eventt
- The array of strings which contains the HTTP header methodsprotected void doSummary(PacketEvent ev, java.lang.String[] t)
ev
- The packet eventt
- The array of strings which contains the HTTP header methodsprotected java.lang.String isClientMethod(java.lang.String t)
t
- String containing the first method of the protocol header
protected void closeSession(SessionBean ses)
closeSession
in class AbstractParser
ses
- The summary bean of closedAbstractParser.closeSession(isc.sensor.SessionBean)
protected void writeSession(java.lang.String key)
writeSession
in class AbstractParser
key
- The key of the sesssion to be written.AbstractParser.writeSession(java.lang.String)
protected void writeOutSession(HttpParser.HttpSummary sum)
sum
- HTTP summary record to writeprotected void writeOutDetail(PacketEvent ev)
ev
- The packet eventhttp
- The vector of parsed HTTP dataprotected void open()
open
in class AbstractParser
AbstractParser.open()
protected void close()
close
in class AbstractParser
AbstractParser.close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |