Joern是一個源碼分析工具,可以分析程序的源碼,生成代碼屬性圖。然後可以根據代碼屬性圖,提取你想要的程序的信息,比如控制流圖,數據流圖等等。
這個工具主要是這篇論文的結果:
https://fabs.codeminers.org/papers/2014-ieeesp.pdf
老版本安裝
官方鏈接:https://joern.readthedocs.io/en/latest/installation.html
老版本安裝的話,可能會遇到的問題是neo4j的老版本比較難下載。一些博客也給出瞭解決方案:https://blog.csdn.net/water_likly/article/details/88415127
新版本安裝
官方鏈接:https://joern.io/docs/installing/
按照官方文檔安裝,基本沒出現什麼問題。
下面簡單介紹一下安裝。
依賴庫
- Java 8 :http://openjdk.java.net/install/
- python 3:https://www.python.org/downloads/
安裝預先build好的二進制程序
wget https://github.com/ShiftLeftSecurity/joern/releases/latest/download/joern-cli.zip
wget https://github.com/ShiftLeftSecurity/joern/releases/latest/download/joern-server.zip
unzip joern-cli.zip
unzip joern-server.zip
安裝一下cpgclientlib
這個庫
pip3 install cpgclientlib
或者源碼安裝這個庫
git clone https://github.com/ShiftLeftSecurity/codepropertygraph.git
cd codepropertygraph/cpgclientlib
sudo python3 setup.py install
依賴裝好以後,build一下源碼,這個過程應該會比較長
git clone https://github.com/ShiftLeftSecurity/joern.git
cd joern
sbt stage
設置一下分配的內存大小
在命令行輸入下面這行代碼,下面的代碼表示分配4g的內存給jvm,當然你也可以分配別的大小的內存。
export _JAVA_OPTS="-Xmx4G"
測試一下安裝的結果
cd joern
./joern