推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
simple2025
0D
V2EX  ›  Python

关于 scapy 抓包的问题

  •  
  •   simple2025 · Jan 14, 2022 · 3052 views
    This topic created in 1715 days ago, the information mentioned may be changed or developed.

    代码

    from scapy.all import *
     
    def CallBack(packet):
        if packet.haslayer('HTTP'):
            http = packet.payload.payload.payload
            print( http.show())
     
    sniff(prn=CallBack, count=0)
    

    但是这个样子抓不到 https 里面原生 http 报文,有什么办法可以抓包 https 里面的 http 报文呢?

    如果有例子就更好了

    顺便问下, ws 和 wss 的又该怎么抓呢

    Buges
        1
    Buges  
       Jan 14, 2022 via Android   ❤️ 1
    你要抓 HTTPS ,要么中间人,要么拿到密钥解密。
    simple2025
        2
    simple2025  
    OP
       Jan 14, 2022
    @Buges scapy 搞不了是吗?
    Buges
        3
    Buges  
       Jan 14, 2022 via Android   ❤️ 1
    @chenqh https://github.com/secdev/scapy/tree/master/doc/notebooks/tls
    当然可以,拿到密钥就能解密。或者换 mitmproxy 用中间人的方式抓。
    simple2025
        4
    simple2025  
    OP
       Jan 14, 2022
    @Buges 看不懂,太菜了我
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2836 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:03 · PVG 08:03 · LAX 17:03 · JFK 20:03
    ♥ Do have faith in what you're doing.