mac 上安裝 frida for python3.7

初期使用 "frida-ios-dump" 作為敲殼工具

搭配 python virtualenv 切割環(huán)境 完美使用 python3.7

但如果想直接使用 frida 在 iTerm2 上做調(diào)適 他還是會(huì)指向 mac 上原本自帶的 python2.7

這就困擾了....

經(jīng)過一番折騰....

解決辦法與流程是這樣的

  1. 先確定 mac 上的版本
?  ~ python -v

Python 2.7.0 (這是我目前上的版本)


  1. 將 mac 整個(gè)切換至 python3.7
    這邊需注意並非移除原本的 2.7 , 而是指向 python3.7
    Download Python3.7
    打開 terminal, 輸入如下指令:
?  ~ vi ~/.bash_profile

檢查是否如下

export PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:$PATH"

編輯 ".bashrc" 文件

?  ~ vi ~/.bashrc
或
?  ~ sudo vi ~/.bashrc

新增如下信息:

alias python2='/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7'
alias python3='/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6'
alias python=python2

保存:

?  ~ wq

讓環(huán)境變數(shù)生效

?  ~ source ~/.bash_profile
?  ~ source ~/.bashrc

檢查目前版本

?  ~ python -V
  • 輸出如下:

    Python 2.7
    
    

切換 python 版本

  • 修改 ".bashrc" 文件中剛剛新增的最後一行

  • 將 "alias python=python2" 改為 "alias python=python3"

  • 儲(chǔ)存

  • 再次讓文件生效,執(zhí)行:

    ?  ~ source ~/.bashrc
    
  • 檢查版本:

    ?  ~ python -V
    
  • 輸出信息:

    Python 3.7
    
    

這樣我們就完成了版本切換的任務(wù)了


  1. 安裝 frida
pip install frida-tools
或
sudo pip install frida-tools

install frida error

如果碰到這樣的問題, 可以參考這連結(jié)來解決
https://stackoverflow.com/questions/42098126/mac-osx-python-ssl-sslerror-ssl-certificate-verify-failed-certificate-verify/42098127#42098127
另一個(gè)可能會(huì)碰到的問題請(qǐng)參考
mac環(huán)境下升級(jí)openssl

  1. 連上手機(jī)(越獄), 來嘗試操作一波
?  ~ frida-ps -U
 PID  Name
----  -----------------------------------------------
9932  App Store
9880  AutoTouch
9949  Facebook
9916  LINE
9930  Outlook
9874  PassbookUIService
......
?  ~ frida-trace -U -i "CCCryptorCreate*" LINE
Instrumenting functions...
CCCryptorCreate: Auto-generated handler at "/Users/tinxie/__handlers__/libcommonCrypto.dylib/CCCryptorCreate.js"
CCCryptorCreateWithMode: Auto-generated handler at "/Users/tinxie/__handlers__/libcommonCrypto.dylib/CCCryptorCreateWithMode.js"
CCCryptorCreateFromData: Auto-generated handler at "/Users/tinxie/__handlers__/libcommonCrypto.dylib/CCCryptorCreateFromData.js"
CCCryptorCreateFromDataWithMode: Auto-generated handler at "/Users/tinxie/__handlers__/libcommonCrypto.dylib/CCCryptorCreateFromDataWithMode.js"
Started tracing 4 functions. Press Ctrl+C to stop.

這樣就完成囉~

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容