Project

General

Profile

Actions

Support #3064

closed

No alert when try to do pentest on my network using DOS

Added by Hanif Prasetiyo almost 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Affected Versions:
Label:
Beginner

Description

Hello guys. Can someone give me an explanation?. I try to do some pentest using DOS SYN flood in Kali Linux.

I use this command to attack

hping3 -V -c 1000 -d 100 -S -p 80 --flood 192.168.10.1

when I tried to see fast.log, none of the warnings were stored.
I'm using emerging-dos.rules from

https://rules.emergingthreats.net/open/suricata/rules/


Files

Screenshot_7.png (33.2 KB) Screenshot_7.png Hanif Prasetiyo, 06/28/2019 04:29 AM
Topology Suricata.png (33 KB) Topology Suricata.png This is the topology i use on pentest Hanif Prasetiyo, 06/28/2019 05:43 PM
Actions #1

Updated by Hanif Prasetiyo almost 5 years ago

Hanif Prasetiyo wrote:

Hello guys. Can someone give me an explanation?. I try to do some pentest using DOS SYN flood in Kali Linux.

I use this command to attack
[...]

when I tried to see fast.log, none of the warnings were stored.
I'm using emerging-dos.rules from
[...]

I try to activate all the rules on emerging-dos.rules but still no luck on alert.

Actions #2

Updated by Peter Manev almost 5 years ago

You should use eve.json for completeness.
Where is Suricata positioned in this set up - did you adjust the home and ext net variables as well?
Most of these rules can use - "alert tcp $EXTERNAL_NET any -> $HOME_NET" so defining the networks in the yaml config is important.
Can you confirm you see the traffic on the mirror interface ?

Actions #3

Updated by Hanif Prasetiyo almost 5 years ago

Peter Manev wrote:

You should use eve.json for completeness.
Where is Suricata positioned in this set up - did you adjust the home and ext net variables as well?
Most of these rules can use - "alert tcp $EXTERNAL_NET any -> $HOME_NET" so defining the networks in the yaml config is important.
Can you confirm you see the traffic on the mirror interface ?

Oh hello again sir, thanks for your replies.
I tried to see a log in eve.json and I see this sir

{"timestamp":"2019-06-27T21:27:08.118724-0700","flow_id":1774451089623984,"event_type":"flow","src_ip":"192.168.10.3","src_port":15978,"dest_ip":"192.168.10.1","dest_port":80,"proto":"TCP","flow":{"pkts_toserver":2,"pkts_toclient":2,"bytes_toserver":128,"bytes_toclient":120,"start":"2019-06-27T21:26:06.871344-0700","end":"2019-06-27T21:26:07.027963-0700","age":1,"state":"closed","reason":"timeout","alerted":false},"tcp":{"tcp_flags":"16","tcp_flags_ts":"02","tcp_flags_tc":"14","syn":true,"rst":true,"ack":true,"state":"closed"}}

it means that suricata record the traffic from DDOS Syn Attack right? but why there is no record alert/warn in fast.log? did i miss something in suricata.yaml especially in parts eve.json?
- eve-log:
      enabled: yes
      filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
      filename: eve.json
      #prefix: "@cee: " # prefix to prepend to each log entry
      # the following are valid when type: syslog above
      #identity: "suricata" 
      #facility: local5
      #level: Info ## possible levels: Emergency, Alert, Critical,
                   ## Error, Warning, Notice, Info, Debug
      #redis:
      #  server: 127.0.0.1
      #  port: 6379
      #  async: true ## if redis replies are read asynchronously
      #  mode: list ## possible values: list|lpush (default), rpush, channel|publish
      #             ## lpush and rpush are using a Redis list. "list" is an alias for lpush
      #             ## publish is using a Redis channel. "channel" is an alias for publish
      #  key: suricata ## key or channel to use (default to suricata)
      # Redis pipelining set up. This will enable to only do a query every
      # 'batch-size' events. This should lower the latency induced by network
      # connection at the cost of some memory. There is no flushing implemented
      # so this setting as to be reserved to high traffic suricata.
      #  pipelining:
      #    enabled: yes ## set enable to yes to enable query pipelining
      #    batch-size: 10 ## number of entry to keep in buffer

      # Include top level metadata. Default yes.
      #metadata: no

      # include the name of the input pcap file in pcap file processing mode
      pcap-file: false

      # Community Flow ID
      # Adds a 'community_id' field to EVE records. These are meant to give
      # a records a predictable flow id that can be used to match records to
      # output of other tools such as Bro.
      #
      # Takes a 'seed' that needs to be same across sensors and tools
      # to make the id less predictable.

      # enable/disable the community id feature.
      community-id: false
      # Seed value for the ID output. Valid values are 0-65535.
      community-id-seed: 0

      # HTTP X-Forwarded-For support by adding an extra field or overwriting
      # the source or destination IP address (depending on flow direction)
      # with the one reported in the X-Forwarded-For HTTP header. This is
      # helpful when reviewing alerts for traffic that is being reverse
      # or forward proxied.
      xff:
        enabled: no
        # Two operation modes are available, "extra-data" and "overwrite".
        mode: extra-data
        # Two proxy deployments are supported, "reverse" and "forward". In
        # a "reverse" deployment the IP address used is the last one, in a
        # "forward" deployment the first IP address is used.
        deployment: reverse
        # Header name where the actual IP address will be reported, if more
        # than one IP address is present, the last IP address will be the
        # one taken into consideration.
        header: X-Forwarded-For

      types:
        - alert:
            # payload: yes             # enable dumping payload in Base64
            # payload-buffer-size: 4kb # max size of payload buffer to output in eve-log
            # payload-printable: yes   # enable dumping payload in printable (lossy) format
            # packet: yes              # enable dumping of packet (without stream segments)
            # http-body: yes           # enable dumping of http body in Base64
            # http-body-printable: yes # enable dumping of http body in printable format
            # metadata: no             # enable inclusion of app layer metadata with alert. Default yes

            # Enable the logging of tagged packets for rules using the
            # "tag" keyword.
            tagged-packets: yes
        - http:
            extended: yes     # enable this for extended logging information
            # custom allows additional http fields to be included in eve-log
            # the example below adds three additional fields when uncommented
            #custom: [Accept-Encoding, Accept-Language, Authorization]
        - dns:
            # This configuration uses the new DNS logging format,
            # the old configuration is still available:
            # http://suricata.readthedocs.io/en/latest/configuration/suricata-yaml.html#eve-extensible-event-format
            # Use version 2 logging with the new format:
            # DNS answers will be logged in one single event
            # rather than an event for each of it.
            # Without setting a version the version
            # will fallback to 1 for backwards compatibility.
            version: 2

            # Enable/disable this logger. Default: enabled.
            #enabled: no

            # Control logging of requests and responses:
            # - requests: enable logging of DNS queries
            # - responses: enable logging of DNS answers
            # By default both requests and responses are logged.
            #requests: no
            #responses: no

            # Format of answer logging:
            # - detailed: array item per answer
            # - grouped: answers aggregated by type
            # Default: all
            #formats: [detailed, grouped]

            # Answer types to log.
            # Default: all
            #types: [a, aaaa, cname, mx, ns, ptr, txt]
        - tls:
            extended: yes     # enable this for extended logging information
            # output TLS transaction where the session is resumed using a
            # session id
            #session-resumption: no
            # custom allows to control which tls fields that are included
            # in eve-log
            #custom: [subject, issuer, session_resumed, serial, fingerprint, sni, version, not_before, not_after, certificate, chain, ja3]
        - files:
            force-magic: no   # force logging magic on all logged files
            # force logging of checksums, available hash functions are md5,
            # sha1 and sha256
            #force-hash: [md5]
        #- drop:
        #    alerts: yes      # log alerts that caused drops
        #    flows: all       # start or all: 'start' logs only a single drop
        #                     # per flow direction. All logs each dropped pkt.
        - smtp:
            #extended: yes # enable this for extended logging information
            # this includes: bcc, message-id, subject, x_mailer, user-agent
            # custom fields logging from the list:
            #  reply-to, bcc, message-id, subject, x-mailer, user-agent, received,
            #  x-originating-ip, in-reply-to, references, importance, priority,
            #  sensitivity, organization, content-md5, date
            #custom: [received, x-mailer, x-originating-ip, relays, reply-to, bcc]
            # output md5 of fields: body, subject
            # for the body you need to set app-layer.protocols.smtp.mime.body-md5
            # to yes
            #md5: [body, subject]

        #- dnp3
        #- nfs
        #- smb
        #- tftp
        #- ikev2
        #- krb5
        - dhcp:
            # DHCP logging requires Rust.
            enabled: no
            # When extended mode is on, all DHCP messages are logged
            # with full detail. When extended mode is off (the
            # default), just enough information to map a MAC address
            # to an IP address is logged.
            extended: no
        - ssh
        - stats:
            totals: yes       # stats for all threads merged together
            threads: no       # per thread stats
            deltas: no        # include delta values
        # bi-directional flows
        - flow
        # uni-directional flows
        #- netflow

        # Metadata event type. Triggered whenever a pktvar is saved
        # and will include the pktvars, flowvars, flowbits and
        # flowints.
        #- metadata

for sure, I already have a setup like this. Is there anything wrong?

HOME_NET: "[192.168.10.0/24,192.168.10.1/24,192.168.10.2/24,192.168.10.3/24]" 
EXTERNAL_NET: "!$HOME_NET" 

and the next, about mirroring interface I've already do that on my switch


ESW1#sh monitor session 1
Session 1
---------
Source Ports:
    RX Only:       None
    TX Only:       None
    Both:          Fa1/0-1,Fa1/3
Source VLANs:
    RX Only:       None
    TX Only:       None
    Both:          None
Destination Ports: Fa1/2
Filter VLANs:      None

Actions #4

Updated by Peter Manev almost 5 years ago

Thank you for the follow up.
I am still missing (from the topology -pardon me if i have missed it) - where is Suricata deployed (is it the 10.3)?

Actions #5

Updated by Hanif Prasetiyo almost 5 years ago

suricata deployed in 10.4 sir

Actions #6

Updated by Andreas Herz almost 5 years ago

  • Assignee set to Community Ticket
  • Target version set to Support
Actions #7

Updated by Hanif Prasetiyo almost 5 years ago

Hanif Prasetiyo wrote:

suricata deployed in 10.4 sir

so is there any way to solve this problem, sir?

Actions #8

Updated by Hanif Prasetiyo almost 5 years ago

Hanif Prasetiyo wrote:

Hanif Prasetiyo wrote:

suricata deployed in 10.4 sir

so is there any way to solve this problem, sir?

I'm still figuring out how to detect TCP SYN flood and try to activate these rules and still no luck to detect

#alert tcp $EXTERNAL_NET 10000: -> $HOME_NET 0:1023 (msg:"ET DOS Potential Tsunami SYN Flood Denial Of Service Attempt"; flags:S; flow:to_server; dsize:>900; threshold: type both, count 20, seconds 120, track by_src; reference:url,security.radware.com/uploadedFiles/Resources_and_Content/Threat/TsunamiSYNFloodAttack.pdf; classtype:attempted-dos; sid:2019404; rev:3;)

Actions #9

Updated by Andreas Herz almost 5 years ago

You could try to narrow it down by reducing the threshold or even reducing some parts of the rule.
Also try to record a pcap (with tcpdump for example) on the same port suricata is listening and look if you see any issues there.

Actions #10

Updated by Hanif Prasetiyo almost 5 years ago

Andreas Herz wrote:

You could try to narrow it down by reducing the threshold or even reducing some parts of the rule.
Also try to record a pcap (with tcpdump for example) on the same port suricata is listening and look if you see any issues there.

Andreas Herz wrote:

You could try to narrow it down by reducing the threshold or even reducing some parts of the rule.
Also try to record a pcap (with tcpdump for example) on the same port suricata is listening and look if you see any issues there.

thx for your replies sir, can you give me some simple example how to reducing the threshold? I'm kinda new about setting threshold rules...

Actions #12

Updated by Peter Manev over 4 years ago

this specific rule

alert tcp $EXTERNAL_NET 10000: -> $HOME_NET 0:1023 (msg:"ET DOS Potential Tsunami SYN Flood Denial Of Service Attempt"; flags:S; flow:to_server; dsize:>900; threshold: type both, count 20, seconds 120, track by_src; reference:url,security.radware.com/uploadedFiles/Resources_and_Content/Threat/TsunamiSYNFloodAttack.pdf; classtype:attempted-dos; sid:2019404; rev:3;)

is looking at home/ext nets(port ranges too) and they should be configured as expected in suricata.yaml (also needs 900 bytes of pyload). For the purpose of testing you could just try -
alert tcp any any -> any any (msg:"ET DOS Potential Tsunami SYN Flood Denial Of Service Attempt"; flags:S; flow:to_server; threshold: type both, count 20, seconds 120, track by_src; reference:url,security.radware.com/uploadedFiles/Resources_and_Content/Threat/TsunamiSYNFloodAttack.pdf; classtype:attempted-dos; sid:12345; rev:3;)

Actions #13

Updated by Andreas Herz over 3 years ago

  • Status changed from New to Closed

Hi, we're closing this issue since there have been no further responses.
If you think this bug is still relevant, try to test it again with the
most recent version of suricata and reopen the issue. If you want to
improve the bug report please take a look at
https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Reporting_Bugs

Actions

Also available in: Atom PDF