You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
I just ran into a weird behaviour of the odlaw.pl tool from barnyard2/tools.
Since this morning (at least), all our servers that report snort/barnyard2 status based on a shell script which uses odlaw.pl started complaining that b2 was following a non-existant file. After checking the reason, on all servers, when running odlaw.pl -r <b2_waldo_file>, Perl would complain like this:
# ./odlaw.pl -r /var/log/snort/barnyard2.waldo
waldo: /var/log/snort/barnyard2.waldo
{
directory = /var/log/snort
filebase = snort.log
Use of uninitialized value in concatenation (.) or string at ./odlaw.pl line 101.
timestamp =
Use of uninitialized value in concatenation (.) or string at ./odlaw.pl line 102.
record =
}
[!] Read waldo data is incomplete or corrupted.
After some digging, i found out the reason was the fact that the timestamp logged in the waldo file (1326104643) in hex contains 0x0A, which perl when reading the waldo file with treated as newline and did not feed all the file data in the unpack function. As such, the unpack function got less then expected and returned bad data (undef) for timestamp and record fields.
Hello.
I just ran into a weird behaviour of the odlaw.pl tool from barnyard2/tools.
Since this morning (at least), all our servers that report snort/barnyard2 status based on a shell script which uses odlaw.pl started complaining that b2 was following a non-existant file. After checking the reason, on all servers, when running odlaw.pl -r <b2_waldo_file>, Perl would complain like this:
After some digging, i found out the reason was the fact that the timestamp logged in the waldo file (1326104643) in hex contains 0x0A, which perl when reading the waldo file with treated as newline and did not feed all the file data in the unpack function. As such, the unpack function got less then expected and returned bad data (undef) for timestamp and record fields.
Hexdump on the waldo file showed the following:
The quick and dirty solution was to unset the native system's line terminator by inserting this line at line 70:
local $/ = undef;
This way without any line terminator character defined, Perl "slurped" all the file and fed it into the unpack function and odlaw.pl worked again.
Since this condition only rarely happens (but it's not impossible), i just wanted to let you guys know about it in case you might want to patch it.
The patch would be the following:
Thank you for your time.
The text was updated successfully, but these errors were encountered: