Skip to main content

A useful logging library for Python

Project description

FuxuanTracer

FuxuanTracer是一个基于Python的开源网络流量监控工具,它能够抓取网络数据包,并解析出网络连接的IP地址, 端口等信息, 方便用户进行网络流量监控。

安装

pip install FuxuanTracer

Get Started

from FuxuanTracer import DataPackAnalyzer

ins = DataPackAnalyzer()

devices = list(ins.getAvaliableDevice().keys())

# 我们选择第4个,因为那个是我的以太网设备
choose_divice =  devices[4]

# 设置过滤器, 注意: 每次调用 setFilter 都会重置过滤规则
ins.setFilter(WebProtocol="HTTPS", Port=[443])

# 抓取10个包
ins.catchDataPak(choose_divice, 100)

# 解析抓取的包
ins.analyze_packets(True,"result.log",False,True)

参数说明(analyze_packets)

    1. True ,代表写入文件
    1. result.log , 写入文件的文件名
    1. False , 代表不用json格式写入文件
    1. True , 代表应用过滤器

更新异步抓取数据包,可以无限抓取数据包

# 异步抓取数据包

ins = DataPackAnalyzer()

devices = list(ins.getAvaliableDevice().keys())
choose_divice =  devices[4]
ins.setFilter(WebProtocol="HTTPS", Port=[443])

# 定义一个main函数,异步执行
async def main(ins=ins, choose_divice=choose_divice):
    await ins.AsyncProcess(
        use_device=choose_divice,
        write_to_file=True,
        file_path="result.log",
        json_fmt=False,
        enqueue=True
    )

# 异步执行main函数
asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fuxuantracer-0.0.2a0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

FuxuanTracer-0.0.2a0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file fuxuantracer-0.0.2a0.tar.gz.

File metadata

  • Download URL: fuxuantracer-0.0.2a0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for fuxuantracer-0.0.2a0.tar.gz
Algorithm Hash digest
SHA256 8571df2f2b8b21c5b2d29ab84ebb4090c1538a66ca5b867d8a7c2974fcb2b8b3
MD5 125b818d4e895b31adacf9bc98a68d87
BLAKE2b-256 65ea0f6c55b701d4e6e41cef66fa999a0d9e9dc08d874d241a2b036eac53b95f

See more details on using hashes here.

File details

Details for the file FuxuanTracer-0.0.2a0-py3-none-any.whl.

File metadata

File hashes

Hashes for FuxuanTracer-0.0.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 036748119cfe02e8374a364a8b8a4e3b2f8cf689ca74e08bcd322b21cbcd754d
MD5 81ce514cec8bc8c8f07ef2fe02a70ae1
BLAKE2b-256 9d3f593d03008f35c747ab62a4de41ed442fdd84ef6e680cca7a6483054aba22

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page