Git Product home page Git Product logo

cxtracker's People

Contributors

djcas9 avatar estuart avatar gamelinux avatar rmahoney249 avatar wmesser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cxtracker's Issues

PCAP start-index is "off by on" packet...

So after doing some test,

it seems that when I start to read from the right after the
pcapfile-header (24bytes), I see that cxtracker is printing the start byte
of the 2. packet in the session.

/tmp/2658 <-- 2658 is the offset outputed by cxtracker
/tmp/24 <-- 24 the pcap file header

$ diff -u /tmp/2658 /tmp/24
--- /tmp/2658 2011-11-16 23:17:42.291931155 +0000
+++ /tmp/24 2011-11-16 23:17:32.531933229 +0000
@@ -1,3 +1,4 @@
+12:29:27.911430 IP 192.168.8.5.1032 > 71.86.84.8.3030: Flags [S], seq3489876656, win 65535, options [mss 1460,nop,nop,sackOK], length 0
12:29:27.960132 IP 71.86.84.8.3030 > 192.168.8.5.1032: Flags [S.], seq090130120, ack 3489876657, win 8192, options [mss 1380,nop,nop,sackOK],length 0
12:29:27.960366 IP 192.168.8.5.1032 > 71.86.84.8.3030: Flags [.], ack1, win 65535, length 0
12:29:28.031383 IP 192.168.8.5.1032 > 71.86.84.8.3030: Flags [P.], seq1:5, ack 1, win 65535, length 4

But this looks great!

Feature Request: Daemonlogger-like "rolling off disk" when disk use reaches x%

Essentially a feature to store only enough pcaps to fill the disk up to x%. Once that disk use is reached, pcaps are deleted in the order they were recorded, freeing space for newer pcaps.

OpenFPC uses this feature of Daemonlogger in conjunction with its own capability to roll the session files off the database to accomplish FPC of the most recent time period that there is sufficient storage to handle.

I'm planning to work on this after the InnoDB VIEW issue. If you know of a good / preferred way to implement this, I'll follow your lead.

Compiling on FreeBSD

Greetings, I'd like to submit a couple patches to enable compiling of cxtracker on FreeBSD. The patches were created against the master branch on 11/5/2011 and tested on FreeBSD 8.2(i386).

-Dave

diff -cr cxtracker_ORG/src/cxtracker.h cxtracker_PATCHED/src/cxtracker.h
*** cxtracker_ORG/src/cxtracker.h   Sat Nov  5 13:08:15 2011
--- cxtracker_PATCHED/src/cxtracker.h   Sat Nov  5 13:11:45 2011
***************
*** 26,31 ****
--- 26,35 ----
  /*  I N C L U D E S  **********************************************************/
  #include "ip.h"

+ #ifdef __FreeBSD__
+ #include <sys/types.h>
+ #endif /* __FreeBSD__ */
+ 
  /*  D E F I N E S  ************************************************************/
  #define VERSION                       "0.9.7"
  #define TIMEOUT                       45


diff -cr cxtracker_ORG/src/ip.c cxtracker_PATCHED/src/ip.c
*** cxtracker_ORG/src/ip.c  Sat Nov  5 13:08:15 2011
--- cxtracker_PATCHED/src/ip.c  Sat Nov  5 13:00:57 2011
***************
*** 24,30 ****
--- 24,33 ----
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <arpa/inet.h>
+ 
+ #ifndef __FreeBSD__
  #include <error.h>
+ #endif /* __FreeBSD__ */

  // private functions

diff -cr cxtracker_ORG/src/ip.h cxtracker_PATCHED/src/ip.h
*** cxtracker_ORG/src/ip.h  Sat Nov  5 13:08:15 2011
--- cxtracker_PATCHED/src/ip.h  Sat Nov  5 12:58:04 2011
***************
*** 26,31 ****
--- 26,35 ----
  #include <netinet/in.h>
  #include <netdb.h>

+ #ifdef __FreeBSD__
+ #include <sys/socket.h>
+ #endif /* __FreeBSD__ */
+ 
  #define IP_ADDRMAX       NI_MAXHOST

  // TODO: raise these values to deconflict with the NI_* flags

cxtracker init script bugs

--- /etc/init.d/cxtracker       2010-09-18 18:59:11.000000000 +0000
+++ cxtracker.new       2010-10-27 13:02:09.000000000 +0000
@@ -26,7 +26,7 @@
   start)
 #      chown -R ${CXT_UID}.${CXT_GID} ${CXT_ARCHIVE_DIR}/
        echo -n "Starting $NAME ..."
-       $DAEMON $CXT_ARCHIVE_DIR $CXT_INTERFACE $CXT_USER $CXT_GROUP > /var/log/$NAME.log  2>&1 &
+       $DAEMON $CXT_ARCHIVE_DIR $CXT_INTERFACE $CXT_USER $CXT_GROUP -b "$CXT_BPF" >> /var/log/$NAME.log  2>&1 &
        PID1=$!
         echo "$PID1" > $PIDFILE
        echo " done."

--- /etc/default/cxtracker.old  2010-10-27 13:05:08.000000000 +0000
+++ /etc/default/cxtracker      2010-10-27 13:05:23.000000000 +0000
@@ -1,5 +1,5 @@
 # Set main configuration options here
-CXT_ARCHIVE_DIR="/nsm_data/`hostname -s`/cxtracker"
+CXT_ARCHIVE_DIR="-d /nsm_data/`hostname -s`/cxtracker"
 CXT_INTERFACE="-i eth0"
 CXT_USER="-u nsm"
 CXT_GROUP="-g nsm"

stats and realtime execution modes

I've been using cxtracker for a while now and ive seen that it works pretty much like sancp's stat mode. So my question is if its possible to run it in realtime, similar to sancp through an option or a special configuration.

I have to say im pretty new to pcap and connection trackers in general, so i might be missing something.

Thanks.

Check that nessesary DIRs are OK

When cxtracker2db.pl starts up:

  • It should check that the log dir exists, and has OK user+permissions
  • It should check if the "failed" dir exists, if not, try to make it, or die if it cant.

INSTALL has outdated DB info

--- INSTALL 2013-01-14 07:56:47.026341642 -0500
+++ INSTALL-new 2013-01-14 07:57:16.838341877 -0500
@@ -35,11 +35,11 @@

 # Prepare the mysql database
 GRANT USAGE ON *.* TO 'cxtracker'@'localhost' identified by 'cxtracker';
-GRANT ALL ON fpcgui.* TO 'cxtracker'@'localhost' IDENTIFIED BY 'cxtracker';
+GRANT ALL ON cxtracker.* TO 'cxtracker'@'localhost' IDENTIFIED BY 'cxtracker';
 FLUSH PRIVILEGES;

-CREATE DATABASE openfpc;
-\u openfpc
+CREATE DATABASE cxtracker;
+\u cxtracker

 # You need to add two function to mysql to handle IPv6
 # INET_ATON6 and INET_NTOA6:

Versioned tarball

Having an official versioned tarball to download would make this easier to officially include into Linux distros.

Feature Proposal: Option to store pcaps to dated directories.

I don't know if this would be good or not, but I could see it being useful.

This is low priority for me but is something that would slightly complicate the step of roll-off in #16, so I'm going ahead and talking about it now.

Vision: pcaps are logged to directories like /pcaps/2013-01-15/cxt.eth0.1358251200

This might make management on disk easier for two reasons:

  1. It breaks up storage into multiple directories
  2. It names the directories in such a way that retrieval is easier

Downside:

  1. OpenFPC currently does not expect pcaps logged by date
  2. Creates slight complications for automated retrieval because figuring out directory becomes a necessary step. However, since the directory is the date, and the date is trivially determined in code, automated retrieval is still possible.

make error

i just cloned the latest and cd to src and i get this error.

make
gcc -c -Wall -g -O3 -Wall -Wextra cxtracker.c
cxtracker.c:32:18: fatal error: pcap.h: No such file or directory
compilation terminated.
make: *** [cxtracker.o] Error 1

Add a COPYING file

The headers say

** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

However, there is no copy of the GPL.

I believe standard practice for code licensed as "GPL v2 or later" is to include the text from this file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt as a file called "COPYING" somewhere in the project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.