V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
chenqh
V2EX  ›  Python

关于 scapy 抓包的问题

  •  
  •   chenqh · 2022-01-14 14:54:13 +08:00 · 2244 次点击
    这是一个创建于 825 天前的主题,其中的信息可能已经有所发展或是发生改变。

    代码

    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  
       2022-01-14 15:37:29 +08:00 via Android   ❤️ 1
    你要抓 HTTPS ,要么中间人,要么拿到密钥解密。
    chenqh
        2
    chenqh  
    OP
       2022-01-14 15:38:53 +08:00
    @Buges scapy 搞不了是吗?
    Buges
        3
    Buges  
       2022-01-14 15:46:22 +08:00 via Android   ❤️ 1
    @chenqh https://github.com/secdev/scapy/tree/master/doc/notebooks/tls
    当然可以,拿到密钥就能解密。或者换 mitmproxy 用中间人的方式抓。
    chenqh
        4
    chenqh  
    OP
       2022-01-14 17:11:13 +08:00
    @Buges 看不懂,太菜了我
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5355 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:30 · PVG 16:30 · LAX 01:30 · JFK 04:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.