]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Fri, 31 Oct 2014 13:56:14 +0000 (14:56 +0100)]
Fix Coverity issue in SMTP output
** CID
1250327 : Uninitialized pointer read (UNINIT)
/src/output-json-email-common.c: 117 in JsonEmailLogJson()
/src/output-json-email-common.c: 139 in JsonEmailLogJson()
Victor Julien [Fri, 31 Oct 2014 13:53:38 +0000 (14:53 +0100)]
smtp: don't create a new tx for rset/quit
A tx is considered complete after the data command completed. However,
this would lead to RSET and QUIT commands setting up a new tx.
This patch simply adds a check that refuses to setup a new tx when these
commands are encountered after the data portion is complete.
Victor Julien [Fri, 31 Oct 2014 12:41:39 +0000 (13:41 +0100)]
filestore: fix crash if keyword setup fails
SigMatch would be added to list, then the alproto check failed, leading
to freeing of sm. But as it was still in the list, the list now contained
a dangling pointer.
Victor Julien [Thu, 30 Oct 2014 17:23:15 +0000 (18:23 +0100)]
mime: fix output issues
When multiple email addresses were in the 'to' field, sometimes
they would be logged as "\r\n \"Name\" <email>".
The \r\n was added by GetFullValue in the mime decoder, for unknown
reasons. Disabling this seems to have no drawbacks.
Victor Julien [Tue, 28 Oct 2014 19:03:32 +0000 (20:03 +0100)]
mime: fix compiler warning
Victor Julien [Tue, 28 Oct 2014 17:56:28 +0000 (18:56 +0100)]
mime: improve error checking
Victor Julien [Tue, 28 Oct 2014 17:26:38 +0000 (18:26 +0100)]
smtp: fix SMTPParserTest14 on 32bit
Victor Julien [Tue, 28 Oct 2014 17:25:33 +0000 (18:25 +0100)]
smtp: improve ProcessDataChunk error checking
Victor Julien [Tue, 28 Oct 2014 16:45:52 +0000 (17:45 +0100)]
smtp: expand tx use
Instead of just using TX for mime decoding, it is now also used for
tracking decoder events.
Victor Julien [Tue, 28 Oct 2014 09:45:21 +0000 (10:45 +0100)]
output-filedata: close files even w/o data
If there is no data chunk but the file is closed/truncated anyway,
logging is still required.
Victor Julien [Tue, 28 Oct 2014 09:41:32 +0000 (10:41 +0100)]
smtp: register file truncate callback
Tag files as truncated from this callback so storing/logging displays
the correct info.
Victor Julien [Mon, 27 Oct 2014 22:59:49 +0000 (23:59 +0100)]
smtp: convert logger to tx logger
Move from packet logger to tx logger.
Victor Julien [Mon, 27 Oct 2014 22:59:11 +0000 (23:59 +0100)]
smtp: add file inspection engine
Fix file inspection engine.
TODO: test
Victor Julien [Mon, 27 Oct 2014 22:57:56 +0000 (23:57 +0100)]
smtp: make TX aware
Store mime decoding context per transaction. For this the parser
creates a TX when the mime body decoding starts.
Victor Julien [Mon, 27 Oct 2014 15:14:09 +0000 (16:14 +0100)]
mime: redo PrintChars using PrintRawDataFp
Victor Julien [Mon, 27 Oct 2014 08:18:31 +0000 (09:18 +0100)]
decode mime: refactor & cleanup
Partly to work around cppchecks:
[src/util-decode-mime.c:1085]: (error) Memory leak: url
Victor Julien [Sat, 25 Oct 2014 15:44:57 +0000 (17:44 +0200)]
mime: rename mime-decode.[ch] to util-decode-mime.[ch]
Victor Julien [Sat, 25 Oct 2014 15:36:56 +0000 (17:36 +0200)]
mime: style updates
Victor Julien [Sat, 25 Oct 2014 15:30:09 +0000 (17:30 +0200)]
mime decode: reshuffle data structures to reduce structure sizes
Victor Julien [Sat, 25 Oct 2014 14:59:15 +0000 (16:59 +0200)]
output smtp: fix call
Victor Julien [Sat, 25 Oct 2014 14:46:01 +0000 (16:46 +0200)]
decode mime: clean up includes
Victor Julien [Sat, 25 Oct 2014 14:22:40 +0000 (16:22 +0200)]
mime decode: improve MimeDecParseLineTest01 and MimeDecParseLineTest02 tests
Victor Julien [Sat, 25 Oct 2014 14:16:54 +0000 (16:16 +0200)]
decode mime: fix scan-build issues
Victor Julien [Sat, 25 Oct 2014 13:25:46 +0000 (15:25 +0200)]
mime decode: fix memory leak
Victor Julien [Sat, 25 Oct 2014 13:22:30 +0000 (15:22 +0200)]
mime decode: remove unused url counter
Victor Julien [Sat, 25 Oct 2014 12:11:03 +0000 (14:11 +0200)]
output smtp: clean up memory at shutdown
Victor Julien [Sat, 25 Oct 2014 11:54:42 +0000 (13:54 +0200)]
Fix compiler warning
Victor Julien [Sat, 25 Oct 2014 07:40:35 +0000 (09:40 +0200)]
mime: refactor buffer use
Turn all buffers into uint8_t (from char) and no longer use the
string functions like strncpy/strncasecmp on them.
Store url and field names as lowercase, and also search/compare
them as lowercase. This allows us to use SCMemcmp.
Tom DeCanio [Thu, 9 Oct 2014 22:16:50 +0000 (15:16 -0700)]
smtp-mime: preinitialize base64 decoder space
Preinit with zeros.
Tom DeCanio [Thu, 9 Oct 2014 21:13:03 +0000 (14:13 -0700)]
mime-decode: clean up after MimeDecParseFullMsgTest01.
Tom DeCanio [Thu, 9 Oct 2014 19:52:30 +0000 (12:52 -0700)]
mime-decode: fix minor memory leak if Mime parser initialization were to fail.
Tom DeCanio [Thu, 9 Oct 2014 19:23:09 +0000 (12:23 -0700)]
mime-decode: remove "comparison between signed and unsigned integer expressions"
warnings
Tom DeCanio [Tue, 7 Oct 2014 22:44:06 +0000 (15:44 -0700)]
app-layer-smtp: move old smtp-mime section in suricata.yaml into
app-layer-protocols.smtp.mine section and update code to accomodate.
Tom DeCanio [Tue, 7 Oct 2014 22:23:15 +0000 (15:23 -0700)]
PR review comment. Use protocol to discern log type.
Tom DeCanio [Thu, 21 Aug 2014 19:34:06 +0000 (12:34 -0700)]
smtp: turn on smtp mime decoding and enable smtp eve logging.
Tom DeCanio [Thu, 14 Aug 2014 19:07:53 +0000 (12:07 -0700)]
eve-log: catch and log URLs in basic text emails without mime encapsulation.
expand pointer walk protection.
Tom DeCanio [Fri, 1 Aug 2014 20:27:33 +0000 (13:27 -0700)]
mime-decode: don't scan attachment's data for URLs.
move event pointer lookup inside extract_urls and protect pointer walk.
Tom DeCanio [Tue, 29 Jul 2014 01:25:13 +0000 (18:25 -0700)]
app-layer-smtp: fix Test14.
Was running one byte past end of buffer.
Declare Unit Test 14's data as static.
Eric Leblond [Mon, 28 Jul 2014 14:36:15 +0000 (16:36 +0200)]
smtp layer: fix unittests
Synchronize test 14 with the new application layer API and improve
debug messages.
Tom DeCanio [Wed, 2 Apr 2014 19:48:01 +0000 (12:48 -0700)]
eve-log: SMTP JSON logger
Tom DeCanio [Tue, 28 Jan 2014 23:33:26 +0000 (15:33 -0800)]
smtp-mime: add server reply codes returned from outlook server
David Abarbanel [Tue, 6 Nov 2012 14:45:36 +0000 (09:45 -0500)]
SMTP MIME Email Message decoder
Ken Steele [Wed, 29 Oct 2014 19:43:42 +0000 (15:43 -0400)]
Make suricata_ctl_flags be volatile
The global variable suricata_ctl_flags needs to volatile, otherwise the
compiler might not cause the variable to be read every time because it
doesn't know other threads might write the variable.
This was causing Suricata to not exit under some conditions.
Victor Julien [Thu, 30 Oct 2014 10:07:38 +0000 (11:07 +0100)]
stream/async: improve handling of syn/ack pickup
If we picked up the ssn with a syn/ack, we don't need to make more
assumptions about sack and wscale after that.
Victor Julien [Thu, 30 Oct 2014 09:16:40 +0000 (10:16 +0100)]
stream/async: fix session setup issues
For these 2 cases:
1. Missing SYN:
-> syn <= missing
<- syn/ack
-> ack
-> data
2. Missing SYN and 3whs ACK:
-> syn <= missing
<- syn/ack
-> ack <= missing
-> data
Fix session pickup. The next_win settings weren't correctly set, so that
packets were rejected.
Bug 1190.
Victor Julien [Sun, 26 Oct 2014 09:07:15 +0000 (10:07 +0100)]
stream: improve tracking with pkt loss in async
If 3whs SYN/ACK and ACK are missing we can still pick up the session if
in async-oneside mode.
-> syn
<- syn/ack <= missing
-> ack <= missing
-> data
Bug 1190.
Victor Julien [Sun, 26 Oct 2014 08:02:08 +0000 (09:02 +0100)]
iprep: cleanup ctx on shutdown
~~Dr.M~~ Error #1: LEAK 480 direct bytes 0x0aae7fc0-0x0aae81a0 + 0 indirect bytes
~~Dr.M~~ # 0 replace_malloc [/work/drmemory_package/common/alloc_replace.c:2373]
~~Dr.M~~ # 1 SRepInit [.../Suricata/src/reputation.c:594]
~~Dr.M~~ # 2 DetectEngineCtxInit [.../src/detect-engine.c:844]
~~Dr.M~~ # 3 main [.../Suricata/src/suricata.c:2230]
Ken Steele [Mon, 6 Oct 2014 15:40:58 +0000 (11:40 -0400)]
Make AppLayerProfiling functions inline
The entire body of these functions are protected by ifdef PROFILING.
If the functions are inlined, then this check removes the need for the
function entirely.
Previously, the empty function was still called, even when not built
for profiling. The functions showed as being 0.25% of total CPU time
without being built for profiling.
Giuseppe Longo [Thu, 23 Oct 2014 09:43:04 +0000 (11:43 +0200)]
Fixes comments for pfring section in suricata.yaml
Bug #1301
Giuseppe Longo [Thu, 23 Oct 2014 09:30:38 +0000 (11:30 +0200)]
PF_RING: force cluster type if vlan is disabled
If vlan is disabled the cluster_flow mode will still take VLAN tags
into account due to using pf_ring's 6-tuple mode.
So this forces to use pf_ring's 5-tuple mode.
Bug #1292
Giuseppe Longo [Fri, 5 Sep 2014 13:58:44 +0000 (15:58 +0200)]
iprep: add unit tests for cidr
Implements unit tests to test the new API
Giuseppe Longo [Wed, 3 Sep 2014 13:30:08 +0000 (15:30 +0200)]
detect-iprep: extends cidr
Adds new API to check if an IP address is belong
to a netblock and gets the value.
Giuseppe Longo [Fri, 29 Aug 2014 12:22:09 +0000 (14:22 +0200)]
iprep: extends cidr support
Implements new API to expand the IP reputation
to netblocks with CIDR notation
A new object 'srepCIDRTree' is kept in the DetectionEngineCtx,
which contains two tree (one for ipv4 and one for ipv6)
where the reputation values are stored.
Eric Leblond [Sat, 18 Oct 2014 17:38:12 +0000 (19:38 +0200)]
lua: add export of dns.rrname
Add the capability for a lua script to ask for rrname in DNS query.
Eric Leblond [Sat, 18 Oct 2014 11:20:52 +0000 (13:20 +0200)]
lua: move function to common utils
LuaStateNeedProto function can be used for any protocol so let's
move it out of the http file.
Victor Julien [Thu, 23 Oct 2014 10:54:13 +0000 (12:54 +0200)]
stream: improve bad window update detection
Ignore more valid ACKs in FIN shutdown phase.
Improve heuristic for window shrinking in case of packet loss.
Victor Julien [Thu, 16 Oct 2014 16:38:19 +0000 (18:38 +0200)]
stream: fix 'bad window update' false positive
ACK packets completing a valid FIN shutdown could be flagged as
'bad window update' if they would shrink the window.
This patch detects this case before doing the bad window update
check.
Tom DeCanio [Fri, 10 Oct 2014 16:40:37 +0000 (09:40 -0700)]
sanity check tcp SACK edges prior to recording. Attempt to avoid Cisco ASA
tcp randomization issue with it not properly writing sequence numbers in SACK.
Victor Julien [Thu, 16 Oct 2014 12:59:38 +0000 (14:59 +0200)]
stream: improve handling of 3whs packet loss
If the 3whs ACK and some data after this is lost, we would get stuck
in the 'SYN_RECV' state, where from there each packet might be
considered invalid.
This patch improves the handling of this case.
Victor Julien [Thu, 16 Oct 2014 12:54:22 +0000 (14:54 +0200)]
stream: fix ssh/ssl logging on tcp session reuse
TCP session reuse wouldn't unset FLOW_NO_APPLAYER_INSPECTION.
Victor Julien [Thu, 16 Oct 2014 12:41:59 +0000 (14:41 +0200)]
ssh.softwareversion: allow more characters
The keyword would not allow matching on "OpenSSH_5.5p1 Debian-6+squeeze5"
as the + and space characters were not allowed.
This patch adds support for them.
Victor Julien [Thu, 16 Oct 2014 09:17:06 +0000 (11:17 +0200)]
stream: add counter for failed pseudo setups
Stream pseudo packets are taken from the packet pool, which can be empty.
In this case a pseudo packet will not be created and processed.
This patch adds a counter "tcp.pseudo_failed" to track this.
Victor Julien [Thu, 16 Oct 2014 08:31:47 +0000 (10:31 +0200)]
stream: clean up pseudo packet counting
Increment the counter from StreamTcpPseudoPacketCreateStreamEndPacket.
Giuseppe Longo [Thu, 16 Oct 2014 08:23:19 +0000 (10:23 +0200)]
pfring: removes old API and #ifdef chunks
Giuseppe Longo [Thu, 16 Oct 2014 08:22:33 +0000 (10:22 +0200)]
pfring: checks if the lib version is >= 6
Checks if the PF_RING version installed on the system is 6,
so old version won't be supported.
Jason Ish [Mon, 20 Oct 2014 21:13:28 +0000 (15:13 -0600)]
Fix MPLS decoder rules.
Jason Ish [Fri, 17 Oct 2014 15:33:07 +0000 (09:33 -0600)]
Use ENGINE_SET_INVALID_EVENT when the packet is too small for an
MPLS header, and when the payload type can not be determined.
Jason Ish [Wed, 8 Oct 2014 16:17:12 +0000 (10:17 -0600)]
Don't default to ethernet, ethernet should be preceded by a pseudowire.
If the payload type can't be determined, raise an alert.
Jason Ish [Wed, 13 Aug 2014 22:53:19 +0000 (16:53 -0600)]
Set decoder events for labels that shouldn't be seen on the wire.
Add unit tests to test for mpls decoder events.
Jason Ish [Sat, 19 Jul 2014 02:23:28 +0000 (20:23 -0600)]
Handle encapsulated ethernet without a PW by defaulting to ethernet
if a fall back.
Jason Ish [Thu, 17 Jul 2014 17:28:56 +0000 (11:28 -0600)]
Handle explicitly IPv6 and IPv6 labels as well as encapsulated ethernet.
Jason Ish [Thu, 17 Jul 2014 16:21:32 +0000 (10:21 -0600)]
Add MPLS counter.
Check length before decoding each label.
Jason Ish [Tue, 15 Jul 2014 19:48:34 +0000 (13:48 -0600)]
Basic MPLS decoder.
Anoop Saldanha [Fri, 25 Jul 2014 07:50:28 +0000 (13:20 +0530)]
CUDA: Update the inspection engine to inform the cuda module that it
doesn't need the gpu results and to release the packet for the next run.
Previously the inspection engine wouldn't inform the cuda module, if it
didn't need the results. As a consequence, when the packet is next taken
for re-use, and if the packet is still being processed by the cuda module,
the engine would wait till the cuda module frees the packet.
This commits updates this functionality to inform the cuda module to
release the packet for the afore-mentioned case.
Ken Steele [Fri, 17 Oct 2014 15:42:48 +0000 (11:42 -0400)]
Check replist is not NULL inline before doing any processing.
The replist is often NULL, so it is worth checking that case before making
the function call do perform work on the list.
Eric Leblond [Wed, 15 Oct 2014 17:38:20 +0000 (19:38 +0200)]
detect-dce-opnum: add sanity check
Specifying the option dce_opnum without value was triggering a
segfault.
Ken Steele [Thu, 2 Oct 2014 21:17:02 +0000 (17:17 -0400)]
Fix typo in configure message about nfnetlink
Victor Julien [Mon, 4 Aug 2014 13:36:42 +0000 (15:36 +0200)]
pcap-log: add option to honor pass rules
Add option (disabled by default) to honor pass rules. This means that
when a pass rule matches in a flow, it's packets are no longer stored
by the pcap-log module.
Jason Ish [Mon, 29 Sep 2014 16:00:06 +0000 (10:00 -0600)]
Bug 1230: Check all SigMatch lists for a named byte_extract variable.
Jason Ish [Mon, 29 Sep 2014 15:37:03 +0000 (09:37 -0600)]
Bug 1230: Simple test case demonstrating failure.
Victor Julien [Sat, 18 Oct 2014 19:47:52 +0000 (21:47 +0200)]
Suppress ARM valgrind warning
Not Suricata related, so suppress.
Ken Steele [Tue, 7 Oct 2014 14:17:21 +0000 (10:17 -0400)]
Speed up SigMatchGetLastSMFromLists()
SigMatchGetLastSMFromLists() is finding the sm with the largest
index among all of the values returned from SigMatchGetLastSM() on
the set of (list and type) tuples passed as arguments.
The function was creating an array of the types, then creating an array
of the results of SigMatchGetLastSM(), sorting that list completely, then
only returning the first values from the list.
The new code, gets one set of arguments from the variable arguments, calls
SigMatchGetLastSM() and if the returned sm has a larger index, keeps that
as the last sm.
Victor Julien [Tue, 7 Oct 2014 09:27:54 +0000 (11:27 +0200)]
tcp session reuse: reset detect state
Reset the detect state on TCP session reuse. We reset the app layer,
so we need to reset the stateful detection as well.
Victor Julien [Tue, 7 Oct 2014 09:25:25 +0000 (11:25 +0200)]
detect state: always lock de_state_m
Always lock the de_state_m on access, also at flow recycle or
cleanup.
Mats Klepsland [Wed, 1 Oct 2014 15:33:58 +0000 (17:33 +0200)]
configure.ac: Moved libpcap before libpfring
Moved the libpcap section in configure.ac before libpfring to
enable libpfring to use the specified libpcap includes and
libraries when testing for libpfring support.
Bug #1294
Mats Klepsland [Wed, 1 Oct 2014 14:39:48 +0000 (16:39 +0200)]
runmode-pfring: Fixed typo s/fron/from/
Mats Klepsland [Wed, 1 Oct 2014 14:34:30 +0000 (16:34 +0200)]
runmode-pfring: Suppress errors when using DNA/ZC
PF_RING DNA/ZC don't use cluster-id and cluster-type. Therefore,
skip setting these values if DNA/ZC is being used.
Bug #1048
Victor Julien [Wed, 24 Sep 2014 14:05:27 +0000 (16:05 +0200)]
lua detect: expose stream payload
Allow a script to set the 'stream' buffer type. This will add the
script to the PMATCH list.
Example script:
alert tcp any any -> any any (content:"html"; lua:stream.lua; sid:1;)
function init (args)
local needs = {}
needs["stream"] = tostring(true)
return needs
end
-- return match via table
function match(args)
local result = {}
b = tostring(args["stream"])
o = tostring(args["offset"])
bo = string.sub(b, o);
print (bo)
return result
end
return 0
Jason Ish [Wed, 17 Sep 2014 17:55:29 +0000 (11:55 -0600)]
Comment out in the action-order section, as its not needed if
the default configuration is used.
Jason Ish [Wed, 17 Sep 2014 17:52:12 +0000 (11:52 -0600)]
Don't require an action-order configuration section. If not present,
use the defaults.
Victor Julien [Tue, 30 Sep 2014 07:56:41 +0000 (09:56 +0200)]
filestore: fix parsing bug
Filestore keyword can have options or no options, and the parser
was enforcing the NOOPT flag too strictly.
Bug #1288
Victor Julien [Wed, 1 Oct 2014 07:09:15 +0000 (09:09 +0200)]
flow json log: add 'shutdown' as flow end reason
When engine shuts down all flows in the hash are logged out. They
may not have timed out yet. So they are forced. Log the reason to
be 'shutdown'.
Victor Julien [Tue, 30 Sep 2014 13:24:24 +0000 (15:24 +0200)]
flow: fix flow logging at shutdown
Move all flows from the hash to the recycler at shutdown.
Bug #1260
Victor Julien [Tue, 30 Sep 2014 11:37:30 +0000 (13:37 +0200)]
output-lua: set proper callbacks for HTTP
Enable the relevant HTTP callbacks.
Bug #1287
Victor Julien [Tue, 30 Sep 2014 11:27:52 +0000 (13:27 +0200)]
output-lua: add config to yaml
Disabled by default.
Victor Julien [Tue, 30 Sep 2014 11:19:09 +0000 (13:19 +0200)]
output-lua: add script-dir config param
Add 'scripts-dir' config directive that is prepended to the script
names to form a path. If ommited or empty, script are opened from
the CWD.
Victor Julien [Tue, 30 Sep 2014 09:12:47 +0000 (11:12 +0200)]
yaml: add eve flow and netflow entries
Added, commented out by default.
Bug #1257.
Victor Julien [Thu, 18 Sep 2014 08:13:18 +0000 (10:13 +0200)]
ssh: convert error message to debug statement
Don't print errors based on traffic issues.
Eric Leblond [Fri, 12 Sep 2014 08:02:12 +0000 (10:02 +0200)]
app-layer-ssh: fix banner parser
Carefully crafted SSH banner could result in parser error.
Signed-off-by: Eric Leblond <eric@regit.org>
Victor Julien [Wed, 17 Sep 2014 12:57:15 +0000 (14:57 +0200)]
ipv6: convert ext header pointers to const
To prevent accidental writes into the orignal packet buffer, use
const pointers for the extension header pointers used by IPv6. This
will cause compiler warnings in case of writes.