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

Commit

Permalink
CapMe: replace include_once with require_once #936
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Jun 3, 2016
1 parent c5e798b commit 144e985
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 10 deletions.
3 changes: 2 additions & 1 deletion capme/.inc/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}


include_once 'functions.php';
require_once 'functions.php';

// record starting time so we can see how long the callback takes
$time0 = microtime(true);
Expand Down Expand Up @@ -45,6 +45,7 @@ function invalidCallback($string) {
exit;
}

// cliscript requests the pcap/transcript from sguild
function cliscript($cmd, $pwd) {
$descspec = array(
0 => array("pipe", "r"),
Expand Down
2 changes: 1 addition & 1 deletion capme/.inc/functions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

include_once 'config.php';
require_once 'config.php';
global $dbHost,$dbName,$dbUser,$dbPass;
$db = mysql_connect($dbHost,$dbUser,$dbPass) or die(mysql_error());
mysql_select_db($dbName,$db) or die();
Expand Down
2 changes: 1 addition & 1 deletion capme/.inc/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//
//

include_once 'functions.php';
require_once 'functions.php';

// Session init
session_start();
Expand Down
6 changes: 3 additions & 3 deletions capme/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

include_once '.inc/functions.php';
include_once '.inc/session.php';
include_once '.inc/config.php';
require_once '.inc/functions.php';
require_once '.inc/session.php';
require_once '.inc/config.php';

// If we see a filename parameter, we know the request came from Snorby/Squert
// and if so we can just query the event table since they just have NIDS alerts.
Expand Down
4 changes: 2 additions & 2 deletions capme/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
//
//

include_once '.inc/config.php';
include_once '.inc/functions.php';
require_once '.inc/config.php';
require_once '.inc/functions.php';

$username = $password = $err = '';
$focus = 'username';
Expand Down
4 changes: 2 additions & 2 deletions capme/logout.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

// session.php contains the sKill function to kill the session
include_once '.inc/session.php';
require_once '.inc/session.php';

// functions.php validates parameters and builds the $parameters string
include_once '.inc/functions.php';
require_once '.inc/functions.php';

sKill($parameters);
?>
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-0ubuntu0securityonion59) trusty; urgency=medium

* CapMe: replace include_once with require_once #936

-- Doug Burks <[email protected]> Fri, 03 Jun 2016 12:05:18 -0400

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

* Issue 935: CapMe: improve input validation on stime and etime variables
Expand Down
124 changes: 124 additions & 0 deletions debian/patches/CapMe:-replace-include_once-with-require_once-#936
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
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-0ubuntu0securityonion59) trusty; urgency=medium
.
* CapMe: replace include_once with require_once #936
Author: Doug Burks <[email protected]>

---
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
@@ -11,7 +11,7 @@ if (!(isset($_SESSION['sLogin']) && $_SE
}


-include_once 'functions.php';
+require_once 'functions.php';

// record starting time so we can see how long the callback takes
$time0 = microtime(true);
@@ -45,6 +45,7 @@ function invalidCallback($string) {
exit;
}

+// cliscript requests the pcap/transcript from sguild
function cliscript($cmd, $pwd) {
$descspec = array(
0 => array("pipe", "r"),
--- securityonion-capme-20121213.orig/capme/.inc/config.php
+++ securityonion-capme-20121213/capme/.inc/config.php
@@ -1,12 +1,12 @@
<?php
-// DB Info.
+
+// DB Info
$dbHost = '127.0.0.1';
$dbName = 'securityonion_db';
$dbUser = 'readonly';
$dbPass = 'securityonion';

// Sguild Info
-
$sgVer = "SGUIL-0.9.0 OPENSSL ENABLED";
$sgHost = "127.0.0.1";
$sgPort = "7734";
--- securityonion-capme-20121213.orig/capme/.inc/functions.php
+++ securityonion-capme-20121213/capme/.inc/functions.php
@@ -1,6 +1,6 @@
<?php

-include_once 'config.php';
+require_once 'config.php';
global $dbHost,$dbName,$dbUser,$dbPass;
$db = mysql_connect($dbHost,$dbUser,$dbPass) or die(mysql_error());
mysql_select_db($dbName,$db) or die();
--- securityonion-capme-20121213.orig/capme/.inc/session.php
+++ securityonion-capme-20121213/capme/.inc/session.php
@@ -19,7 +19,7 @@
//
//

-include_once 'functions.php';
+require_once 'functions.php';

// Session init
session_start();
--- securityonion-capme-20121213.orig/capme/index.php
+++ securityonion-capme-20121213/capme/index.php
@@ -1,8 +1,8 @@
<?php

-include_once '.inc/functions.php';
-include_once '.inc/session.php';
-include_once '.inc/config.php';
+require_once '.inc/functions.php';
+require_once '.inc/session.php';
+require_once '.inc/config.php';

// If we see a filename parameter, we know the request came from Snorby/Squert
// and if so we can just query the event table since they just have NIDS alerts.
--- securityonion-capme-20121213.orig/capme/login.php
+++ securityonion-capme-20121213/capme/login.php
@@ -19,8 +19,8 @@
//
//

-include_once '.inc/config.php';
-include_once '.inc/functions.php';
+require_once '.inc/config.php';
+require_once '.inc/functions.php';

$username = $password = $err = '';
$focus = 'username';
--- securityonion-capme-20121213.orig/capme/logout.php
+++ securityonion-capme-20121213/capme/logout.php
@@ -1,10 +1,10 @@
<?php

// session.php contains the sKill function to kill the session
-include_once '.inc/session.php';
+require_once '.inc/session.php';

// functions.php validates parameters and builds the $parameters string
-include_once '.inc/functions.php';
+require_once '.inc/functions.php';

sKill($parameters);
?>
1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ handle-failed-pcap_agent-more-gracefully-in-second-request
CapMe:-Handle-pcaps-that-generate-no-p0f-output-#927
Issue-934:-CapMe:-subdirectories-should-redirect-to-main-page
Issue-935:-CapMe:-improve-input-validation-on-stime-and-etime-variables
CapMe:-replace-include_once-with-require_once-#936

0 comments on commit 144e985

Please sign in to comment.