suricata.yaml (71.6 KB)
test.rules (400 Bytes)
The suricata.yaml and test.rules files are attached.
❯ sudo tcpdump -i eno2 host 10.0.15.51 and port 80 and 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eno2, link-type EN10MB (Ethernet), capture size 262144 bytes
10:16:39.149535 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 645165058:645165730, ack 1686701862, win 2058, options [nop,nop,TS val 1418648088 ecr 3808956564], length 672: HTTP: GET /vulnerabilities/sqli/?id=1%27+union+select+user_id%2C+password%2C+avatar+from+users%3B+--&Submit=Submit HTTP/1.1
10:16:39.149535 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 0:672, ack 1, win 2058, options [nop,nop,TS val 1418648088 ecr 3808956564], length 672: HTTP: GET /vulnerabilities/sqli/?id=1%27+union+select+user_id%2C+password%2C+avatar+from+users%3B+--&Submit=Submit HTTP/1.1
10:16:39.232126 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 672:1300, ack 530, win 2050, options [nop,nop,TS val 1418648169 ecr 3808985759], length 628: HTTP: GET /favicon.ico HTTP/1.1
10:16:39.232162 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 672:1300, ack 530, win 2050, options [nop,nop,TS val 1418648169 ecr 3808985759], length 628: HTTP: GET /favicon.ico HTTP/1.1
10:16:44.235074 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 1300:1972, ack 2236, win 2048, options [nop,nop,TS val 1418653134 ecr 3808985836], length 672: HTTP: GET /vulnerabilities/sqli/?id=1%27+union+select+user_id%2C+password%2C+avatar+from+users%3B+--&Submit=Submit HTTP/1.1
10:16:44.235111 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 1300:1972, ack 2236, win *2048, options [nop,nop,TS val 1418653134 ecr 3808985836], length 672: HTTP: GET /vulnerabilities/sqli/?id=1%27+union+select+user_id%2C+password%2C+avatar+from+users%3B+--&Submit=Submit HTTP/1.1
10:16:44.363964 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 1972:2600, ack 2764, win 2048, options [nop,nop,TS val 1418653285 ecr 3808990825], length 628: HTTP: GET /favicon.ico HTTP/1.1
10:16:44.363964 IP 10.0.100.47.52267 > 10.0.15.51.http: Flags [P.], seq 1972:2600, ack 2764, win 2048, options [nop,nop,TS val 1418653285 ecr 3808990825], length 628: HTTP: GET /favicon.ico HTTP/1.1
[ tcpdump ]
❯ tail -f /log/suricata/fast.log | grep "10.0.15.51"
[fast.log]
HTTP requests including union+select string were sent to 10.0.15.51.
Although I can see 4 GET Requests in tcpdump.
Not detected in fast.log.
It is detected once or twice when checking the log, but it is not detected even if you send a request after that.
I use disable.conf, not enable.conf. The sid of the rule defined in test.rules is not included in disable.conf.
I guessed that it was not detected because of the fragment, I checked it with wireshark, and there was no fragment.
I tested the rule by directly designating the ip.
In this case, it showed normal detection.
alert http any any -> 10.0.15.51 any (msg:"SQL Injection TEST"; flow:to_server; content:"union+select"; nocase; fast_pattern; classtype:attempted-recon; sid:0009833; rev:1;)
alert http 10.0.15.51 any -> any any (msg:"SQL Error Response TEST"; flow:to_client; http.response_body; content:"You have an error in your SQL syntax"; nocase; fast_pattern; classtype:successful-recon-limited; sid:0009834; rev:1;)
❯ sudo tail -f /log/suricata/fast.log
08/06/2021-10:37:36.860938 [**] [1:2027865:4] ET INFO Observed DNS Query to .cloud TLD [**] [Classification: Potentially Bad Traffic] [Priority: 2] {UDP} 10.0.14.61:52916 -> 10.0.0.10:53
08/06/2021-10:37:36.861077 [**] [1:2027865:4] ET INFO Observed DNS Query to .cloud TLD [**] [Classification: Potentially Bad Traffic] [Priority: 2] {UDP} 10.0.14.61:61609 -> 10.0.0.10:53
08/06/2021-10:37:36.861078 [**] [1:2027865:4] ET INFO Observed DNS Query to .cloud TLD [**] [Classification: Potentially Bad Traffic] [Priority: 2] {UDP} 10.0.14.61:61609 -> 10.0.0.10:53
08/06/2021-10:37:36.861078 [**] [1:2027865:4] ET INFO Observed DNS Query to .cloud TLD [**] [Classification: Potentially Bad Traffic] [Priority: 2] {UDP} 10.0.14.61:61609 -> 10.0.0.10:53
08/06/2021-10:37:36.861078 [**] [1:2027865:4] ET INFO Observed DNS Query to .cloud TLD [**] [Classification: Potentially Bad Traffic] [Priority: 2] {UDP} 10.0.14.61:61609 -> 10.0.0.10:53
08/06/2021-10:37:57.828797 [**] [1:2018959:4] ET POLICY PE EXE or DLL Windows file download HTTP [**] [Classification: Potential Corporate Privacy Violation] [Priority: 1] {TCP} 23.203.135.145:80 -> 10.0.100.208:64696
08/06/2021-10:37:57.828797 [**] [1:2014819:3] ET INFO Packed Executable Download [**] [Classification: Misc activity] [Priority: 3] {TCP} 23.203.135.145:80 -> 10.0.100.208:64696
08/06/2021-10:37:58.659415 [**] [1:2001581:15] ET SCAN Behavioral Unusual Port 135 traffic Potential Scan or Infection [**] [Classification: Misc activity] [Priority: 3] {TCP} 10.0.15.49:56091 -> 10.0.100.162:135
08/06/2021-10:37:59.162146 [**] [1:2001569:15] ET SCAN Behavioral Unusual Port 445 traffic Potential Scan or Infection [**] [Classification: Misc activity] [Priority: 3] {TCP} 10.0.15.49:56091 -> 10.0.100.162:445
08/06/2021-10:37:59.410010 [**] [1:2001579:15] ET SCAN Behavioral Unusual Port 139 traffic Potential Scan or Infection [**] [Classification: Misc activity] [Priority: 3] {TCP} 10.0.15.49:56092 -> 10.0.100.56:139
08/06/2021-10:38:05.282031 [**] [1:9833:1] DHK SQL Injection TEST [**] [Classification: Attempted Information Leak] [Priority: 2] {TCP} 10.0.100.47:52440 -> 10.0.15.51:80
08/06/2021-10:38:05.282031 [**] [1:9833:1] DHK SQL Injection TEST [**] [Classification: Attempted Information Leak] [Priority: 2] {TCP} 10.0.100.47:52440 -> 10.0.15.51:80
08/06/2021-10:38:05.353676 [**] [1:9834:1] DHK SQL Error Response TEST [**] [Classification: Information Leak] [Priority: 2] {TCP} 10.0.15.51:80 -> 10.0.100.47:52440
08/06/2021-10:38:05.353676 [**] [1:9834:1] DHK SQL Error Response TEST [**] [Classification: Information Leak] [Priority: 2] {TCP} 10.0.15.51:80 -> 10.0.100.47:52440
08/06/2021-10:38:05.359875 [**] [1:9833:1] DHK SQL Injection TEST [**] [Classification: Attempted Information Leak] [Priority: 2] {TCP} 10.0.100.47:52440 -> 10.0.15.51:80
08/06/2021-10:38:05.359875 [**] [1:9833:1] DHK SQL Injection TEST [**] [Classification: Attempted Information Leak] [Priority: 2] {TCP} 10.0.100.47:52440 -> 10.0.15.51:80
It seems to be a problem with the suricata rule, is there a problematic part in my rule??