Coder Social home page Coder Social logo

fuxuantracer's Introduction

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())

fuxuantracer's People

Contributors

kokomi12345 avatar

Stargazers

Alen avatar super1207 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.