zoukankan      html  css  js  c++  java
  • mitmproxy fiddler 抓包 填坑

    使用mitmproxy抓[DY]包填坑:
        参考资料:
            https://www.cnblogs.com/lsdb/p/10106655.html
            https://github.com/mitmproxy/mitmproxy
            https://docs.mitmproxy.org/stable/api/events.html
            https:cnblogs.com/findyou/p/3491014.html

    手机条件:

        1、root

        2、下载豌豆荚,下载15.0.0版本的DY(其他版本暂未尝试是否可行)

    抓https安装证书:
        参考:
            https://www.cnblogs.com/lsdb/p/10106655.html
            https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/
        证书采用上述参考资料安装后,可以抓取百度类的https请求,但无法抓取DY的。需要对证书进行二次处理,并放指定位置。
        证书处理:
            gitbash/linux中执行:hashed_name=`openssl x509 -inform PEM -subject_hash_old -in FiddlerRoot.cer | head -1` && cp FiddlerRoot.cer $hashed_name.0
            将生成:$hashed_name.0文件
            将文件拷贝到手机目录:adb push xxxxxxxx.0 /system/etc/security/cacerts/
            如果报:adb: error: failed to copy 'c8750f0d.0' to '/system/etc/security/cacerts/c8750f0d.0': remote couldn't create file: Permission denied
              解决:
                  1、确定手机已经root过了
                  2、进入手机:adb shell
                  3、执行:su(这时候$会变#,否则说明没有root,必须先root)
                  4、手机通过数据线连接,把文件拷贝进设备
                  5、pc端拷贝文件:cp sdcard/c8750f0d.0 /system/etc/security/cacerts
                  6、重启手机(完)

    使用fiddler抓包:(MIT控制台看起来不直观,日志太多了,又不好操作,先用fiddler来看,然后用mit来拦截做业务处理)
        参考资料:
            https:cnblogs.com/findyou/p/3491014.html(安装与配置)
            https:cnblogs.com/chenxi188/p/11917840.html(证书导出)
        从fiddler导出来的证书是cert的,需要转换成pem:
            gitbash执行:openssl x509 -inform DER -in FiddlerRoot.cer -out FiddlerRoot.cer.pem
            拷贝到系统证书目录:cp sdcard/269953fb.0 /system/etc/security/cacerts
        配置fiddler:
            Tools > Options > HTTPS > CertEnroll engine[蓝色链接] > Clear server certs on exit(勾选上)
            运行about:config
                增加变量和值:fiddler.certmaker.validdays 5(证书有效期)
        重启fiddler(完)

  • 相关阅读:
    想不明白为什么不复用老接口?
    dubbo入门教程-从零搭建dubbo服务
    使用Node.js时如何引入jQuery
    博客园在我的博客添加点击小心心特效
    博客园在微信内置浏览器打开时添加微信赞赏码功能
    Keepalived
    双网卡服务器使用指定网卡互通不同网段数据
    LNMP详解
    Centos7数据实时同步(Rsync+inotify)
    解决Centos7本机时间与实际时间相差8小时
  • 原文地址:https://www.cnblogs.com/Denny_Yang/p/15634222.html
Copyright © 2011-2022 走看看