From 7d9095f113bd6cea3e9e59f5be908e8a68e27c08 Mon Sep 17 00:00:00 2001 From: Sebastian Lenzlinger Date: Wed, 12 Jun 2024 20:01:59 +0200 Subject: [PATCH] SYNC --- code/iottb/__main__.py | 2 +- code/iottb/main2.py | 10 ++++++++++ code/iottb/subcommands/sniff.py | 10 ++++++++++ code/iottb/utils/tcpdump_utils.py | 2 +- notes/scrible | 13 +++++++++++++ 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 code/iottb/main2.py create mode 100644 code/iottb/subcommands/sniff.py create mode 100644 notes/scrible diff --git a/code/iottb/__main__.py b/code/iottb/__main__.py index 379a7e2..ff3150f 100644 --- a/code/iottb/__main__.py +++ b/code/iottb/__main__.py @@ -29,7 +29,7 @@ def setup_argparse(): interfaces_parser = subparsers.add_parser('list-interfaces', aliases=['li', 'if'], help='List available network interfaces.') - interfaces_parser.set_defaults(func=list_interfaces()) + interfaces_parser.set_defaults(func=list_interfaces) return root_parser diff --git a/code/iottb/main2.py b/code/iottb/main2.py new file mode 100644 index 0000000..cb82aba --- /dev/null +++ b/code/iottb/main2.py @@ -0,0 +1,10 @@ +import subprocess +import logging + +logger = logging.getLogger(__name__) +logging.basicConfig(level=logging.DEBUG) + + + + +if __name__ == '__main__': diff --git a/code/iottb/subcommands/sniff.py b/code/iottb/subcommands/sniff.py new file mode 100644 index 0000000..1a9ab7f --- /dev/null +++ b/code/iottb/subcommands/sniff.py @@ -0,0 +1,10 @@ +import subprocess + +def sniff_tcpdump(args, filter): + pass + +def sniff_mitmproxy(args, filter): + pass + +def sniff_raw(cmd,args): + pass \ No newline at end of file diff --git a/code/iottb/utils/tcpdump_utils.py b/code/iottb/utils/tcpdump_utils.py index 2763f11..6870202 100644 --- a/code/iottb/utils/tcpdump_utils.py +++ b/code/iottb/utils/tcpdump_utils.py @@ -15,7 +15,7 @@ def ensure_installed(): raise RuntimeError('tcpdump is not installed. Please install it to continue.') -def list_interfaces() -> str: +def list_interfaces(args) -> str: """List available network interfaces using tcpdump.""" ensure_installed() try: diff --git a/notes/scrible b/notes/scrible new file mode 100644 index 0000000..3663610 --- /dev/null +++ b/notes/scrible @@ -0,0 +1,13 @@ +`iottb sniff`: + min: nothing + min meaningfull: interface + min usefull: ip/mac addr of dev + good: ip/mac, device type + better: + +`iottb device` + `add`: add new device config + +`iottb db` + `init` initialize device database + `add` add device