Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
handle failed pcap_agent more gracefully in second request
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed May 31, 2016
1 parent 271aa55 commit c8090d4
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions capme/.inc/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ function cliscript($cmd, $pwd) {
if (preg_match("/^ERROR: Connection failed$/", $line)) {
invalidCallback("ERROR: Connection to sguild failed!");
}
if (preg_match("/^DEBUG: $/", $line)) {
invalidCallback("ERROR: No data was returned. Check pcap_agent service.");
}
// To handle large pcaps more gracefully, we only render the first $maxtranscriptbytes.
$transcriptbytes += strlen($line);
if ($transcriptbytes <= $maxtranscriptbytes) {
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
securityonion-capme (20121213-0ubuntu0securityonion55) trusty; urgency=medium

* handle failed pcap_agent more gracefully in second request

-- Doug Burks <doug.burks@gmail.com> Mon, 30 May 2016 20:03:09 -0400

securityonion-capme (20121213-0ubuntu0securityonion54) trusty; urgency=medium

* handle failed pcap_agent more gracefully
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
securityonion-capme (20121213-0ubuntu0securityonion55) trusty; urgency=medium
.
* handle failed pcap_agent more gracefully in second request
Author: Doug Burks <doug.burks@gmail.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- securityonion-capme-20121213.orig/capme/.inc/callback.php
+++ securityonion-capme-20121213/capme/.inc/callback.php
@@ -336,6 +336,9 @@ if ($err == 1) {
if (preg_match("/^ERROR: Connection failed$/", $line)) {
invalidCallback("ERROR: Connection to sguild failed!");
}
+ if (preg_match("/^DEBUG: $/", $line)) {
+ invalidCallback("ERROR: No data was returned. Check pcap_agent service.");
+ }
// To handle large pcaps more gracefully, we only render the first $maxtranscriptbytes.
$transcriptbytes += strlen($line);
if ($transcriptbytes <= $maxtranscriptbytes) {
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ include-filename-parameter-for-pivoting-from-Squert
more-informative-error-message-when-failing-on-non-tcp-traffic
add-check-for-active-pcap_agent-to-functions.php
handle-failed-pcap_agent-more-gracefully
handle-failed-pcap_agent-more-gracefully-in-second-request

0 comments on commit c8090d4

Please sign in to comment.