|
@@ -35,7 +35,7 @@ def _to_str(inp):
|
|
|
return "".join( chr(x) for x in inp)
|
|
|
|
|
|
|
|
|
-VERSION = "1.4"
|
|
|
+VERSION = "1.5"
|
|
|
|
|
|
PROC_TCP4 = "/proc/net/tcp"
|
|
|
PROC_UDP4 = "/proc/net/udp"
|
|
@@ -461,10 +461,11 @@ iface = conf.route.route("0.0.0.0")[0]
|
|
|
rfilter = "ip or ip6"
|
|
|
print("")
|
|
|
# commandline params
|
|
|
-parser = argparse.ArgumentParser(description='sisniff V'+VERSION+"\n2017-2022 by sigi <https://wiki.zweiernet.ch/wiki/sisniff>",
|
|
|
+parser = argparse.ArgumentParser(description='sisniff V'+VERSION+"\n2017-2023 by sigi <https://wiki.zweiernet.ch/wiki/sisniff>",
|
|
|
formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
|
parser.add_argument('-i', help="Interface", choices=iface_list)
|
|
|
parser.add_argument('-n', help="Do not resolve IP-Addresses", action="store_true")
|
|
|
+parser.add_argument('-P', help="Don't put interface into promiscuous mode", 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")
|
|
@@ -490,7 +491,11 @@ if args.filter:
|
|
|
print("\033[1m> Applying Filter: \"" + rfilter + fillter + "\"\033[0m")
|
|
|
if args.p:
|
|
|
filter_prog = args.p
|
|
|
-
|
|
|
+no_promisc = ""
|
|
|
+if args.P:
|
|
|
+ conf.sniff_promisc = conf.promisc = 0
|
|
|
+ no_promisc = " (disabled promiscuous mode)"
|
|
|
+
|
|
|
|
|
|
# local addresses
|
|
|
if args.v6:
|
|
@@ -510,7 +515,7 @@ else:
|
|
|
MYADDRS = MYADDRS + MYADDRS6
|
|
|
xMYADDRS = xMYADDRS + [_to_v6_proc(expand_v6(x)) for x in MYADDRS6]
|
|
|
print("> My IP-Addresses: " + str(MYADDRS))
|
|
|
-print("> Listening on: " + iface)
|
|
|
+print("> Listening on: " + iface + no_promisc)
|
|
|
|
|
|
# confirmed connections cache (ringboffer)
|
|
|
conn_cache = []
|