SlideShare ist ein Scribd-Unternehmen logo
1 von 76
`


Intrusion Detection Systems
Introduction
                                            Eve
Threats                                  (Intruder)
Types
Host or Network?   Intrusion
Agent-based        Detection

Snort
A simple rule                  Defence
A few intrusions
User profiling
                                         Defence
Honeypots
IPS
Conclusions




                                                                               Author: Bill Buchanan
                                                  Author: Prof Bill Buchanan
Intrusion Detection Systems                 Eve
                                         (Intruder)
Introduction
Threats
                   Intrusion
Types              Detection
Host or Network?
Agent-based                    Defence
Snort
A simple rule
A few intrusions                         Defence

User profiling
Honeypots
IPS
Conclusions


                      Introduction




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
Enemy takes some time to breach each of the levels of defence




                                                  Defence
  Defence                Defence                                    Defence




                                                                                                      Author: Bill Buchanan
Forth-level          Third-level            Second-level              First-level
 defence              defence                 defence                  defence
                                                                         Author: Prof Bill Buchanan


                                                  Defence-in-the-depth
DMZ – an area
 Trusted     where military          Untrusted




                                                                      Author: Bill Buchanan
(our side)      actions             (their side)
             are prohibited


                                         Author: Prof Bill Buchanan


                              DMZ
Assets




                 Hello. How are
                  you? Is this
                     okay?


             Data




                                                                                     Author: Bill Buchanan
Users       Systems               Even with the best
                                  defences, intruders
                                  can penetrate them    Author: Prof Bill Buchanan


                                           Protecting
Intrusion Detection Systems can help to reduce breaches




Intrusion
Detection




                                                        Intrusion
                                                        Detection         Intrusion
                                                                          Detection

                Users


Systems

                                  Intrusion
                                  Detection

                Data



Assets




                                                                                                               Author: Bill Buchanan
  Forth-level               Third-level            Second-level             First-level
   defence                   defence                 defence                 defence
                                                                                  Author: Prof Bill Buchanan


                                                          Defence-in-the-depth
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                           Threats




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
Data
Corporate access                              stealing
Email access
                                                                   External
Web access                                                          hack
   Intrusion
   Detection

                                                         DoS (Denial-of-
                                                            sevice)



                                                     Personal
               Users   Firewall/                      abuse
                       gateway
   Systems



                                                  Worms/viruses
               Data



   Assets




                                                                                            Author: Bill Buchanan
      Network/
    Organisational             Terrorism/                     Fraud
      perimeter                 extortion                      Author: Prof Bill Buchanan


                                            Outside threats
CSI (Computer Security Institute) found:
         70% of organisation had breaches
         60% of all breaches came from inside their
         own systems
                                                                     Data
Corporate access                                                   stealing
Email access
                                                                                       External
Web access                                                                              hack
   Intrusion
   Detection

                                                                               DoS (Denial-of-
                                                                                  sevice)


                                     Firewall/
                                     Gateway                              Personal
                    Users
                                (cannot deal with                          abuse
   Systems                       internal threats)


                                                                       Worms/viruses
                    Data



   Assets




                                                                                                                Author: Bill Buchanan
      Network/
    Organisational                                    Terrorism/                 Fraud
      perimeter                                        extortion                   Author: Prof Bill Buchanan


                                            Internal threats (often Protecting
                                                                    a great threat than from outside)
Eve
                   (Intruder)




                                                                 Public Web    Public FTP               Public Proxy
         Defence                                                 Server        Server                   Server


                                                Defence




Audit/                             Firewall
logging

           Intrusion Detection
                 System
 Intrusion
 Detection                                                                          DMZ
                                                                                            Intrusion
                                                                                            Detection

                                      Defence
                                                                                                           Intrusion Detection
                                                                                                                 System
                                                                  NAT Device



Defence-in-depth puts as many
obstacles in the way of an
intruder, so that it becomes              Intrusion Detection
                                                System
harder to penetrate the network,   Intrusion
                                   Detection
                                                                    Defence

and easier to detect




                                                                                                                                           Author: Bill Buchanan
                                                                                                                     Users



                                                                                                              Author: Prof Bill Buchanan


                                                                Defence-in-depth (multiple obstacles)
Intrusion Detection Systems                  Eve
                                          (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                     Defence
Snort
A simple rule                             Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                               Types




                                                                              Author: Bill Buchanan
                                                 Author: Prof Bill Buchanan
Intrusion
                                      Detection




                                                                              Anomaly Detection.
 Misuse Detection
                                                                     This assumes that abnormal
 This attempts to model
                                                                      behaviour by a user can be
 attacks on a system as
                                                                      correlated with an intrusion.
 specific patterns, and then
                                                                       Its advantage is that it can
 scans for occurrences of
                                      IDS agent                               typically react to new
 these. Its disadvantage is
                                                                             attacks, but can often
 that it struggles to detect
                                                                     struggle to detect variants of
 new attacks.
                                                                     known attacks, particularly if
                                                                            they fit into the normal
                                                                          usage pattern of a user.
                                                                      Another problem is that the
                                                                            intruder can mimic the
                                                                        behavioural pattern of the
                                                  Personal abuse                                user.
Viruses/Worms         External hack
                      (scripting)




                                                                                                                  Author: Bill Buchanan
                                                                   External hack       Data
Denial-of-Service                                  Fraud           (human)             stealing


                                                                                     Author: Prof Bill Buchanan


                                                              IDS types
Network intrusion
                                                                     detection systems (NIDS)
                                                                       These monitor packets
                                                                      on the network and tries to
                                                                        determine an intrusion.
                                                                        This is either host base
                                                                       (where it runs on a host),
                              Intrusion Detection                         or can listen to the
                                    System
                                                                         network using a hub,
                                                                            router or probe.




                                                    User profiling
System Integrity Verifier

  These monitor system
   files to determine if an
intruder has changed them
   (a backdoor attack). A
  good example of this is
                                                                     Log file monitors (LFM)
Tripwire. It can also watch
       other key system
 components, such as the                                               These monitor log files
Windows registry and root/                                             which are generated by
      administrator level                                            network services, and look
          privileges.                                                for key patterns of change.
                                                                          Swatch is a good




                                                                                                               Author: Bill Buchanan
                                                                              example.




                                                                                  Author: Prof Bill Buchanan


                                                               IDS Types
Intruder gains public information             Intruder gains more specific
about the systems, such as DNS and            information such as subnet layout, and
IP information                                networked devices.


             Outside                               Inside
         reconnaissance           Intrusion
                                               reconnaissance                  Intrusion
                                  Detection                                    Detection




       Eve
    (Intruder)

                          From code yellow to code
                                                                                     Exploit
                          red ...



                                                                                           Intruder finds a
                                                                                           weakness, such as
                                                                                           cracking a password,
                                                                                           breaching
                                                                                           a firewall, and so on.
                 Profit                            Foothold
                                 Intrusion                                     Intrusion




                                                                                                                            Author: Bill Buchanan
                                 Detection                                     Detection




    Data stealing, system                     Once into the system, the
    damage,                                   intruder can then advance
    user abuse, and so on.                    up the privilege levels,                         Author: Prof Bill Buchanan


                                                               Typical pattern of intrusion
Intrusion Detection Systems                  Eve
                                          (Intruder)

Introduction
Threats             Intrusion
                    Detection
Types
Host or Network?
Agent-based                     Defence
Snort
A simple rule                             Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                   Host or Network?




                                                                              Author: Bill Buchanan
                                                 Author: Prof Bill Buchanan
Public Web Public FTP            Public Proxy
                                                                                 Server     Server                Server


                                                                                                                                    Intrusion
                                                                                                                                    Detection



Audit/                                              Firewall
logging
            Intrusion Detection
                  System
Intrusion
Detection
                                                                                                          DMZ

                                                                                                                       Intrusion Detection
                                                                                                                             System
                                                                                  NAT Device




                                  Network-based
                                  IDS listens to           Intrusion Detection
                                  some/all                       System
                                  network traffic                                                                Intrusion
                                                                                                                 Detection
                                                    Intrusion
                                                    Detection

                                                                                    Intrusion Detection
                                                                                          System




                                                                                                                                                          Author: Bill Buchanan
                                                                                            Host-based IDS
                                                                                            listens to traffic
                                                                                            in/out of a host
                                                                                                                             Author: Prof Bill Buchanan


                                                                                             Host or network?
Firewall


Intrusion Detection
      System
                                               DMZ


                                 NAT Device




                                                                                        Author: Bill Buchanan
                                                           Author: Prof Bill Buchanan


                                              Protecting
Hub


                           Intrusion
                           Detection      IDS can listen to
                                          all the incoming
Switch
                                           and outgoing network


               Intrusion
               Detection

                           This IDS cannot hear any
                           traffic which is not addressed to it
                           as it connects to a switch.




                                                                                      Author: Bill Buchanan
                                                         Author: Prof Bill Buchanan


                                        IDS location
interface FastEthernet0/1
                                port monitor FastEthernet0/2
                                port monitor FastEthernet0/5
                                port monitor VLAN2
                              !
                              interface FastEthernet0/2
            0/1   0/2   0/5
Intrusion                     !
Detection
                              interface FastEthernet0/3
                                switchport access vlan 2
                              !
                              interface FastEthernet0/4
                                switchport access vlan 2
                              !
                              interface FastEthernet0/5
                              !
                              interface VLAN1
                                ip address 192.168.0.1 255.255.255.0
                                no ip directed-broadcast
                                no ip route-cache
                              !




                                                                                               Author: Bill Buchanan
                                                                  Author: Prof Bill Buchanan


                                            Using the span port
Intrusion
                                    Detection
                                                This IDS detects                   IDS detects
                                                                                                        Intrusion
                                                                                                        Detection


                                                successful attacks               attacks against
            Intrusion                           against firewall                      server
            Detection




                                                                  DMZ
                 This IDS detects
                 attacks against
                 main firewall




            Host
Intrusion
Detection




                                                     Intrusion
                                                     Detection

                                                                 IDS detects internal
   IDS detects
                                                                      attacks
 attacks against




                                                                                                                                Author: Bill Buchanan
      host                                               `




                                                                                                   Author: Prof Bill Buchanan


                                                                               Protecting
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                     Agent-based




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
Security agent

  Management agent




                     QoS agent

                                                SNORT agent
Auditing agent




                                                                                        Author: Bill Buchanan
                                          Reconfig agent

                                                           Author: Prof Bill Buchanan


                       Agent-based system allows for distributed security
IDS        Agent-based




Author: Bill Buchanan
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                         WinPCap




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
User-defined
            Wireshark            SNORT
                                                       agent

                               API Interface




Capture
   filter     WinPCap                                libpcap




               Network Interface: Ethernet, Wireless, ADSL, etc




                                                                                           Author: Bill Buchanan
                                                              Author: Prof Bill Buchanan


                             Integrating with WinPCap – capturing packets
IDS         WinPCap




Author: Bill Buchanan
using System;
using Tamir.IPLib;
namespace NapierCapture
{
   public class ShowDevices
   {
      public static void Main(string[] args)
      {
         string verWinPCap =null;
         int count=0;
         verWinPCap= Tamir.IPLib.Version.GetVersionString();
         PcapDeviceList getNetConnections = SharpPcap.GetAllDevices();
         Console.WriteLine("WinPCap Version: {0}", verWinPCap);
         Console.WriteLine("Connected devices:rn");
         foreach(PcapDevice net in getNetConnections)
         {
            Console.WriteLine("{0}) {1}",count,net.PcapDescription);
            Console.WriteLine("tName:t{0}",net.PcapName);
            Console.WriteLine("tMode:ttt{0}",net.PcapMode);
            Console.WriteLine("tIP Address: tt{0}",net.PcapIpAddress);
            Console.WriteLine("tLoopback: tt{0}",net.PcapLoopback);
            Console.WriteLine();
            count++;
         }
         Console.Write("Press any <RETURN> to exit");
         Console.Read();
      }
   }                                 Tamir Code Wrapper (.NET interface)
}




                                                                                             Author: Bill Buchanan
                                                  WinPCap

                                                                Author: Prof Bill Buchanan


                             Integrating with WinPCap – showing the interface
namespace NapierCapture
                       {
                          public class CapturePackets
                          {
                             public static void Main(string[] args)
                             {
                                PcapDeviceList getNetConnections = SharpPcap.GetAllDevices();

                                 NetworkDevice netConn = (NetworkDevice)getNetConnections[1];
                                 PcapDevice device = netConn;
                                 device.PcapOnPacketArrival +=
                                 new SharpPcap.PacketArrivalEvent(device_PcapOnPacketArrival);
                                 Console.WriteLine("Network connection: {0}",
                                    device.PcapDescription);
                                 device.PcapStartCapture();
                                 Console.Write("Press any <RETURN> to exit");
                                 Console.Read();
                                 device.PcapStopCapture();
                                 device.PcapClose();
                               }
                               private static void device_PcapOnPacketArrival(object sender,
                                                            Packet packet)
                               {
                                  DateTime time = packet.PcapHeader.Date;
                                  int len = packet.PcapHeader.PacketLength;
                                  Console.WriteLine("{0}:{1}:{2},{3} Len={4}",time.Hour,
                                   time.Minute, time.Second, time.Millisecond, len);
                               }
                           }
                       }                                          Tamir Code Wrapper (.NET interface)




                                                                                                                        Author: Bill Buchanan
13:17:56,990 Len=695
13:17:57,66 Len=288
13:17:57,68 Len=694
13:18:4,363 Len=319                                                           WinPCap
13:18:4,364 Len=373                                                                        Author: Prof Bill Buchanan
13:18:4,364 Len=371
13:18:4,365 Len=375
13:18:4,366 Len=367
                                                                           Protecting
Intrusion Detection Systems                  Eve
                                          (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                     Defence
Snort
A simple rule                             Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                               Snort




                                                                              Author: Bill Buchanan
                                                 Author: Prof Bill Buchanan
Other tools:
                                Tcptrace. Identity TCP streams.
                                Tcpflow. Reconstruct TCP streams.




                                                     Event data




SNORT rules                 SNORT agent
                                                      Log data
   file




     Signature detection.                      Anomaly detection.




                                                                                                 Author: Bill Buchanan
     Identify well-known                       Statistical anomalies,
     patterns of attack.                       such as user logins,
                                               changes to files, and so
                                               on.
                                                                    Author: Prof Bill Buchanan


                                                Snort rules
alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";)

alert      Generate an alert and log packet
log        Log packet
pass       Ignore the packet
activate   Alert and activate another rule
Dynamic    Remain idle until activated by an activate rule




                                                             Event data




                                         SNORT agent
                                                             Log data




                                                                                                             Author: Bill Buchanan
                                                                                Author: Prof Bill Buchanan


                                                               Snort rules
alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";)

[Source IP] [Port]       [Destination IP] [Port]




                                                           Event data




                               SNORT agent
                                                            Log data




                                                                                                             Author: Bill Buchanan
                                                                                Author: Prof Bill Buchanan


                                                              Snort rules
alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";)



Payload detection:
Hex sequence "|00 01 86 a5|"                                                        Modifiers:
Text sequence "USER root"                                                           rawbytes
                                                                                    offset
                                                                                    distance
                                                                                    within
                                                                                    uricontent
                                                                                    bytejump

                                                           Event data




                               SNORT agent
                                                            Log data




                                                                                                                Author: Bill Buchanan
                                                                                   Author: Prof Bill Buchanan


                                                             Payload detection
alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";)




                                                Message-to-display




                                                           Event data




                               SNORT agent
                                                            Log data




                                                                                                             Author: Bill Buchanan
                                                                                Author: Prof Bill Buchanan


                                                          Payload detection
alert tcp $HOME_NET any -> $EXTERNAL_NET 1863
(msg:"CHAT MSN login attempt"; flow:to_server,established; content:"USR "; depth:4;
nocase; content:" TWN "; distance:1; nocase;
classtype:policy-violation; sid:1991; rev:1;)




                                                      Event data




                         SNORT agent
                                                      Log data



              The SID and REV represent know Snort rules:

                 Less 100 Reserved for future use
                 Between 100 and 1,000,000 are rules included with the Snort
                distribution




                                                                                                             Author: Bill Buchanan
                 More than 1,000,000 is for local rules

              For example: sid:336; rev:7; represents an attempt to change to
              the system administrator’s account in FTP.
                                                                                Author: Prof Bill Buchanan


                                                               Snort rule
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                    A simple rule




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
alert tcp any any -> any any (content:"the"; msg:"The found ....";)




      Snort -v -c bill.rules -l /log



                   [**] [1:0:0] The found .... [**]    16 January 10:27pm
                   [Priority: 0]
       Alert.ids
       (in log)   01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169
                   192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20
                   DgmLen:347 DF
                   ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20

                   [**] [1:0:0] The found .... [**]
                   [Priority: 0]
                   01/16-22:27:35.287084 0:3:6D:FF:2A:51 -> 0:60:B3:68:B1:10 type:0x800 len:0x198
                   192.168.0.20:3554 -> 192.168.0.22:445 TCP TTL:128 TOS:0x0 ID:1086 IpLen:20
                   DgmLen:394 DF
                   ***AP*** Seq: 0x3524EE7B Ack: 0xF842AB06 Win: 0x42E4 TcpLen: 20

                   [**] [1:0:0] The found .... [**]
                   [Priority: 0]
                   01/16-22:27:35.290026 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x5D
                   192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:775 IpLen:20




                                                                                                                      Author: Bill Buchanan
                   DgmLen:79 DF
                   ***AP*** Seq: 0xF842AB06 Ack: 0x3524EFDD Win: 0x41BF TcpLen: 20


                                                                                         Author: Prof Bill Buchanan


                                                                   Running Snort
IP header                                                 TCP header
Version     Header len.             Type of service                            TCP Source Port
                   Total length                                               TCP Destination Port
                   Identification
                                                                               Sequence Number
0 D M                  Fragment Offset
  Time-to-live (TTL)                   Protocol
                                                                         Acknowledgement Number
                Header Checksum
                                                                    Data Offset                Flags/Reserved
                Source IP Address
                                                                                     Window
                                                                                    Checksum
              Destination IP Address
                                                                                  Urgent Pointer


                                                                                                   Ethernet frame
            Src MAC            Dest. MAC                               IP          TCP
                                                  Type     Length                          Data
            address             address                              header       header




 [**] [1:0:0] The found .... [**]
 [Priority: 0]
 01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169
 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20 DgmLen:347 DF
 ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20




                                                                                                                                     Author: Bill Buchanan
                                                                                                        Author: Prof Bill Buchanan


                                                                              Payload detection
IP header                                                 TCP header
Version     Header len.             Type of service                            TCP Source Port
                   Total length                                               TCP Destination Port
                   Identification
                                                                               Sequence Number
0 D M                  Fragment Offset
  Time-to-live (TTL)                   Protocol
                                                                         Acknowledgement Number
                Header Checksum
                                                                    Data Offset                Flags/Reserved
                Source IP Address
                                                                                     Window
                                                                                    Checksum
              Destination IP Address
                                                                                  Urgent Pointer


                                                                                                   Ethernet frame
            Src MAC            Dest. MAC                               IP          TCP
                                                  Type     Length                          Data
            address             address                              header       header




 [**] [1:0:0] The found .... [**]
 [Priority: 0]
 01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169
 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20 DgmLen:347 DF
 ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20




                                                                                                                                     Author: Bill Buchanan
                                                                                                              Protocol
                                                                                                              1 ICMP
                                                                                                              6 TCP
                                                                                                              8 EGP
                                                                                                              41 IPv6 over IPv4
                                                                                                              46 RSVP
                                                                                                        Author: Prof Bill Buchanan
                                                                                                              50 ESP
                                                                                                              51 AH
                                                                              Payload detection
IP header                                                 TCP header
Version     Header len.             Type of service                            TCP Source Port
                   Total length                                               TCP Destination Port
                   Identification
                                                                               Sequence Number
0 D M                  Fragment Offset
  Time-to-live (TTL)                   Protocol
                                                                         Acknowledgement Number
                Header Checksum
                                                                    Data Offset                Flags/Reserved
                Source IP Address
                                                                                     Window
                                                                                    Checksum
              Destination IP Address
                                                                                  Urgent Pointer


                                                                                                   Ethernet frame
            Src MAC            Dest. MAC                               IP          TCP
                                                  Type     Length                          Data
            address             address                              header       header




 [**] [1:0:0] The found .... [**]
 [Priority: 0]
 01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169
 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20 DgmLen:347 DF
 ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20




                                                                                                                                     Author: Bill Buchanan
                                                                                                        Author: Prof Bill Buchanan


                                                                              Payload detection
+       log
    +    192.168.0.1            TCP_3423-445.ids
    +    192.168.0.2            TCP_3424-139.ids
    +    192.168.0.3
                                TCP_3521-445.ids
    +    192.168.0.20
    +    192.168.0.21           TCP_3529-139.ids
    +    192.168.0.24           TCP_3554-445.ids                   Log of traffic
    +    192.168.0.25                                              between port 3423 and
    +    192.168.0.60           TCP_3566-445.ids
                                                                   455 to/from 192.168.0.20




                    01/16-22:11:15.833440 192.168.0.20:3423 -> 192.168.0.22:445
                    TCP TTL:128 TOS:0x0 ID:975 IpLen:20 DgmLen:48 DF
                    ******S* Seq: 0x26885B8B Ack: 0x0 Win: 0x4000 TcpLen: 28
                    TCP Options (4) => MSS: 1460 NOP NOP SackOK
                    =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

                    01/16-22:11:15.835497 192.168.0.22:445 -> 192.168.0.20:3423
                    TCP TTL:128 TOS:0x0 ID:653 IpLen:20 DgmLen:48 DF
                    ***A**S* Seq: 0xE9A4004C Ack: 0x26885B8C Win: 0x4470 TcpLen: 28
                    TCP Options (4) => MSS: 1460 NOP NOP SackOK
                    =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

                    01/16-22:11:15.835571 192.168.0.20:3423 -> 192.168.0.22:445




                                                                                                                    Author: Bill Buchanan
                    TCP TTL:128 TOS:0x0 ID:977 IpLen:20 DgmLen:40 DF
                    ***A**** Seq: 0x26885B8C Ack: 0xE9A4004D Win: 0x4470 TcpLen: 20
                    =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+




                                                                                       Author: Prof Bill Buchanan


                                                                  Snort logs
TCP header

                         TCP Source Port

                        TCP Destination Port


                         Sequence Number



                    Acknowledgement Number


          Data Offset                          Flags/Reserved

                              Window

                            Checksum

                           Urgent Pointer




Flags – the flag field is defined as UAPRSF,

     U is the urgent flag (URG).
     A the acknowledgement flag (ACK).
     P the push function (PSH).
     R the reset flag (RST).




                                                                                                                 Author: Bill Buchanan
     S the sequence synchronize flag (SYN).
     F the end-of-transmission flag (FIN).


                                                                                    Author: Prof Bill Buchanan


                                                                Payload detection
Originator                                                                        Recipient
 1. CLOSED                                                                        LISTEN
 2. SYN-SENT         -> <SEQ=999><CTL=SYN>                                        SYN-RECEIVED
 3. ESTABLISHED      <SEQ=100><ACK=1000><CTL=SYN,ACK> <-                          SYN-RECEIVED
 4. ESTABLISHED      -> <SEQ=1000><ACK=101> <CTL=ACK>                             ESTABLISHED
 5. ESTABLISHED      -> <SEQ=1000><ACK=101> <CTL=ACK><DATA>                       ESTABLISHED




                                                The SYN flag identifies
                                                      a connection




         Flags – the flag field is defined as UAPRSF,

              U is the urgent flag (URG).
              A the acknowledgement flag (ACK).
              P the push function (PSH).
              R the reset flag (RST).
              S the sequence synchronize flag (SYN).
              F the end-of-transmission flag (FIN).




                                                                                                                      Author: Bill Buchanan
                                                                                         Author: Prof Bill Buchanan


                                                                     Payload detection
An incoming SYN flag is important in detecting
the start of a connection. The main flags are:

F FIN
S SYN
R RST
P PSH
A ACK
U URG

The following modifiers can be set to change the match criteria:

+ match on the specified bits, plus any others
* match if any of the specified bits are set
! match if the specified bits are not set

Example to test for SYN flag:                    It is often important to know the flow direction. The main flow
                                                 rules options are:
alert tcp any any -> any any (flags:S;)
                                                        to_client. Used for server responses to client.
                                                        to_server Used for client requests to server.
                                                        from_client. Used on client responses.
                                                        from_server. Used on server responses.
                                                        established . Established TCP connections.




                                                                                                                       Author: Bill Buchanan
                                                 Example to test for an FTP connection to the users computer:

                                                 alert tcp any any -> $HOME_NET 21 (flow: from_client;
                                                                        content: "CWD incoming"; nocase;
                                                                                          Author: Prof Bill Buchanan


                                                              Payload detection
IP header                                              TCP header
Version     Header len.             Type of service                       TCP Source Port
                    Total length                                        TCP Destination Port
                   Identification
                                                                         Sequence Number
0 D M                  Fragment Offset
  Time-to-live (TTL)                   Protocol
                                                                     Acknowledgement Number
                Header Checksum
                                                                Data Offset               Flags/Reserved
                Source IP Address
                                                                                 Window
                                                                               Checksum
              Destination IP Address
                                                                              Urgent Pointer


  01/16-22:11:15.833440 192.168.0.20:3423 -> 192.168.0.22:445
  TCP TTL:128 TOS:0x0 ID:975 IpLen:20 DgmLen:48 DF
  ******S* Seq: 0x26885B8B      Ack: 0x0 Win: 0x4000 TcpLen: 28
  TCP Options (4) => MSS: 1460 NOP NOP SackOK
  =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

  01/16-22:11:15.835497 192.168.0.22:445 -> 192.168.0.20:3423
  TCP TTL:128 TOS:0x0 ID:653 IpLen:20 DgmLen:48 DF
  ***A**S* Seq: 0xE9A4004C       Ack: 0x26885B8C Win: 0x4470 TcpLen: 28
  TCP Options (4) => MSS: 1460 NOP NOP SackOK
  =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

  01/16-22:11:15.835571 192.168.0.20:3423 -> 192.168.0.22:445




                                                                                                                            Author: Bill Buchanan
  TCP TTL:128 TOS:0x0 ID:977 IpLen:20 DgmLen:40 DF
  ***A**** Seq: 0x26885B8C Ack: 0xE9A4004D Win: 0x4470 TcpLen: 20
  =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


                                                                                               Author: Prof Bill Buchanan


                                                                   Payload detection
Switch
Devices can
only communicate                               ARP request: Who has 192.168.0.168?
directly if they have
they have the
MAC address and
IP address.



                                  ARP request is broadcast to the network




   01/16-09:31:08.785149 ARP who-has 192.168.0.168 tell 192.168.0.22
   01/16-09:45:59.458607 ARP who-has 192.168.0.42 tell 192.168.0.216
   01/16-09:45:59.459159 ARP reply 192.168.0.42 is-at 0:20:18:38:B8:63
   01/16-09:46:03.857325 ARP who-has 192.168.0.104 tell 192.168.0.198
   01/16-09:46:10.125715 ARP who-has 192.168.0.15 tell 192.168.0.38
   01/16-09:46:10.125930 ARP who-has 192.168.0.38 tell 192.168.0.15




                                                                                                          Author: Bill Buchanan
                                                                             Author: Prof Bill Buchanan


                                                           ARP information
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                   A few intrusions




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
Aims/objectives
                                       of the organisation




Legal, moral and
social responsibilities                     Policy
                                           Definition
Technicial feasability




                          Policy
                      Implementation                              Evaluation       Verification




   Operating Firewall                              Application                        Audit
    System    rules                                  rights
     rights




                                                                                                                        Author: Bill Buchanan
            Domain        Event log
             rights       definition



                                                                                           Author: Prof Bill Buchanan


                                                                 Intrusions/Policy Violations
alert tcp $HOME_NET any -> $EXTERNAL_NET 1863
(msg:"CHAT MSN login attempt"; flow:to_server,established; content:"USR "; depth:4;
nocase; content:" TWN "; distance:1; nocase;
classtype:policy-violation; sid:1991; rev:1;)




                                                                                                        Author: Bill Buchanan
                                                                           Author: Prof Bill Buchanan


                                                  Intrusions/Policy Violations
FTP server
                              (listening on port 21)


Intrusion Detection
      System




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan


                      Intrusions/Policy Violations
220-Microsoft FTP Service
 220 NTXPW35

 530 Please login with USER and PASS.

 331 Password required for        .

 230-FTP Server
 230 User bill logged in.

   214-The following commands are recognized
       ABOR         ACCT    ALLO      FTP server
                                        APPE   CDUP
       CWD          DELE    FEAT         HELP   LIST
       MDTM         MKD     MODE      (listening on port 21)
                                        NLST   NOOP
       OPTS         PASS    PASV        PORT    PWD
       QUIT         REIN    REST        RETR
       RMD          RNFR    RNTO        SITE
       SIZE
Intrusion Detection SMNT    STAT        STOR
       STOU
      System        STRU    SYST        TYPE
       USER         XCUP    XCWD        XMKD
       XPWD         XRMD
   214 HELP command successful.

 257 "/bill" is current directory.

 250 CWD command successful.

 257 "/" is current directory.

 250 CWD command successful.

 150 Opening ASCII mode data connection for /bin/ls.




                                                                                     Author: Bill Buchanan
                                                        Author: Prof Bill Buchanan


                          Intrusions/Policy Violations
Intrusion Detection
      System




                                                                           Author: Bill Buchanan
                                              Author: Prof Bill Buchanan


                      Intrusions/Policy Violations
Author: Bill Buchanan
                        Author: Prof Bill Buchanan


Intrusions/Policy Violations
Author: Bill Buchanan
                        Author: Prof Bill Buchanan


Intrusions/Policy Violations
Email for Fred


                                  Email server
                                     (SMTP –
                                listening on port
                                       25)




                                                                         Author: Bill Buchanan
                                            Author: Prof Bill Buchanan


                 Intrusions/Policy Violations
<SYN, FIN>                 Server




                                                                  Author: Bill Buchanan
                                     Author: Prof Bill Buchanan


             Intrusions/Policy Violations
alert tcp $TELNET_SERVERS 23 -> $EXTERNAL_NET
      (msg:"TELNET
  any (msg:"TELNET root login";
  flow:from_server,established;
  flow:from_server,established;
  content:"login|3A| root";
  classtype:suspicious-
  classtype:suspicious-login; sid:719; rev:7;)




                                                                                         Author: Bill Buchanan
                                                            Author: Prof Bill Buchanan


                                    Intrusions/Policy Violations
Typical scans:
                     Open port 10?                                         Ping sweeps.
                     Open port 11?                                         TCP scans.
                     ..                                                    UDP scans.
                     Open port 8888?                                       OS identification scans.
                                                                           Account scans.




A particular threat
is the TCP/UDP port
scanner, which scans for open
ports on a host.
                                       An open port is in the LISTEN
                                       state.
If an intruder finds one, it may try
and connect to it.                     C:log>netstat -a
                                       Active Connections
                                       Proto Local Address               Foreign Address              State
                                       TCP    bills:epmap                bills:0                      LISTENING
                                       TCP    bills:microsoft-ds         bills:0                      LISTENING




                                                                                                                             Author: Bill Buchanan
                                       TCP    bills:1035                 bills:0                      LISTENING
                                       TCP    bills:3389                 bills:0                      LISTENING



                                                                                                Author: Prof Bill Buchanan


                                                                       UDP/TCP Port Scans
Ping 192.168.0.1?                                   Typical scans:
          Ping 192.168.0.1?                                   Ping sweeps.
          ..                                                  TCP scans.
          Ping 192.168.0.253?                                 UDP scans.
          Ping 192.168.0.254?                                 OS identification scans.
                                                              Account scans.




A particular threat
is the ping port
scanner, which pings multiple
hosts to see which ones are alive

If an intruder finds one, they may
try and connect to it.               Often ping (ICMP) is blocked on
                                     the gateway of the network.




                                                                                                                Author: Bill Buchanan
                                                                                   Author: Prof Bill Buchanan


                                                             Ping sweeps
Login anonymous               Typical scans:
             Login fred fred               Ping sweeps.
             Login user password           TCP scans.
             Login root                    UDP scans.
             Login default                 OS identification scans.
                                           Account scans.




                                       Directory
                                       server




Typical problems:
Anonymous logins
                                     E-Commerce
Using the same password as user ID
                                     server
Using password as password.
Using root login
Using system default logins
Weak passwords
Well-known passwords




                                                                                             Author: Bill Buchanan
Social Engineering




                                                                Author: Prof Bill Buchanan


                                      User account scans
IDS        Agent-based




Author: Bill Buchanan
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                    User Profiling




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
Name: Fred McLean
                                                                      Nationality: USA
                                                                      Location: Washington
           Name: Fiona Smith                                          Gender: Male
           Nationality: British                                       Typical purchase: Fish Food
           Location: Edinburgh                                        Average Purchases/week: 50
           Gender: Female                                             Average Value of purchases: $4
           Typical purchase: Computer equipment                       Browser used: IE
           Average Purchases/week: 5                                  Date of last purchase: 18 Sept 2008
           Average Value of purchases: £30                            Email address: f.mclean@usa
           Browser used: Mozilla                                                                     Name: Michel Weber
           Date of last purchase: 6 May 2008                                                         Nationality: German
           Email address: f.smith@nowhere                                                            Location: Munich
                                                                                                     Gender: Male
                                                                                                     Typical purchase: Flowers
                                                                                                     Average Purchases/week: 0.005
                                        Name: Amélie Cheney                                          Average Value of purchases: €43
                                        Nationality: French                                          Browser used: Opera
                                        Location: Paris                                              Date of last purchase: 1 Mar 2007
                                        Gender: Female                                               Email address: m_weber@de
                                        Typical purchase: Clothes
                                        Average Purchases/week: 70
                                        Average Value of purchases: €13
                                        Browser used: Mozilla
                                        Date of last purchase: 16 Sept 2008
                                        Email address: a.cheney@fr.edu




                                                                                          Name: A.N.Other
                                                                                          Nationality: Any
                                                                                          Location: Nowhere
                                                                                          Gender: Female/Male
                                                                                          Typical purchase: High-value goods
                                                                                          Average Purchases/week: 1000
                                                                                          Average Value of purchases: $9999
                                                                                          Browser used: Not known
                                              Transactions are                            Date of last purchase: Today




                                                                                                                                                  Author: Bill Buchanan
                                              checked                                     Email address: doesnt@exist

                                              against user profile

                     User profiler (such as bank                  User/behaviour profiling is especially
Profiles             transaction agent)                           useful in fraud detection                          Author: Prof Bill Buchanan


                                                                      User profiling for on-line purchases
Name: Fred McLean
                                                                           Login: fmclean
                                                                           Location: Production
             Name: Fiona Smith                                             Gender: Male
             Login: fsmith                                                 Typing speed: 44 wpm
             Location: Sales                                               Applications: AutoCAD, Outlook
             Gender: Female                                                Working hours: 9pm-8am
             Typing speed: 54 wpm                                          Equipment used: HP8800
             Applications: Excel, Word, Outlook                            Internet usage: 1GB/hour
             Working hours: 9am-4:30pm                                     Network accesses: 40,000/hr
             Equipment used: HP4110                                                                     Name: Michel Weber
             Internet usage: 50MB/hour                                                                  Login: fmclean
             Network accesses: 40/hr                                                                    Location: Production
                                                                                                        Gender: Male
                                                                                                        Typing speed: 10 wpm
                                                                                                        Applications: Outlook
                                            Name: Amélie Cheney                                         Working hours: 7am-2pm
                                            Login: acheney                                              Equipment used: HP4111
                                            Location: Accounts                                          Internet usage: 500MB/hour
                                            Gender: Female                                              Network accesses: 4000/hr
                                            Typing speed: 22 wpm
                                            Applications: Excel, Outlook
                                            Working hours: 9am-1pm
                                            Equipment used: HP1330                                         2. Agent on each
                                            Internet usage: 5MB/hour                                       machine analyses the
                                            Network accesses: 2/hr
                                                                                                           current user, and
1. On-login, the user
                                                                                                           reports on differences
profile is uploaded to
                                                                                                           of behaviour
the local machine
                                                                                              Name: A.N.Other
                                                                                              Login: any
                                                                                              Location: Any
                                                                                              Gender: Female/Male
                                                                                              Typing speed: 10 wpm
                                                                                              Applications: Excel, Word, Outlook
                                                                                              Working hours: 9am-11pm
                                                                                              Equipment used: Any
                                                                                              Internet usage: 500MB/hour




                                                                                                                                                      Author: Bill Buchanan
                                                                                              Network accesses: 400/hr




                         User profiler (monitors alerts
Profiles                 from user agents)                                                                               Author: Prof Bill Buchanan


                                                                           User profiling for local access/usage
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                       Honeypots




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan
This device has all the required weaknesses,
                      such as:

                        Default administrator/password.
                        Dummy users with weak passwords.
                        Ports open for connection.
                        React to virus/worm systems (but simulate
                        conditions).


Intruder
                                                            Servers/
                                                            systems




           Honeypot




                                                                                                  Author: Bill Buchanan
                                                                     Author: Prof Bill Buchanan


                                              Honeypots
create default
                                                                            set default personality "Windows XP"
                                                                            set default default tcp action reset
                                                                            add default tcp port 110 "sh scripts/pop.sh"
                                        Open ports: 110 (POP-               add default tcp port 80 "perl scripts/iis-0.95/main.pl"
                                        3), 80 (HTTP), 21 (FTP,             add default tcp port 25 block
                                                22 (SSH)                    add default tcp port 21 "sh scripts/ftp.sh"
                                                                            add default tcp port 22 proxy $ipsrc:22
                                                                            add default udp port 139 drop
                                                                            set default uptime 3284460
Honeypots




                                                                            ### Cisco router
                                                                            create router
                                                                            set router personality "Cisco PIX Firewall (PixOS 5.2 -
                                                                            6.1)"
                                                                            add router tcp port 23 "/usr/bin/perl scripts/router-
                                                                            telnet.pl"
                                            Low-interaction
                                                                            set router default tcp action reset
                                            honeypot. This                  set router uid 32767 gid 32767
                                        simulates only part of the          set router uptime 1327650
                                         network stack (such as             # Bind specific templates to specific IP address
                High-interaction              for Honeyd)                   # If not bound, default to Windows template
                                         - can be virtual (from a virtual   bind 192.168.1.150 router
                 honeypot. This         machine) or simulated by another
            simulates all the aspects




                                                                                                                                               Author: Bill Buchanan
                                                   machine.
IDS




            of the operating system



                                                                                                                  Author: Prof Bill Buchanan


                                                                                             Honeypot types
#!/usr/bin/perl
# Copyright 2002 Niels Provos <provos@citi.umich.edu>
# All rights reserved.
# For the license refer to the main source code of Honeyd.
# Don't echo Will Echo Will Surpress Go Ahead
$return = pack('ccccccccc', 255, 254, 1, 255, 251, 1, 255, 251, 3); exit;
syswrite STDOUT, $return, 9;                                        sub read_word {
                                                                      local $prompt = shift;
$string =                                                             local $echo = shift;
"Users (authorized or unauthorized) have no explicit orr             local $word;
implicit expectation of privacy. Any or all uses of thisr
system may be intercepted, monitored, recorded, copied,r             syswrite STDOUT, "$prompt";
audited, inspected, and disclosed to authorized site,r
and law enforcement personnel, as well as to authorizedr             $word = "";
officials of other agencies, both domestic and foreign.r
                                                               create default
                                                                      $alarmed = 0;
                                                               set default personality "Windows XP"
By using this system, the user consents to suchr                     eval {
interception, monitoring, recording, copying, auditing,r      set default default tcp sub { $alarmed = 1; die; };
                                                                        local $SIG{ALRM} =
                                                                                             action reset
inspection, and disclosure at the discretion of authorizedr   add default tcp port 110 "sh scripts/pop.sh"
                                                                        alarm 30;
site.r                                                        add default tcp = 0; 80 "perl scripts/iis-0.95/main.pl"
                                                                        $finished port
r                                                             add default tcp port 25 block
                                                                        do {
Unauthorized or improper use of this system may result inr
administrative disciplinary action and civil and criminalr
                                                               add default tcp= port 21 STDIN, $buffer, 1;
                                                                          $nread    sysread "sh scripts/ftp.sh"
                                                               add defaultdie tcp port 22 proxy $ipsrc:22
                                                                               unless $nread;
penalties. By continuing to use this system you indicater                if (ord($buffer) == 0) {
your awareness of and consent to these terms and conditionsr add default udp port 139 drop
                                                                          ; #ignore
 of use. LOG OFF IMMEDIATELY if you do not agree to ther      set default uptime 3284460 == 255) {
                                                                          } elsif (ord($buffer)
conditions stated in this warning.r
    Agent-based




                                                                          sysread STDIN, $buffer, 2;
r                                                             ### Cisco} router(ord($buffer) == 13 || ord($buffer) == 10) {
                                                                             elsif
r                                                                        syswrite STDOUT, "rn" if $echo;
r
                                                               create router
                                                                          $finished = 1;
                                                               set router personality "Cisco PIX Firewall (PixOS 5.2 -
User Access Verificationr                                                } else {
";                                                             6.1)"      syswrite STDOUT, $buffer, 1 if $echo;
                                                             add router tcp= port 23 "/usr/bin/perl scripts/router-
                                                                       $word   $word.$buffer;
syswrite STDOUT, $string;                                    telnet.pl"}
$count = 0;                                                  set router default tcp action reset
                                                                     } while (!$finished);
while ($count < 3) {                                                 alarm 0;
  do {
                                                             set router uid 32767 gid 32767
                                                                  };
                                                             set router uptime 1327650
    $count++;                                                     syswrite STDOUT, "rn" if $alarmed || ! $echo;
    syswrite STDOUT, "rn";                                 # Bind specific templates to specific IP address
                                                                  if ($alarmed) {
    $word = read_word("Username: ", 1);                      # If not bound,STDOUT, "% to Windows template
                                                                     syswrite default $prompt timeout expired!rn";
  } while (!$word && $count < 3);                            bind 192.168.1.150 router
                                                                     return (0);
  if ($count >= 3 && !$word) {                                       }
    exit;




                                                                                                                                     Author: Bill Buchanan
  }
   IDS




                                                                     return ($word);
  $password = read_word("Password: ", 0);                        }
  if (!$password) {
    syswrite STDOUT, "% Login invalidrn";
  } else {
    syswrite STDERR, "Attempted login: $word/$password";
    syswrite STDOUT, "% Access deniedrn";                                                             Author: Prof Bill Buchanan
  }
}
                                                                                               Example of router-telnet.pl
Intrusion Detection Systems                   Eve
                                                 (Intruder)

      Introduction
      Threats              Intrusion
                           Detection
      Types
      Host or Network?
      Agent-based                      Defence
      Snort
      A simple rule                              Defence
      A few intrusions
      User profiling
      Honeypots
      IPS
      Conclusions


                         IPS and In/out-line




                                                                                     Author: Bill Buchanan
IDS




                                                        Author: Prof Bill Buchanan
In-line IDS, which can decide
             to drop a packet, alarm
             (send an alert/log) or reset a
             connection.




                                                    Out-of-line IDS, which
                                                    passively listens to traffic
                                                    and cannot actually drop
                                                    packets (unless there is an
                                                    IPS)




                                              Intrusion Detection
                                                    System          In-line IDS has the advantage
Syslog                                                              that they can act on the
Server                                                              intrusion, but it has a
(stores alerts/logs/                                                performance impact. The
etc)                                                                signatures are also difficult to
                                                                    change/upgrade.
                                                                    Out-of-line IDS has the




                                                                                                                     Author: Bill Buchanan
                                                                    advantage of being able to
                                                                    more easily craft an IDS rule,
                                                                    but cannot take actions,
                                                                    directly.
                                                                                        Author: Prof Bill Buchanan


                                                       In-line and out-of-line IDS
Example Cisco IDS
signatures                           (config)# ip audit ?
1001 – Bad IP Options                  attack     Specify default action for attack signatures
(Info)
                                       info       Specify default action for informational signatures
1100 – IP Fragment (Attack)
2000 - ICMP echo reply                 name       Specify an IDS audit rule
(Info)                                 notify     Specify the notification mechanisms (nr-director or log) for the
2154 – Ping of death                              alarms
(Attack)                               po         Specify nr-director's PostOffice information (for sending events
3041 – SYN/FIN Packet                             to the nr-directors
(Attack)
                                       signature Add a policy to a signature
3040 – NULL TCP Packet
(Attack)                               smtp       Specify SMTP Mail spam threshold
3050 – Half open SYN                 (config)# ip audit notify ?
(Attack)                               log          Send events as syslog messages
3152 – CWD Root on FTP                 nr-director Send events to the nr-director
(Info)                               (config)# ip audit notify log
                                     (config)# logging 132.191.125.3
                                     (config)# ip audit ?
                                       attack     Specify default action for attack signatures
                                       info       Specify default action for informational signatures
                                       name       Specify an IDS audit rule
                                       notify     Specify the notification mechanisms (nr-director or log) for the
                                                  alarms
                                       po         Specify nr-director's PostOffice information (for sending events
       IPS




                                                  to the nr-directorsIntrusion Detection
                                       signature Add a policy to a signature
                                                                           System
                                       smtp       Specify SMTP Mail spam threshold
                      Syslog         (config)# ip audit info ?
                                       action Specify the actions
                      Server         (config)# ip audit info action ?
                      (stores          alarm Generate events for matching signatures
                      alerts/logs/     drop   Drop packets matching signatures
                      etc)             reset Reset the connection (if applicable)
                                     (config)# ip audit info action drop
                                     (config)# ip audit attack action reset




                                                                                                                            Author: Bill Buchanan
                                     (config)# ip audit signature ?
      IDS




                                       <1-65535> Signature to be configured
                                     (config)# ip audit signature 1005 disable
                                     (config)# ip audit smtp ?
                                       spam Specify the threshold for spam signature
                                       <cr>
                                     (config)# ip audit smtp spam ?                            Author: Prof Bill Buchanan
                                       <1-65535> Threshold of correspondents to trigger alarm
                                                               Intrusion Prevention Systems (IPS)
                                     (config)# ip audit smtp spam 4
Intrusion Detection Systems                   Eve
                                           (Intruder)

Introduction
Threats              Intrusion
                     Detection
Types
Host or Network?
Agent-based                      Defence
Snort
A simple rule                              Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                   Anomaly Detection




                                                                               Author: Bill Buchanan
                                                  Author: Prof Bill Buchanan
Bob




          Anomaly detection:
      Learn normal activity, such as:
              User activity.
             System activity
             Server activity
             Network activity
           Application activity
               And so on




                                                                                     Author: Bill Buchanan
                                                        Author: Prof Bill Buchanan

                                        Author: Prof Bill Buchanan
                       User, system and network anomaly
Bob




User anomaly:
Typing speed
Packages used
Working hours
Emails sent/hr
Web sites visited



  System anomaly:
  CPU Usage/min
  Threads/min
  Disk writes/min




                                                                          Author: Bill Buchanan
                                             Author: Prof Bill Buchanan


                    User, system and network anomaly
Bob




Network anomaly
IP packets (%)
TCP packets (%)
HTTP (%)
FTP (%)




 FTP threshold (2%)




                                                                                   Author: Bill Buchanan
                                                      Author: Prof Bill Buchanan

                                      Author: Prof Bill Buchanan
                      User, system and network anomaly
Intrusion Detection Systems                 Eve
                                         (Intruder)

Introduction
Threats            Intrusion
                   Detection
Types
Host or Network?
Agent-based                    Defence
Snort
A simple rule                            Defence
A few intrusions
User profiling
Honeypots
IPS
Conclusions


                     Conclusions




                                                                             Author: Bill Buchanan
                                                Author: Prof Bill Buchanan

Weitere ähnliche Inhalte

Was ist angesagt?

A review of anomaly based intrusions detection in multi tier web applications
A review of anomaly based intrusions detection in multi tier web applicationsA review of anomaly based intrusions detection in multi tier web applications
A review of anomaly based intrusions detection in multi tier web applicationsiaemedu
 
OOW 2009 EBS Security R12
OOW 2009 EBS Security R12OOW 2009 EBS Security R12
OOW 2009 EBS Security R12jucaab
 

Was ist angesagt? (6)

A review of anomaly based intrusions detection in multi tier web applications
A review of anomaly based intrusions detection in multi tier web applicationsA review of anomaly based intrusions detection in multi tier web applications
A review of anomaly based intrusions detection in multi tier web applications
 
Fabio Ghioni
Fabio GhioniFabio Ghioni
Fabio Ghioni
 
Research Overview
Research OverviewResearch Overview
Research Overview
 
101 ab 1530-1600
101 ab 1530-1600101 ab 1530-1600
101 ab 1530-1600
 
Rm
RmRm
Rm
 
OOW 2009 EBS Security R12
OOW 2009 EBS Security R12OOW 2009 EBS Security R12
OOW 2009 EBS Security R12
 

Ähnlich wie Ids

Incident response: Introduction
Incident response: IntroductionIncident response: Introduction
Incident response: IntroductionNapier University
 
CSN09112: Introduction to Computer Security
CSN09112: Introduction to Computer SecurityCSN09112: Introduction to Computer Security
CSN09112: Introduction to Computer SecurityNapier University
 
Cyber crime trends in 2013
Cyber crime trends in 2013 Cyber crime trends in 2013
Cyber crime trends in 2013 The eCore Group
 
Network security
Network securityNetwork security
Network securityfangjiafu
 
Symantec Endpoint Protection 12
Symantec Endpoint Protection 12Symantec Endpoint Protection 12
Symantec Endpoint Protection 12Symantec
 
Cio ciso security_strategyv1.1
Cio ciso security_strategyv1.1Cio ciso security_strategyv1.1
Cio ciso security_strategyv1.1Anindya Ghosh,
 
Trend Micro - Targeted attacks: Have you found yours?
Trend Micro - Targeted attacks: Have you found yours?Trend Micro - Targeted attacks: Have you found yours?
Trend Micro - Targeted attacks: Have you found yours?Global Business Events
 
Datos personales y riesgos digitales
Datos personales y riesgos digitalesDatos personales y riesgos digitales
Datos personales y riesgos digitalesJuan Carlos Carrillo
 
Anatomy of an Attack
Anatomy of an AttackAnatomy of an Attack
Anatomy of an Attackspoofyroot
 

Ähnlich wie Ids (11)

Incident response: Introduction
Incident response: IntroductionIncident response: Introduction
Incident response: Introduction
 
CSN09112: Introduction to Computer Security
CSN09112: Introduction to Computer SecurityCSN09112: Introduction to Computer Security
CSN09112: Introduction to Computer Security
 
Cyber crime trends in 2013
Cyber crime trends in 2013 Cyber crime trends in 2013
Cyber crime trends in 2013
 
Targeted Attacks: Have you found yours?
Targeted Attacks: Have you found yours?Targeted Attacks: Have you found yours?
Targeted Attacks: Have you found yours?
 
Network security
Network securityNetwork security
Network security
 
Symantec Endpoint Protection 12
Symantec Endpoint Protection 12Symantec Endpoint Protection 12
Symantec Endpoint Protection 12
 
Cio ciso security_strategyv1.1
Cio ciso security_strategyv1.1Cio ciso security_strategyv1.1
Cio ciso security_strategyv1.1
 
Trend Micro - Targeted attacks: Have you found yours?
Trend Micro - Targeted attacks: Have you found yours?Trend Micro - Targeted attacks: Have you found yours?
Trend Micro - Targeted attacks: Have you found yours?
 
Health Information Privacy and Security
Health Information Privacy and SecurityHealth Information Privacy and Security
Health Information Privacy and Security
 
Datos personales y riesgos digitales
Datos personales y riesgos digitalesDatos personales y riesgos digitales
Datos personales y riesgos digitales
 
Anatomy of an Attack
Anatomy of an AttackAnatomy of an Attack
Anatomy of an Attack
 

Mehr von fangjiafu

Wce internals rooted_con2011_ampliasecurity
Wce internals rooted_con2011_ampliasecurityWce internals rooted_con2011_ampliasecurity
Wce internals rooted_con2011_ampliasecurityfangjiafu
 
Oracle forensics 101
Oracle forensics 101Oracle forensics 101
Oracle forensics 101fangjiafu
 
Understanding and selecting_dsp_final
Understanding and selecting_dsp_finalUnderstanding and selecting_dsp_final
Understanding and selecting_dsp_finalfangjiafu
 
Wce12 uba ampliasecurity_eng
Wce12 uba ampliasecurity_engWce12 uba ampliasecurity_eng
Wce12 uba ampliasecurity_engfangjiafu
 
Ddos analizi
Ddos analiziDdos analizi
Ddos analizifangjiafu
 
Bypass dbms assert
Bypass dbms assertBypass dbms assert
Bypass dbms assertfangjiafu
 
Cursor injection
Cursor injectionCursor injection
Cursor injectionfangjiafu
 
Create user to_sysdba
Create user to_sysdbaCreate user to_sysdba
Create user to_sysdbafangjiafu
 
Presentation nix
Presentation nixPresentation nix
Presentation nixfangjiafu
 
Layer 7 ddos
Layer 7 ddosLayer 7 ddos
Layer 7 ddosfangjiafu
 
Tlsoptimizationprint 120224194603-phpapp02
Tlsoptimizationprint 120224194603-phpapp02Tlsoptimizationprint 120224194603-phpapp02
Tlsoptimizationprint 120224194603-phpapp02fangjiafu
 
Presentation nix
Presentation nixPresentation nix
Presentation nixfangjiafu
 
Proper passwordhashing
Proper passwordhashingProper passwordhashing
Proper passwordhashingfangjiafu
 
Burp suite injection中的应用by小冰
Burp suite injection中的应用by小冰Burp suite injection中的应用by小冰
Burp suite injection中的应用by小冰fangjiafu
 
2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronizationfangjiafu
 

Mehr von fangjiafu (20)

Wce internals rooted_con2011_ampliasecurity
Wce internals rooted_con2011_ampliasecurityWce internals rooted_con2011_ampliasecurity
Wce internals rooted_con2011_ampliasecurity
 
Oracle forensics 101
Oracle forensics 101Oracle forensics 101
Oracle forensics 101
 
Understanding and selecting_dsp_final
Understanding and selecting_dsp_finalUnderstanding and selecting_dsp_final
Understanding and selecting_dsp_final
 
Wce12 uba ampliasecurity_eng
Wce12 uba ampliasecurity_engWce12 uba ampliasecurity_eng
Wce12 uba ampliasecurity_eng
 
Ddos analizi
Ddos analiziDdos analizi
Ddos analizi
 
Bypass dbms assert
Bypass dbms assertBypass dbms assert
Bypass dbms assert
 
Cursor injection
Cursor injectionCursor injection
Cursor injection
 
Create user to_sysdba
Create user to_sysdbaCreate user to_sysdba
Create user to_sysdba
 
Presentation nix
Presentation nixPresentation nix
Presentation nix
 
Layer 7 ddos
Layer 7 ddosLayer 7 ddos
Layer 7 ddos
 
Tlsoptimizationprint 120224194603-phpapp02
Tlsoptimizationprint 120224194603-phpapp02Tlsoptimizationprint 120224194603-phpapp02
Tlsoptimizationprint 120224194603-phpapp02
 
Crypto hlug
Crypto hlugCrypto hlug
Crypto hlug
 
Fp
FpFp
Fp
 
Presentation nix
Presentation nixPresentation nix
Presentation nix
 
Rr 7944
Rr 7944Rr 7944
Rr 7944
 
Proper passwordhashing
Proper passwordhashingProper passwordhashing
Proper passwordhashing
 
Burp suite injection中的应用by小冰
Burp suite injection中的应用by小冰Burp suite injection中的应用by小冰
Burp suite injection中的应用by小冰
 
Oech03
Oech03Oech03
Oech03
 
2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization2008 07-24 kwpm-threads_and_synchronization
2008 07-24 kwpm-threads_and_synchronization
 
Unit07
Unit07Unit07
Unit07
 

Kürzlich hochgeladen

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 

Kürzlich hochgeladen (20)

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 

Ids

  • 1. ` Intrusion Detection Systems Introduction Eve Threats (Intruder) Types Host or Network? Intrusion Agent-based Detection Snort A simple rule Defence A few intrusions User profiling Defence Honeypots IPS Conclusions Author: Bill Buchanan Author: Prof Bill Buchanan
  • 2. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Types Detection Host or Network? Agent-based Defence Snort A simple rule A few intrusions Defence User profiling Honeypots IPS Conclusions Introduction Author: Bill Buchanan Author: Prof Bill Buchanan
  • 3. Enemy takes some time to breach each of the levels of defence Defence Defence Defence Defence Author: Bill Buchanan Forth-level Third-level Second-level First-level defence defence defence defence Author: Prof Bill Buchanan Defence-in-the-depth
  • 4. DMZ – an area Trusted where military Untrusted Author: Bill Buchanan (our side) actions (their side) are prohibited Author: Prof Bill Buchanan DMZ
  • 5. Assets Hello. How are you? Is this okay? Data Author: Bill Buchanan Users Systems Even with the best defences, intruders can penetrate them Author: Prof Bill Buchanan Protecting
  • 6. Intrusion Detection Systems can help to reduce breaches Intrusion Detection Intrusion Detection Intrusion Detection Users Systems Intrusion Detection Data Assets Author: Bill Buchanan Forth-level Third-level Second-level First-level defence defence defence defence Author: Prof Bill Buchanan Defence-in-the-depth
  • 7. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Threats Author: Bill Buchanan Author: Prof Bill Buchanan
  • 8. Data Corporate access stealing Email access External Web access hack Intrusion Detection DoS (Denial-of- sevice) Personal Users Firewall/ abuse gateway Systems Worms/viruses Data Assets Author: Bill Buchanan Network/ Organisational Terrorism/ Fraud perimeter extortion Author: Prof Bill Buchanan Outside threats
  • 9. CSI (Computer Security Institute) found: 70% of organisation had breaches 60% of all breaches came from inside their own systems Data Corporate access stealing Email access External Web access hack Intrusion Detection DoS (Denial-of- sevice) Firewall/ Gateway Personal Users (cannot deal with abuse Systems internal threats) Worms/viruses Data Assets Author: Bill Buchanan Network/ Organisational Terrorism/ Fraud perimeter extortion Author: Prof Bill Buchanan Internal threats (often Protecting a great threat than from outside)
  • 10. Eve (Intruder) Public Web Public FTP Public Proxy Defence Server Server Server Defence Audit/ Firewall logging Intrusion Detection System Intrusion Detection DMZ Intrusion Detection Defence Intrusion Detection System NAT Device Defence-in-depth puts as many obstacles in the way of an intruder, so that it becomes Intrusion Detection System harder to penetrate the network, Intrusion Detection Defence and easier to detect Author: Bill Buchanan Users Author: Prof Bill Buchanan Defence-in-depth (multiple obstacles)
  • 11. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Types Author: Bill Buchanan Author: Prof Bill Buchanan
  • 12. Intrusion Detection Anomaly Detection. Misuse Detection This assumes that abnormal This attempts to model behaviour by a user can be attacks on a system as correlated with an intrusion. specific patterns, and then Its advantage is that it can scans for occurrences of IDS agent typically react to new these. Its disadvantage is attacks, but can often that it struggles to detect struggle to detect variants of new attacks. known attacks, particularly if they fit into the normal usage pattern of a user. Another problem is that the intruder can mimic the behavioural pattern of the Personal abuse user. Viruses/Worms External hack (scripting) Author: Bill Buchanan External hack Data Denial-of-Service Fraud (human) stealing Author: Prof Bill Buchanan IDS types
  • 13. Network intrusion detection systems (NIDS) These monitor packets on the network and tries to determine an intrusion. This is either host base (where it runs on a host), Intrusion Detection or can listen to the System network using a hub, router or probe. User profiling System Integrity Verifier These monitor system files to determine if an intruder has changed them (a backdoor attack). A good example of this is Log file monitors (LFM) Tripwire. It can also watch other key system components, such as the These monitor log files Windows registry and root/ which are generated by administrator level network services, and look privileges. for key patterns of change. Swatch is a good Author: Bill Buchanan example. Author: Prof Bill Buchanan IDS Types
  • 14. Intruder gains public information Intruder gains more specific about the systems, such as DNS and information such as subnet layout, and IP information networked devices. Outside Inside reconnaissance Intrusion reconnaissance Intrusion Detection Detection Eve (Intruder) From code yellow to code Exploit red ... Intruder finds a weakness, such as cracking a password, breaching a firewall, and so on. Profit Foothold Intrusion Intrusion Author: Bill Buchanan Detection Detection Data stealing, system Once into the system, the damage, intruder can then advance user abuse, and so on. up the privilege levels, Author: Prof Bill Buchanan Typical pattern of intrusion
  • 15. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Host or Network? Author: Bill Buchanan Author: Prof Bill Buchanan
  • 16. Public Web Public FTP Public Proxy Server Server Server Intrusion Detection Audit/ Firewall logging Intrusion Detection System Intrusion Detection DMZ Intrusion Detection System NAT Device Network-based IDS listens to Intrusion Detection some/all System network traffic Intrusion Detection Intrusion Detection Intrusion Detection System Author: Bill Buchanan Host-based IDS listens to traffic in/out of a host Author: Prof Bill Buchanan Host or network?
  • 17. Firewall Intrusion Detection System DMZ NAT Device Author: Bill Buchanan Author: Prof Bill Buchanan Protecting
  • 18. Hub Intrusion Detection IDS can listen to all the incoming Switch and outgoing network Intrusion Detection This IDS cannot hear any traffic which is not addressed to it as it connects to a switch. Author: Bill Buchanan Author: Prof Bill Buchanan IDS location
  • 19. interface FastEthernet0/1 port monitor FastEthernet0/2 port monitor FastEthernet0/5 port monitor VLAN2 ! interface FastEthernet0/2 0/1 0/2 0/5 Intrusion ! Detection interface FastEthernet0/3 switchport access vlan 2 ! interface FastEthernet0/4 switchport access vlan 2 ! interface FastEthernet0/5 ! interface VLAN1 ip address 192.168.0.1 255.255.255.0 no ip directed-broadcast no ip route-cache ! Author: Bill Buchanan Author: Prof Bill Buchanan Using the span port
  • 20. Intrusion Detection This IDS detects IDS detects Intrusion Detection successful attacks attacks against Intrusion against firewall server Detection DMZ This IDS detects attacks against main firewall Host Intrusion Detection Intrusion Detection IDS detects internal IDS detects attacks attacks against Author: Bill Buchanan host ` Author: Prof Bill Buchanan Protecting
  • 21. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Agent-based Author: Bill Buchanan Author: Prof Bill Buchanan
  • 22. Security agent Management agent QoS agent SNORT agent Auditing agent Author: Bill Buchanan Reconfig agent Author: Prof Bill Buchanan Agent-based system allows for distributed security
  • 23. IDS Agent-based Author: Bill Buchanan
  • 24. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions WinPCap Author: Bill Buchanan Author: Prof Bill Buchanan
  • 25. User-defined Wireshark SNORT agent API Interface Capture filter WinPCap libpcap Network Interface: Ethernet, Wireless, ADSL, etc Author: Bill Buchanan Author: Prof Bill Buchanan Integrating with WinPCap – capturing packets
  • 26. IDS WinPCap Author: Bill Buchanan
  • 27. using System; using Tamir.IPLib; namespace NapierCapture { public class ShowDevices { public static void Main(string[] args) { string verWinPCap =null; int count=0; verWinPCap= Tamir.IPLib.Version.GetVersionString(); PcapDeviceList getNetConnections = SharpPcap.GetAllDevices(); Console.WriteLine("WinPCap Version: {0}", verWinPCap); Console.WriteLine("Connected devices:rn"); foreach(PcapDevice net in getNetConnections) { Console.WriteLine("{0}) {1}",count,net.PcapDescription); Console.WriteLine("tName:t{0}",net.PcapName); Console.WriteLine("tMode:ttt{0}",net.PcapMode); Console.WriteLine("tIP Address: tt{0}",net.PcapIpAddress); Console.WriteLine("tLoopback: tt{0}",net.PcapLoopback); Console.WriteLine(); count++; } Console.Write("Press any <RETURN> to exit"); Console.Read(); } } Tamir Code Wrapper (.NET interface) } Author: Bill Buchanan WinPCap Author: Prof Bill Buchanan Integrating with WinPCap – showing the interface
  • 28. namespace NapierCapture { public class CapturePackets { public static void Main(string[] args) { PcapDeviceList getNetConnections = SharpPcap.GetAllDevices(); NetworkDevice netConn = (NetworkDevice)getNetConnections[1]; PcapDevice device = netConn; device.PcapOnPacketArrival += new SharpPcap.PacketArrivalEvent(device_PcapOnPacketArrival); Console.WriteLine("Network connection: {0}", device.PcapDescription); device.PcapStartCapture(); Console.Write("Press any <RETURN> to exit"); Console.Read(); device.PcapStopCapture(); device.PcapClose(); } private static void device_PcapOnPacketArrival(object sender, Packet packet) { DateTime time = packet.PcapHeader.Date; int len = packet.PcapHeader.PacketLength; Console.WriteLine("{0}:{1}:{2},{3} Len={4}",time.Hour, time.Minute, time.Second, time.Millisecond, len); } } } Tamir Code Wrapper (.NET interface) Author: Bill Buchanan 13:17:56,990 Len=695 13:17:57,66 Len=288 13:17:57,68 Len=694 13:18:4,363 Len=319 WinPCap 13:18:4,364 Len=373 Author: Prof Bill Buchanan 13:18:4,364 Len=371 13:18:4,365 Len=375 13:18:4,366 Len=367 Protecting
  • 29. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Snort Author: Bill Buchanan Author: Prof Bill Buchanan
  • 30. Other tools: Tcptrace. Identity TCP streams. Tcpflow. Reconstruct TCP streams. Event data SNORT rules SNORT agent Log data file Signature detection. Anomaly detection. Author: Bill Buchanan Identify well-known Statistical anomalies, patterns of attack. such as user logins, changes to files, and so on. Author: Prof Bill Buchanan Snort rules
  • 31. alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";) alert Generate an alert and log packet log Log packet pass Ignore the packet activate Alert and activate another rule Dynamic Remain idle until activated by an activate rule Event data SNORT agent Log data Author: Bill Buchanan Author: Prof Bill Buchanan Snort rules
  • 32. alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";) [Source IP] [Port] [Destination IP] [Port] Event data SNORT agent Log data Author: Bill Buchanan Author: Prof Bill Buchanan Snort rules
  • 33. alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";) Payload detection: Hex sequence "|00 01 86 a5|" Modifiers: Text sequence "USER root" rawbytes offset distance within uricontent bytejump Event data SNORT agent Log data Author: Bill Buchanan Author: Prof Bill Buchanan Payload detection
  • 34. alert tcp any any -> 192.168.1.0/24 111 (content:"|00 01 86 a5|"; msg:"mountd access";) Message-to-display Event data SNORT agent Log data Author: Bill Buchanan Author: Prof Bill Buchanan Payload detection
  • 35. alert tcp $HOME_NET any -> $EXTERNAL_NET 1863 (msg:"CHAT MSN login attempt"; flow:to_server,established; content:"USR "; depth:4; nocase; content:" TWN "; distance:1; nocase; classtype:policy-violation; sid:1991; rev:1;) Event data SNORT agent Log data The SID and REV represent know Snort rules: Less 100 Reserved for future use Between 100 and 1,000,000 are rules included with the Snort distribution Author: Bill Buchanan More than 1,000,000 is for local rules For example: sid:336; rev:7; represents an attempt to change to the system administrator’s account in FTP. Author: Prof Bill Buchanan Snort rule
  • 36. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions A simple rule Author: Bill Buchanan Author: Prof Bill Buchanan
  • 37. alert tcp any any -> any any (content:"the"; msg:"The found ....";) Snort -v -c bill.rules -l /log [**] [1:0:0] The found .... [**] 16 January 10:27pm [Priority: 0] Alert.ids (in log) 01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20 DgmLen:347 DF ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20 [**] [1:0:0] The found .... [**] [Priority: 0] 01/16-22:27:35.287084 0:3:6D:FF:2A:51 -> 0:60:B3:68:B1:10 type:0x800 len:0x198 192.168.0.20:3554 -> 192.168.0.22:445 TCP TTL:128 TOS:0x0 ID:1086 IpLen:20 DgmLen:394 DF ***AP*** Seq: 0x3524EE7B Ack: 0xF842AB06 Win: 0x42E4 TcpLen: 20 [**] [1:0:0] The found .... [**] [Priority: 0] 01/16-22:27:35.290026 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x5D 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:775 IpLen:20 Author: Bill Buchanan DgmLen:79 DF ***AP*** Seq: 0xF842AB06 Ack: 0x3524EFDD Win: 0x41BF TcpLen: 20 Author: Prof Bill Buchanan Running Snort
  • 38. IP header TCP header Version Header len. Type of service TCP Source Port Total length TCP Destination Port Identification Sequence Number 0 D M Fragment Offset Time-to-live (TTL) Protocol Acknowledgement Number Header Checksum Data Offset Flags/Reserved Source IP Address Window Checksum Destination IP Address Urgent Pointer Ethernet frame Src MAC Dest. MAC IP TCP Type Length Data address address header header [**] [1:0:0] The found .... [**] [Priority: 0] 01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20 DgmLen:347 DF ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20 Author: Bill Buchanan Author: Prof Bill Buchanan Payload detection
  • 39. IP header TCP header Version Header len. Type of service TCP Source Port Total length TCP Destination Port Identification Sequence Number 0 D M Fragment Offset Time-to-live (TTL) Protocol Acknowledgement Number Header Checksum Data Offset Flags/Reserved Source IP Address Window Checksum Destination IP Address Urgent Pointer Ethernet frame Src MAC Dest. MAC IP TCP Type Length Data address address header header [**] [1:0:0] The found .... [**] [Priority: 0] 01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20 DgmLen:347 DF ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20 Author: Bill Buchanan Protocol 1 ICMP 6 TCP 8 EGP 41 IPv6 over IPv4 46 RSVP Author: Prof Bill Buchanan 50 ESP 51 AH Payload detection
  • 40. IP header TCP header Version Header len. Type of service TCP Source Port Total length TCP Destination Port Identification Sequence Number 0 D M Fragment Offset Time-to-live (TTL) Protocol Acknowledgement Number Header Checksum Data Offset Flags/Reserved Source IP Address Window Checksum Destination IP Address Urgent Pointer Ethernet frame Src MAC Dest. MAC IP TCP Type Length Data address address header header [**] [1:0:0] The found .... [**] [Priority: 0] 01/16-22:27:35.286762 0:60:B3:68:B1:10 -> 0:3:6D:FF:2A:51 type:0x800 len:0x169 192.168.0.22:445 -> 192.168.0.20:3554 TCP TTL:128 TOS:0x0 ID:774 IpLen:20 DgmLen:347 DF ***AP*** Seq: 0xF842A9D3 Ack: 0x3524EE7B Win: 0x4321 TcpLen: 20 Author: Bill Buchanan Author: Prof Bill Buchanan Payload detection
  • 41. + log + 192.168.0.1 TCP_3423-445.ids + 192.168.0.2 TCP_3424-139.ids + 192.168.0.3 TCP_3521-445.ids + 192.168.0.20 + 192.168.0.21 TCP_3529-139.ids + 192.168.0.24 TCP_3554-445.ids Log of traffic + 192.168.0.25 between port 3423 and + 192.168.0.60 TCP_3566-445.ids 455 to/from 192.168.0.20 01/16-22:11:15.833440 192.168.0.20:3423 -> 192.168.0.22:445 TCP TTL:128 TOS:0x0 ID:975 IpLen:20 DgmLen:48 DF ******S* Seq: 0x26885B8B Ack: 0x0 Win: 0x4000 TcpLen: 28 TCP Options (4) => MSS: 1460 NOP NOP SackOK =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 01/16-22:11:15.835497 192.168.0.22:445 -> 192.168.0.20:3423 TCP TTL:128 TOS:0x0 ID:653 IpLen:20 DgmLen:48 DF ***A**S* Seq: 0xE9A4004C Ack: 0x26885B8C Win: 0x4470 TcpLen: 28 TCP Options (4) => MSS: 1460 NOP NOP SackOK =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 01/16-22:11:15.835571 192.168.0.20:3423 -> 192.168.0.22:445 Author: Bill Buchanan TCP TTL:128 TOS:0x0 ID:977 IpLen:20 DgmLen:40 DF ***A**** Seq: 0x26885B8C Ack: 0xE9A4004D Win: 0x4470 TcpLen: 20 =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Author: Prof Bill Buchanan Snort logs
  • 42. TCP header TCP Source Port TCP Destination Port Sequence Number Acknowledgement Number Data Offset Flags/Reserved Window Checksum Urgent Pointer Flags – the flag field is defined as UAPRSF, U is the urgent flag (URG). A the acknowledgement flag (ACK). P the push function (PSH). R the reset flag (RST). Author: Bill Buchanan S the sequence synchronize flag (SYN). F the end-of-transmission flag (FIN). Author: Prof Bill Buchanan Payload detection
  • 43. Originator Recipient 1. CLOSED LISTEN 2. SYN-SENT -> <SEQ=999><CTL=SYN> SYN-RECEIVED 3. ESTABLISHED <SEQ=100><ACK=1000><CTL=SYN,ACK> <- SYN-RECEIVED 4. ESTABLISHED -> <SEQ=1000><ACK=101> <CTL=ACK> ESTABLISHED 5. ESTABLISHED -> <SEQ=1000><ACK=101> <CTL=ACK><DATA> ESTABLISHED The SYN flag identifies a connection Flags – the flag field is defined as UAPRSF, U is the urgent flag (URG). A the acknowledgement flag (ACK). P the push function (PSH). R the reset flag (RST). S the sequence synchronize flag (SYN). F the end-of-transmission flag (FIN). Author: Bill Buchanan Author: Prof Bill Buchanan Payload detection
  • 44. An incoming SYN flag is important in detecting the start of a connection. The main flags are: F FIN S SYN R RST P PSH A ACK U URG The following modifiers can be set to change the match criteria: + match on the specified bits, plus any others * match if any of the specified bits are set ! match if the specified bits are not set Example to test for SYN flag: It is often important to know the flow direction. The main flow rules options are: alert tcp any any -> any any (flags:S;) to_client. Used for server responses to client. to_server Used for client requests to server. from_client. Used on client responses. from_server. Used on server responses. established . Established TCP connections. Author: Bill Buchanan Example to test for an FTP connection to the users computer: alert tcp any any -> $HOME_NET 21 (flow: from_client; content: "CWD incoming"; nocase; Author: Prof Bill Buchanan Payload detection
  • 45. IP header TCP header Version Header len. Type of service TCP Source Port Total length TCP Destination Port Identification Sequence Number 0 D M Fragment Offset Time-to-live (TTL) Protocol Acknowledgement Number Header Checksum Data Offset Flags/Reserved Source IP Address Window Checksum Destination IP Address Urgent Pointer 01/16-22:11:15.833440 192.168.0.20:3423 -> 192.168.0.22:445 TCP TTL:128 TOS:0x0 ID:975 IpLen:20 DgmLen:48 DF ******S* Seq: 0x26885B8B Ack: 0x0 Win: 0x4000 TcpLen: 28 TCP Options (4) => MSS: 1460 NOP NOP SackOK =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 01/16-22:11:15.835497 192.168.0.22:445 -> 192.168.0.20:3423 TCP TTL:128 TOS:0x0 ID:653 IpLen:20 DgmLen:48 DF ***A**S* Seq: 0xE9A4004C Ack: 0x26885B8C Win: 0x4470 TcpLen: 28 TCP Options (4) => MSS: 1460 NOP NOP SackOK =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 01/16-22:11:15.835571 192.168.0.20:3423 -> 192.168.0.22:445 Author: Bill Buchanan TCP TTL:128 TOS:0x0 ID:977 IpLen:20 DgmLen:40 DF ***A**** Seq: 0x26885B8C Ack: 0xE9A4004D Win: 0x4470 TcpLen: 20 =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Author: Prof Bill Buchanan Payload detection
  • 46. Switch Devices can only communicate ARP request: Who has 192.168.0.168? directly if they have they have the MAC address and IP address. ARP request is broadcast to the network 01/16-09:31:08.785149 ARP who-has 192.168.0.168 tell 192.168.0.22 01/16-09:45:59.458607 ARP who-has 192.168.0.42 tell 192.168.0.216 01/16-09:45:59.459159 ARP reply 192.168.0.42 is-at 0:20:18:38:B8:63 01/16-09:46:03.857325 ARP who-has 192.168.0.104 tell 192.168.0.198 01/16-09:46:10.125715 ARP who-has 192.168.0.15 tell 192.168.0.38 01/16-09:46:10.125930 ARP who-has 192.168.0.38 tell 192.168.0.15 Author: Bill Buchanan Author: Prof Bill Buchanan ARP information
  • 47. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions A few intrusions Author: Bill Buchanan Author: Prof Bill Buchanan
  • 48. Aims/objectives of the organisation Legal, moral and social responsibilities Policy Definition Technicial feasability Policy Implementation Evaluation Verification Operating Firewall Application Audit System rules rights rights Author: Bill Buchanan Domain Event log rights definition Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 49. alert tcp $HOME_NET any -> $EXTERNAL_NET 1863 (msg:"CHAT MSN login attempt"; flow:to_server,established; content:"USR "; depth:4; nocase; content:" TWN "; distance:1; nocase; classtype:policy-violation; sid:1991; rev:1;) Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 50. FTP server (listening on port 21) Intrusion Detection System Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 51. 220-Microsoft FTP Service 220 NTXPW35 530 Please login with USER and PASS. 331 Password required for . 230-FTP Server 230 User bill logged in. 214-The following commands are recognized ABOR ACCT ALLO FTP server APPE CDUP CWD DELE FEAT HELP LIST MDTM MKD MODE (listening on port 21) NLST NOOP OPTS PASS PASV PORT PWD QUIT REIN REST RETR RMD RNFR RNTO SITE SIZE Intrusion Detection SMNT STAT STOR STOU System STRU SYST TYPE USER XCUP XCWD XMKD XPWD XRMD 214 HELP command successful. 257 "/bill" is current directory. 250 CWD command successful. 257 "/" is current directory. 250 CWD command successful. 150 Opening ASCII mode data connection for /bin/ls. Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 52. Intrusion Detection System Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 53. Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 54. Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 55. Email for Fred Email server (SMTP – listening on port 25) Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 56. <SYN, FIN> Server Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 57. alert tcp $TELNET_SERVERS 23 -> $EXTERNAL_NET (msg:"TELNET any (msg:"TELNET root login"; flow:from_server,established; flow:from_server,established; content:"login|3A| root"; classtype:suspicious- classtype:suspicious-login; sid:719; rev:7;) Author: Bill Buchanan Author: Prof Bill Buchanan Intrusions/Policy Violations
  • 58. Typical scans: Open port 10? Ping sweeps. Open port 11? TCP scans. .. UDP scans. Open port 8888? OS identification scans. Account scans. A particular threat is the TCP/UDP port scanner, which scans for open ports on a host. An open port is in the LISTEN state. If an intruder finds one, it may try and connect to it. C:log>netstat -a Active Connections Proto Local Address Foreign Address State TCP bills:epmap bills:0 LISTENING TCP bills:microsoft-ds bills:0 LISTENING Author: Bill Buchanan TCP bills:1035 bills:0 LISTENING TCP bills:3389 bills:0 LISTENING Author: Prof Bill Buchanan UDP/TCP Port Scans
  • 59. Ping 192.168.0.1? Typical scans: Ping 192.168.0.1? Ping sweeps. .. TCP scans. Ping 192.168.0.253? UDP scans. Ping 192.168.0.254? OS identification scans. Account scans. A particular threat is the ping port scanner, which pings multiple hosts to see which ones are alive If an intruder finds one, they may try and connect to it. Often ping (ICMP) is blocked on the gateway of the network. Author: Bill Buchanan Author: Prof Bill Buchanan Ping sweeps
  • 60. Login anonymous Typical scans: Login fred fred Ping sweeps. Login user password TCP scans. Login root UDP scans. Login default OS identification scans. Account scans. Directory server Typical problems: Anonymous logins E-Commerce Using the same password as user ID server Using password as password. Using root login Using system default logins Weak passwords Well-known passwords Author: Bill Buchanan Social Engineering Author: Prof Bill Buchanan User account scans
  • 61. IDS Agent-based Author: Bill Buchanan
  • 62. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions User Profiling Author: Bill Buchanan Author: Prof Bill Buchanan
  • 63. Name: Fred McLean Nationality: USA Location: Washington Name: Fiona Smith Gender: Male Nationality: British Typical purchase: Fish Food Location: Edinburgh Average Purchases/week: 50 Gender: Female Average Value of purchases: $4 Typical purchase: Computer equipment Browser used: IE Average Purchases/week: 5 Date of last purchase: 18 Sept 2008 Average Value of purchases: £30 Email address: f.mclean@usa Browser used: Mozilla Name: Michel Weber Date of last purchase: 6 May 2008 Nationality: German Email address: f.smith@nowhere Location: Munich Gender: Male Typical purchase: Flowers Average Purchases/week: 0.005 Name: Amélie Cheney Average Value of purchases: €43 Nationality: French Browser used: Opera Location: Paris Date of last purchase: 1 Mar 2007 Gender: Female Email address: m_weber@de Typical purchase: Clothes Average Purchases/week: 70 Average Value of purchases: €13 Browser used: Mozilla Date of last purchase: 16 Sept 2008 Email address: a.cheney@fr.edu Name: A.N.Other Nationality: Any Location: Nowhere Gender: Female/Male Typical purchase: High-value goods Average Purchases/week: 1000 Average Value of purchases: $9999 Browser used: Not known Transactions are Date of last purchase: Today Author: Bill Buchanan checked Email address: doesnt@exist against user profile User profiler (such as bank User/behaviour profiling is especially Profiles transaction agent) useful in fraud detection Author: Prof Bill Buchanan User profiling for on-line purchases
  • 64. Name: Fred McLean Login: fmclean Location: Production Name: Fiona Smith Gender: Male Login: fsmith Typing speed: 44 wpm Location: Sales Applications: AutoCAD, Outlook Gender: Female Working hours: 9pm-8am Typing speed: 54 wpm Equipment used: HP8800 Applications: Excel, Word, Outlook Internet usage: 1GB/hour Working hours: 9am-4:30pm Network accesses: 40,000/hr Equipment used: HP4110 Name: Michel Weber Internet usage: 50MB/hour Login: fmclean Network accesses: 40/hr Location: Production Gender: Male Typing speed: 10 wpm Applications: Outlook Name: Amélie Cheney Working hours: 7am-2pm Login: acheney Equipment used: HP4111 Location: Accounts Internet usage: 500MB/hour Gender: Female Network accesses: 4000/hr Typing speed: 22 wpm Applications: Excel, Outlook Working hours: 9am-1pm Equipment used: HP1330 2. Agent on each Internet usage: 5MB/hour machine analyses the Network accesses: 2/hr current user, and 1. On-login, the user reports on differences profile is uploaded to of behaviour the local machine Name: A.N.Other Login: any Location: Any Gender: Female/Male Typing speed: 10 wpm Applications: Excel, Word, Outlook Working hours: 9am-11pm Equipment used: Any Internet usage: 500MB/hour Author: Bill Buchanan Network accesses: 400/hr User profiler (monitors alerts Profiles from user agents) Author: Prof Bill Buchanan User profiling for local access/usage
  • 65. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Honeypots Author: Bill Buchanan Author: Prof Bill Buchanan
  • 66. This device has all the required weaknesses, such as: Default administrator/password. Dummy users with weak passwords. Ports open for connection. React to virus/worm systems (but simulate conditions). Intruder Servers/ systems Honeypot Author: Bill Buchanan Author: Prof Bill Buchanan Honeypots
  • 67. create default set default personality "Windows XP" set default default tcp action reset add default tcp port 110 "sh scripts/pop.sh" Open ports: 110 (POP- add default tcp port 80 "perl scripts/iis-0.95/main.pl" 3), 80 (HTTP), 21 (FTP, add default tcp port 25 block 22 (SSH) add default tcp port 21 "sh scripts/ftp.sh" add default tcp port 22 proxy $ipsrc:22 add default udp port 139 drop set default uptime 3284460 Honeypots ### Cisco router create router set router personality "Cisco PIX Firewall (PixOS 5.2 - 6.1)" add router tcp port 23 "/usr/bin/perl scripts/router- telnet.pl" Low-interaction set router default tcp action reset honeypot. This set router uid 32767 gid 32767 simulates only part of the set router uptime 1327650 network stack (such as # Bind specific templates to specific IP address High-interaction for Honeyd) # If not bound, default to Windows template - can be virtual (from a virtual bind 192.168.1.150 router honeypot. This machine) or simulated by another simulates all the aspects Author: Bill Buchanan machine. IDS of the operating system Author: Prof Bill Buchanan Honeypot types
  • 68. #!/usr/bin/perl # Copyright 2002 Niels Provos <provos@citi.umich.edu> # All rights reserved. # For the license refer to the main source code of Honeyd. # Don't echo Will Echo Will Surpress Go Ahead $return = pack('ccccccccc', 255, 254, 1, 255, 251, 1, 255, 251, 3); exit; syswrite STDOUT, $return, 9; sub read_word { local $prompt = shift; $string = local $echo = shift; "Users (authorized or unauthorized) have no explicit orr local $word; implicit expectation of privacy. Any or all uses of thisr system may be intercepted, monitored, recorded, copied,r syswrite STDOUT, "$prompt"; audited, inspected, and disclosed to authorized site,r and law enforcement personnel, as well as to authorizedr $word = ""; officials of other agencies, both domestic and foreign.r create default $alarmed = 0; set default personality "Windows XP" By using this system, the user consents to suchr eval { interception, monitoring, recording, copying, auditing,r set default default tcp sub { $alarmed = 1; die; }; local $SIG{ALRM} = action reset inspection, and disclosure at the discretion of authorizedr add default tcp port 110 "sh scripts/pop.sh" alarm 30; site.r add default tcp = 0; 80 "perl scripts/iis-0.95/main.pl" $finished port r add default tcp port 25 block do { Unauthorized or improper use of this system may result inr administrative disciplinary action and civil and criminalr add default tcp= port 21 STDIN, $buffer, 1; $nread sysread "sh scripts/ftp.sh" add defaultdie tcp port 22 proxy $ipsrc:22 unless $nread; penalties. By continuing to use this system you indicater if (ord($buffer) == 0) { your awareness of and consent to these terms and conditionsr add default udp port 139 drop ; #ignore of use. LOG OFF IMMEDIATELY if you do not agree to ther set default uptime 3284460 == 255) { } elsif (ord($buffer) conditions stated in this warning.r Agent-based sysread STDIN, $buffer, 2; r ### Cisco} router(ord($buffer) == 13 || ord($buffer) == 10) { elsif r syswrite STDOUT, "rn" if $echo; r create router $finished = 1; set router personality "Cisco PIX Firewall (PixOS 5.2 - User Access Verificationr } else { "; 6.1)" syswrite STDOUT, $buffer, 1 if $echo; add router tcp= port 23 "/usr/bin/perl scripts/router- $word $word.$buffer; syswrite STDOUT, $string; telnet.pl"} $count = 0; set router default tcp action reset } while (!$finished); while ($count < 3) { alarm 0; do { set router uid 32767 gid 32767 }; set router uptime 1327650 $count++; syswrite STDOUT, "rn" if $alarmed || ! $echo; syswrite STDOUT, "rn"; # Bind specific templates to specific IP address if ($alarmed) { $word = read_word("Username: ", 1); # If not bound,STDOUT, "% to Windows template syswrite default $prompt timeout expired!rn"; } while (!$word && $count < 3); bind 192.168.1.150 router return (0); if ($count >= 3 && !$word) { } exit; Author: Bill Buchanan } IDS return ($word); $password = read_word("Password: ", 0); } if (!$password) { syswrite STDOUT, "% Login invalidrn"; } else { syswrite STDERR, "Attempted login: $word/$password"; syswrite STDOUT, "% Access deniedrn"; Author: Prof Bill Buchanan } } Example of router-telnet.pl
  • 69. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions IPS and In/out-line Author: Bill Buchanan IDS Author: Prof Bill Buchanan
  • 70. In-line IDS, which can decide to drop a packet, alarm (send an alert/log) or reset a connection. Out-of-line IDS, which passively listens to traffic and cannot actually drop packets (unless there is an IPS) Intrusion Detection System In-line IDS has the advantage Syslog that they can act on the Server intrusion, but it has a (stores alerts/logs/ performance impact. The etc) signatures are also difficult to change/upgrade. Out-of-line IDS has the Author: Bill Buchanan advantage of being able to more easily craft an IDS rule, but cannot take actions, directly. Author: Prof Bill Buchanan In-line and out-of-line IDS
  • 71. Example Cisco IDS signatures (config)# ip audit ? 1001 – Bad IP Options attack Specify default action for attack signatures (Info) info Specify default action for informational signatures 1100 – IP Fragment (Attack) 2000 - ICMP echo reply name Specify an IDS audit rule (Info) notify Specify the notification mechanisms (nr-director or log) for the 2154 – Ping of death alarms (Attack) po Specify nr-director's PostOffice information (for sending events 3041 – SYN/FIN Packet to the nr-directors (Attack) signature Add a policy to a signature 3040 – NULL TCP Packet (Attack) smtp Specify SMTP Mail spam threshold 3050 – Half open SYN (config)# ip audit notify ? (Attack) log Send events as syslog messages 3152 – CWD Root on FTP nr-director Send events to the nr-director (Info) (config)# ip audit notify log (config)# logging 132.191.125.3 (config)# ip audit ? attack Specify default action for attack signatures info Specify default action for informational signatures name Specify an IDS audit rule notify Specify the notification mechanisms (nr-director or log) for the alarms po Specify nr-director's PostOffice information (for sending events IPS to the nr-directorsIntrusion Detection signature Add a policy to a signature System smtp Specify SMTP Mail spam threshold Syslog (config)# ip audit info ? action Specify the actions Server (config)# ip audit info action ? (stores alarm Generate events for matching signatures alerts/logs/ drop Drop packets matching signatures etc) reset Reset the connection (if applicable) (config)# ip audit info action drop (config)# ip audit attack action reset Author: Bill Buchanan (config)# ip audit signature ? IDS <1-65535> Signature to be configured (config)# ip audit signature 1005 disable (config)# ip audit smtp ? spam Specify the threshold for spam signature <cr> (config)# ip audit smtp spam ? Author: Prof Bill Buchanan <1-65535> Threshold of correspondents to trigger alarm Intrusion Prevention Systems (IPS) (config)# ip audit smtp spam 4
  • 72. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Anomaly Detection Author: Bill Buchanan Author: Prof Bill Buchanan
  • 73. Bob Anomaly detection: Learn normal activity, such as: User activity. System activity Server activity Network activity Application activity And so on Author: Bill Buchanan Author: Prof Bill Buchanan Author: Prof Bill Buchanan User, system and network anomaly
  • 74. Bob User anomaly: Typing speed Packages used Working hours Emails sent/hr Web sites visited System anomaly: CPU Usage/min Threads/min Disk writes/min Author: Bill Buchanan Author: Prof Bill Buchanan User, system and network anomaly
  • 75. Bob Network anomaly IP packets (%) TCP packets (%) HTTP (%) FTP (%) FTP threshold (2%) Author: Bill Buchanan Author: Prof Bill Buchanan Author: Prof Bill Buchanan User, system and network anomaly
  • 76. Intrusion Detection Systems Eve (Intruder) Introduction Threats Intrusion Detection Types Host or Network? Agent-based Defence Snort A simple rule Defence A few intrusions User profiling Honeypots IPS Conclusions Conclusions Author: Bill Buchanan Author: Prof Bill Buchanan