How to use Joern locally
Install Joern, parse a local codebase into a CPG, open the shell, and run queries from this cheatsheet.
1. Install Joern
Download Joern from the official project and make sure the CLI commands are in your PATH.
joern --version
2. Parse local code
Create a CPG from a source directory. Add a language when Joern cannot detect it automatically.
joern-parse ./target-app --output cpg.bin.zip
3. Open the CPG
Start Joern with the generated CPG and run quick discovery queries.
joern cpg.bin.zip
4. Run a first query
Start with simple call searches, then move into source-to-sink data-flow.
cpg.call.name("(?i)(system|popen|exec.*)").code.l