Snort Rule Wireless/Mobile network LAB 박준석. Snort Rules  Snort Rule simple, lightweight, flexible, powerful simple, lightweight, flexible, powerful 

Slides:



Advertisements
Similar presentations
Network and Application Attacks Contributed by- Chandra Prakash Suryawanshi CISSP, CEH, SANS-GSEC, CISA, ISO 27001LI, BS 25999LA, ERM (ISB) June 2006.
Advertisements

CPSC Network Layer4-1 IP addresses: how to get one? Q: How does a host get IP address? r hard-coded by system admin in a file m Windows: control-panel->network->configuration-
Interconnecting Networks with TCP/IP
Introduction1-1 message segment datagram frame source application transport network link physical HtHt HnHn HlHl M HtHt HnHn M HtHt M M destination application.
CSE551: Computer Network Review r Network Layers r TCP/UDP r IP.
1 Reading Log Files. 2 Segment Format
Snort Roy INSA Lab.. Outline What is “ Snort ” ? Working modes How to write snort rules ? Snort plug-ins It ’ s show time.
Firewalls and Intrusion Detection Systems
Chapter 3 Review of Protocols And Packet Formats
FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. 6 Packet Filtering By Whitman, Mattord, & Austin© 2008 Course Technology.
ECE 526 – Network Processing Systems Design Packet Processing II: algorithms and data structures Chapter 5: D. E. Comer.
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
Chapter 9 Classification And Forwarding. Outline.
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
CIS 193A – Lesson12 Monitoring Tools. CIS 193A – Lesson12 Focus Question What are the common ways of specifying network packets used in tcpdump, wireshark,
USENIX LISA ‘99 Conference © Copyright 1999, Martin Roesch Snort - Lightweight Intrusion Detection for Networks Martin Roesch.
Intrusion Protection Mark Shtern. Protection systems Firewalls Intrusion detection and protection systems Honeypots System Auditing.
Polytechnic University Introduction 1 Intrusion Detection Systems Examples of IDSs in real life r Car alarms r Fire detectors r House alarms r Surveillance.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
Packet Filtering. 2 Objectives Describe packets and packet filtering Explain the approaches to packet filtering Recommend specific filtering rules.
FIREWALL Mạng máy tính nâng cao-V1.
Penetration Testing Security Analysis and Advanced Tools: Snort.
January 2009Prof. Reuven Aviv: Firewalls1 Firewalls.
Chapter 6: Packet Filtering
Intrusion Detection: Snort. Basics: History Snort was developed in 1998 by Martin Roesch. It was intended to be an open-source technology, and remains.
Access Control List ACL. Access Control List ACL.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
IP Forwarding.
COEN 252: Computer Forensics Network Analysis and Intrusion Detection with Snort.
Module 4: Configuring ISA Server as a Firewall. Overview Using ISA Server as a Firewall Examining Perimeter Networks and Templates Configuring System.
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
CSCI 530 Lab Intrusion Detection Systems IDS. A collection of techniques and methodologies used to monitor suspicious activities both at the network and.
Packet Filtering Chapter 4. Learning Objectives Understand packets and packet filtering Understand approaches to packet filtering Set specific filtering.
Snort & Nmap Mike O’Connor Eric Tallman Matt Yasiejko.
Access Control List (ACL)
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 ICMP: A helper protocol to IP The Internet Control Message Protocol (ICMP) is the protocol used for error.
© Introduction to Internetworking – Alex Kooijman 04/04/2000 Introduction to internetworking Part Two.
Cs490ns - cotter1 Snort Intrusion Detection System
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Writing Snort Rules A quick guide Brian Caswell. 2 The life of a packet through Snort’s detection engine.
Snort Intrusion Detection. What is Snort Packet Analysis Tool Most widely deployed NIDS Initial release by Marty Roesch in 1998 Current version
Internet Protocol Formats. IP (V4) Packet byte 0 byte1 byte 2 byte 3 data... – up to 65 K including heading info Version IHL Serv. Type Total Length Identifcation.
COEN 252: Computer Forensics Network Analysis and Intrusion Detection with Snort.
Snort - Lightweight Intrusion Detection for Networks YOUNG Wo Sang Program Committee, PISA
Intrusion Detection & Snort Dan Fleck, PhD
Tracking Rejected Traffic.  When creating Cisco router access lists, one of the greatest downfalls of the log keyword is that it only records matches.
Chapter 8 Network Security Thanks and enjoy! JFK/KWR All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking:
Firewalls A brief introduction to firewalls. What does a Firewall do? Firewalls are essential tools in managing and controlling network traffic Firewalls.
Access Control List (ACL) W.lilakiatsakun. Transport Layer Review (1) TCP (Transmission Control Protocol) – HTTP (Web) – SMTP (Mail) UDP (User Datagram.
Network Intrusion Detection System (NIDS)
IP Protocol CSE TCP/IP Concepts Connectionless Operation Internetworking involves connectionless operation at the level of the Internet Protocol.
1 OSI Reference Model Benefits Standardizes interfaces Facilitates modular engineering Ensures interoperable technology Accelerates evolution Simplifies.
IP Internet Protocol. IP TCP UDP ICMPIGMP ARP PPP Ethernet.
IP - Internet Protocol No. 1  Seattle Pacific University IP: The Internet Protocol Kevin Bolding Electrical Engineering Seattle Pacific University.
Polytechnic University Firewall and Trusted Systems Presented by, Lekshmi. V. S cos
Introduction to Networks
Multiplexing.
FortiGate IPS operation training
Transport Layer.
Internet Protocol Formats
Wireshark Lab#3.
Learning Snort Rules by Capturing Intrusions In Live Network Traffic
Learning Snort Rules by Capturing Intrusions In Live Network Traffic
Introducing ACL Operation
Chapter 4: Access Control Lists (ACLs)
EEC-484/584 Computer Networks
Wide Area Networks and Internet CT1403
Internet Protocol Formats
SNORT RULES.
Session 20 INST 346 Technologies, Infrastructure and Architecture
Presentation transcript:

Snort Rule Wireless/Mobile network LAB 박준석

Snort Rules  Snort Rule simple, lightweight, flexible, powerful simple, lightweight, flexible, powerful  What rules describe 잘 알려진, 공통된 공격 시도 잘 알려진, 공통된 공격 시도 관리자가 지정한 보안 정책에 위배되는 사항 관리자가 지정한 보안 정책에 위배되는 사항 관리자가 생각하기에, 네트워크 패킷이 변칙적이라고 생각하는 상황 관리자가 생각하기에, 네트워크 패킷이 변칙적이라고 생각하는 상황  Guiding Principle 룰은 한줄에 작성되야 한다 룰은 한줄에 작성되야 한다 룰은 두개의 부분 (rule header, rule option) 으로 구성 룰은 두개의 부분 (rule header, rule option) 으로 구성 Rule header : rule's action, protocol, source and destination IP addresses and CIDR (Classless Inter-Domain Routing) block, and the source and destination ports informationRule header : rule's action, protocol, source and destination IP addresses and CIDR (Classless Inter-Domain Routing) block, and the source and destination ports information Rule option : alert messages, parts of the packet you should inspectRule option : alert messages, parts of the packet you should inspect

Snort Rules (cont..)  Include allows other rule files to be included allows other rule files to be included Format Format include: include: Ex) include /etc/snort/ping-libEx) include /etc/snort/ping-lib  Variable variables may be defined variables may be defined Format Format var: var: Simple substitution Simple substitution ExampleExample var MY_NET [ /24, /24] var MY_NET [ /24, /24] alert tcp any any -> $MY_NET any (flags: S; msg: "SYN packet";) alert tcp any any -> $MY_NET any (flags: S; msg: "SYN packet";)

Snort Rules (cont..)  Variable (cont..) Variable modification Variable modification $var$var define meta variable define meta variable $(var)$(var) replace with the contents of variable "var“ replace with the contents of variable "var“ $(var:-default)$(var:-default) replace with the contents of the variable "var" or with "default" if "var" is undefined replace with the contents of the variable "var" or with "default" if "var" is undefined $(var:?message)$(var:?message) replace with the contents of variable "var" or print out the error message "message" and exit replace with the contents of variable "var" or print out the error message "message" and exit ExampleExample var MY_NET $(MY_NET: /24) var MY_NET $(MY_NET: /24) log tcp any any -> $(MY_NET:?MY_NET is undefined!) 23 log tcp any any -> $(MY_NET:?MY_NET is undefined!) 23

Snort Rules (cont..)  Example alert tcp any any -> / (content:"| a5|"; msg: "mountd access";) Rule ActionTCP Protocol Source : Any IP and PortIncoming Target : IP – , C class( ~ ) Port Header : Who, Where and What Option : Alert, Packet Inspection Information Find this contents Alert Message

Basics in Writing : Rule Action  Here we are!  Rule Action alert : 선택된 경고 방법을 사용하여 경고를 내보내고, 패 킷을 기록한다. alert : 선택된 경고 방법을 사용하여 경고를 내보내고, 패 킷을 기록한다. log : 패킷을 기록한다. log : 패킷을 기록한다. pass : 패킷을 무시한다. pass : 패킷을 무시한다. activate : alert 수행 후 다른 동적룰 (dynamic rule) 을 활성 화한다. activate : alert 수행 후 다른 동적룰 (dynamic rule) 을 활성 화한다. dynamic : 다른룰에 의해 활성화되기 이전까지 가만히 있 다가, log rule 로서 동작을 시작한다. dynamic : 다른룰에 의해 활성화되기 이전까지 가만히 있 다가, log rule 로서 동작을 시작한다. alert tcp any any -> / (content:"| a5|"; msg: "mountd access";)

Basics in Writing : Protocol  Here we are!  Protocol Currently available protocols Currently available protocols TCPTCP UDPUDP ICMPICMP In the future In the future ARP, IGRP, GRE, OSPF, RIP, and IPXARP, IGRP, GRE, OSPF, RIP, and IPX alert tcp any any -> / (content:"| a5|"; msg: “external mountd access";)

Basics in Writing : IP address and Port  Here we are!  IP address and PORT Format Format IP address + CIDR Port number IP address + CIDR Port number IP address definition IP address definition any : define any addressany : define any address hostname lookup feature does not supportedhostname lookup feature does not supported alert tcp any any -> / (content:"| a5|"; msg: "mountd access";)

Basics in Writing : IP address and Port  CIDR 룰에 적용되는 IP address 에 대해서 넷마스크 지정 룰에 적용되는 IP address 에 대해서 넷마스크 지정 /24 indicates a Class C network/24 indicates a Class C network /16 a Class B network/16 a Class B network /32 a specific machine address/32 a specific machine address Example Example /24 : from to /24 : from to

Basics in Writing : IP address and Port  Some operators ! negation operator ! negation operator : range operator : range operator Example Example alert tcp ! /24 any -> / (content: "| a5|"; msg: "external mountd access";)alert tcp ! /24 any -> / (content: "| a5|"; msg: "external mountd access";) on any traffic that originates outside of the local network on any traffic that originates outside of the local network log tcp any any -> /24 !6000:6010log tcp any any -> /24 !6000:6010 log everything except the X Windows ports log everything except the X Windows ports log tcp any :1024 -> /24 500:log tcp any :1024 -> /24 500: log TCP traffic from privileged ports less than or equal to 1024 going to ports greater than or equal to 500 log TCP traffic from privileged ports less than or equal to 1024 going to ports greater than or equal to 500

Basics in Writing : Direction Operator  Here we are!  Indication of orientation indicates traffic that rule applies to indicates traffic that rule applies to -> from source to destination -> from source to destination <> bi-directional <> bi-directional useful for recording / analyzing both sides of conversationuseful for recording / analyzing both sides of conversation ex> POP3, Telnetex> POP3, Telnet alert tcp any any -> / (content:"| a5|"; msg: "mountd access";)

Basics in Writing : Rule Options  Here we are!  Special characters Format Format (Keyword : Argument; Keyword : Argument... ;) (Keyword : Argument; Keyword : Argument... ;) ; Rule separation ; Rule separation : Argument of keyword : Argument of keyword | Binary data | Binary data alert tcp any any -> / (content:"| a5|"; msg: "mountd access";)

Basics in Writing : Rule Options  Available Keyword msg msg prints a message in alerts and packet logs ex) msg : “ ”prints a message in alerts and packet logs ex) msg : “ ” logto logto log the packet to a user specified filename instead of the standard output filelog the packet to a user specified filename instead of the standard output file ex) logto : “filename”; ex) logto : “filename”; ttl ttl test the IP header's TTL field value ex) ttl : ;test the IP header's TTL field value ex) ttl : ; tos tos test the IP header's TOS field value ex) tos : ;test the IP header's TOS field value ex) tos : ; id id test the IP header's fragment ID field for a specific value ex) id : ;test the IP header's fragment ID field for a specific value ex) id : ; ipoption ipoption watch the IP option fields for specific codeswatch the IP option fields for specific codes fragbits fragbits test the fragmentation bits of the IP headertest the fragmentation bits of the IP header ex) alert tcp !$HOME_NET any -> $HOME_NET any (fragbits : R+ ; \msg: “Rerserved bit set!”;) ex) alert tcp !$HOME_NET any -> $HOME_NET any (fragbits : R+ ; \msg: “Rerserved bit set!”;) dsize dsize test the packet's payload size against a valuetest the packet's payload size against a value flags flags test the TCP flags for certain valuestest the TCP flags for certain values

Basics in Writing : Rule Options  Keyword (cont..) seq seq test the TCP sequence number field for a specific valuetest the TCP sequence number field for a specific value ack ack test the TCP acknowledgement field for a specific valuetest the TCP acknowledgement field for a specific value itype itype test the ICMP type field against a specific valuetest the ICMP type field against a specific value icode icode test the ICMP code field against a specific valuetest the ICMP code field against a specific value icmp_id icmp_id test the ICMP ECHO ID field against a specific valuetest the ICMP ECHO ID field against a specific value icmp_seq icmp_seq test the ICMP ECHO sequence number against a specific valuetest the ICMP ECHO sequence number against a specific value content content search for a pattern in the packet's payloadsearch for a pattern in the packet's payload ex) alert tcp any any -> / (content:|90C8 COFF FFFF|/bin/sh” ;\msg : “IMAP buffer overflow!”;) ;\msg : “IMAP buffer overflow!”;) content-list content-list search for a set of patterns in the packet's payloadsearch for a set of patterns in the packet's payload

Basics in Writing : Rule Options  Keyword (cont..) nocase nocase match the preceding content string with case insensitivitymatch the preceding content string with case insensitivity session session dumps the application layer information for a given sessiondumps the application layer information for a given session rpc rpc watch RPC services for specific application/procedure callswatch RPC services for specific application/procedure calls resp resp active response (knock down connections, etc)active response (knock down connections, etc) react react active response (block web sites)active response (block web sites) reference reference external attack reference idsexternal attack reference ids sid sid Snort rule idSnort rule id rev rev classtype classtype rule revision numberrule revision number rule classification identifierrule classification identifier priority priority rule severity identifierrule severity identifier

Basics in Writing : Rule Options  Keyword (cont..) uricontent uricontent search for a pattern in the URI portion of a packetsearch for a pattern in the URI portion of a packet tag tag advanced logging actions for rulesadvanced logging actions for rules ip_proto ip_proto IP header's protocol valueIP header's protocol value sameip sameip determines if source ip equals the destination ipdetermines if source ip equals the destination ip stateless stateless valid regardless of stream statevalid regardless of stream state regex regex wildcard pattern matchingwildcard pattern matching offset offset modifier for the content option, sets the offset to begin attempting a pattern matchmodifier for the content option, sets the offset to begin attempting a pattern match depth depth modifier for the content option, sets the maximum search depth for a pattern match attemptmodifier for the content option, sets the maximum search depth for a pattern match attempt ex) alert tcp any any -> /24 80 ( content : “cgi-bin/phf”; \ offset : 3 ; depth: 22 ; msg : “CGI-PHF access”;)

Reference  Snort sample%20snort%20rule sample%20snort%20rule  Cert improvement/implementations/i html improvement/implementations/i html