What Would You Do With A Pointer and A Size?
What Would You Do With A Pointer and A Size?
So……
Near-Realtime Detection Framework or:
“Anything is Possible”
The heart of the NRT system
APIs to handle:
Deep Inspection Nugget registration
Data Handler registration
Detection requests
Alerting
Full analysis logging
Output to API compliant systems
Database driven
• Implements a database to provide a
centralized set of file information and
• Handles incoming queries for Data
Handlers that have failed local cache
hits
• Handles detection requests from
both Data Handlers and DINs
• Handles incoming results from Deep
Inspection Nuggets
• Handles database updates based on
DIN data
• Writes out verbose logging based on
DIN data
• Provides alerting to Data Handlers
Capture data and metadata
Contact dispatcher for handling
Has this file been evaluated before?
Where should I send it?
Pass that data set to a Deep Inspection Nugget
Accept feedback from the Dispatcher for
detection request
Asynchronous alerting
Local cache of detection outcome
• Data (in this case a file) is captured
• Metadata is captured (in this case
URL and filename)
• A local cache of MD5 sums and URLs
of files previously collected
• A library to handle managing the
initial file evaluation, cache checks and
communication with the Dispatcher
Must handle data transfer from Data
Handlers
Must communicate with Dispatcher
Register detection capability
Request for additional processing of
subcomponents
Provide alerting feedback to Dispatcher
• Registers with the Dispatcher
• Processes data provided by the Data
Handlers, as instructed by the
Dispatcher
• Handles incoming queries for Data
Handlers that have failed local cache
hits
• Handles detection requests from
both Data Handlers and DINs
• Handles incoming results from Deep
Inspection Nuggets
• Handles database updates based on
DIN data
• Writes out verbose logging based on
DIN data
• Provides alerting to Data Handlers
Provide entry to the system for any arbitrary
data type
Determine and manage detection based on a
registered DIN
Provide alerting to any framework capable
system
Provide verbose, detailed logging on the
findings of the Nugget Farm
Make intelligent use of all data discovered
during the evaluation process
An implementation of the NRT goals on a Snort platform
Target: Malicious pdf files
Let’s pretend that the PDF nugget already has the data…
Why are we passing back files?
MD5 is stored for files and subcomponents
both bad and good
Primarily this is used to avoid reprocessing
files we’ve already looked at
But after a update to any DIN, all known-
good entries are “tainted”
After an update to
detection, previously
analyzed files may be
found to be bad
We don’t rescan all
files
But if we see a match
for md5 to a previous
file, we will alert
retroactively
When a subcomponent alerts, it is stored for
logging in its fully normalized state.
If a file is bad, when the DIN completes
detection it passes the file to the Dispatcher
Response teams have the entire file as well as
each portion that alerted in an easily
analyzed format
Verbose data back to Data Handler should also be as verbose
as possible
In this case we place data into the payload and provide a
custom message to Snort so we can use established
methods of handling Snort alerts
04/16-16:38:48.1271450328 [**] [300:3221225473:1]
URL:/users/pusscat/jbig2.pdf Hostname:metasploit.com Alert
Info:Probable exploit of CVE-2009-0658 (JBIG2) detected in object 8,
declared as /Length 33/Filter [/FlateDecode/ASCIIHexDecode/JBIG2Decode
] [**] {TCP} 64.214.53.2:0 -> 216.75.1.230:0
04/16-16:38:48.12714503280:0:0:0:0:0 -> 0:0:0:0:0:0 type:0x800 len:0x0
64.214.53.2:0 -> 216.75.1.230:0 TCP TTL:240 TOS:0x10 ID:0 IpLen:20 DgmLen:1280
***AP*** Seq: 0x0 Ack: 0x0 Win: 0x0 TcpLen: 20
55 52 4C 3A 2F 75 73 65 72 73 2F 70 75 73 73 63 URL:/users/pussc
61 74 2F 6A 62 69 67 32 2E 70 64 66 20 48 6F 73 at/jbig2.pdf Hos
74 6E 61 6D 65 3A 6D 65 74 61 73 70 6C 6F 69 74 tname:metasploit
2E 63 6F 6D 20 41 6C 65 72 74 20 49 6E 66 6F 3A .com Alert Info:
50 72 6F 62 61 62 6C 65 20 65 78 70 6C 6F 69 74 Probable exploit
20 6F 66 20 43 56 45 2D 32 30 30 39 2D 30 36 35 of CVE-2009-065
38 20 28 4A 42 49 47 32 29 20 64 65 74 65 63 74 8 (JBIG2) detect
65 64 20 69 6E 20 6F 62 6A 65 63 74 20 38 2C 20 ed in object 8,
64 65 63 6C 61 72 65 64 20 61 73 20 2F 4C 65 6E declared as /Len
67 74 68 20 33 33 2F 46 69 6C 74 65 72 20 5B 2F gth 33/Filter [/
46 6C 61 74 65 44 65 63 6F 64 65 2F 41 53 43 49 FlateDecode/ASCI
49 48 65 78 44 65 63 6F 64 65 2F 4A 42 49 47 32 IHexDecode/JBIG2
44 65 63 6F 64 65 20 5D 20 Decode ]
Seriously, what would you do with a pointer and a size?
Create file format templates which parse our
elements and provide you a datastructure
You tell me, does this string of variable names look weird to you?
EvctenMNtrWDQVBKGrwGxrxKfMiZoYziRxAFEfjMdXRzjGNqVZYEAqogviSvzHp
GpCkihcVtXRWcHphvhAnPOXnrxmTXJEUIkcYzelWZUCuIyKArtJvcEQXzUjHEzu
SjGEJugOyFQnaSplNWwQsqOoV