Browse Source

v1.3.1: - arguments change (-pHl -> -Hl, -pH -> -H)
- Shebang python3

Peter Siegrist 1 year ago
parent
commit
9d114df418
2 changed files with 15 additions and 14 deletions
  1. 9 8
      README.md
  2. 6 6
      sisniff

+ 9 - 8
README.md

@@ -10,7 +10,7 @@ It supports TCP, UDP and ICMP packets, both on IPv4 and IPv6<br>
 All BPF-Filter on top of IP which can be used by tcpdump are also supported.<br>
 <p>
 
-For HTTP connections, there is an argument to show part of its payload.<br>
+For HTTP connections, there is an argument (<code>-H resp. -Hl</code>) to show short or long payload.<br>
 
  
 Under some cirumstances the program/PID cannot be evaluated. This mavericks would be reported as follow:
@@ -33,14 +33,16 @@ This program needs Python 3.x or Python 2.x.
  
  
 Homepage (german): https://wiki.zweiernet.ch/wiki/sisniff
+
+Direct Download: `wget https://git.zweiernet.ch/sigi/sisniff/raw/master/sisniff` 
  
  
 <pre>
 --------------------
 # sisniff -h
-usage: sisniff [-h] -i {eth0,lo,wlan0} [-n] [-p program|not-program] [-4] [-6] [-pH] [-pHl] [filter]
+usage: sisniff [-h] -i {eth0,lo,wlan0} [-n] [-p program|not-program] [-4] [-6] [-H] [-Hl] [filter]
 
-sisniff V1.2
+sisniff V1.3.1
 2017-2022 by sigi <https://wiki.zweiernet.ch/wiki/sisniff>
 
 positional arguments:
@@ -48,15 +50,14 @@ positional arguments:
 
 optional arguments:
   -h, --help            show this help message and exit
-  -i {eth0,lo,tun0,wlan0}
-                        Interface (required)
+  -i {eth0,lo,wlan0}    Interface (required)
   -n                    Do not resolve IP-Addresses
   -p program|not-program
                         Filter by program name (accepts * for matching) ([not-] negates)
   -4                    Only IPv4
   -6                    Only IPv6
-  -pH                   Show HTTP Payload
-  -pHl                  Show HTTP Payload, long output
+  -H                   Show HTTP Payload
+  -Hl                  Show HTTP Payload, long output
 --------------------
 </pre>
 
@@ -72,7 +73,7 @@ optional arguments:
 # sisniff -i wlan0 "port not ssh"
 # sisniff -i wlan0 -p *vpn*
 # sisniff -i wlan0 -p not-thunderbird-bin -4 "host not www.zweiernet.ch"
-# sisniff -i eth0 -p firefox -pHl		
+# sisniff -i eth0 -p firefox -Hl "port 80"		
 </pre>
 
 

+ 6 - 6
sisniff

@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # (c) 2017-2022 by Siegrist(SystemLoesungen) <PSS@ZweierNet.ch>
 #
@@ -35,7 +35,7 @@ def _to_str(inp):
         return "".join( chr(x) for x in inp)
     
 
-VERSION = "1.3"
+VERSION = "1.3.1"
 
 PROC_TCP4 = "/proc/net/tcp"
 PROC_UDP4 = "/proc/net/udp"
@@ -466,8 +466,8 @@ parser.add_argument('-n', help="Do not resolve IP-Addresses", action="store_true
 parser.add_argument('-p', help='Filter by program name (accepts * for matching) ([not-] negates)', type=str, metavar='program|not-program')
 parser.add_argument('-4', dest='v4', help="Only IPv4", action="store_true")
 parser.add_argument('-6', dest='v6', help="Only IPv6", action="store_true")
-parser.add_argument('-pH', help="Show HTTP Payload", action="store_true")
-parser.add_argument('-pHl', help="Show HTTP Payload, long output", action="store_true")
+parser.add_argument('-H', help="Show HTTP Payload", action="store_true")
+parser.add_argument('-Hl', help="Show HTTP Payload, long output", action="store_true")
 parser.add_argument('filter', nargs='?', help="Filter (BPF syntax) on top of IP (in dbl-quotes \"...\")", type=str)
 args = parser.parse_args()
 iface = args.i
@@ -477,9 +477,9 @@ if args.v4:
 	rfilter = "ip"
 if args.v6:
 	rfilter = "ip6"
-if args.pH:
+if args.H:
     payloadH = True
-if args.pHl:
+if args.Hl:
     payloadH = True
     payloadHl = True
 if args.filter: