debian/0000755000000000000000000000000012047027204007164 5ustar debian/httpry-tools.install0000644000000000000000000000010712033042555013243 0ustar scripts/plugins usr/share/httpry scripts/parse_log.pl usr/share/httpry debian/manpages0000644000000000000000000000001112033042555010673 0ustar httpry.1 debian/httpry-daemon.httpry.default0000644000000000000000000000137412033042555014664 0ustar # Defaults for httpry initscript # sourced by /etc/init.d/httpry # Enable the daemon to start invoked by init script. Set 'yes or 'no'. ENABLED=yes # At startup VERBOSE value is set in 'no'. When user invokes # httpry init.d script, no output is showed. # It could be unexpected behaviour, because it is common practice for # init.d script to ignore VERBOSE value. # Here VERBOSE is overridden to conform such the practice. VERBOSE=yes # Arguments to be passed to httpry executable beside -d option. For detailed # explanations on possible options see httpry(1) manpage or consult # documentation /usr/share/doc/httpry. OPTIONS="-o /var/log/httpry.log -i any" # Specify a bpf-style capture filter. For more informations see tcpdump(8) # manpage. EXPRESSION="" debian/README.Debian0000644000000000000000000000062112033042555011225 0ustar httpry daemon ============= httpry package contains init script for controlling the daemon instance. By default, log is written to /var/log/httpry.log and it's rotated daily. For various option consult httpry(1) manpage and edit /etc/default/httpry file. httpry tools ============ Perl scripts for parsing log files are provided by httpry-tools package and located in /usr/share/httpry directory. debian/compat0000644000000000000000000000000212033042555010363 0ustar 9 debian/httpry-daemon.httpry.logrotate0000644000000000000000000000037612033042555015241 0ustar /var/log/httpry.log { copytruncate daily rotate 52 create 640 root adm compress delaycompress missingok notifempty postrotate [ ! -f /var/run/httpry.pid ] || kill -HUP `cat /var/run/httpry.pid` endscript } debian/docs0000644000000000000000000000000412033042555010032 0ustar doc debian/gbp.conf0000644000000000000000000000012012033042555010575 0ustar [DEFAULT] debian-branch = master upstream-branch = upstream pristine-tar = True debian/watch0000644000000000000000000000015012033042555010212 0ustar version=3 http://githubredir.debian.net/github/jbittel/httpry /github/jbittel/httpry/httpry-(.+).tar.gz debian/httpry-daemon.httpry.init.d0000644000000000000000000000505212033042555014422 0ustar #!/bin/sh ### BEGIN INIT INFO # Provides: httpry # Required-Start: $local_fs $remote_fs $network $syslog # Required-Stop: $local_fs $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/stop httpry daemon instance # Description: This script is controlling httpry daemon instance # using start-stop-daemon. ### END INIT INFO # Author: Janos Guljas PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="httpry daemon" NAME=httpry DAEMON=/usr/sbin/$NAME PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME GROUP=adm UMASK=027 [ -x "$DAEMON" ] || exit 0 . /lib/init/vars.sh . /lib/lsb/init-functions [ -r /etc/default/$NAME ] && . /etc/default/$NAME do_start() { if [ "$ENABLED" != yes ]; then [ "$VERBOSE" != no ] && log_progress_msg "(disabled; see /etc/default/$NAME)" return 2 fi start-stop-daemon --start --quiet --pidfile $PIDFILE --group $GROUP --umask $UMASK \ --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --group $GROUP --umask $UMASK \ --exec $DAEMON -- \ -d $OPTIONS $EXPRESSION > /dev/null 2>&1 \ || return 2 } do_stop() { start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 rm -f $PIDFILE return "$RETVAL" } do_reload() { start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; reload|force-reload) [ "$VERBOSE" != no ] && log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? ;; restart) [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac : debian/patches/0000755000000000000000000000000012033042555010614 5ustar debian/patches/series0000644000000000000000000000004512033042555012030 0ustar fix-makefile.patch fix-manpage.patch debian/patches/fix-makefile.patch0000644000000000000000000000276412033042555014207 0ustar Description: Update makefile to support DESTDIR and debug symbols Author: Janos Guljas Last-Update: 2012-10-2 --- a/Makefile +++ b/Makefile @@ -6,8 +6,10 @@ # Copyright (c) 2005-2012 Jason Bittel # +DESTDIR?=/usr/local + CC = gcc -CCFLAGS = -Wall -O3 -funroll-loops -I/usr/include/pcap -I/usr/local/include/pcap +CCFLAGS = -Wall -g -DDEBUG -O3 -funroll-loops -I/usr/include/pcap -I/usr/local/include/pcap DEBUGFLAGS = -Wall -g -DDEBUG -I/usr/include/pcap -I/usr/local/include/pcap LIBS = -lpcap -lm -pthread PROG = httpry @@ -18,7 +20,7 @@ FILES = httpry.c format.c methods.c uti all: $(PROG) $(PROG): $(FILES) - $(CC) $(CCFLAGS) -o $(PROG) $(FILES) $(LIBS) + $(CC) $(CCFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PROG) $(FILES) $(LIBS) debug: $(FILES) @echo "--------------------------------------------------" @@ -50,12 +52,13 @@ install: $(PROG) @echo "a location of your choosing manually" @echo "--------------------------------------------------" @echo "" - cp -f $(PROG) /usr/sbin/ - cp -f $(PROG).1 /usr/man/man1/ || cp -f $(PROG).1 /usr/local/man/man1/ + mkdir -p $(DESTDIR)/usr/sbin/ + cp -f $(PROG) $(DESTDIR)/usr/sbin/ +# cp -f $(PROG).1 /usr/man/man1/ || cp -f $(PROG).1 /usr/local/man/man1/ uninstall: - rm -f /usr/sbin/$(PROG) - rm -f /usr/man/man1/$(PROG).1 || rm -f /usr/local/man/man1/$(PROG).1 + rm -f $(DESTDIR)/sbin/$(PROG) +# rm -f /usr/man/man1/$(PROG).1 || rm -f /usr/local/man/man1/$(PROG).1 clean: rm -f $(PROG) debian/patches/fix-manpage.patch0000644000000000000000000000750112033042555014034 0ustar Description: Fix hyphens on options in manpage httpry.1 Author: Janos Guljas Last-Update: 2012-10-2 --- a/httpry.1 +++ b/httpry.1 @@ -2,9 +2,9 @@ .SH NAME httpry \- HTTP logging and information retrieval tool .SH SYNOPSIS -.B httpry [ -dFpq ] [ -b file ] [ -f format ] [ -i device ] [ -m methods ] [ -n count ] [ -o file ] [ -P file ] [ -r file ] [-t seconds] [ -u user ] [ 'expression' ] +.B httpry [ \-dFpq ] [ \-b file ] [ \-f format ] [ \-i device ] [ \-m methods ] [ \-n count ] [ \-o file ] [ \-P file ] [ \-r file ] [ \-t seconds] [ \-u user ] [ 'expression' ] .br -.B httpry -h +.B httpry \-h .br .SH DESCRIPTION .PP @@ -14,56 +14,56 @@ to perform analysis itself, but instead for later analysis. It can be run in real-time displaying the live traffic on the wire, or as a daemon process that logs to an output file. .SH OPTIONS -.IP "-b \fIfile\fP" +.IP "\-b \fIfile\fP" Write all processed HTTP packets to a binary pcap dump file. Useful for further analysis of logged data. -.IP "-d" +.IP "\-d" Run the program as a daemon process. All program status output will be sent to syslog. A pid file is created for the process in /var/run/httpry.pid by -default. Requires an output file specified with -o. -.IP "-f \fIformat\fP" +default. Requires an output file specified with \-o. +.IP "\-f \fIformat\fP" Provide a comma-delimited string specifying the parsed HTTP data to output. See the doc/format-string file for further information regarding available options and syntax. -.IP "-F" +.IP "\-F" Disable all output buffering. This may be helpful when piping httpry output into another program. -.IP "-h" +.IP "\-h" Display a brief description of these options. -.IP "-i \fIdevice\fP" +.IP "\-i \fIdevice\fP" Specify an ethernet interface for the program to listen on. If not specified, the program will poll the system for a list of interfaces and select the first one found. -.IP "-l \fIthreshold\fP" +.IP "\-l \fIthreshold\fP" Specify a requests per second rate threshold value when running in rate -statistics mode (-s). Only hosts with a rps value greater than or equal to +statistics mode (\-s). Only hosts with a rps value greater than or equal to this number will be displayed. Defaults to 1. -.IP "-m \fImethods\fP" +.IP "\-m \fImethods\fP" Provide a comma-delimited string that specifies the request methods to parse. The program defaults to parsing all of the standard RFC2616 method strings if this option is not set. See the doc/method-string file for more information. -.IP "-n \fIcount\fP" +.IP "\-n \fIcount\fP" Parse this number of HTTP packets and then exit. Defaults to 0, which means loop forever. -.IP "-o \fIfile\fP" +.IP "\-o \fIfile\fP" Specify an output file for writing parsed packet data. -.IP "-p" +.IP "\-p" Do not put the NIC in promiscuous mode on startup. Note that the NIC could already be in that mode for another reason. -.IP "-P \fIfile\fP" +.IP "\-P \fIfile\fP" Specify a path and filename for creating the PID file in daemon mode. -.IP "-q" +.IP "\-q" Suppress non-critical output (startup banner, statistics, etc.). -.IP "-r \fIfile\fP" +.IP "\-r \fIfile\fP" Provide an input capture file to read from instead of performing a live capture. This option does not require root privileges. -.IP "-s" +.IP "\-s" Run httpry in an HTTP request per second display mode. This periodically displays the rate per active host and total rate at a specified interval. -.IP "-t \fIseconds\fP" +.IP "\-t \fIseconds\fP" Specify the host statistics display interval in seconds when running in -rate statistics mode (-s). Defaults to 5 seconds. -.IP "-u \fIuser\fP" +rate statistics mode (\-s). Defaults to 5 seconds. +.IP "\-u \fIuser\fP" Specify an alternate user to take ownership of the process and any output files. You will need root privileges to do this; it will switch to the new user after initialization. debian/rules0000755000000000000000000000112112043054346010242 0ustar #!/usr/bin/make -f CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) %: dh $@ override_dh_strip: dh_strip --dbg-package=httpry-dbg override_dh_auto_install: dh_auto_install --destdir=debian/httpry override_dh_install-indep: dh_install chmod +x debian/httpry-tools/usr/share/httpry/parse_log.pl override_dh_installdocs: dh_installdocs -Xdoc/ChangeLog -Xdoc/COPYING override_dh_installinit: dh_installinit --name=httpry override_dh_installlogrotate: dh_installlogrotate --name=httpry debian/NEWS0000644000000000000000000000062212047027204007663 0ustar httpry (0.1.7-3) unstable; urgency=low Init script is moved from httpry package to httpry-daemon. This package is now required to run httpry as a daemon for logging HTTP traffic, making easier to use the binary executable without installing unneeded scripts and having daemon running by installing only the httpry package. -- Janos Guljas Thu, 08 Nov 2012 22:42:02 +0100 debian/control0000644000000000000000000000754612043057543010610 0ustar Source: httpry Section: net Priority: optional Maintainer: Janos Guljas Build-Depends: debhelper (>= 9), libpcap0.8-dev Standards-Version: 3.9.4 Homepage: http://dumpsterventures.com/jason/httpry/ Vcs-Git: git://git.debian.org/collab-maint/httpry.git Vcs-Browser: http://git.debian.org/?p=collab-maint/httpry.git Package: httpry Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: httpry-daemon, httpry-tools Description: HTTP logging and information retrieval tool httpry is a tool designed for displaying and logging HTTP traffic. It is not intended to perform analysis itself, but instead to capture, parse and/or log the traffic for later analysis. It can be run in real-time displaying the live traffic on the wire, or as a daemon process that logs to an output file. It is written to be as lightweight and flexible as possible, so that it can be easily adaptable to different applications. It does not display the raw HTTP data transferred, but instead focuses on parsing and displaying the request/response line along with associated header fields. . This package contains the httpry executable. Package httpry-daemon contains required init script for running httpry as a daemon. Scripts for parsing log files are provided by httpry-tools. Package: httpry-dbg Architecture: any Section: debug Priority: extra Depends: ${misc:Depends}, httpry (= ${binary:Version}) Description: HTTP logging and information retrieval tool - debug symbols httpry is a tool designed for displaying and logging HTTP traffic. It is not intended to perform analysis itself, but instead to capture, parse and/or log the traffic for later analysis. It can be run in real-time displaying the live traffic on the wire, or as a daemon process that logs to an output file. It is written to be as lightweight and flexible as possible, so that it can be easily adaptable to different applications. It does not display the raw HTTP data transferred, but instead focuses on parsing and displaying the request/response line along with associated header fields. . This package contains the debug symbols for httpry. Install this package if you need to debug such a program or if you need a useful backtrace of a crash. Package: httpry-daemon Architecture: all Depends: ${misc:Depends}, httpry (>= ${source:Version}) Breaks: httpry (<= 0.1.7-2) Description: HTTP logging and information retrieval tool - daemon httpry is a tool designed for displaying and logging HTTP traffic. It is not intended to perform analysis itself, but instead to capture, parse and/or log the traffic for later analysis. It can be run in real-time displaying the live traffic on the wire, or as a daemon process that logs to an output file. It is written to be as lightweight and flexible as possible, so that it can be easily adaptable to different applications. It does not display the raw HTTP data transferred, but instead focuses on parsing and displaying the request/response line along with associated header fields. . This package contains required init script to run httpry as a daemon. Package: httpry-tools Architecture: all Depends: ${misc:Depends}, ${perl:Depends} Description: HTTP logging and information retrieval tool - log parsing scripts httpry is a tool designed for displaying and logging HTTP traffic. It is not intended to perform analysis itself, but instead to capture, parse and/or log the traffic for later analysis. It can be run in real-time displaying the live traffic on the wire, or as a daemon process that logs to an output file. It is written to be as lightweight and flexible as possible, so that it can be easily adaptable to different applications. It does not display the raw HTTP data transferred, but instead focuses on parsing and displaying the request/response line along with associated header fields. . This package contains log parsing scripts written in Perl. debian/copyright0000644000000000000000000001302612033042555011122 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: httpry Upstream-Contact: Jason Bittel Source: http://dumpsterventures.com/jason/httpry/ Files: * Copyright: 2005-2012 Jason Bittel License: GPL-2+ Files: tcp.h Copyright: 2005-2012 Jason Bittel 2005 The Tcpdump Group 2002 Tim Carstens License: BSD These IP and TCP structs/macros are from sniffex.c and were released under the following license: . sniffex.c . Sniffer example of TCP/IP packet capture using libpcap. . Version 0.1.1 (2005-07-05) Copyright (c) 2005 The Tcpdump Group . This software is intended to be used as a practical example and demonstration of the libpcap library; available at: http://www.tcpdump.org/ . This software is a modification of Tim Carstens' "sniffer.c" demonstration source code, released as follows: . sniffer.c Copyright (c) 2002 Tim Carstens 2002-01-07 Demonstration of using libpcap timcarst -at- yahoo -dot- com . "sniffer.c" is distributed under these terms: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 4. The name "Tim Carstens" may not be used to endorse or promote products derived from this software without prior written permission . THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . This software, "sniffex.c", is a derivative work of "sniffer.c" and is covered by the following terms: . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Because this is a derivative work, you must comply with the "sniffer.c" terms reproduced above. 2. Redistributions of source code must retain the Tcpdump Group copyright notice at the top of this source file, this list of conditions and the following disclaimer. 3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 4. The names "tcpdump" or "libpcap" may not be used to endorse or promote products derived from this software without prior written permission. . THERE IS ABSOLUTELY NO WARRANTY FOR THIS PROGRAM. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. . IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Files: debian/* Copyright: 2012 Janos Guljas License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/changelog0000644000000000000000000000131612047027125011041 0ustar httpry (0.1.7-3) unstable; urgency=low * Separate the init script from the binary package httpry: - New package httpry-daemon that contains the init script. - httpry-daemon breaks httrpy <= 0.1.7-2. - Add a news entry in debian/NEWS. -- Janos Guljas Thu, 08 Nov 2012 23:03:50 +0100 httpry (0.1.7-2) unstable; urgency=low * Remove non-existing httpry-daemon package from httpry's Suggests. * Only override dh_install for architecture independent packages. -- Janos Guljas Thu, 04 Oct 2012 13:14:26 +0200 httpry (0.1.7-1) unstable; urgency=low * Initial release. (Closes: #539665) -- Janos Guljas Wed, 03 Oct 2012 15:41:51 +0200 debian/source/0000755000000000000000000000000012033042555010465 5ustar debian/source/format0000644000000000000000000000001412033042555011673 0ustar 3.0 (quilt)