Automated Translation Automated Translation Between Attack - - PowerPoint PPT Presentation

automated translation automated translation between
SMART_READER_LITE
LIVE PREVIEW

Automated Translation Automated Translation Between Attack - - PowerPoint PPT Presentation

Automated Translation Automated Translation Between Attack Languages Between Attack Languages (Translating Snort rules to STATL scenarios) (Translating Snort rules to STATL scenarios) Steven T. Eckmann Eckmann Steven T. Reliable Software


slide-1
SLIDE 1

Automated Translation Automated Translation Between Attack Languages Between Attack Languages

(Translating Snort rules to STATL scenarios) (Translating Snort rules to STATL scenarios) Steven T. Steven T. Eckmann Eckmann Reliable Software Group Reliable Software Group University of California University of California Santa Barbara, CA 93106 Santa Barbara, CA 93106

http://www.cs.ucsb.edu/~ http://www.cs.ucsb.edu/~rsg rsg/STAT/ /STAT/ 10 October 2001 10 October 2001

slide-2
SLIDE 2

STAT

2

Outline Outline

  • Problem

Problem

  • Proposed solution

Proposed solution

  • Translating Snort to STATL

Translating Snort to STATL

  • Other translations

Other translations

  • Lessons learned

Lessons learned

  • Conclusions and future work

Conclusions and future work

slide-3
SLIDE 3

STAT

3

The Problem The Problem

  • Developing IDS signatures is labor-intensive

Developing IDS signatures is labor-intensive

  • There are many signature-based

There are many signature-based IDSs IDSs

  • Sharing signatures between

Sharing signatures between IDSs IDSs would conserve valuable would conserve valuable resources resources

  • Each IDS has its own signature “language”, so sharing

Each IDS has its own signature “language”, so sharing signatures is not trivial signatures is not trivial

slide-4
SLIDE 4

STAT

4

Proposed solution Proposed solution

  • Automated translation between signature languages

Automated translation between signature languages

– – Simplifies signature sharing Simplifies signature sharing – – Supports easier comparison of different signatures for similar attacks Supports easier comparison of different signatures for similar attacks

  • express signatures in (or translate to) a common language

express signatures in (or translate to) a common language

  • Potential benefits of research

Potential benefits of research

– – Leads to greater insight into attack language requirements Leads to greater insight into attack language requirements

  • what can language A do that B cannot, and vice versa?

what can language A do that B cannot, and vice versa?

– – Has not been done before Has not been done before

  • ArachNIDS

ArachNIDS database supports generation of signatures for several database supports generation of signatures for several IDSs IDSs with similar rule languages with similar rule languages

– Snort, Dragon, Snort, Dragon, Pakemon Pakemon, DefenseWorx DefenseWorx, Shoki Shoki

slide-5
SLIDE 5

STAT

5

Translation issues Translation issues

  • Language compatibility

Language compatibility

– – Cannot translate features that don’t exist in target language Cannot translate features that don’t exist in target language – – Domain-dependent factors Domain-dependent factors

  • protocols (

protocols (ethernet ethernet, IP, TCP, UDP, ICMP, DNS, ...) , IP, TCP, UDP, ICMP, DNS, ...)

  • protocol fields

protocol fields

  • user-defined functions

user-defined functions

– – Domain-independent factors Domain-independent factors

  • multi-event patterns

multi-event patterns

– sequence, or, and, loop, time, ... sequence, or, and, loop, time, ...

  • Other factors

Other factors

– – Are generated signatures “as good as” hand-crafted signatures? Are generated signatures “as good as” hand-crafted signatures? – – Is automated translation cost-effective? Is automated translation cost-effective?

slide-6
SLIDE 6

STAT

6

Why snort Why snort

  • Snort has a simple, concise language for expressing

Snort has a simple, concise language for expressing detection signatures detection signatures

  • Snort signatures are readily available

Snort signatures are readily available

  • Several other network

Several other network IDSs IDSs have signature languages have signature languages essentially equivalent to snort essentially equivalent to snort

slide-7
SLIDE 7

STAT

7

Snort rules Snort rules

  • A snort rule is a detection signature for matching single

A snort rule is a detection signature for matching single events events

– – Snort uses Snort uses preprocessors preprocessors to match signatures too complex for rule to match signatures too complex for rule language language

  • Each rule has a

Each rule has a rule header rule header and and rule options rule options

– – Rule header matches “action”, IP addresses, and ports Rule header matches “action”, IP addresses, and ports – – Rule options match protocol fields and payload content Rule options match protocol fields and payload content

  • Example

Example

alert

alert tcp tcp $EXTERNAL_NET any $EXTERNAL_NET any -> $HOME_NET 21 > $HOME_NET 21 ( (msg msg:"FTP :"FTP passwd passwd attempt";flags: A+; content:" attempt";flags: A+; content:"passwd passwd";) ";)

slide-8
SLIDE 8

STAT

8

Why STATL Why STATL

  • Domain-independent attack language

Domain-independent attack language

– – Extensions for Extensions for

  • IP networks (

IP networks (NetSTAT NetSTAT) )

  • Solaris BSM

Solaris BSM

  • WinNT event logging facility

WinNT event logging facility

  • Apache event logs

Apache event logs

  • Syslog

Syslog facility facility

  • IDMEF alerts

IDMEF alerts

  • Much more expressive than snort, etc.

Much more expressive than snort, etc.

  • Text and graphical form

Text and graphical form

  • Potentially the “common language” mentioned earlier

Potentially the “common language” mentioned earlier

slide-9
SLIDE 9

STAT

9

STATL basic abstractions STATL basic abstractions

  • Scenario

Scenario

– – States States – – Transitions (consuming, Transitions (consuming, nonconsuming nonconsuming, unwinding) , unwinding) – – Signature actions Signature actions – – Assertions Assertions – – Global environment Global environment – – Local environment Local environment – – Code blocks Code blocks

  • Events

Events

  • Timers

Timers

slide-10
SLIDE 10

STAT

10

NetSTAT NetSTAT example example

use use tcpip tcpip; scenario scenario streambin streambin { { string CLASSIFICATION_NAME = " string CLASSIFICATION_NAME = "Streambin Streambin"; "; string CLASSIFICATION_URL = "http://www. string CLASSIFICATION_URL = "http://www.cs cs.ucsb ucsb.edu edu/~ /~rsg rsg"; "; string SOURCE_NODEADDRESS = "unknown"; string SOURCE_NODEADDRESS = "unknown"; string SOURCE_PORT = "unknown"; string SOURCE_PORT = "unknown"; string TARGET_NODEADDRESS = "unknown"; string TARGET_NODEADDRESS = "unknown"; string TARGET_PORT = "unknown"; string TARGET_PORT = "unknown"; string ADDITIONAL_DATA = "Binary packet: "; string ADDITIONAL_DATA = "Binary packet: "; int sid int sid; transition transition open (s0->data)

  • pen (s0->data) nonconsuming

nonconsuming { { [ [STREAMOpen STREAMOpen s] : s.header.type == STREAM_EVENT_OPEN_C2S && s] : s.header.type == STREAM_EVENT_OPEN_C2S && (s.header. (s.header.getDstPort getDstPort() == 25 || // () == 25 || //smtp smtp s.header. s.header.getDstPort getDstPort() == 21 || //ftp () == 21 || //ftp s.header. s.header.getDstPort getDstPort() == 110) //pop () == 110) //pop { { sid sid = s.header.id; = s.header.id; SOURCE_NODEADDRESS = s.header. SOURCE_NODEADDRESS = s.header.getSrcStr getSrcStr(); (); SOURCE_PORT = s.header. SOURCE_PORT = s.header.getSrcPortStr getSrcPortStr(); (); TARGET_NODEADDRESS = s.header. TARGET_NODEADDRESS = s.header.getDstStr getDstStr(); (); TARGET_PORT = s.header. TARGET_PORT = s.header.getDstPortStr getDstPortStr(); (); } } } } transition transition data (data->data) data (data->data) consuming consuming { { [STREAM s] : (s.header.type == STREAM_EVENT_DATA_C2S && [STREAM s] : (s.header.type == STREAM_EVENT_DATA_C2S && s.header.id == s.header.id == sid sid && !s. && !s.containsBinary containsBinary()) ()) } } transition transition binary (data->binary) binary (data->binary) consuming consuming { { [STREAM s] : (s.header.type == STREAM_EVENT_DATA_C2S && [STREAM s] : (s.header.type == STREAM_EVENT_DATA_C2S && s.header.id == s.header.id == sid sid && s. && s.containsBinary containsBinary()) ()) { ADDITIONAL_DATA += s. { ADDITIONAL_DATA += s.asString asString(); } (); } } } transition transition close (data->s0) close (data->s0) unwinding unwinding { { [ [STREAMClose STREAMClose s] : s.header.id == s] : s.header.id == sid sid } } initial initial state state s0 { } s0 { } state state data { } data { } state state binary { binary { { log(" { log("Streambin Streambin compromised"); } compromised"); } } } }

slide-11
SLIDE 11

STAT

11

NetSTAT NetSTAT example example

s0 data binary

  • pen

binary data close

slide-12
SLIDE 12

STAT

12

Translating snort to STATL Translating snort to STATL

constraints constraints

  • Detection and response are independent concepts in STAT

Detection and response are independent concepts in STAT

– – Responses are dynamically associated with signatures at runtime Responses are dynamically associated with signatures at runtime

  • Snort reaction/response features are not translated

Snort reaction/response features are not translated

– – Most snort action types (e.g., Most snort action types (e.g., alert alert) ) – – Output options Output options msg msg and and logto logto – – Response/reactions options Response/reactions options resp resp and and react react

  • No attempt to “translate” snort preprocessors

No attempt to “translate” snort preprocessors

– – e.g., e.g., portscan portscan

slide-13
SLIDE 13

STAT

13

Translating snort to STATL Translating snort to STATL

translation rules translation rules

  • Variables

Variables

– – $NAME $NAME translates to scenario parameter translates to scenario parameter NAME NAME

  • Rule header - action

Rule header - action

– – Rule actions Rule actions alert alert and and log log translate to nothing - not part of translate to nothing - not part of signature signature – – Rule actions Rule actions activate activate and and dynamic dynamic translate to looping scenario translate to looping scenario – – Rule action Rule action pass pass not translatable not translatable

  • no such semantics in STATL

no such semantics in STATL

slide-14
SLIDE 14

STAT

14

Translating snort to STATL Translating snort to STATL

translation rules translation rules

  • Rule header - protocol, IP addresses, ports

Rule header - protocol, IP addresses, ports

– – Protocol translates to event spec Protocol translates to event spec

  • tcp

tcp translates translates to to [IP [IP ip ip [TCP [TCP tcp tcp]] ]], etc. , etc.

– – Source and destination IP addresses Source and destination IP addresses

  • 192.168.1.0/24

192.168.1.0/24 translates translates to to ip ip.header. .header.src srcMatch Match(“192.168.1.0/24”) (“192.168.1.0/24”)

  • any

any translates to nothing translates to nothing

– – Source and destination ports Source and destination ports

  • 21 translates to

21 translates to

tcp

tcp.header. .header.get getDst DstPort Port() == 21 () == 21

– – Direction Direction

  • determines only which IP address and port specify source and which

determines only which IP address and port specify source and which specify destination specify destination

slide-15
SLIDE 15

STAT

15

Translating snort to STATL Translating snort to STATL

translation rules translation rules

  • Rule options

Rule options

– – Most snort options translate directly to a STATL condition Most snort options translate directly to a STATL condition

  • ttl

ttl: :n n translates to translates to ip ip.header. .header.ttl ttl == == n n – – String matching String matching

content: content:string string; offset: ; offset:n n; depth: ; depth:m m; ; translates to translates to tcp tcp. .payloadMatch payloadMatch( (string string, ,n n, ,m m, ,nocase nocase?) ?)

slide-16
SLIDE 16

STAT

16

Translating snort to STATL Translating snort to STATL

example example

alert alert tcp tcp $EXTERNAL_NET any $EXTERNAL_NET any -> $HOME_NET 21 > $HOME_NET 21 ( (msg msg:"FTP :"FTP passwd passwd attempt";flags: A+; content:" attempt";flags: A+; content:"passwd passwd";) ";) transition t26 (s0->s1) transition t26 (s0->s1) nonconsuming nonconsuming { { [IP [IP ip ip [TCP [TCP tcp tcp]] : ]] : ip ip.header. .header.srcMatch srcMatch(EXTERNAL_NET) && (EXTERNAL_NET) && ip ip.header. .header.dstMatch dstMatch(HOME_NET) (HOME_NET) && ( && (tcp tcp.header. .header.getDstPort getDstPort() == 21) () == 21) && ( && (tcp tcp.header.flags & (TH_ACK)) .header.flags & (TH_ACK)) && && tcp tcp.payloadMatch payloadMatch(" ("passwd passwd",0,0,false) ",0,0,false) { CLASSIFICATION_NAME = CLASSIFICATION_NAME = "FTP "FTP passwd passwd attempt" attempt"; SOURCE_NODEADDRESS = SOURCE_NODEADDRESS = ip ip.header. .header.getSrcStr getSrcStr(); (); TARGET_NODEADDRESS = TARGET_NODEADDRESS = ip ip.header. .header.getDstStr getDstStr(); (); SOURCE_PORT = SOURCE_PORT = tcp tcp.header. .header.getSrcPortStr getSrcPortStr(); (); TARGET_PORT = TARGET_PORT = tcp tcp.header. .header.getDstPortStr getDstPortStr(); (); } }

slide-17
SLIDE 17

STAT

17

Snort-to-STATL summary Snort-to-STATL summary

  • Most snort rules translate directly

Most snort rules translate directly

– – Snort preprocessors may be used to implement “complex” signatures Snort preprocessors may be used to implement “complex” signatures

  • preprocessors are essentially free-form

preprocessors are essentially free-form

  • automated translation impractical

automated translation impractical

  • Snort “pass” rules cannot be translated to STATL

Snort “pass” rules cannot be translated to STATL

– – Sensor control issue, not a signature issue Sensor control issue, not a signature issue

  • Snort can be directed to exit on undefined variables

Snort can be directed to exit on undefined variables

– – Snort runtime issue, not a signature issue Snort runtime issue, not a signature issue

  • Redundancy between TCP and UDP rules

Redundancy between TCP and UDP rules

– – Abstract signature does not depend on protocol Abstract signature does not depend on protocol

  • “Families” of snort rules

“Families” of snort rules

slide-18
SLIDE 18

STAT

18

Translating rule “families” Translating rule “families”

  • ne scenario

per rule

  • ne transition

per rule

  • ne transition

per family

slide-19
SLIDE 19

STAT

19

Translating STATL to snort Translating STATL to snort

constraints constraints

  • Multi-event scenarios cannot be translated to snort rules

Multi-event scenarios cannot be translated to snort rules

– – Each snort rule applies to single packets Each snort rule applies to single packets – – A scenario may have multiple transitions, but all transitions must A scenario may have multiple transitions, but all transitions must share the initial state and the final state share the initial state and the final state – – No unwinding transitions No unwinding transitions

  • Only basic event types for IP, TCP, UDP, and ICMP

Only basic event types for IP, TCP, UDP, and ICMP

– – E.g., IP_ E.g., IP_datagram datagram is ok, IP_fragment is not is ok, IP_fragment is not – – No other protocols No other protocols

  • No scenario functions

No scenario functions

  • No state variables

No state variables

  • No state

No state codeblocks codeblocks and limited transition and limited transition codeblocks codeblocks

slide-20
SLIDE 20

STAT

20

STATL-to-snort summary STATL-to-snort summary

  • Only a very limited subset of STATL can be translated to

Only a very limited subset of STATL can be translated to snort snort

– – For that limited subset, translation is straightforward For that limited subset, translation is straightforward

  • Most of the 25+ signatures in the “standard”

Most of the 25+ signatures in the “standard” NetSTAT NetSTAT scenario set cannot be translated to snort rules scenario set cannot be translated to snort rules

– – Multiple transitions (events), unsupported protocols, or abstract Multiple transitions (events), unsupported protocols, or abstract events events – – STAT encourages a relatively small number of sophisticated STAT encourages a relatively small number of sophisticated signatures signatures – – Snort encourages a relatively large number of simple signatures Snort encourages a relatively large number of simple signatures

slide-21
SLIDE 21

STAT

21

Other languages Other languages investigated investigated

  • N-code (NFR)

N-code (NFR)

– – An NFR An NFR backend backend consists of configuration files, recorders, consists of configuration files, recorders, and N-code and N-code filters filters – – Configuration files and recorders specify what data is recorded and Configuration files and recorders specify what data is recorded and where where – – Filters specify which events match Filters specify which events match

  • each filter has a name, a trigger type (i.e., event), trigger modifiers (like

each filter has a name, a trigger type (i.e., event), trigger modifiers (like snort protocol-specific rule options), and a “ snort protocol-specific rule options), and a “codeblock codeblock” ”

  • analogous to STATL transitions

analogous to STATL transitions

– – Is it possible and practical to translate between NFR backends and Is it possible and practical to translate between NFR backends and STATL ( STATL (NetSTAT NetSTAT) scenarios? ) scenarios?

slide-22
SLIDE 22

STAT

22

N-code translation N-code translation investigation investigation

  • Translated a small number of simple signatures in each

Translated a small number of simple signatures in each direction direction

  • Translated one substantial NFR backend - a

Translated one substantial NFR backend - a webserver webserver detector - from NFR to STATL detector - from NFR to STATL

  • Developed a set of rules for translating NFR backends to

Developed a set of rules for translating NFR backends to STATL STATL

  • Applied STATL-to-NFR rules by hand to create a new

Applied STATL-to-NFR rules by hand to create a new version of the version of the webserver webserver detector backend detector backend

– – Functionally identical to the original, but structurally very different Functionally identical to the original, but structurally very different

slide-23
SLIDE 23

STAT

23

N-code translation N-code translation summary summary

  • N-code to STATL

N-code to STATL

– – Identify implicit states and transitions, if any Identify implicit states and transitions, if any – – Everything else is as easy as snort to STATL Everything else is as easy as snort to STATL

  • STATL to N-code

STATL to N-code

– – Represent STATL states with N-code global variables Represent STATL states with N-code global variables – – Use only event types that correspond to NFR triggers Use only event types that correspond to NFR triggers – – Use only event fields that correspond to NFR trigger modifiers Use only event fields that correspond to NFR trigger modifiers

  • It might be practical to automatically translate in either

It might be practical to automatically translate in either direction, with some limitations on what can be translated direction, with some limitations on what can be translated

slide-24
SLIDE 24

STAT

24

Summary of lessons Summary of lessons learned learned

  • Tight coupling between detection and response complicates

Tight coupling between detection and response complicates signature development and sharing signature development and sharing

  • With respect to detection (ignoring response features)

With respect to detection (ignoring response features)

– – STATL appears to be a superset of snort STATL appears to be a superset of snort – – STATL appears to be a superset of N-code (but the difference is less) STATL appears to be a superset of N-code (but the difference is less) – – Snort rules are very concise but not very expressive Snort rules are very concise but not very expressive – – STATL and N-code are very expressive but not nearly as concise as STATL and N-code are very expressive but not nearly as concise as snort snort

  • N-code is more concise than STATL for simple signatures

N-code is more concise than STATL for simple signatures

– – How groups of related rules/filters/transitions are translated may How groups of related rules/filters/transitions are translated may significantly affect performance significantly affect performance

slide-25
SLIDE 25

STAT

25

Conclusions and Conclusions and future work future work

  • Is signature sharing practical?

Is signature sharing practical?

– – Results so far are promising Results so far are promising

  • Is language translation useful?

Is language translation useful?

– – Yes, writing signatures is a human-intensive task Yes, writing signatures is a human-intensive task

  • Is a common attack language feasible or useful?

Is a common attack language feasible or useful?

– – Might allow a CVE-like (or Might allow a CVE-like (or ArachNIDS ArachNIDS-like?) database of signatures

  • like?) database of signatures
  • More to be done

More to be done

– – Other interesting languages: Other interesting languages: bro bro, P-BEST , P-BEST – – More rigorous specifications of signature categories that can be More rigorous specifications of signature categories that can be represented in various signature languages represented in various signature languages – – Performance studies to identify whether translations are practical Performance studies to identify whether translations are practical

slide-26
SLIDE 26

STAT

26

  • This slide intentionally blank

This slide intentionally blank

slide-27
SLIDE 27

STAT

27

Attack languages Attack languages

  • Event languages

Event languages describe basic events for security analysis describe basic events for security analysis

  • Response languages

Response languages define actions to be taken after define actions to be taken after detection detection

  • Report languages

Report languages are used to share information about are used to share information about attacks attacks

  • Correlation languages

Correlation languages specify relationships among attacks specify relationships among attacks

  • Exploit languages

Exploit languages define steps to be followed to perform an define steps to be followed to perform an intrusion intrusion

  • Detection languages

Detection languages provide mechanisms/abstractions to provide mechanisms/abstractions to identify the manifestation of an attack identify the manifestation of an attack