Skip to content

AttributeError: 'snicstats' object has no attribute 'flags' #2

Description

@Truewaydm

Like this code problem on linux:
if_addrs = psutil.net_if_addrs()
if_stats = psutil.net_if_stats()
for interface, addresses in if_addrs.items():
flags = typing.cast(str, if_stats[interface].flags).split(",")

        if (
            "loopback" in flags  # Loopback interfaces
            or interface == "docker0"  # Docker default bridge interface
            or interface.startswith("br-")  # More docker bridge interfaces
            or interface.startswith(
                "veth"
            )  # Virtual interfaces for each docker container
        ):
            continue

I trued your addon for httptoolkit, but it doesn't work with CA mitmproxy, had a blockage TLS certificate by google.
Work only using httptoolkit CA and httptoolkit server/API. If you solve problem and sniff all trafic, explane how you do that with mitmproxy CA.

So, that problem for AttributeError: 'snicstats' object has no attribute 'flags', it helps me.
if_address = psutil.net_if_addrs()
if_stats = psutil.net_if_stats()
for interface, addresses in if_address.items():
stats = if_stats[interface]
if hasattr(stats, 'flags'):
flags = typing.cast(str, stats.flags).split(",")
else:
flags = []

        if (
                "loopback" in flags  # Loopback interfaces
                or interface == "lo"  # loopback interface is usually called “lo”
                or interface == "docker0"  # Docker default bridge interface
                or interface.startswith("br-")  # More docker bridge interfaces
                or interface.startswith("veth")  # Virtual interfaces for each docker container
        ):
            continue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions