Kijewski Piotr First
Kijewski Piotr First
Piotr Kijewski
CERT Polska/NASK
Introduction
Apart from the timely generation, a high true detection rate and a
low false alarm rate, from a practical point of view it is important that
the signature derived remains independent of application level protocols.
This means that the signature can be used in any intrusion detection or
prevention software – one that does not have to understand the relevant
application level protocol. This allows for the signature to be more
universal: a) the signature may be used in a larger number of intrusion
detection systems b) it may be applied to new protocols.
However, when using the sliding windows, every packet has a large
amount of hashes computed on it, their number being dependant on
packet length and the size of the window (if s is the packet size in bytes
and β the window length, the amount of hashes is s – β + 1).
The shorter the window length, the higher the probability of detection but
also the higher the chance of a false alarm. According to [4], it is
necessary to employ a window of length 150b in order to reduce false
alarms to zero (mostly due to the long length of Microsoft RPC queries).
Rabin fingerprints, due to their high efficiency can be used not just in
honeynet environments but on high speed production networks.
This approach allows for the use of small Rabin window sizes, increasing
the probability of detection, and at the same time allows for the final
signature to be computed by the more elastic LCS algorithm.
Using Rabin fingerprints in this way means that polymorphic attacks can
be detected, as long as a honeynet is being monitored, not a production
network. This can be achieved through a rule that, when clustering flows
based on Rabin similarity, sends for further analysis only clusters made up
of one representative. These single member clusters are then grouped
together. Thus, polymorphic attacks may be detected based on their lack
of Rabin similarity. Of course, computing an LCS on such flows is unlikely
(depending on the quality of the polymorphic code generator). However,
as shown in [7], it is possible to compute a signature based on disjoint
sequences of bytes, because even assuming perfect polymorphism, there
must remain fixed value short byte sequences, so that the polymorphic
exploit will be able to function correctly. Such algorithms, like the Smith-
Waterman algorithm, are being considered by us for implementation.
However it is worth remembering that so far, no self propagating code has
utilized polymorphic exploits. The closest to such code was the Witty
worm [8], that randomly padded exploit packets.
Implementation
Test results
Over a 24 hour period, a total of 775 716 packets were monitored. Only
similar packets (defined as 30% common Rabin fingerprints) that came
from at least 3 distinct sources in a space of 5 minutes were sent by the
flow-classifier snort plugin to Apache. The mod_lcs Apache plugin
generated a total of 408 LCS signatures. These signatures were
subsequently grouped into 63 clusters. 63 signatures were then generated
over these clusters, one signature per each cluster.
1
Probably related to Winpopup spam
2
A large amount of short packets to the standard MS SQL Server port - possibly a brute
force attempt. It was not identified by any Snort rules.
• NetBIOS query (port 139/TCP) – 1 cluster
• HTTP OPTIONS query (port 80/TCP) – 1 cluster
alert tcp $EXTERNAL_NET any -> $HOME_NET 445 (msg:"0x31 LSA"; flow:to_server,established;
content:"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111";)
Summary
References
[8] Colleen Shannon, David Moore, “The Spread of the Witty Worm”,
CAIDA, 2004, http://www.caida.org/analysis/security/witty/
[9] Martin Ester, Hans-Peter Kriegel, Jörg Sander, Xiaowei Xu, "A
Density-Based Algorithm for Discovering Clusters in Large Spatial
Databases with Noise", Proc. 2nd int. Conf. on Knowledge Discovery and
Data Mining (KDD ‘96), Portland, Oregon, 1996
[11] Bleeding Snort The Aggregation Point for Snort Signatures and
Research http://www.bleedingsnort.com